Closed yel-best closed 2 months ago
@yel-best Please try to enable or disable option: CONFIG_LV_COLOR_16_SWAP=y
in menuconfig
@yel-best Please try to enable or disable option:
CONFIG_LV_COLOR_16_SWAP=y
inmenuconfig
Thanks, I have updated the description of the question, can you help me take a look?
@yel-best Please try to enable or disable option:
CONFIG_LV_COLOR_16_SWAP=y
inmenuconfig
CONFIG_LV_COLOR_16_SWAP
is even weirder when disabled, so I enabled CONFIG_LV_COLOR_16_SWAP=y
by default
Updates
Since ILI9341 IPS LCD is used
I adjusted it to disable CONFIG_LV_COLOR_16_SWAP
Add code:
esp_lcd_panel_invert_color(lcd_panel, true);
Because we see that the inverted color address is 0x21, it should be sufficient.
static esp_err_t panel_ili9341_invert_color(esp_lcd_panel_t *panel, bool invert_color_data)
{
ili9341_panel_t *ili9341 = __containerof(panel, ili9341_panel_t, base);
esp_lcd_panel_io_handle_t io = ili9341->io;
int command = 0;
if (invert_color_data) {
command = LCD_CMD_INVON;
} else {
command = LCD_CMD_INVOFF;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, command, NULL, 0), TAG, "send command failed");
return ESP_OK;
}
After selecting the result, the color should be normal according to the fuzzy judgment, but the interface will be blurry. How to solve this problem of fuzzy interface? what is the reason?
This is still not right color settings. It seems, that you should change vendor initialization data: https://github.com/espressif/esp-bsp/blob/05d471ac4a65ea84c6d8bf1c83250b58f1a53beb/components/lcd/esp_lcd_ili9341/include/esp_lcd_ili9341.h#L37 these data can be different for each vendor.
You can try this change: https://github.com/espressif/esp-bsp/commit/b35a400e47cf8a0034cf769c32cbf12fbafdc90a
@yel-best Please try to enable or disable option:
CONFIG_LV_COLOR_16_SWAP=y
inmenuconfig
CONFIG_LV_COLOR_16_SWAP
is even weirder when disabled, so I enabledCONFIG_LV_COLOR_16_SWAP=y
by default
Hi @yel-best, in this situation (without using invert_color()
), I think you can try to change the RGB elements' order as the following code:
const esp_lcd_panel_dev_config_t panel_config = {
.reset_gpio_num = EXAMPLE_PIN_NUM_LCD_RST, // Set to -1 if not use
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) // Implemented by LCD command `36h`
.color_space = ESP_LCD_COLOR_SPACE_BGR,
#else
.rgb_endian = LCD_RGB_ENDIAN_BGR,
#endif
.bits_per_pixel = 16, // Implemented by LCD command `3Ah` (16/18)
// .vendor_config = &vendor_config, // Uncomment this line if use custom initialization commands
};
@yel-best Please try to enable or disable option:
CONFIG_LV_COLOR_16_SWAP=y
inmenuconfig
CONFIG_LV_COLOR_16_SWAP
is even weirder when disabled, so I enabledCONFIG_LV_COLOR_16_SWAP=y
by defaultHi @yel-best, in this situation (without using
invert_color()
), I think you can try to change the RGB elements' order as the following code:const esp_lcd_panel_dev_config_t panel_config = { .reset_gpio_num = EXAMPLE_PIN_NUM_LCD_RST, // Set to -1 if not use #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) // Implemented by LCD command `36h` .color_space = ESP_LCD_COLOR_SPACE_BGR, #else .rgb_endian = LCD_RGB_ENDIAN_BGR, #endif .bits_per_pixel = 16, // Implemented by LCD command `3Ah` (16/18) // .vendor_config = &vendor_config, // Uncomment this line if use custom initialization commands };
thanks , ok
However, in this case, after using inversion, the colors will appear to be correct, but the text content on the screen will be blurred.
This is still not right color settings. It seems, that you should change vendor initialization data:
these data can be different for each vendor. You can try this change: b35a400
@yel-best Ok, looks like this step should be necessary.
This is still not right color settings. It seems, that you should change vendor initialization data: https://github.com/espressif/esp-bsp/blob/05d471ac4a65ea84c6d8bf1c83250b58f1a53beb/components/lcd/esp_lcd_ili9341/include/esp_lcd_ili9341.h#L37
these data can be different for each vendor. You can try this change: b35a400
@yel-best Ok, looks like this step should be necessary.
yes,you are right. The LCD driver I am currently using should beILI9341v,
not the ordinaryILI9341
protocol, so I need to make some modifications. Directly using the cmd in the package will not display properly.
I modified the configuration and used CONFIG_LV_COLOR_16_SWAP=y
, and finally I got the desired result
Check out my latest results
Thank you all for your help, thank you very much 👏
FYI, in LVGL v9 LV_COLOR_16_SWAP
is removed and you can call lv_draw_sw_rgb565_swap
in the flush_cb.
FYI, in LVGL v9
LV_COLOR_16_SWAP
is removed and you can calllv_draw_sw_rgb565_swap
in the flush_cb.
oh..thank you for your reminder, I will pay attention to this option when upgrading lvgl 9. 😃
Use esp_lcd_ili9341 last version library Use ESP-IDF 5.0.2 version library Use LVGL 8.3.11 version library
The screen used is ILI9341 IPS screen The touch chip is FT6336
Use
CONFIG_LV_COLOR_16_SWAP=Y
After I configure all the parameters and initialize LVGL, the colors seem to be inverted when I light up the screen. Red turns to yellow, and yellow turns to red. The effect picture is as follows, but the blue is not inverted. I don’t know what it is. Why, can you give me some help?
"#FF0000 " It should be red, “#FF9400” it should be yellow
The interface display is different
With this setting, the background tone should be white and highlighted, but still black.
Introduction to the screen I use: http://www.lcdwiki.com/3.2inch_IPS_SPI_Module_ILI9341
thx