Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default SPI2 pins for other chips in the led_strip component #584

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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