Commit 14ff368d authored by Dr. Stefan Labich's avatar Dr. Stefan Labich

added USE_FSPI_PORT flag to support more ESP32-S2 boards

parent 32d99142
...@@ -11,16 +11,18 @@ ...@@ -11,16 +11,18 @@
#ifdef CONFIG_IDF_TARGET_ESP32 #ifdef CONFIG_IDF_TARGET_ESP32
#ifdef USE_HSPI_PORT #ifdef USE_HSPI_PORT
SPIClass spi = SPIClass(HSPI); SPIClass spi = SPIClass(HSPI);
#elif defined(USE_FSPI_PORT)
SPIClass spi = SPIClass(FSPI);
#else // use default VSPI port #else // use default VSPI port
//SPIClass& spi = SPI;
SPIClass spi = SPIClass(VSPI); SPIClass spi = SPIClass(VSPI);
#endif #endif
#else #else
#ifdef USE_HSPI_PORT #ifdef USE_HSPI_PORT
SPIClass spi = SPIClass(HSPI); SPIClass spi = SPIClass(HSPI);
#else // use FSPI port #elif defined(USE_FSPI_PORT)
//SPIClass& spi = SPI;
SPIClass spi = SPIClass(FSPI); SPIClass spi = SPIClass(FSPI);
#else // use FSPI port
SPIClass& spi = SPI;
#endif #endif
#endif #endif
#endif #endif
...@@ -32,6 +34,8 @@ ...@@ -32,6 +34,8 @@
#define DMA_CHANNEL 1 #define DMA_CHANNEL 1
#ifdef USE_HSPI_PORT #ifdef USE_HSPI_PORT
spi_host_device_t spi_host = HSPI_HOST; spi_host_device_t spi_host = HSPI_HOST;
#elif defined(USE_FSPI_PORT)
spi_host_device_t spi_host = SPI_HOST;
#else // use VSPI port #else // use VSPI port
spi_host_device_t spi_host = VSPI_HOST; spi_host_device_t spi_host = VSPI_HOST;
#endif #endif
......
...@@ -67,6 +67,8 @@ SPI3_HOST = 2 ...@@ -67,6 +67,8 @@ SPI3_HOST = 2
#else #else
#define SPI_PORT 3 //HSPI is port 3 on ESP32 S2 #define SPI_PORT 3 //HSPI is port 3 on ESP32 S2
#endif #endif
#elif defined(USE_FSPI_PORT)
#define SPI_PORT 2 //FSPI(ESP32 S2)
#else #else
#ifdef CONFIG_IDF_TARGET_ESP32 #ifdef CONFIG_IDF_TARGET_ESP32
#define SPI_PORT VSPI #define SPI_PORT VSPI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment