Merge pull request #145 from arktrin/fix-spi-conf

Fix SPI configuration for ESP32C3 and ESP32S2
This commit is contained in:
Tomas Rezucha 2021-12-14 16:28:06 +01:00 committed by GitHub
commit 4afc03a9fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 18 deletions

View file

@ -64,16 +64,12 @@ extern "C" {
#define ENABLE_TOUCH_INPUT CONFIG_LV_ENABLE_TOUCH
#if defined (CONFIG_LV_TFT_DISPLAY_SPI_HSPI)
#if defined (CONFIG_IDF_TARGET_ESP32C3)
#if defined (CONFIG_LV_TFT_DISPLAY_SPI1_HOST)
#define TFT_SPI_HOST SPI1_HOST
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI2_HOST)
#define TFT_SPI_HOST SPI2_HOST
#else
#define TFT_SPI_HOST HSPI_HOST
#endif
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI_VSPI)
#define TFT_SPI_HOST VSPI_HOST
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI_FSPI)
#define TFT_SPI_HOST FSPI_HOST
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI3_HOST)
#define TFT_SPI_HOST SPI3_HOST
#endif
#if defined (CONFIG_LV_TFT_DISPLAY_SPI_HALF_DUPLEX)

View file

@ -469,18 +469,17 @@ menu "LVGL TFT Display controller"
choice
prompt "TFT SPI Bus." if LV_TFT_DISPLAY_PROTOCOL_SPI
default LV_TFT_DISPLAY_SPI_VSPI if LV_PREDEFINED_DISPLAY_TTGO && \
default LV_TFT_DISPLAY_SPI3_HOST if LV_PREDEFINED_DISPLAY_TTGO && \
!IDF_TARGET_ESP32S2
default LV_TFT_DISPLAY_SPI_FSPI if IDF_TARGET_ESP32S2
help
Select the SPI Bus the TFT Display is attached to.
config LV_TFT_DISPLAY_SPI_HSPI
bool "HSPI"
config LV_TFT_DISPLAY_SPI_VSPI
bool "VSPI" if !IDF_TARGET_ESP32S2
config LV_TFT_DISPLAY_SPI_FSPI
bool "FSPI" if IDF_TARGET_ESP32S2
config LV_TFT_DISPLAY_SPI1_HOST
bool "SPI1_HOST"
config LV_TFT_DISPLAY_SPI2_HOST
bool "SPI2_HOST"
config LV_TFT_DISPLAY_SPI3_HOST
bool "SPI3_HOST"
endchoice
choice