mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-19 14:26:01 -04:00
refactor(sdspi): place sdspi driver into a new component
This commit is contained in:
parent
f2a0beb579
commit
c50e364a97
@ -16,7 +16,6 @@ set(includes "include"
|
|||||||
"parlio/include"
|
"parlio/include"
|
||||||
"rmt/include"
|
"rmt/include"
|
||||||
"sdio_slave/include"
|
"sdio_slave/include"
|
||||||
"sdspi/include"
|
|
||||||
"sigma_delta/include"
|
"sigma_delta/include"
|
||||||
"temperature_sensor/include"
|
"temperature_sensor/include"
|
||||||
"touch_sensor/include"
|
"touch_sensor/include"
|
||||||
@ -113,14 +112,6 @@ if(CONFIG_SOC_SDM_SUPPORTED)
|
|||||||
"deprecated/sigma_delta_legacy.c")
|
"deprecated/sigma_delta_legacy.c")
|
||||||
endif()
|
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
|
# Temperature Sensor related source files
|
||||||
if(CONFIG_SOC_TEMP_SENSOR_SUPPORTED)
|
if(CONFIG_SOC_TEMP_SENSOR_SUPPORTED)
|
||||||
list(APPEND srcs "temperature_sensor/temperature_sensor.c"
|
list(APPEND srcs "temperature_sensor/temperature_sensor.c"
|
||||||
@ -173,7 +164,7 @@ else()
|
|||||||
# for backward compatibility, the driver component needs to
|
# for backward compatibility, the driver component needs to
|
||||||
# have a public dependency on other "esp_driver_foo" components
|
# 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_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}
|
LDFRAGMENTS ${ldfragments}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
15
components/esp_driver_sdspi/CMakeLists.txt
Normal file
15
components/esp_driver_sdspi/CMakeLists.txt
Normal file
@ -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
|
||||||
|
)
|
@ -9,7 +9,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "driver/sdmmc_types.h"
|
#include "sd_protocol_types.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/spi_master.h"
|
#include "driver/spi_master.h"
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_heap_caps.h"
|
#include "esp_heap_caps.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/sdmmc_defs.h"
|
#include "sd_protocol_defs.h"
|
||||||
#include "driver/sdspi_host.h"
|
#include "driver/sdspi_host.h"
|
||||||
#include "sdspi_private.h"
|
#include "sdspi_private.h"
|
||||||
#include "sdspi_crc.h"
|
#include "sdspi_crc.h"
|
@ -8,9 +8,8 @@
|
|||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "sys/lock.h"
|
#include "sys/lock.h"
|
||||||
#include "driver/sdmmc_types.h"
|
#include "sd_protocol_defs.h"
|
||||||
#include "driver/sdmmc_defs.h"
|
#include "sd_protocol_types.h"
|
||||||
#include "driver/sdmmc_types.h"
|
|
||||||
#include "sdspi_private.h"
|
#include "sdspi_private.h"
|
||||||
#include "sdspi_crc.h"
|
#include "sdspi_crc.h"
|
||||||
|
|
@ -22,7 +22,7 @@ else()
|
|||||||
|
|
||||||
list(APPEND include_dirs "vfs")
|
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")
|
list(APPEND priv_requires "vfs" "esp_driver_gpio")
|
||||||
endif()
|
endif()
|
||||||
|
@ -7,6 +7,6 @@ set(src "test_app_main.c" "test_vfs_access.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS ${src}
|
idf_component_register(SRCS ${src}
|
||||||
PRIV_INCLUDE_DIRS .
|
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
|
WHOLE_ARCHIVE
|
||||||
)
|
)
|
||||||
|
@ -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_default_configs.h \
|
||||||
$(PROJECT_PATH)/components/esp_driver_sdmmc/include/driver/sdmmc_host.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_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_common.h \
|
||||||
$(PROJECT_PATH)/components/esp_driver_spi/include/driver/spi_master.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_hd.h \
|
||||||
|
@ -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.
|
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 commands to slave devices
|
||||||
- Sending and receiving data
|
- Sending and receiving data
|
||||||
|
@ -8,7 +8,7 @@ SD/SDIO/MMC 驱动程序
|
|||||||
|
|
||||||
SD/SDIO/MMC 驱动是一种基于 SDMMC 和 SD SPI 主机驱动的协议级驱动程序,目前已支持 SD 存储器、SDIO 卡和 eMMC 芯片。
|
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:
|
||||||
|
|
||||||
- 发送命令至从设备
|
- 发送命令至从设备
|
||||||
- 接收和发送数据
|
- 接收和发送数据
|
||||||
|
@ -10,11 +10,11 @@ examples/storage/custom_flash_driver:
|
|||||||
|
|
||||||
examples/storage/emmc:
|
examples/storage/emmc:
|
||||||
depends_components:
|
depends_components:
|
||||||
- sdmmc
|
|
||||||
- driver # `driver` will be replaced with `esp_driver_sdspi`
|
|
||||||
- fatfs
|
- fatfs
|
||||||
- vfs
|
- vfs
|
||||||
|
- sdmmc
|
||||||
- esp_driver_sdmmc
|
- esp_driver_sdmmc
|
||||||
|
- esp_driver_sdspi
|
||||||
enable:
|
enable:
|
||||||
- if: IDF_TARGET == "esp32s3"
|
- if: IDF_TARGET == "esp32s3"
|
||||||
reason: only support on esp32s3
|
reason: only support on esp32s3
|
||||||
@ -134,7 +134,7 @@ examples/storage/sd_card/sdspi:
|
|||||||
depends_components:
|
depends_components:
|
||||||
- vfs
|
- vfs
|
||||||
- sdmmc
|
- sdmmc
|
||||||
- driver # To be updated to `esp_driver_sdspi`
|
- esp_driver_sdspi
|
||||||
disable:
|
disable:
|
||||||
- if: SOC_GPSPI_SUPPORTED != 1
|
- if: SOC_GPSPI_SUPPORTED != 1
|
||||||
disable_test:
|
disable_test:
|
||||||
|
@ -99,7 +99,7 @@ tools/test_apps/storage/sdmmc_console:
|
|||||||
depends_components:
|
depends_components:
|
||||||
- sdmmc
|
- sdmmc
|
||||||
- esp_driver_sdmmc
|
- esp_driver_sdmmc
|
||||||
- driver # driver will be replaced with esp_driver_sdspi
|
- esp_driver_sdspi
|
||||||
|
|
||||||
tools/test_apps/system/bootloader_sections:
|
tools/test_apps/system/bootloader_sections:
|
||||||
disable:
|
disable:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
idf_component_register(SRCS cmd_sdmmc.c
|
idf_component_register(SRCS cmd_sdmmc.c
|
||||||
INCLUDE_DIRS .
|
INCLUDE_DIRS .
|
||||||
PRIV_REQUIRES console sdmmc esp_driver_sdmmc esp_driver_gpio sdmmc_test_board
|
PRIV_REQUIRES console sdmmc esp_driver_sdmmc esp_driver_gpio esp_driver_sdspi
|
||||||
driver # driver will be replaced with esp_driver_sdspi later
|
sdmmc_test_board
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
idf_component_register(SRCS sdmmc_test_board.c sdmmc_test_board_defs.c
|
idf_component_register(SRCS sdmmc_test_board.c sdmmc_test_board_defs.c
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
PRIV_REQUIRES sdmmc driver)
|
PRIV_REQUIRES sdmmc esp_driver_sdmmc esp_driver_sdspi)
|
||||||
|
@ -3,8 +3,7 @@ idf_component_register(
|
|||||||
sdmmc_test_cd_wp_common.c
|
sdmmc_test_cd_wp_common.c
|
||||||
sdmmc_test_rw_common.c
|
sdmmc_test_rw_common.c
|
||||||
PRIV_REQUIRES
|
PRIV_REQUIRES
|
||||||
sdmmc esp_driver_sdmmc sdmmc_test_board esp_timer unity test_utils
|
sdmmc esp_driver_sdmmc esp_driver_sdspi sdmmc_test_board esp_timer unity test_utils
|
||||||
driver # driver will be replaced with esp_driver_sdspi later
|
|
||||||
WHOLE_ARCHIVE TRUE
|
WHOLE_ARCHIVE TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user