LVSF v8 Custom Widget Examples
Source path: example/multimedia/lvgl/lvsf_v8_examples
Introduction
This project gathers SiFli’s custom widgets (lvsf widgets) built on LVGL v8 into a single project: each widget demo lives in its own sub-folder under src/widgets/<name>/, and only one widget is built per firmware. To see another widget or inspect another API, just select the corresponding example in the configuration, rebuild and reflash — there is no need to open a dozen separate projects.
The demo sources are aggregated from the former standalone
lvgl_v8_<name>projects. The demonstration code itself is unchanged; only the per-projectmain.cfiles were removed. A singlesrc/main.cnow calls the entry function of the example selected in menuconfig.
Examples at a glance
Config option |
Sub-folder |
Widget |
Entry function |
Description |
|---|---|---|---|---|
|
|
|
|
Chart widget drawing one or more line/bar data series |
|
|
|
|
Label with a built-in data refresh path; text follows a data source periodically |
|
|
|
|
Physics “gravity” icon menu; icons arranged in rings move and avoid each other |
|
|
|
|
Builds a number out of glyph images, like a nixie/ticker display |
|
|
|
|
Progress bar that clips a foreground image according to a value |
|
|
|
|
Multi-function roller/wheel picker; callback-fed content, snaps to center |
|
|
|
|
Multiple transition animation effects (animated images) |
|
|
|
|
Multi-function list; a multi-page example based on the gui_app_fwk framework |
|
|
|
|
Simple declarative roller from a |
|
|
|
|
Slider whose round knob shows the reading (or a custom short text) |
|
|
|
|
Sector (angle) mask that reveals an image as a pie according to a value |
|
|
|
|
Selectable list; each row shows a selected/unselected icon, single-select |
|
|
|
|
Generic animation timeline engine mapping a time range to a value range |
Each sub-folder contains its own README.md / README_EN.md with an overview, key APIs, typical usage and run instructions. To inspect a widget’s API usage, open demo_<name>.c and the README in its sub-folder.
Quick start: switching the widget being demonstrated
The flow is simply: pick an example (menuconfig or edit proj.conf) → rebuild → flash and run. Below we switch from the default basechart to multlist as an example.
Option 2: edit proj.conf directly (scriptable / straightforward)
Open project/proj.conf in a text editor; the selected example is at the end:
# Default widget example (choice, only one); see README for how to switch
CONFIG_LV_WIDGET_DEMO_BASECHART=y
Change it to the target example (comment out / remove the old line and set the new one to y; a choice allows only one y at a time). For example, switch to multlist:
# CONFIG_LV_WIDGET_DEMO_BASECHART=y
CONFIG_LV_WIDGET_DEMO_MULTLIST=y
The available macro names are listed in the “Config option” column above: LV_WIDGET_DEMO_BASECHART / BASELABEL / FOLLOW / IMGARRAY / IMGBAR / MULROLLER / MULTANIM / MULTLIST / MULTROLLER / MULTSLIDER / SECTOR / SELECT / TIMELINE.
Save and rebuild (no manual cache cleanup is needed; scons detects the proj.conf change and regenerates the configuration):
scons --board=sf32lb52-lcd_n16r8 -j8
Note: after switching examples you must rebuild and reflash; the firmware only contains the demo code of the single widget currently selected.
Building and flashing
The board project is in the project directory. Build for a specific board (replace --board= with yours):
cd project
scons --board=sf32lb52-lcd_n16r8 -j8
Flash using the generated download.bat (or uart_download.bat) in the build directory. On the SF32LB52x/SF32LB56x series an extra uart_download.bat is generated; run it and enter the download UART port number.
Directory layout
lvsf_v8_examples/
├── README.md / README_EN.md # this file
├── assets/ # image assets (only multanim / multlist need them)
│ └── SConscript # packs only the images of the selected example
├── project/ # build project (SConstruct / proj.conf / Kconfig ...)
└── src/
├── Kconfig # widget example selection menu (choice)
├── SConscript # builds only the sources of the selected example
├── main.c # single entry, calls the selected example via Kconfig macro
└── widgets/ # one sub-folder per widget example
├── basechart/ # demo_xxx.c/h + README
├── ...
└── multlist/ # gui_app_fwk multi-page example (several .c files)
Notes
Only one example is built and run at a time; the sources and images of unselected examples are not compiled and do not occupy flash.
The
multlistexample is built on the application framework (gui_app_fwk); its entry differs from the other examples and is handled separately inmain.c.Examples that require file-system resources (Lottie JSON, video, font files) —
lvgl_v8_lottie,lvgl_v8_media,lvgl_v8_freetype— are not included here and remain standalone projects.See the SDK documentation chapter “LVGL v8 custom widgets” for detailed API references.