Re: ESP32 LVGL Graphics Library
Posted: Tue Aug 20, 2024 6:08 pm
There is some supplementary code. I've pulled most to macros - and I think most of the rest could also be moved apart from the #includes
Using different displays.
Some displays have code builtin to lvgl (see the first post in this topic for use of st7789) - the need code to send a command (with data) and data to the display. I didn't need to modify the lvgl lv_delay code here as I use FC delays for initialising the display.
The ili9488 isn't supported - so needs a 'flush' to send data to a specified 'window' and an initialisation routine. I've used my own here - the board uses A0..A15 to send parallel data.
lvgl supports multiple displays (the actual hardware) not to be confused with screens (what is displayed - I demonstrate this with the keyboard)
Displaying a jpg is as simple as:
Note that the jpg decoder is enabled in the lv_conf - if using littlefs (there is a partition set in the sample partitions.csv) then add
to main/cmakelists.txt
I didn't get the littlefs support working correctly (and use stdio commands to access the files) - might need some more playing..
Touch works well - for example I tried the bar with a user adjustable position and the calendar widget.
I've barely scratched the surface of lvgl here - there a huge range of styles and widgets - and I have only combined a few (for example a label, roller and button for the initial screen) Have fun!
Ben - how do you turn off the (superbright) LED on the back of the board?
Martin
Using different displays.
Some displays have code builtin to lvgl (see the first post in this topic for use of st7789) - the need code to send a command (with data) and data to the display. I didn't need to modify the lvgl lv_delay code here as I use FC delays for initialising the display.
The ili9488 isn't supported - so needs a 'flush' to send data to a specified 'window' and an initialisation routine. I've used my own here - the board uses A0..A15 to send parallel data.
lvgl supports multiple displays (the actual hardware) not to be confused with screens (what is displayed - I demonstrate this with the keyboard)
Displaying a jpg is as simple as:
Code: Select all
lv_obj_t * img1;
img1 = lv_img_create(lv_scr_act());
lv_obj_align(img1, LV_IMAGE_ALIGN_CENTER, 0, 0);
lv_img_set_src(img1, "A:/storage/wrens3.jpg");
Code: Select all
littlefs_create_partition_image(storage D:/Projects/Flowcode/Images FLASH_IN_PROJECT)
I didn't get the littlefs support working correctly (and use stdio commands to access the files) - might need some more playing..
Touch works well - for example I tried the bar with a user adjustable position and the calendar widget.
I've barely scratched the surface of lvgl here - there a huge range of styles and widgets - and I have only combined a few (for example a label, roller and button for the initial screen) Have fun!
Ben - how do you turn off the (superbright) LED on the back of the board?
Martin