参数配置
使能 LVGL 库和 LVGL demo
在 Luban-Lite 根目录下执行 scons --menuconfig
,进入 menuconfig 的功能配置界面,配置如下:
c
Application options --->
*** Filesystem related ***
[*] Using File System Image 0 --->
--- Using File System Image 0
Select File System Type (FATFS) --->
(packages/artinchip/lvgl-ui/aic_demo/base_demo/lvgl_src/) Data Directory
(app.fatfs) Image Name
[*] auto calcuate image size
[ ] Using File System Image 1 ----
*** lvgl demo select related ***
-*- LVGL (official): powerful and easy-to-use embedded GUI library --->
(20) Priority of LVGL thread
(32768) Stack size of LVGL thread
(5) Display refresh period (ms)
[ ] Support SquareLine Studio
[ ] Enable built-in examples
[ ] Enable built-in demos
-*- ArtInChip lvgl demo
select lvgl demo (lvgl demo with basic function) --->
(X) lvgl demo with basic function
( ) lvgl demo of meter
(16) LVGL color depth(32/16)
(8) LVGL image cached number
(/rodata/lvgl_data) LVGL Resource Directory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
根目录下有多个挂载点:
c
recorder/ram` --挂载 ramdisk 文件系统
recorder/rodata` --对应 Using File System Image 0 中 Data Directory 中的资源文件
recorder/data` --对应 Using File System Image 1 中 Data Directory 中的资源文件
recorder/sdcard` --挂载 SD 卡
recorder/udisk` --挂载 U 盘
1
2
3
4
5
2
3
4
5
资源文件配置说明:
1.不同的 demo 需要配置对应的资源路径,例如:lvgl demo with basic function 对应的资源路径为:packages/artinchip/lvgl-ui/aic_demo/base_demo/lvgl_src/
2.上述配置中使用了 File System Image 0 分区来存储 demo 资源文件,所以我们配置 lvgl 的资源路径为 /rodata/lvgl_data
。
注解
1.LVGL color depth可以配置为16或32,16表示显示buffer格式为rgb565,32表示显示格式为argb8888, 此格式需要和display驱动中的framebuffer格式对应
2.可通过Stack size of LVGL thread配置LVGL线程的堆栈大小,需配置合适的大小避免出现stack溢出
3.可以通过LVGL image cached number来配置图片缓存张数,可以通过图片缓存机制来提升UI流畅度,但是缓存越多,占用内存也越多