From 22b4270a6bfd627a4e9af8aec659369af71f172e Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 14 Nov 2023 17:06:40 +0800 Subject: [PATCH] refactor(sdio): place sdio slave driver into a new component --- components/driver/CMakeLists.txt | 8 +------- .../driver/test_apps/.build-test-rules.yml | 10 ---------- components/esp_driver_sdio/CMakeLists.txt | 13 +++++++++++++ .../include/driver/sdio_slave.h | 12 +++++------- .../src}/README.md | 0 .../src}/sdio_slave.c | 5 ----- .../test_apps/.build-test-rules.yml | 17 +++++++++++++++++ .../test_apps/sdio/sdio_common_tests/README.md | 0 .../host_sdmmc/CMakeLists.txt | 0 .../sdio_common_tests/host_sdmmc/README.md | 0 .../host_sdmmc/main/CMakeLists.txt | 0 .../host_sdmmc/main/idf_component.yml | 0 .../host_sdmmc/main/test_app_main.c | 3 --- .../host_sdmmc/main/test_sdio_sdhost.c | 14 +++----------- .../host_sdmmc/sdkconfig.ci.default | 0 .../host_sdmmc/sdkconfig.defaults | 0 .../sdio/sdio_common_tests/pytest_sdio.py | 0 .../sdio/sdio_common_tests/sdio/CMakeLists.txt | 0 .../sdio/sdio_common_tests/sdio/README.md | 0 .../sdio_common_tests/sdio/main/CMakeLists.txt | 0 .../sdio/main/test_app_main.c | 1 - .../sdio/main/test_sdio_slave.c | 12 +----------- .../sdio/sdkconfig.ci.default | 0 .../sdio_common_tests/sdio/sdkconfig.defaults | 0 .../sdio/sdio_common_tests/sdio_common_test.h | 2 -- docs/doxygen/Doxyfile | 18 +++++++++--------- .../release-5.x/5.3/peripherals.rst | 2 ++ .../release-5.x/5.3/peripherals.rst | 2 ++ examples/peripherals/.build-test-rules.yml | 4 ++++ 29 files changed, 57 insertions(+), 66 deletions(-) create mode 100644 components/esp_driver_sdio/CMakeLists.txt rename components/{driver/sdio_slave => esp_driver_sdio}/include/driver/sdio_slave.h (94%) rename components/{driver/sdio_slave => esp_driver_sdio/src}/README.md (100%) rename components/{driver/sdio_slave => esp_driver_sdio/src}/sdio_slave.c (99%) create mode 100644 components/esp_driver_sdio/test_apps/.build-test-rules.yml rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/README.md (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/README.md (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/main/CMakeLists.txt (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c (99%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c (98%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.ci.default (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.defaults (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/pytest_sdio.py (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/README.md (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/main/CMakeLists.txt (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c (99%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c (99%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.ci.default (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.defaults (100%) rename components/{driver => esp_driver_sdio}/test_apps/sdio/sdio_common_tests/sdio_common_test.h (99%) diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 208270f633..35630aff30 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -15,7 +15,6 @@ set(includes "include" "ledc/include" "parlio/include" "rmt/include" - "sdio_slave/include" "sigma_delta/include" "temperature_sensor/include" "touch_sensor/include" @@ -101,11 +100,6 @@ if(CONFIG_SOC_RMT_SUPPORTED) list(APPEND ldfragments "rmt/linker.lf") endif() -# SDIO Slave related source files -if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED) - list(APPEND srcs "sdio_slave/sdio_slave.c") -endif() - # Sigma-Delta Modulation related source files if(CONFIG_SOC_SDM_SUPPORTED) list(APPEND srcs "sigma_delta/sdm.c" @@ -164,7 +158,7 @@ else() # for backward compatibility, the driver component needs to # have a public dependency on other "esp_driver_foo" components esp_driver_gpio esp_driver_pcnt esp_driver_gptimer esp_driver_spi esp_driver_mcpwm - esp_driver_sdmmc esp_driver_sdspi esp_driver_ana_cmpr esp_driver_i2s + esp_driver_ana_cmpr esp_driver_i2s esp_driver_sdmmc esp_driver_sdspi esp_driver_sdio LDFRAGMENTS ${ldfragments} ) endif() diff --git a/components/driver/test_apps/.build-test-rules.yml b/components/driver/test_apps/.build-test-rules.yml index d47ccffe3a..a7d41a7415 100644 --- a/components/driver/test_apps/.build-test-rules.yml +++ b/components/driver/test_apps/.build-test-rules.yml @@ -92,16 +92,6 @@ components/driver/test_apps/rs485: temporary: true reason: lack of runners -components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc: - enable: - - if: IDF_TARGET == "esp32" - temporary: false - reason: always use ESP32 SDMMC as host - -components/driver/test_apps/sdio/sdio_common_tests/sdio: - disable: - - if: SOC_SDIO_SLAVE_SUPPORTED != 1 - components/driver/test_apps/sigma_delta: disable: - if: SOC_SDM_SUPPORTED != 1 diff --git a/components/esp_driver_sdio/CMakeLists.txt b/components/esp_driver_sdio/CMakeLists.txt new file mode 100644 index 0000000000..a90762b19c --- /dev/null +++ b/components/esp_driver_sdio/CMakeLists.txt @@ -0,0 +1,13 @@ +set(srcs) + +set(public_include "include") + +# SDIO Slave related source files +if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED) + list(APPEND srcs "src/sdio_slave.c") +endif() + +idf_component_register(SRCS ${srcs} + INCLUDE_DIRS ${public_include} + PRIV_REQUIRES esp_driver_gpio esp_ringbuf + ) diff --git a/components/driver/sdio_slave/include/driver/sdio_slave.h b/components/esp_driver_sdio/include/driver/sdio_slave.h similarity index 94% rename from components/driver/sdio_slave/include/driver/sdio_slave.h rename to components/esp_driver_sdio/include/driver/sdio_slave.h index 6d05406bb7..16225507ce 100644 --- a/components/driver/sdio_slave/include/driver/sdio_slave.h +++ b/components/esp_driver_sdio/include/driver/sdio_slave.h @@ -18,18 +18,17 @@ extern "C" { typedef void(*sdio_event_cb_t)(uint8_t event); - /// Configuration of SDIO slave typedef struct { sdio_slave_timing_t timing; ///< timing of sdio_slave. see `sdio_slave_timing_t`. sdio_slave_sending_mode_t sending_mode; ///< mode of sdio_slave. `SDIO_SLAVE_MODE_STREAM` if the data needs to be sent as much as possible; `SDIO_SLAVE_MODE_PACKET` if the data should be sent in packets. int send_queue_size; ///< max buffers that can be queued before sending. size_t recv_buffer_size; - ///< If buffer_size is too small, it costs more CPU time to handle larger number of buffers. - ///< If buffer_size is too large, the space larger than the transaction length is left blank but still counts a buffer, and the buffers are easily run out. - ///< Should be set according to length of data really transferred. - ///< All data that do not fully fill a buffer is still counted as one buffer. E.g. 10 bytes data costs 2 buffers if the size is 8 bytes per buffer. - ///< Buffer size of the slave pre-defined between host and slave before communication. All receive buffer given to the driver should be larger than this. + ///< If buffer_size is too small, it costs more CPU time to handle larger number of buffers. + ///< If buffer_size is too large, the space larger than the transaction length is left blank but still counts a buffer, and the buffers are easily run out. + ///< Should be set according to length of data really transferred. + ///< All data that do not fully fill a buffer is still counted as one buffer. E.g. 10 bytes data costs 2 buffers if the size is 8 bytes per buffer. + ///< Buffer size of the slave pre-defined between host and slave before communication. All receive buffer given to the driver should be larger than this. sdio_event_cb_t event_cb; ///< when the host interrupts slave, this callback will be called with interrupt number (0-7). uint32_t flags; ///< Features to be enabled for the slave, combinations of ``SDIO_SLAVE_FLAG_*``. #define SDIO_SLAVE_FLAG_DAT2_DISABLED BIT(0) /**< It is required by the SD specification that all 4 data @@ -282,7 +281,6 @@ void sdio_slave_clear_host_int(sdio_slave_hostint_t mask); */ esp_err_t sdio_slave_wait_int(int pos, TickType_t wait); - #ifdef __cplusplus } #endif diff --git a/components/driver/sdio_slave/README.md b/components/esp_driver_sdio/src/README.md similarity index 100% rename from components/driver/sdio_slave/README.md rename to components/esp_driver_sdio/src/README.md diff --git a/components/driver/sdio_slave/sdio_slave.c b/components/esp_driver_sdio/src/sdio_slave.c similarity index 99% rename from components/driver/sdio_slave/sdio_slave.c rename to components/esp_driver_sdio/src/sdio_slave.c index 589984e3ae..c683547047 100644 --- a/components/driver/sdio_slave/sdio_slave.c +++ b/components/esp_driver_sdio/src/sdio_slave.c @@ -75,8 +75,6 @@ The driver of FIFOs works as below: driver also fix the STAILQ_NEXT pointer of the last descriptor so that the descriptors are now in a ring again. */ - - #include #include "driver/sdio_slave.h" #include "soc/sdio_slave_periph.h" @@ -92,7 +90,6 @@ The driver of FIFOs works as below: #include "hal/sdio_slave_hal.h" #include "hal/gpio_hal.h" - #define SDIO_SLAVE_CHECK(res, str, ret_val) do { if(!(res)){\ SDIO_SLAVE_LOGE("%s", str);\ return ret_val;\ @@ -103,7 +100,6 @@ static const char TAG[] = "sdio_slave"; #define SDIO_SLAVE_LOGE(s, ...) ESP_LOGE(TAG, "%s(%d): "s, __FUNCTION__,__LINE__,##__VA_ARGS__) #define SDIO_SLAVE_LOGW(s, ...) ESP_LOGW(TAG, "%s: "s, __FUNCTION__,##__VA_ARGS__) - // sdio_slave_buf_handle_t is of type recv_desc_t*; typedef struct recv_desc_s { union { @@ -122,7 +118,6 @@ typedef struct recv_desc_s { }; } recv_desc_t; - typedef TAILQ_HEAD(recv_tailq_head_s, recv_desc_s) recv_tailq_t; typedef struct { diff --git a/components/esp_driver_sdio/test_apps/.build-test-rules.yml b/components/esp_driver_sdio/test_apps/.build-test-rules.yml new file mode 100644 index 0000000000..df1d2c4828 --- /dev/null +++ b/components/esp_driver_sdio/test_apps/.build-test-rules.yml @@ -0,0 +1,17 @@ +components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc: + enable: + - if: IDF_TARGET == "esp32" + temporary: false + reason: always use ESP32 SDMMC as host + depends_components: + - sdmmc + - esp_driver_sdmmc + - esp_driver_sdio + +components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio: + disable: + - if: SOC_SDIO_SLAVE_SUPPORTED != 1 + depends_components: + - sdmmc + - esp_driver_sdmmc + - esp_driver_sdio diff --git a/components/driver/test_apps/sdio/sdio_common_tests/README.md b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/README.md similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/README.md rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/README.md diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/README.md b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/README.md similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/README.md rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/README.md diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/CMakeLists.txt b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/CMakeLists.txt similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/CMakeLists.txt rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/CMakeLists.txt diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c similarity index 99% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c index fcf63d0500..f32ce071b3 100644 --- a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c +++ b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_app_main.c @@ -14,7 +14,6 @@ static size_t before_free_8bit; static size_t before_free_32bit; - void setUp(void) { before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); @@ -46,7 +45,5 @@ void app_main(void) printf("/____/_____/___/\\____/ /____/_____/_/ /_/_/ /_/\\____/ \n"); printf(" \n"); - - unity_run_menu(); } diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c similarity index 98% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c index 1a184b3b94..23ef53a52c 100644 --- a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c +++ b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/test_sdio_sdhost.c @@ -38,7 +38,6 @@ typedef struct { bool check_data; } test_sdio_param_t; - /*--------------------------------------------------------------- Host Init Settings ---------------------------------------------------------------*/ @@ -91,7 +90,6 @@ static void s_send_finish_test(essl_handle_t handle) essl_send_slave_intr(handle, BIT(7), TEST_TIMEOUT_MAX); } - /*--------------------------------------------------------------- Function Tests ---------------------------------------------------------------*/ @@ -132,8 +130,6 @@ TEST_CASE("SDIO_SDMMC: test interrupt", "[sdio]") sdmmc_host_deinit(); } - - /*--------------------------------------------------------------- SDMMC_SDIO: test register ---------------------------------------------------------------*/ @@ -168,8 +164,6 @@ TEST_CASE("SDIO_SDMMC: test register", "[sdio]") sdmmc_host_deinit(); } - - /*--------------------------------------------------------------- SDMMC_SDIO: test reset ---------------------------------------------------------------*/ @@ -213,7 +207,6 @@ TEST_CASE("SDIO_SDMMC: test reset", "[sdio]") sdmmc_host_deinit(); } - /*--------------------------------------------------------------- Transaction Tests ---------------------------------------------------------------*/ @@ -285,7 +278,6 @@ TEST_CASE("SDIO_SDMMC: test from host (Performance)", "[sdio_speed]") test_from_host(false); } - static void test_to_host(bool check_data) { //prepare buffer @@ -329,15 +321,15 @@ static void test_to_host(bool check_data) remain_length -= rcv_len; } while (remain_length > 0); - int64_t c_time_ms = ccomp_timer_stop()/1000; + int64_t c_time_ms = ccomp_timer_stop() / 1000; int64_t end_us = esp_timer_get_time(); - uint32_t total_time_ms = (end_us - pre_us)/1000; + uint32_t total_time_ms = (end_us - pre_us) / 1000; ESP_LOGI(TAG, "test done, total time: %" PRIu32 " ms (%d ms compensated), bytes transferred: %"PRIu32, total_time_ms, (int)c_time_ms, expected_length); uint32_t throughput_byte_per_ms = expected_length / c_time_ms; ESP_LOGI(TAG, "Throughput: compensated %"PRIu32"KB/s %.2lf MB/s, typical %.2lf MB/s", - throughput_byte_per_ms, throughput_byte_per_ms/1000., expected_length/(total_time_ms*1000.)); + throughput_byte_per_ms, throughput_byte_per_ms / 1000., expected_length / (total_time_ms * 1000.)); esp_rom_delay_us(50 * 1000); s_send_finish_test(handle); diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.ci.default b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.ci.default similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.ci.default rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.ci.default diff --git a/components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.defaults b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.defaults similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.defaults rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/sdkconfig.defaults diff --git a/components/driver/test_apps/sdio/sdio_common_tests/pytest_sdio.py b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/pytest_sdio.py similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/pytest_sdio.py rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/pytest_sdio.py diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/README.md b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/README.md similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/README.md rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/README.md diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/main/CMakeLists.txt b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/CMakeLists.txt similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/main/CMakeLists.txt rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/CMakeLists.txt diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c similarity index 99% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c index 3b5e4ad2ea..de8b75a135 100644 --- a/components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c +++ b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_app_main.c @@ -14,7 +14,6 @@ static size_t before_free_8bit; static size_t before_free_32bit; - void setUp(void) { before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c similarity index 99% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c index 6da8b7cbc5..ca3e6816d2 100644 --- a/components/driver/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c +++ b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/main/test_sdio_slave.c @@ -25,7 +25,6 @@ static const char *TAG = "test_sdio"; - /*--------------------------------------------------------------- Slave Init Settings ---------------------------------------------------------------*/ @@ -69,8 +68,6 @@ static void s_slave_init(sdio_slave_sending_mode_t mode) TEST_ESP_OK(sdio_slave_initialize(&slave_config)); } - -#include "esp_rom_sys.h" /*--------------------------------------------------------------- Function Tests ---------------------------------------------------------------*/ @@ -141,7 +138,6 @@ TEST_CASE("SDIO_Slave: test reset", "[sdio]") TEST_ASSERT_EQUAL(i, arg); } - WORD_ALIGNED_ATTR uint8_t host_tx_buffer[TEST_RESET_DATA_LEN] = {}; for (int i = 0; i < TEST_RESET_BUF_NUMS; i++) { test_fill_random_to_buffer(i, host_tx_buffer, TEST_RESET_DATA_LEN); @@ -159,7 +155,6 @@ TEST_CASE("SDIO_Slave: test reset", "[sdio]") sdio_slave_deinit(); } - /*--------------------------------------------------------------- Transaction Tests ---------------------------------------------------------------*/ @@ -178,7 +173,6 @@ static void test_from_host(bool check_data) TEST_ASSERT(slave_rx_buffer[i]); } - for (int i = 0; i < TEST_TARNS_PARAM_NUMS; i++) { //slave init s_slave_init(SDIO_SLAVE_SEND_STREAM); @@ -214,7 +208,6 @@ static void test_from_host(bool check_data) TEST_ESP_OK(sdio_slave_recv_load_buf(used_buf_handle)); } - wait_for_finish(&s_test_slv_ctx); sdio_slave_stop(); sdio_slave_deinit(); @@ -226,7 +219,6 @@ static void test_from_host(bool check_data) test_destroy_buffer_pool(); } - TEST_CASE("SDIO_Slave: test from host", "[sdio]") { test_from_host(true); @@ -237,7 +229,6 @@ TEST_CASE("SDIO_Slave: test from host (Performance)", "[sdio_speed]") test_from_host(false); } - /*--------------------------------------------------------------- To Host Tests ---------------------------------------------------------------*/ @@ -262,7 +253,7 @@ static void test_to_host(void) do { void* arg; //when the queue is full, do a blocking wait for 10ms, otherwise non-blocking - err = sdio_slave_send_get_finished(&arg, QUEUE_FULL()? 1: 0); + err = sdio_slave_send_get_finished(&arg, QUEUE_FULL() ? 1 : 0); if (err == ESP_OK) { s_test_slv_ctx.queued_cnt --; continue; @@ -283,7 +274,6 @@ static void test_to_host(void) s_test_slv_ctx.queued_cnt--; } - wait_for_finish(&s_test_slv_ctx); sdio_slave_stop(); sdio_slave_deinit(); diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.ci.default b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.ci.default similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.ci.default rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.ci.default diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.defaults b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.defaults similarity index 100% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.defaults rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/sdkconfig.defaults diff --git a/components/driver/test_apps/sdio/sdio_common_tests/sdio_common_test.h b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio_common_test.h similarity index 99% rename from components/driver/test_apps/sdio/sdio_common_tests/sdio_common_test.h rename to components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio_common_test.h index 2258307507..2f857f4246 100644 --- a/components/driver/test_apps/sdio/sdio_common_tests/sdio_common_test.h +++ b/components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio_common_test.h @@ -11,12 +11,10 @@ #include #include "sdkconfig.h" - #ifdef __cplusplus extern "C" { #endif - #define TEST_RX_BUFFER_SIZE 2048 /*--------------------------------------------------------------- diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index cca747ac93..289b2e001c 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -88,16 +88,7 @@ INPUT = \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_rx.h \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_tx.h \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_types.h \ - $(PROJECT_PATH)/components/driver/sdio_slave/include/driver/sdio_slave.h \ $(PROJECT_PATH)/components/driver/sigma_delta/include/driver/sdm.h \ - $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_default_configs.h \ - $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_host.h \ - $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_types.h \ - $(PROJECT_PATH)/components/esp_driver_sdspi/include/driver/sdspi_host.h \ - $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_common.h \ - $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_master.h \ - $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_slave_hd.h \ - $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_slave.h \ $(PROJECT_PATH)/components/driver/temperature_sensor/include/driver/temperature_sensor.h \ $(PROJECT_PATH)/components/driver/touch_sensor/include/driver/touch_sensor_common.h \ $(PROJECT_PATH)/components/driver/twai/include/driver/twai.h \ @@ -143,6 +134,15 @@ INPUT = \ $(PROJECT_PATH)/components/esp_driver_i2s/include/driver/i2s_tdm.h \ $(PROJECT_PATH)/components/esp_driver_i2s/include/driver/i2s_types.h \ $(PROJECT_PATH)/components/esp_driver_pcnt/include/driver/pulse_cnt.h \ + $(PROJECT_PATH)/components/esp_driver_sdio/include/driver/sdio_slave.h \ + $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_default_configs.h \ + $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_host.h \ + $(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_types.h \ + $(PROJECT_PATH)/components/esp_driver_sdspi/include/driver/sdspi_host.h \ + $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_common.h \ + $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_master.h \ + $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_slave_hd.h \ + $(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_slave.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_com.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_driver.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_mac.h \ diff --git a/docs/en/migration-guides/release-5.x/5.3/peripherals.rst b/docs/en/migration-guides/release-5.x/5.3/peripherals.rst index a800215ae8..db7755a7a9 100644 --- a/docs/en/migration-guides/release-5.x/5.3/peripherals.rst +++ b/docs/en/migration-guides/release-5.x/5.3/peripherals.rst @@ -11,6 +11,8 @@ In order to control the dependence of other components on drivers at a smaller g - `esp_driver_spi` - Driver for GPSPI - `esp_driver_mcpwm` - Driver for Motor Control PWM - `esp_driver_sdmmc` - Driver for SDMMC +- `esp_driver_sdspi` - Driver for SDSPI +- `esp_driver_sdio` - Driver for SDIO - `esp_driver_ana_cmpr` - Driver for Analog Comparator - `esp_driver_i2s` - Driver for I2S diff --git a/docs/zh_CN/migration-guides/release-5.x/5.3/peripherals.rst b/docs/zh_CN/migration-guides/release-5.x/5.3/peripherals.rst index 1b4ff20939..45c005b019 100644 --- a/docs/zh_CN/migration-guides/release-5.x/5.3/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-5.x/5.3/peripherals.rst @@ -11,6 +11,8 @@ - `esp_driver_spi` - 通用 SPI 驱动 - `esp_driver_mcpwm` - 电机控制 PWM 驱动 - `esp_driver_sdmmc` - SDMMC 驱动 +- `esp_driver_sdspi` - SDSPI 驱动 +- `esp_driver_sdio` - SDIO 驱动 - `esp_driver_ana_cmpr` - 模拟比较器驱动 - `esp_driver_i2s` - I2S 驱动 diff --git a/examples/peripherals/.build-test-rules.yml b/examples/peripherals/.build-test-rules.yml index 75431e4afe..f1d9422d50 100644 --- a/examples/peripherals/.build-test-rules.yml +++ b/examples/peripherals/.build-test-rules.yml @@ -260,6 +260,8 @@ examples/peripherals/sdio/host: - if: IDF_TARGET != "esp32" temporary: true reason: lack of runners + depends_components: + - esp_driver_sdio examples/peripherals/sdio/slave: disable: @@ -268,6 +270,8 @@ examples/peripherals/sdio/slave: - if: IDF_TARGET != "esp32" temporary: true reason: lack of runners + depends_components: + - esp_driver_sdio examples/peripherals/secure_element/atecc608_ecdsa: enable: