I express my deep gratitude for the wonderful library. My project sparkled with new colors and acquired new opportunities. Thank you! BUT there are a few annoying points.
Why is there no way to select a display driver at runtime? Flash size 4M (or larger) allows you to store multiple display driver code.
Only 1 display driver (touchscreen driver) is always available in a project. It is even spelled out at the CMakeLists.txt level.
Why is there no way to dynamically change the LV_HOR_RES_MAX
and LV_VER_RES_MAX
values depending on the display driver (for example, as an external variable)?
For example, for ILI9341
LV_HOR_RES_MAX
= 320, LV_VER_RES_MAX
= 240. And for ILI9488
LV_HOR_RES_MAX
= 480, LV_VER_RES_MAX
= 320.
There are many places in the lvgl
library as well as in the lvgl_esp32_drivers
files where the LV_HOR_RES_MAX
and LV_VER_RES_MAX
macros are used. E.g.
void lv_disp_drv_init(lv_disp_drv_t * driver)
{
_lv_memset_00(driver, sizeof(lv_disp_drv_t));
driver->flush_cb = NULL;
driver->hor_res = LV_HOR_RES_MAX;
driver->ver_res = LV_VER_RES_MAX;
driver->buffer = NULL;
driver->rotated = LV_DISP_ROT_NONE;
driver->sw_rotate = 0;
driver->color_chroma_key = LV_COLOR_TRANSP;
driver->dpi = LV_DPI;
....
}
When choosing a DARK
theme, the LIGHT
theme always remains.
Kconfig
choice LV_THEME_DEFAULT_FLAG
depends on LV_THEME_MATERIAL
prompt "Select theme default flag"
default LV_THEME_DEFAULT_FLAG_LIGHT
help
Select theme default flag
config LV_THEME_DEFAULT_FLAG_LIGHT
bool "Light theme"
config LV_THEME_DEFAULT_FLAG_DARK
bool "Dark theme"
endchoice
lv_conf_internal.h
#ifndef LV_THEME_DEFAULT_FLAG
# ifdef CONFIG_LV_THEME_DEFAULT_FLAG
# define LV_THEME_DEFAULT_FLAG CONFIG_LV_THEME_DEFAULT_FLAG
# else
# define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT
# endif
#endif
Initially I used the ILI9341
driver and the LV_COLOR_16_SWAP
option was selected in the menuconfig.
When the ILI9488
driver was selected, the color display on the screen was incorrect. I spent a lot of time and effort to understand the problem of disgusting color on the display. The color was broken due to the selected LV_COLOR_16_SWAP
option.
The existing implementation of the display driver, for example, for the ILI9488 controller and the touchscreen driver on the XPT2046 controller, does not allow using the common SPI bus. At least all my attempts to set up a common bus have led nowhere. When I touch the touchscreen anywhere on the screen, the touch coordinates are always the same.
I (151157) XPT2046: P(0,0)
I (151157) XPT2046: P_norm(0,0)
I (151157) XPT2046: x = 0, y = 0
I (151207) XPT2046: P(0,0)
I (151207) XPT2046: P_norm(0,0)
I (151207) XPT2046: x = 0, y = 0
I (156687) XPT2046: P(0,0)
I (156687) XPT2046: P_norm(0,0)
I (156687) XPT2046: x = 0, y = 0
I (156737) XPT2046: P(0,0)
I (156737) XPT2046: P_norm(0,0)
I (156737) XPT2046: x = 0, y = 0
P.S. I have already created similar topics on the lvgl/lv_port_esp32 github, but I did not receive an answer and advice on how to solve the problem.