diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 33fff2827f..208270f633 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -16,7 +16,6 @@ set(includes "include" "parlio/include" "rmt/include" "sdio_slave/include" - "sdspi/include" "sigma_delta/include" "temperature_sensor/include" "touch_sensor/include" @@ -113,14 +112,6 @@ if(CONFIG_SOC_SDM_SUPPORTED) "deprecated/sigma_delta_legacy.c") endif() -# SDSPI related source files -if(CONFIG_SOC_GPSPI_SUPPORTED) - list(APPEND srcs "sdspi/sdspi_crc.c" - "sdspi/sdspi_host.c" - "sdspi/sdspi_transaction.c") -endif() - - # Temperature Sensor related source files if(CONFIG_SOC_TEMP_SENSOR_SUPPORTED) list(APPEND srcs "temperature_sensor/temperature_sensor.c" @@ -173,7 +164,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_ana_cmpr esp_driver_i2s + esp_driver_sdmmc esp_driver_sdspi esp_driver_ana_cmpr esp_driver_i2s LDFRAGMENTS ${ldfragments} ) endif() diff --git a/components/esp_driver_sdspi/CMakeLists.txt b/components/esp_driver_sdspi/CMakeLists.txt new file mode 100644 index 0000000000..41809a1e0d --- /dev/null +++ b/components/esp_driver_sdspi/CMakeLists.txt @@ -0,0 +1,15 @@ +set(srcs) + +set(public_include "include") + +if(CONFIG_SOC_GPSPI_SUPPORTED) + list(APPEND srcs "src/sdspi_crc.c" + "src/sdspi_host.c" + "src/sdspi_transaction.c") +endif() + +idf_component_register(SRCS ${srcs} + INCLUDE_DIRS ${public_include} + REQUIRES sdmmc esp_driver_spi esp_driver_gpio + PRIV_REQUIRES esp_timer + ) diff --git a/components/driver/sdspi/include/driver/sdspi_host.h b/components/esp_driver_sdspi/include/driver/sdspi_host.h similarity index 99% rename from components/driver/sdspi/include/driver/sdspi_host.h rename to components/esp_driver_sdspi/include/driver/sdspi_host.h index 4bcfe78d3d..a8a793e17e 100644 --- a/components/driver/sdspi/include/driver/sdspi_host.h +++ b/components/esp_driver_sdspi/include/driver/sdspi_host.h @@ -9,7 +9,7 @@ #include #include #include "esp_err.h" -#include "driver/sdmmc_types.h" +#include "sd_protocol_types.h" #include "driver/gpio.h" #include "driver/spi_master.h" diff --git a/components/driver/sdspi/sdspi_crc.c b/components/esp_driver_sdspi/src/sdspi_crc.c similarity index 100% rename from components/driver/sdspi/sdspi_crc.c rename to components/esp_driver_sdspi/src/sdspi_crc.c diff --git a/components/driver/sdspi/sdspi_crc.h b/components/esp_driver_sdspi/src/sdspi_crc.h similarity index 100% rename from components/driver/sdspi/sdspi_crc.h rename to components/esp_driver_sdspi/src/sdspi_crc.h diff --git a/components/driver/sdspi/sdspi_host.c b/components/esp_driver_sdspi/src/sdspi_host.c similarity index 99% rename from components/driver/sdspi/sdspi_host.c rename to components/esp_driver_sdspi/src/sdspi_host.c index a1f18ac98f..7877c3133f 100644 --- a/components/driver/sdspi/sdspi_host.c +++ b/components/esp_driver_sdspi/src/sdspi_host.c @@ -13,7 +13,7 @@ #include "esp_log.h" #include "esp_heap_caps.h" #include "driver/gpio.h" -#include "driver/sdmmc_defs.h" +#include "sd_protocol_defs.h" #include "driver/sdspi_host.h" #include "sdspi_private.h" #include "sdspi_crc.h" diff --git a/components/driver/sdspi/sdspi_private.h b/components/esp_driver_sdspi/src/sdspi_private.h similarity index 100% rename from components/driver/sdspi/sdspi_private.h rename to components/esp_driver_sdspi/src/sdspi_private.h diff --git a/components/driver/sdspi/sdspi_transaction.c b/components/esp_driver_sdspi/src/sdspi_transaction.c similarity index 98% rename from components/driver/sdspi/sdspi_transaction.c rename to components/esp_driver_sdspi/src/sdspi_transaction.c index 0ed40fd5b5..ad139c7cc4 100644 --- a/components/driver/sdspi/sdspi_transaction.c +++ b/components/esp_driver_sdspi/src/sdspi_transaction.c @@ -8,9 +8,8 @@ #include "esp_err.h" #include "esp_log.h" #include "sys/lock.h" -#include "driver/sdmmc_types.h" -#include "driver/sdmmc_defs.h" -#include "driver/sdmmc_types.h" +#include "sd_protocol_defs.h" +#include "sd_protocol_types.h" #include "sdspi_private.h" #include "sdspi_crc.h" diff --git a/components/fatfs/CMakeLists.txt b/components/fatfs/CMakeLists.txt index 4e36c1b50a..f641ca860a 100644 --- a/components/fatfs/CMakeLists.txt +++ b/components/fatfs/CMakeLists.txt @@ -22,7 +22,7 @@ else() list(APPEND include_dirs "vfs") - list(APPEND requires "sdmmc" "driver") # `driver` will be replaced with `esp_driver_sdspi` + list(APPEND requires "sdmmc" "esp_driver_sdmmc" "esp_driver_sdspi") list(APPEND priv_requires "vfs" "esp_driver_gpio") endif() diff --git a/components/vfs/test_apps/main/CMakeLists.txt b/components/vfs/test_apps/main/CMakeLists.txt index d0d0f826d2..efc6105105 100644 --- a/components/vfs/test_apps/main/CMakeLists.txt +++ b/components/vfs/test_apps/main/CMakeLists.txt @@ -7,6 +7,6 @@ set(src "test_app_main.c" "test_vfs_access.c" idf_component_register(SRCS ${src} PRIV_INCLUDE_DIRS . - PRIV_REQUIRES test_utils vfs fatfs spiffs unity lwip wear_levelling cmock + PRIV_REQUIRES test_utils vfs fatfs spiffs unity lwip wear_levelling cmock driver WHOLE_ARCHIVE ) diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index e678206c34..cca747ac93 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -93,7 +93,7 @@ INPUT = \ $(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/driver/sdspi/include/driver/sdspi_host.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 \ diff --git a/docs/en/api-reference/storage/sdmmc.rst b/docs/en/api-reference/storage/sdmmc.rst index c2b5eef35e..dbaff4c8fe 100644 --- a/docs/en/api-reference/storage/sdmmc.rst +++ b/docs/en/api-reference/storage/sdmmc.rst @@ -8,7 +8,7 @@ Overview The SD/SDIO/MMC driver currently supports SD memory, SDIO cards, and eMMC chips. This is a protocol level driver built on top of SDMMC and SD SPI host drivers. -SDMMC and SD SPI host drivers (:component_file:`esp_driver_sdmmc/include/driver/sdmmc_host.h` and :component_file:`driver/sdspi/include/driver/sdspi_host.h`) provide API functions for: +SDMMC and SD SPI host drivers (:component_file:`esp_driver_sdmmc/include/driver/sdmmc_host.h` and :component_file:`esp_driver_sdspi/include/driver/sdspi_host.h`) provide API functions for: - Sending commands to slave devices - Sending and receiving data diff --git a/docs/zh_CN/api-reference/storage/sdmmc.rst b/docs/zh_CN/api-reference/storage/sdmmc.rst index 5c955f5a3d..f4cea0bd00 100644 --- a/docs/zh_CN/api-reference/storage/sdmmc.rst +++ b/docs/zh_CN/api-reference/storage/sdmmc.rst @@ -8,7 +8,7 @@ SD/SDIO/MMC 驱动程序 SD/SDIO/MMC 驱动是一种基于 SDMMC 和 SD SPI 主机驱动的协议级驱动程序,目前已支持 SD 存储器、SDIO 卡和 eMMC 芯片。 -SDMMC 主机驱动和 SD SPI 主机驱动(:component_file:`esp_driver_sdmmc/include/driver/sdmmc_host.h` 和 :component_file:`driver/sdspi/include/driver/sdspi_host.h`)为以下功能提供 API: +SDMMC 主机驱动和 SD SPI 主机驱动(:component_file:`esp_driver_sdmmc/include/driver/sdmmc_host.h` 和 :component_file:`esp_driver_sdspi/include/driver/sdspi_host.h`)为以下功能提供 API: - 发送命令至从设备 - 接收和发送数据 diff --git a/examples/storage/.build-test-rules.yml b/examples/storage/.build-test-rules.yml index 7455aa8ca1..985ea2f47f 100644 --- a/examples/storage/.build-test-rules.yml +++ b/examples/storage/.build-test-rules.yml @@ -10,11 +10,11 @@ examples/storage/custom_flash_driver: examples/storage/emmc: depends_components: - - sdmmc - - driver # `driver` will be replaced with `esp_driver_sdspi` - fatfs - vfs + - sdmmc - esp_driver_sdmmc + - esp_driver_sdspi enable: - if: IDF_TARGET == "esp32s3" reason: only support on esp32s3 @@ -134,7 +134,7 @@ examples/storage/sd_card/sdspi: depends_components: - vfs - sdmmc - - driver # To be updated to `esp_driver_sdspi` + - esp_driver_sdspi disable: - if: SOC_GPSPI_SUPPORTED != 1 disable_test: diff --git a/tools/test_apps/.build-test-rules.yml b/tools/test_apps/.build-test-rules.yml index 6be7a2df80..84973ddc8d 100644 --- a/tools/test_apps/.build-test-rules.yml +++ b/tools/test_apps/.build-test-rules.yml @@ -99,7 +99,7 @@ tools/test_apps/storage/sdmmc_console: depends_components: - sdmmc - esp_driver_sdmmc - - driver # driver will be replaced with esp_driver_sdspi + - esp_driver_sdspi tools/test_apps/system/bootloader_sections: disable: diff --git a/tools/test_apps/storage/sdmmc_console/components/cmd_sdmmc/CMakeLists.txt b/tools/test_apps/storage/sdmmc_console/components/cmd_sdmmc/CMakeLists.txt index be7d6f78e7..c358366e39 100644 --- a/tools/test_apps/storage/sdmmc_console/components/cmd_sdmmc/CMakeLists.txt +++ b/tools/test_apps/storage/sdmmc_console/components/cmd_sdmmc/CMakeLists.txt @@ -1,5 +1,6 @@ idf_component_register(SRCS cmd_sdmmc.c INCLUDE_DIRS . - PRIV_REQUIRES console sdmmc esp_driver_sdmmc esp_driver_gpio sdmmc_test_board - driver # driver will be replaced with esp_driver_sdspi later + PRIV_REQUIRES console sdmmc esp_driver_sdmmc esp_driver_gpio esp_driver_sdspi + sdmmc_test_board + ) diff --git a/tools/test_apps/storage/sdmmc_console/components/sdmmc_test_board/CMakeLists.txt b/tools/test_apps/storage/sdmmc_console/components/sdmmc_test_board/CMakeLists.txt index 6d7fd32bbf..f241106c7a 100644 --- a/tools/test_apps/storage/sdmmc_console/components/sdmmc_test_board/CMakeLists.txt +++ b/tools/test_apps/storage/sdmmc_console/components/sdmmc_test_board/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS sdmmc_test_board.c sdmmc_test_board_defs.c INCLUDE_DIRS include - PRIV_REQUIRES sdmmc driver) + PRIV_REQUIRES sdmmc esp_driver_sdmmc esp_driver_sdspi) diff --git a/tools/test_apps/storage/sdmmc_console/components/sdmmc_tests/CMakeLists.txt b/tools/test_apps/storage/sdmmc_console/components/sdmmc_tests/CMakeLists.txt index f363ef58ed..3627aa66a0 100644 --- a/tools/test_apps/storage/sdmmc_console/components/sdmmc_tests/CMakeLists.txt +++ b/tools/test_apps/storage/sdmmc_console/components/sdmmc_tests/CMakeLists.txt @@ -3,8 +3,7 @@ idf_component_register( sdmmc_test_cd_wp_common.c sdmmc_test_rw_common.c PRIV_REQUIRES - sdmmc esp_driver_sdmmc sdmmc_test_board esp_timer unity test_utils - driver # driver will be replaced with esp_driver_sdspi later + sdmmc esp_driver_sdmmc esp_driver_sdspi sdmmc_test_board esp_timer unity test_utils WHOLE_ARCHIVE TRUE )