Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion lvgl_tft/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,19 @@ menu "LVGL TFT Display controller"

endmenu

# menu will be visible only when LV_PREDEFINED_DISPLAY_NONE is y
menu "Display ST7789 Configuration"
visible if LV_TFT_DISPLAY_CONTROLLER_ST7789

config LV_DISP_ST7789_SOFT_RESET
bool "Soft reset - use software reset instead of reset pin"
depends on LV_TFT_DISPLAY_CONTROLLER_ST7789
default n
help
Use software reset and ignores configured reset pin (some hardware does not use a reset pin).

endmenu

# menu will be visible only when LV_PREDEFINED_DISPLAY_NONE is y
menu "Display Pin Assignments"
visible if LV_PREDEFINED_DISPLAY_NONE || LV_PREDEFINED_DISPLAY_RPI_MPI3501 || LV_PREDEFINED_PINS_TKOALA
Expand Down Expand Up @@ -885,7 +898,7 @@ menu "LVGL TFT Display controller"
Configure the display DC pin here.

config LV_DISP_PIN_RST
int "GPIO for Reset" if LV_TFT_DISPLAY_PROTOCOL_SPI
int "GPIO for Reset" if LV_TFT_DISPLAY_PROTOCOL_SPI && !LV_DISP_ST7789_SOFT_RESET
range 0 39 if IDF_TARGET_ESP32
range 0 43 if IDF_TARGET_ESP32S2

Expand Down
7 changes: 7 additions & 0 deletions lvgl_tft/st7789.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,26 @@ void st7789_init(void)
//Initialize non-SPI GPIOs
gpio_pad_select_gpio(ST7789_DC);
gpio_set_direction(ST7789_DC, GPIO_MODE_OUTPUT);

#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
gpio_pad_select_gpio(ST7789_RST);
gpio_set_direction(ST7789_RST, GPIO_MODE_OUTPUT);
#endif

#if ST7789_ENABLE_BACKLIGHT_CONTROL
gpio_pad_select_gpio(ST7789_BCKL);
gpio_set_direction(ST7789_BCKL, GPIO_MODE_OUTPUT);
#endif

//Reset the display
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
gpio_set_level(ST7789_RST, 0);
vTaskDelay(100 / portTICK_RATE_MS);
gpio_set_level(ST7789_RST, 1);
vTaskDelay(100 / portTICK_RATE_MS);
#else
st7789_send_cmd(ST7789_SWRESET);
#endif

printf("ST7789 initialization.\n");

Expand Down