Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS
#13
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):

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
  Reply


Messages In This Thread
RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - by lupyuen - 05-22-2023, 02:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Latest firmware for PinePhone modem! Subsentient 105 158,416 02-02-2025, 08:47 PM
Last Post: bacydentir85
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 40 36,454 12-28-2024, 12:19 AM
Last Post: mara
  Office applications for the Pinephone Peter Gamma 2 751 09-05-2024, 09:22 AM
Last Post: Peter Gamma
  Struggle to install LibreOffice on the PinePhone Peter Gamma 50 39,280 07-26-2024, 10:35 PM
Last Post: Peter Gamma
  Why does Pine64 sabotage office on the Pinephone? Peter Gamma 5 1,502 07-04-2024, 07:34 AM
Last Post: Kevin Kofler
  Which word processor to choose for the Pinephone? Peter Gamma 16 6,705 06-22-2024, 07:28 AM
Last Post: Peter Gamma
  Samba share on the Pinephone? Peter Gamma 0 773 06-16-2024, 10:26 PM
Last Post: Peter Gamma
  Possible Free Backup Carrier for PinePhone PineFone 0 701 06-13-2024, 03:45 PM
Last Post: PineFone
  Using Signal on PinePhone in mid-2023? dante404 47 26,202 05-03-2024, 02:19 AM
Last Post: dragonhospital
Wink PINEPHONE not booting Touchwood 2 1,456 02-23-2024, 07:27 AM
Last Post: Touchwood

Forum Jump:


Users browsing this thread: 1 Guest(s)