diff --git a/lvgl_spi_conf.h b/lvgl_spi_conf.h index 9b6d0ae..7a333fe 100644 --- a/lvgl_spi_conf.h +++ b/lvgl_spi_conf.h @@ -162,11 +162,15 @@ extern "C" { #endif /* CONFIG_LV_TFT_USE_CUSTOM_SPI_CLK_DIVIDER */ +#if defined (CONFIG_LV_TFT_DISPLAY_USE_CUSTOM_SPI_MODE) +#define SPI_TFT_SPI_MODE (CONFIG_LV_TFT_DISPLAY_CUSTOM_SPI_MODE) +#else #if defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7789) #define SPI_TFT_SPI_MODE (2U) #else #define SPI_TFT_SPI_MODE (0U) #endif +#endif /* Touch driver */ #if (CONFIG_LV_TOUCH_CONTROLLER == TOUCH_CONTROLLER_STMPE610) diff --git a/lvgl_tft/Kconfig b/lvgl_tft/Kconfig index 706cd07..80922ac 100644 --- a/lvgl_tft/Kconfig +++ b/lvgl_tft/Kconfig @@ -494,6 +494,18 @@ menu "LVGL TFT Display controller" bool "QIO (4-bit Quad SPI)" endchoice + config LV_TFT_DISPLAY_USE_CUSTOM_SPI_MODE + bool "Use custom SPI Mode" if LV_TFT_DISPLAY_PROTOCOL_SPI + help + Allow user to choose a custom SPI mode + + config LV_TFT_DISPLAY_CUSTOM_SPI_MODE + int "Custom SPI Mode" + range 0 3 + depends on LV_TFT_DISPLAY_USE_CUSTOM_SPI_MODE + help + Custom SPI mode, representing a pair of (CPOL, CPHA) configuration. + choice prompt "TFT SPI Duplex Mode" if LV_TFT_DISPLAY_PROTOCOL_SPI default LV_TFT_DISPLAY_SPI_FULL_DUPLEX if LV_PREDEFINED_DISPLAY_RPI_RA8875 || LV_TFT_DISPLAY_CONTROLLER_FT81X