Skip to content

Commit

Permalink
Merge pull request #584 from rob4226/bugfix-led-strip-spi-pins
Browse files Browse the repository at this point in the history
Add default SPI2 pins for other chips in the led_strip component
  • Loading branch information
UncleRus authored Nov 23, 2023
2 parents 25b0a18 + 2ab7c1a commit 707ee39
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/led_strip_spi/led_strip_spi_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 707ee39

Please sign in to comment.