Update LVGL (master 9.2+) and related libraries (#130)
- LVGL 9.2+ (master commit) - esp_lvgl_port (master with my PR hotfix changes) - espressif/esp_lcd_touch_gt911 1.1.1~2
This commit is contained in:
committed by
GitHub
parent
e4b8519f67
commit
80b69b7f45
@@ -1,2 +1,5 @@
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS ".")
|
||||
|
||||
lvgl_port_create_c_image("images/esp_logo.png" "images/" "ARGB8888" "NONE")
|
||||
lvgl_port_add_images(${COMPONENT_LIB} "images/")
|
||||
|
||||
@@ -4,5 +4,5 @@ dependencies:
|
||||
version: "^1"
|
||||
override_path: "../../../../lcd_touch/esp_lcd_touch_tt21100/"
|
||||
esp_lvgl_port:
|
||||
version: ">=1.2.0"
|
||||
version: "*"
|
||||
override_path: "../../../"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*.c
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -51,6 +51,9 @@
|
||||
|
||||
static const char *TAG = "EXAMPLE";
|
||||
|
||||
// LVGL image declare
|
||||
LV_IMG_DECLARE(esp_logo)
|
||||
|
||||
/* LCD IO and panel */
|
||||
static esp_lcd_panel_io_handle_t lcd_io = NULL;
|
||||
static esp_lcd_panel_handle_t lcd_panel = NULL;
|
||||
@@ -177,12 +180,14 @@ static esp_err_t app_lvgl_init(void)
|
||||
const lvgl_port_display_cfg_t disp_cfg = {
|
||||
.io_handle = lcd_io,
|
||||
.panel_handle = lcd_panel,
|
||||
.buffer_size = EXAMPLE_LCD_H_RES * EXAMPLE_LCD_DRAW_BUFF_HEIGHT * sizeof(uint16_t),
|
||||
.buffer_size = EXAMPLE_LCD_H_RES * EXAMPLE_LCD_DRAW_BUFF_HEIGHT,
|
||||
.double_buffer = EXAMPLE_LCD_DRAW_BUFF_DOUBLE,
|
||||
.hres = EXAMPLE_LCD_H_RES,
|
||||
.vres = EXAMPLE_LCD_V_RES,
|
||||
.monochrome = false,
|
||||
/* Rotation values must be same as used in esp_lcd for initial settings of the screen */
|
||||
#if LVGL_VERSION_MAJOR >= 9
|
||||
.color_format = LV_COLOR_FORMAT_RGB565,
|
||||
#endif
|
||||
.rotation = {
|
||||
.swap_xy = false,
|
||||
.mirror_x = true,
|
||||
@@ -190,7 +195,9 @@ static esp_err_t app_lvgl_init(void)
|
||||
},
|
||||
.flags = {
|
||||
.buff_dma = true,
|
||||
#if LVGL_VERSION_MAJOR >= 9
|
||||
.swap_bytes = true,
|
||||
#endif
|
||||
}
|
||||
};
|
||||
lvgl_disp = lvgl_port_add_disp(&disp_cfg);
|
||||
@@ -226,6 +233,11 @@ static void app_main_display(void)
|
||||
|
||||
/* Your LVGL objects code here .... */
|
||||
|
||||
/* Create image */
|
||||
lv_obj_t *img_logo = lv_img_create(scr);
|
||||
lv_img_set_src(img_logo, &esp_logo);
|
||||
lv_obj_align(img_logo, LV_ALIGN_TOP_MID, 0, 20);
|
||||
|
||||
/* Label */
|
||||
lv_obj_t *label = lv_label_create(scr);
|
||||
lv_obj_set_width(label, EXAMPLE_LCD_H_RES);
|
||||
@@ -236,7 +248,7 @@ static void app_main_display(void)
|
||||
#else
|
||||
lv_label_set_text(label, LV_SYMBOL_BELL" Hello world Espressif and LVGL "LV_SYMBOL_BELL"\n "LV_SYMBOL_WARNING" For simplier initialization, use BSP "LV_SYMBOL_WARNING);
|
||||
#endif
|
||||
lv_obj_align(label, LV_ALIGN_CENTER, 0, -30);
|
||||
lv_obj_align(label, LV_ALIGN_CENTER, 0, 20);
|
||||
|
||||
/* Button */
|
||||
lv_obj_t *btn = lv_btn_create(scr);
|
||||
|
||||
Reference in New Issue
Block a user