From 2ab7c1ae74a7872c9778579697000ea05750fd38 Mon Sep 17 00:00:00 2001 From: Rob4226 Date: Wed, 22 Nov 2023 20:35:14 -0500 Subject: [PATCH] fix: led_strip add default spi2 pins for more chips --- components/led_strip_spi/led_strip_spi_esp32.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/led_strip_spi/led_strip_spi_esp32.h b/components/led_strip_spi/led_strip_spi_esp32.h index 8877e570..9aa99181 100644 --- a/components/led_strip_spi/led_strip_spi_esp32.h +++ b/components/led_strip_spi/led_strip_spi_esp32.h @@ -41,9 +41,16 @@ #define LED_STRIP_SPI_DEFAULT_HOST_DEVICE SPI2_HOST ///< Default is `SPI2_HOST` (`HSPI_HOST` if `esp-idf` version is v3.x). #endif -#if defined(CONFIG_IDF_TARGET_ESP32C3) +#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) \ + || defined(CONFIG_IDF_TARGET_ESP32C6) #define LED_STRIP_SPI_DEFAULT_MOSI_IO_NUM (7) #define LED_STRIP_SPI_DEFAULT_SCLK_IO_NUM (6) +#elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) +#define LED_STRIP_SPI_DEFAULT_MOSI_IO_NUM (11) +#define LED_STRIP_SPI_DEFAULT_SCLK_IO_NUM (12) +#elif defined(CONFIG_IDF_TARGET_ESP32H2) +#define LED_STRIP_SPI_DEFAULT_MOSI_IO_NUM (5) +#define LED_STRIP_SPI_DEFAULT_SCLK_IO_NUM (4) #else #define LED_STRIP_SPI_DEFAULT_MOSI_IO_NUM (13) ///< GPIO pin number of `LED_STRIP_SPI_DEFAULT_HOST_DEVICE`'s MOSI (default is 13 for ESP32, 7 for ESP32C3) #define LED_STRIP_SPI_DEFAULT_SCLK_IO_NUM (14) ///< GPIO pin number of `LED_STRIP_SPI_DEFAULT_HOST_DEVICE`'s SCLK (default is 14 for ESP32, 6 for ESP32C3)