Allow user to configure custom SPI mode (#181)

Fixes #178
This commit is contained in:
Carlos Diaz 2022-02-15 00:51:37 -06:00 committed by GitHub
parent fc81c6da5a
commit 7c6bdc5635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -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)

View file

@ -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