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
  Using Signal on PinePhone in mid-2023? dante404 47 14,543 05-03-2024, 02:19 AM
Last Post: dragonhospital
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 38 25,772 04-23-2024, 10:29 AM
Last Post: donchurch
  PinePhone app development WhiteHexagon 15 4,317 04-23-2024, 05:19 AM
Last Post: Jonnyc
Wink PINEPHONE not booting Touchwood 2 565 02-23-2024, 07:27 AM
Last Post: Touchwood
  Slack on PinePhone Adam Seline 5 5,556 12-20-2023, 07:20 AM
Last Post: nickolas
  Struggle to install LibreOffice on the PinePhone Peter Gamma 48 25,114 11-24-2023, 07:02 AM
Last Post: Peter Gamma
  Which word processor to choose for the Pinephone? Peter Gamma 8 2,235 11-23-2023, 01:06 AM
Last Post: Peter Gamma
  openSUSE for Pinephone Alefnode 75 103,495 11-17-2023, 08:37 AM
Last Post: Uturn
  Genode- Sculpt OS for the PinePhone (non Linux) Surehand53 1 1,085 11-04-2023, 07:23 PM
Last Post: tllim
  Abiword as a office mobile word processor for the Pinephone? Peter Gamma 11 2,549 10-24-2023, 08:57 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)