That's awesome @WhiteHexagon ! And thank you so much for bearing with me :-)
(1) The Colour Bars is actually a Test Pattern that's rendered by the Display Driver in C, not in LVGL. (Source Code) (Explained here)
(2) I realise you don't have a Serial Debug Cable, so let's configure NuttX to start the LVGL Demo automatically (as explained here):
(3) NuttX should now boot to the LVGL Demo App automatically (Like this)
(4) The source code for the LVGL Demo is at
apps/graphics/lvgl/lvgl/demos/widgets/lv_demo_widgets.c
(Repo is here)
(5) To build our own LVGL Demo, edit lv_demo_widgets.c, look for the function lv_demo_widgets, and change the code inside to:
(Explained here)
(6) Yeah the LVGL code looks quite messy in C. In the next article, I'll use Zig to build a Feature Phone UI for NuttX on PinePhone. So stay tuned! :-)
UPDATE: I just remembered that I created a simple Zig LVGL App for PinePhone: pinephone-lvgl-zig
UPDATE: To fix the Arm64 / Zig toolchain on macOS, we could run a Linux Container like Rancher Desktop
(1) The Colour Bars is actually a Test Pattern that's rendered by the Display Driver in C, not in LVGL. (Source Code) (Explained here)
(2) I realise you don't have a Serial Debug Cable, so let's configure NuttX to start the LVGL Demo automatically (as explained here):
Code:
make menuconfig
In “RTOS Features > Tasks and Scheduling":
Set “Application Entry Point” to lvgldemo_main
Set “Application Entry Name” to lvgldemo_main
In “Application Configuration > NSH Library”:
Disable “Have Architecture-Specific Initialization”
(3) NuttX should now boot to the LVGL Demo App automatically (Like this)
(4) The source code for the LVGL Demo is at
apps/graphics/lvgl/lvgl/demos/widgets/lv_demo_widgets.c
(Repo is here)
(5) To build our own LVGL Demo, edit lv_demo_widgets.c, look for the function lv_demo_widgets, and change the code inside to:
Code:
// Create a Button, set the Width and Height
void lv_demo_widgets(void) {
lv_obj_t *btn = lv_btn_create(lv_scr_act());
lv_obj_set_height(btn, LV_SIZE_CONTENT);
lv_obj_set_width(btn, 120);
}
(Explained here)
(6) Yeah the LVGL code looks quite messy in C. In the next article, I'll use Zig to build a Feature Phone UI for NuttX on PinePhone. So stay tuned! :-)
UPDATE: I just remembered that I created a simple Zig LVGL App for PinePhone: pinephone-lvgl-zig
UPDATE: To fix the Arm64 / Zig toolchain on macOS, we could run a Linux Container like Rancher Desktop