Reduce SPI clock and add panel stabilization delays
Lowered the SPI clock to 5MHz to reduce power consumption and avoid brownout issues. Added delays after panel reset and initialization to ensure proper stabilization. Introduced ENABLE_BACKLIGHT macro and conditional backlight control logic. Updated .gitignore to exclude build and managed_components directories in 05_LVGL_WITH_RAM. Updated dependency and sdkconfig files to reflect new local paths and component versions.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@
|
|||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
/ref_demo
|
/ref_demo
|
||||||
/.cache
|
/.cache
|
||||||
|
/05_LVGL_WITH_RAM/build
|
||||||
|
/05_LVGL_WITH_RAM/managed_components
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ dependencies:
|
|||||||
esp_lcd_sh8601:
|
esp_lcd_sh8601:
|
||||||
dependencies: []
|
dependencies: []
|
||||||
source:
|
source:
|
||||||
path: C:\Users\neila\Downloads\ESP32-S3-Touch-AMOLED-1.8-Demo\ESP-IDF-v5.3.2\05_LVGL_WITH_RAM\components\esp_lcd_sh8601
|
path: /Users/neil/Coding/iroBot/05_LVGL_WITH_RAM/components/esp_lcd_sh8601
|
||||||
type: local
|
type: local
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
espressif/cmake_utilities:
|
espressif/cmake_utilities:
|
||||||
@@ -16,7 +16,7 @@ dependencies:
|
|||||||
type: service
|
type: service
|
||||||
version: 0.5.3
|
version: 0.5.3
|
||||||
espressif/esp_io_expander:
|
espressif/esp_io_expander:
|
||||||
component_hash: abf3ea0d71407d79d15500550aa3ba433848459b0fa94717cf9478822593ee5d
|
component_hash: 034903704f65e3994d7cce9d080b19d89525cf6d416574b932826adf680f3942
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: idf
|
- name: idf
|
||||||
require: private
|
require: private
|
||||||
@@ -24,7 +24,7 @@ dependencies:
|
|||||||
source:
|
source:
|
||||||
registry_url: https://components.espressif.com
|
registry_url: https://components.espressif.com
|
||||||
type: service
|
type: service
|
||||||
version: 1.1.0
|
version: 1.2.0
|
||||||
espressif/esp_io_expander_tca9554:
|
espressif/esp_io_expander_tca9554:
|
||||||
component_hash: e9e49ddb1038c2b54b13c51b5e3e6dbdd10a878959c8ab0e0a7c8206316add61
|
component_hash: e9e49ddb1038c2b54b13c51b5e3e6dbdd10a878959c8ab0e0a7c8206316add61
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -42,13 +42,13 @@ dependencies:
|
|||||||
espressif/esp_lcd_touch:
|
espressif/esp_lcd_touch:
|
||||||
dependencies: []
|
dependencies: []
|
||||||
source:
|
source:
|
||||||
path: C:\Users\neila\Downloads\ESP32-S3-Touch-AMOLED-1.8-Demo\ESP-IDF-v5.3.2\05_LVGL_WITH_RAM\components\espressif__esp_lcd_touch
|
path: /Users/neil/Coding/iroBot/05_LVGL_WITH_RAM/components/espressif__esp_lcd_touch
|
||||||
type: local
|
type: local
|
||||||
version: 1.1.1
|
version: 1.1.1
|
||||||
espressif/esp_lcd_touch_ft5x06:
|
espressif/esp_lcd_touch_ft5x06:
|
||||||
dependencies: []
|
dependencies: []
|
||||||
source:
|
source:
|
||||||
path: C:\Users\neila\Downloads\ESP32-S3-Touch-AMOLED-1.8-Demo\ESP-IDF-v5.3.2\05_LVGL_WITH_RAM\components\espressif__esp_lcd_touch_ft5x06
|
path: /Users/neil/Coding/iroBot/05_LVGL_WITH_RAM/components/espressif__esp_lcd_touch_ft5x06
|
||||||
type: local
|
type: local
|
||||||
version: 1.0.6
|
version: 1.0.6
|
||||||
idf:
|
idf:
|
||||||
|
|||||||
@@ -2274,6 +2274,12 @@ CONFIG_ESP_LCD_TOUCH_MAX_POINTS=5
|
|||||||
CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=1
|
CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=1
|
||||||
# end of ESP LCD TOUCH
|
# end of ESP LCD TOUCH
|
||||||
|
|
||||||
|
#
|
||||||
|
# ESP IO Expander
|
||||||
|
#
|
||||||
|
# CONFIG_IO_EXPANDER_ENABLE_GPIO_API_WRAPPER is not set
|
||||||
|
# end of ESP IO Expander
|
||||||
|
|
||||||
#
|
#
|
||||||
# LVGL configuration
|
# LVGL configuration
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ dependencies:
|
|||||||
esp_lcd_sh8601:
|
esp_lcd_sh8601:
|
||||||
dependencies: []
|
dependencies: []
|
||||||
source:
|
source:
|
||||||
path: C:\Users\neila\Coding\iroBotAMOLED\components\esp_lcd_sh8601
|
path: /Users/neil/Coding/iroBot/components/esp_lcd_sh8601
|
||||||
type: local
|
type: local
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
espressif/esp_io_expander:
|
espressif/esp_io_expander:
|
||||||
|
|||||||
17
main/main.c
17
main/main.c
@@ -80,7 +80,7 @@ static const char *TAG = "LVGL_AMOLED";
|
|||||||
#define PIN_NUM_TOUCH_RST (-1)
|
#define PIN_NUM_TOUCH_RST (-1)
|
||||||
#define PIN_NUM_TOUCH_INT (GPIO_NUM_21)
|
#define PIN_NUM_TOUCH_INT (GPIO_NUM_21)
|
||||||
|
|
||||||
#define USE_TOUCH 1
|
#define ENABLE_BACKLIGHT 0
|
||||||
|
|
||||||
/* IO Expander Pins */
|
/* IO Expander Pins */
|
||||||
#define IO_EXPANDER_PIN_NUM_0 (1 << 0)
|
#define IO_EXPANDER_PIN_NUM_0 (1 << 0)
|
||||||
@@ -485,8 +485,9 @@ void app_main(void) {
|
|||||||
|
|
||||||
esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG(
|
esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG(
|
||||||
PIN_NUM_LCD_CS, notify_lvgl_flush_ready, &disp_drv);
|
PIN_NUM_LCD_CS, notify_lvgl_flush_ready, &disp_drv);
|
||||||
|
// Reduce SPI clock to 5MHz to lower power consumption and avoid brownout
|
||||||
io_config.pclk_hz =
|
io_config.pclk_hz =
|
||||||
40 * 1000 * 1000; /* Reduced to 40MHz for stability (matching demo) */
|
5 * 1000 * 1000; /* 5MHz for stability */
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST,
|
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST,
|
||||||
&io_config, &lcd_io));
|
&io_config, &lcd_io));
|
||||||
@@ -507,11 +508,23 @@ void app_main(void) {
|
|||||||
ESP_ERROR_CHECK(esp_lcd_new_panel_sh8601(lcd_io, &panel_config, &lcd_panel));
|
ESP_ERROR_CHECK(esp_lcd_new_panel_sh8601(lcd_io, &panel_config, &lcd_panel));
|
||||||
ESP_LOGI(TAG, "Resetting panel");
|
ESP_LOGI(TAG, "Resetting panel");
|
||||||
ESP_ERROR_CHECK(esp_lcd_panel_reset(lcd_panel));
|
ESP_ERROR_CHECK(esp_lcd_panel_reset(lcd_panel));
|
||||||
|
// Small delay to allow the panel to stabilize after reset
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(100));
|
||||||
ESP_LOGI(TAG, "Initializing panel");
|
ESP_LOGI(TAG, "Initializing panel");
|
||||||
ESP_ERROR_CHECK(esp_lcd_panel_init(lcd_panel));
|
ESP_ERROR_CHECK(esp_lcd_panel_init(lcd_panel));
|
||||||
|
// Additional delay before turning the panel on
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(200));
|
||||||
ESP_LOGI(TAG, "Turning panel ON");
|
ESP_LOGI(TAG, "Turning panel ON");
|
||||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(lcd_panel, true));
|
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(lcd_panel, true));
|
||||||
ESP_LOGI(TAG, "Panel init complete");
|
ESP_LOGI(TAG, "Panel init complete");
|
||||||
|
#if ENABLE_BACKLIGHT
|
||||||
|
// Turn off backlight initially via IO expander to reduce power draw
|
||||||
|
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 0);
|
||||||
|
// Short delay to ensure panel is stable
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(100));
|
||||||
|
// Enable backlight after panel is on
|
||||||
|
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Touch Driver Setup (FT5x06) */
|
/* Touch Driver Setup (FT5x06) */
|
||||||
#if USE_TOUCH
|
#if USE_TOUCH
|
||||||
|
|||||||
Reference in New Issue
Block a user