I'm working on a project based on an esp32s2 board and I need to interface with an SD card, using the SPI peripheral.
The datasheet says:
ESP32-S2 family features four SPI interfaces (SPI0, SPI1, SPI2 and SPI3). SPI0 and SPI1 can only be configured
to operate in SPI memory mode; SPI2 can be configured to operate in SPI memory and general-purpose SPI
modes; SPI3 can only be configured to operate in general-purpose SPI mode
With esp32, we had two available interfaces in the Arduino core:
- HSPI (SPI2)
- VSPI (SPI3)
Code: Select all
#if CONFIG_IDF_TARGET_ESP32S2
_sck = (_spi_num == FSPI) ? SCK : -1;
_miso = (_spi_num == FSPI) ? MISO : -1;
_mosi = (_spi_num == FSPI) ? MOSI : -1;
_ss = (_spi_num == FSPI) ? SS : -1;
#else
Code: Select all
#if CONFIG_IDF_TARGET_ESP32S2
#define VSPI FSPI
#endif
Thanks!