Merge branch 'feature/support_sdspi_on_s2_c3-backport_v4.3' into 'release/v4.3'

example: support sdspi on s2 c3 (backports v4.3)

See merge request espressif/esp-idf!15426
This commit is contained in:
morris 2021-10-09 09:57:21 +00:00
commit e7cc27417f

View File

@ -33,12 +33,18 @@ static const char *TAG = "example";
// #define USE_SPI_MODE
// ESP32-S2 and ESP32-C3 doesn't have an SD Host peripheral, always use SPI:
#if CONFIG_IDF_TARGET_ESP32S2 ||CONFIG_IDF_TARGET_ESP32C3
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
#ifndef USE_SPI_MODE
#define USE_SPI_MODE
#endif // USE_SPI_MODE
// on ESP32-S2, DMA channel must be the same as host id
#if CONFIG_IDF_TARGET_ESP32S2
#define SPI_DMA_CHAN host.slot
#elif CONFIG_IDF_TARGET_ESP32C3
#define SPI_DMA_CHAN SPI_DMA_CH_AUTO
#endif //CONFIG_IDF_TARGET_ESP32S2
#endif //CONFIG_IDF_TARGET_ESP32S2
// DMA channel to be used by the SPI peripheral