From 683b7a2554a28a5da115f2429632f7ed76a7e475 Mon Sep 17 00:00:00 2001 From: lvhaiyu Date: Sun, 10 Nov 2024 17:33:39 +0800 Subject: [PATCH] bugfix(lcd): Fixed low Lane bit rate and other known issues. --- .../lcd/esp_lcd_ili9881c/esp_lcd_ili9881c.c | 25 ++++++++----------- .../lcd/esp_lcd_ili9881c/idf_component.yml | 2 +- .../lcd/esp_lcd_st7796/esp_lcd_st7796_mipi.c | 2 +- .../lcd/esp_lcd_st7796/idf_component.yml | 2 +- .../esp_lcd_st7796/include/esp_lcd_st7796.h | 2 +- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/components/lcd/esp_lcd_ili9881c/esp_lcd_ili9881c.c b/components/lcd/esp_lcd_ili9881c/esp_lcd_ili9881c.c index 54cd1ce2..95b1b285 100644 --- a/components/lcd/esp_lcd_ili9881c/esp_lcd_ili9881c.c +++ b/components/lcd/esp_lcd_ili9881c/esp_lcd_ili9881c.c @@ -108,16 +108,6 @@ esp_err_t esp_lcd_new_panel_ili9881c(const esp_lcd_panel_io_handle_t io, const e break; } - // The ID register is on the CMD_Page 1 - uint8_t ID1, ID2, ID3; - esp_lcd_panel_io_tx_param(io, ILI9881C_CMD_CNDBKxSEL, (uint8_t[]) { - ILI9881C_CMD_BKxSEL_BYTE0, ILI9881C_CMD_BKxSEL_BYTE1, ILI9881C_CMD_BKxSEL_BYTE2_PAGE1 - }, 3); - esp_lcd_panel_io_rx_param(io, 0x00, &ID1, 1); - esp_lcd_panel_io_rx_param(io, 0x01, &ID2, 1); - esp_lcd_panel_io_rx_param(io, 0x02, &ID3, 1); - ESP_LOGI(TAG, "ID1: 0x%x, ID2: 0x%x, ID3: 0x%x", ID1, ID2, ID3); - ili9881c->io = io; ili9881c->init_cmds = vendor_config->init_cmds; ili9881c->init_cmds_size = vendor_config->init_cmds_size; @@ -367,8 +357,8 @@ static esp_err_t panel_ili9881c_del(esp_lcd_panel_t *panel) } // Delete MIPI DPI panel ili9881c->del(panel); - free(ili9881c); ESP_LOGD(TAG, "del ili9881c panel @%p", ili9881c); + free(ili9881c); return ESP_OK; } @@ -397,10 +387,17 @@ static esp_err_t panel_ili9881c_init(esp_lcd_panel_t *panel) return ESP_ERR_INVALID_ARG; } - // back to CMD_Page 1 - ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ILI9881C_CMD_CNDBKxSEL, (uint8_t[]) { + // The ID register is on the CMD_Page 1 + uint8_t ID1, ID2, ID3; + esp_lcd_panel_io_tx_param(io, ILI9881C_CMD_CNDBKxSEL, (uint8_t[]) { ILI9881C_CMD_BKxSEL_BYTE0, ILI9881C_CMD_BKxSEL_BYTE1, ILI9881C_CMD_BKxSEL_BYTE2_PAGE1 - }, 3), TAG, "send command failed"); + }, 3); + esp_lcd_panel_io_rx_param(io, 0x00, &ID1, 1); + esp_lcd_panel_io_rx_param(io, 0x01, &ID2, 1); + esp_lcd_panel_io_rx_param(io, 0x02, &ID3, 1); + ESP_LOGI(TAG, "ID1: 0x%x, ID2: 0x%x, ID3: 0x%x", ID1, ID2, ID3); + + // For modifying MIPI-DSI lane settings ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ILI9881C_PAD_CONTROL, (uint8_t[]) { lane_command, }, 1), TAG, "send command failed"); diff --git a/components/lcd/esp_lcd_ili9881c/idf_component.yml b/components/lcd/esp_lcd_ili9881c/idf_component.yml index e05e37cf..bdb43a56 100644 --- a/components/lcd/esp_lcd_ili9881c/idf_component.yml +++ b/components/lcd/esp_lcd_ili9881c/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.0" +version: "1.0.1" targets: - esp32p4 description: ESP LCD ILI9881C (MIPI DSI) diff --git a/components/lcd/esp_lcd_st7796/esp_lcd_st7796_mipi.c b/components/lcd/esp_lcd_st7796/esp_lcd_st7796_mipi.c index 203d615f..75df50bb 100644 --- a/components/lcd/esp_lcd_st7796/esp_lcd_st7796_mipi.c +++ b/components/lcd/esp_lcd_st7796/esp_lcd_st7796_mipi.c @@ -172,8 +172,8 @@ static esp_err_t panel_st7796_del(esp_lcd_panel_t *panel) } // Delete MIPI DPI panel st7796->del(panel); - free(st7796); ESP_LOGD(TAG, "del st7796 panel @%p", st7796); + free(st7796); return ESP_OK; } diff --git a/components/lcd/esp_lcd_st7796/idf_component.yml b/components/lcd/esp_lcd_st7796/idf_component.yml index 4829ebb9..c08cb044 100644 --- a/components/lcd/esp_lcd_st7796/idf_component.yml +++ b/components/lcd/esp_lcd_st7796/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.3.0" +version: "1.3.1" targets: - esp32s2 - esp32s3 diff --git a/components/lcd/esp_lcd_st7796/include/esp_lcd_st7796.h b/components/lcd/esp_lcd_st7796/include/esp_lcd_st7796.h index d3279ab4..b0ac4563 100644 --- a/components/lcd/esp_lcd_st7796/include/esp_lcd_st7796.h +++ b/components/lcd/esp_lcd_st7796/include/esp_lcd_st7796.h @@ -158,7 +158,7 @@ esp_err_t esp_lcd_new_panel_st7796(const esp_lcd_panel_io_handle_t io, const esp .bus_id = 0, \ .num_data_lanes = 1, \ .phy_clk_src = MIPI_DSI_PHY_CLK_SRC_DEFAULT, \ - .lane_bit_rate_mbps = 250, \ + .lane_bit_rate_mbps = 480, \ } /**