From 84dfb69a675f2c202a0c8de66817256ff09dc35f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 17 Jul 2022 14:25:53 -0700 Subject: [PATCH] Add FSPI interface for esp32s2 and honor the DATA_PIN and CLOCK_PIN since the SPI channels can be remapped --- src/platforms/esp/32/fastspi_esp32.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/platforms/esp/32/fastspi_esp32.h b/src/platforms/esp/32/fastspi_esp32.h index d69bc5239..5fe8346dd 100644 --- a/src/platforms/esp/32/fastspi_esp32.h +++ b/src/platforms/esp/32/fastspi_esp32.h @@ -45,11 +45,14 @@ FASTLED_NAMESPACE_BEGIN * THE SOFTWARE. */ +#include + #ifndef FASTLED_ESP32_SPI_BUS #define FASTLED_ESP32_SPI_BUS VSPI #endif -SPIClass ledSPI(FASTLED_ESP32_SPI_BUS); +static SPIClass ledSPI(FASTLED_ESP32_SPI_BUS); + #if FASTLED_ESP32_SPI_BUS == VSPI static uint8_t spiClk = 18; @@ -61,6 +64,11 @@ SPIClass ledSPI(FASTLED_ESP32_SPI_BUS); static uint8_t spiMiso = 12; static uint8_t spiMosi = 13; static uint8_t spiCs = 15; +#elif FASTLED_ESP32_SPI_BUS == FSPI // ESP32S2 has FSPI and can map to arbitrary pins + #define spiMosi DATA_PIN + #define spiClk CLOCK_PIN + #define spiMiso -1 + #define spiCs -1 #endif template @@ -169,4 +177,4 @@ class ESP32SPIOutput { } }; -FASTLED_NAMESPACE_END \ No newline at end of file +FASTLED_NAMESPACE_END