Skip to content

Commit 36b51de

Browse files
committed
fix(lcd): Fixed some known issues with LCD components
1 parent 8b85130 commit 36b51de

File tree

16 files changed

+61
-11
lines changed

16 files changed

+61
-11
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ GPATH
1919
# eclipse setting
2020
.settings
2121

22+
# clangd cache directory files
23+
.cache
24+
2225
# MacOS directory files
2326
.DS_Store
2427

.gitlab/ci/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ build_example_display_lcd_rgb_lcd_8bit:
441441
- .rules:build:example_display_lcd_rgb_lcd_8bit
442442
parallel:
443443
matrix:
444-
- IMAGE: espressif/idf:release-v5.1
444+
- IMAGE: espressif/idf:release-v5.3
445445
variables:
446446
EXAMPLE_DIR: examples/display/lcd/rgb_lcd_8bit
447447

@@ -451,7 +451,7 @@ build_example_display_lcd_rgb_avoid_tearing:
451451
- .rules:build:example_display_lcd_rgb_avoid_tearing
452452
parallel:
453453
matrix:
454-
- IMAGE: espressif/idf:release-v5.1
454+
- IMAGE: espressif/idf:release-v5.3
455455
variables:
456456
EXAMPLE_DIR: examples/display/lcd/rgb_avoid_tearing
457457

.gitlab/ci/deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ pack-upload_files:
110110
- job: "build_example_display_lcd_lcd_with_te: [espressif/idf:release-v5.1]"
111111
- job: "build_example_display_lcd_qspi_with_ram: [espressif/idf:release-v5.1]"
112112
- job: "build_example_display_lcd_qspi_without_ram: [espressif/idf:release-v5.3]"
113-
- job: "build_example_display_lcd_rgb_avoid_tearing: [espressif/idf:release-v5.1]"
114-
- job: "build_example_display_lcd_rgb_lcd_8bit: [espressif/idf:release-v5.1]"
113+
- job: "build_example_display_lcd_rgb_avoid_tearing: [espressif/idf:release-v5.3]"
114+
- job: "build_example_display_lcd_rgb_lcd_8bit: [espressif/idf:release-v5.3]"
115115
- job: "build_example_keyboard: [espressif/idf:release-v5.3]"
116116
- job: "build_example_usb_device_bootloader_uf2: [espressif/idf:release-v5.3]"
117117
- job: "build_example_usb_device_usb_dongle: [espressif/idf:release-v5.3]"

components/display/lcd/esp_lcd_st7701/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.1.2 - 2025-04-03
4+
5+
### bugfix:
6+
7+
* Fixed the issue where the ST7701 RGB interface mirror and swap were ineffective
8+
39
## v1.1.1 - 2024-11-10
410

511
### bugfix:

components/display/lcd/esp_lcd_st7701/esp_lcd_st7701_rgb.c

+11
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,20 @@ static esp_err_t panel_st7701_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool
338338
} else {
339339
st7701->madctl_val &= ~LCD_CMD_ML_BIT;
340340
}
341+
342+
// Enable the Command2 BK0
343+
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_CND2BKxSEL, (uint8_t []) {
344+
ST7701_CMD_BKxSEL_BYTE0, ST7701_CMD_BKxSEL_BYTE1, ST7701_CMD_BKxSEL_BYTE2, ST7701_CMD_BKxSEL_BYTE3,
345+
ST7701_CMD_BKxSEL_BK0 | ST7701_CMD_CN2_BIT,
346+
}, 5), TAG, "send command failed");
341347
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_SDIR, (uint8_t[]) {
342348
sdir_val,
343349
}, 1), TAG, "send command failed");;
350+
351+
// Disable Command2
352+
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_CND2BKxSEL, (uint8_t []) {
353+
ST7701_CMD_BKxSEL_BYTE0, ST7701_CMD_BKxSEL_BYTE1, ST7701_CMD_BKxSEL_BYTE2, ST7701_CMD_BKxSEL_BYTE3, 0,
354+
}, 5), TAG, "send command failed");
344355
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_MADCTL, (uint8_t[]) {
345356
st7701->madctl_val,
346357
}, 1), TAG, "send command failed");;

components/display/lcd/esp_lcd_st7701/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.1.1"
1+
version: "1.1.2"
22
targets:
33
- esp32s3
44
- esp32p4

components/display/lcd/esp_lcd_st7703/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.0.3 - 2025-04-03
4+
5+
### bugfix:
6+
7+
* Added configuration for sending initialization parameters in command mode
8+
39
## v1.0.2 - 2025-01-13
410

511
### bugfix:

components/display/lcd/esp_lcd_st7703/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ Implementation of the ST7703 LCD controller with esp_lcd component.
1212

1313
For more information on LCD, please refer to the [LCD documentation](https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/index.html).
1414

15+
If the screen still fails to turn on after confirming that the initialization register parameters and timing parameters are correct, you can try enabling the `init_in_command_mode` parameter in the `st7703_vendor_config_t` configuration.
16+
17+
```c
18+
19+
st7703_vendor_config_t vendor_config = {
20+
...
21+
.init_in_command_mode = true,
22+
...
23+
};
24+
25+
```
26+
1527
## Add to project
1628
1729
Packages from this repository are uploaded to [Espressif's component service](https://components.espressif.com/).

components/display/lcd/esp_lcd_st7703/esp_lcd_st7703.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ typedef struct {
2626
uint8_t colmod_val; // save surrent value of LCD_CMD_COLMOD register
2727
const st7703_lcd_init_cmd_t *init_cmds;
2828
uint16_t init_cmds_size;
29+
bool init_in_command_mode;
2930
struct {
3031
unsigned int reset_level: 1;
3132
} flags;
@@ -97,6 +98,7 @@ esp_err_t esp_lcd_new_panel_st7703(const esp_lcd_panel_io_handle_t io, const esp
9798
st7703->init_cmds_size = vendor_config->init_cmds_size;
9899
st7703->reset_gpio_num = panel_dev_config->reset_gpio_num;
99100
st7703->flags.reset_level = panel_dev_config->flags.reset_active_high;
101+
st7703->init_in_command_mode = vendor_config->init_in_command_mode;
100102

101103
// Create MIPI DPI panel
102104
esp_lcd_panel_handle_t panel_handle = NULL;
@@ -181,7 +183,9 @@ static esp_err_t panel_st7703_init(esp_lcd_panel_t *panel)
181183
uint16_t init_cmds_size = 0;
182184
bool is_cmd_overwritten = false;
183185

184-
ESP_RETURN_ON_ERROR(st7703->init(panel), TAG, "init MIPI DPI panel failed");
186+
if (!st7703->init_in_command_mode) {
187+
ESP_RETURN_ON_ERROR(st7703->init(panel), TAG, "init MIPI DPI panel failed");
188+
}
185189

186190
uint8_t ID[3];
187191
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_rx_param(io, 0x04, ID, 3), TAG, "read ID failed");
@@ -234,6 +238,10 @@ static esp_err_t panel_st7703_init(esp_lcd_panel_t *panel)
234238
}
235239
ESP_LOGD(TAG, "send init commands success");
236240

241+
if (st7703->init_in_command_mode) {
242+
ESP_RETURN_ON_ERROR(st7703->init(panel), TAG, "init MIPI DPI panel failed");
243+
}
244+
237245
return ESP_OK;
238246
}
239247

components/display/lcd/esp_lcd_st7703/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.2"
1+
version: "1.0.3"
22
targets:
33
- esp32p4
44
description: ESP LCD ST7703(MIPI-DSI)

components/display/lcd/esp_lcd_st7703/include/esp_lcd_st7703.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct {
4040
* Please refer to `vendor_specific_init_default` in source file.
4141
*/
4242
uint16_t init_cmds_size; /*<! Number of commands in above array */
43+
bool init_in_command_mode; /*!< Send LCD initialization commands in command-mode, default in video-mode */
4344
struct {
4445
esp_lcd_dsi_bus_handle_t dsi_bus; /*!< MIPI-DSI bus configuration */
4546
const esp_lcd_dpi_panel_config_t *dpi_config; /*!< MIPI-DPI panel configuration */

components/display/lcd/esp_lcd_st77922/test_apps/sdkconfig.defaults.esp32s3

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
2+
CONFIG_COMPILER_OPTIMIZATION_PERF=y
13
CONFIG_SPIRAM=y
24
CONFIG_SPIRAM_MODE_OCT=y
35
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
46
CONFIG_SPIRAM_RODATA=y
57
CONFIG_SPIRAM_SPEED_80M=y
68
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
7-
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y

examples/display/lcd/mipi_dsi_avoid_tearing/main/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
idf:
3-
version: ">=5.1.0"
3+
version: ">=5.3.0"
44

55
lvgl/lvgl:
66
version: "^9"

examples/display/lcd/rgb_avoid_tearing/main/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
idf:
3-
version: ">=5.1.0"
3+
version: ">=5.3.0"
44

55
lvgl/lvgl:
66
version: ">8.3.9,<9"

examples/display/lcd/rgb_avoid_tearing/main/lvgl_port_v8.c

+2
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ esp_err_t lvgl_port_init(esp_lcd_panel_handle_t lcd_handle, esp_lcd_touch_handle
595595
ESP_ERROR_CHECK(tick_init());
596596

597597
lvgl_port_interface = interface;
598+
#if LVGL_PORT_AVOID_TEAR_ENABLE
598599
switch (interface) {
599600
#if SOC_LCDCAM_RGB_LCD_SUPPORTED
600601
case LVGL_PORT_INTERFACE_RGB:
@@ -613,6 +614,7 @@ esp_err_t lvgl_port_init(esp_lcd_panel_handle_t lcd_handle, esp_lcd_touch_handle
613614
ESP_LOGE(TAG, "Invalid interface type");
614615
return ESP_ERR_INVALID_ARG;
615616
}
617+
#endif
616618

617619
lv_disp_t *disp = display_init(lcd_handle);
618620
assert(disp);

examples/display/lcd/rgb_lcd_8bit/main/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
idf:
3-
version: ">=5.1.0"
3+
version: ">=5.3.0"
44

55
lvgl/lvgl:
66
version: "^9"

0 commit comments

Comments
 (0)