6.9.2. 参数配置

6.9.2.1. 使能LVGL库和LVGL demo

在 Luban-Lite根目录下执行 scons --menuconfig,进入 menuconfig 的功能配置界面,配置如下:

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

根目录下有多个挂载点

/ram        --挂载ramdisk文件系统
/rodata     --对应Using File System Image 0中Data Directory中的资源文件
/data       --对应Using File System Image 1中Data Directory中的资源文件
/sdcard     --挂载SD卡
/udisk      --挂载U盘

资源文件配置说明:

  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流畅度,但是缓存越多,占用内存也越多