- 參考韋東山 – Tina_Linux_圖形系統_開發指南
Tina-linux lvgl 配置
環境配置
進入Tina-SDK根目錄
source build/envsetup.sh
lunch XXX平臺名稱
make menuconfig
LVGL
Gui --->Littlevgl --->< > lv_demo<*> lv_examples (lvgl官方demo)-*- lvgl-8.1.0 use sunxifb double buffer (使能雙緩沖,解決撕裂問題)[*] lvgl-8.1.0 use sunxifb cache (使能fb cache)[ ] lvgl-8.1.0 use sunxifb g2d (使能G2D硬件加速)[ ] lvgl-8.1.0 use sunxifb g2d rotate (使能G2D硬件旋轉)[ ] lvgl-8.1.0 use freetype (自動鏈接freetype)<*> lv_g2d_test (g2d接口測試用例)<*> lv_monitor (壓力測試與數據監測軟件)< > smartva< > smartva_ota
- LVGL 源碼路徑
tina/package/gui/littlevgl-8
sunxig2d
- 源碼路徑
tina/package/gui/littlevgl-8/lv_drivers/display/sunxig2d.c
sunximem
- 源碼路徑
tina/package/gui/littlevgl-8/lv_drivers/display/sunxigmem.c
evdev
- 源碼路徑
tina/package/gui/littlevgl-8/lv_drivers/indev/evdev.c
- 添加觸摸屏控制
在tina/package/gui/littlevgl-8/lv_examples/src/lv_drv_conf.h 中修改 EVDEV_NAME 為觸摸屏的 event 節點
#ifndef USE_EVDEV
# define USE_EVDEV 1
#endif#ifndef USE_BSD_EVDEV
# define USE_BSD_EVDEV 0
#endif#if USE_EVDEV || USE_BSD_EVDEV
# define EVDEV_NAME "/dev/input/event2" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
# define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
其中 event可以在 開發板 linux 中使用 cat /dev/input/event確認是否正確
編譯測試
編譯
- 以上修改完成后,按照正常編譯流程編譯
~:source build/envsetup.sh
~:lunch 4
~:make -j32 V=s編譯完成后打包鏡像
~:pack
- 注意:pack 打包鏡像時,有可能遇到 dl 包過大的錯誤如下:
這是因為內核編譯開啟了 lvgl 的包,導致編譯生成的 rootfs.fex 包大于設定的最大尺寸限制。需要修改一下最大尺寸設置,修改路徑如下:
tina-d1-h/device/config/chips/t113/configs/100ask/sys_partition.fex : [partition]name = rootfssize = 74800downloadfile = "rootfs.fex"user_type = 0x8000
修改后執行 pack 即可
測試
將新生成的 img 鏡像燒錄到開發板,進入系統后執行指令如下:
~:lv_examples 0 (lv_demo_widgets)
~:lv_examples 1 (lv_demo_music)
~:lv_examples 2 (lv_demo_benchmark)
~:lv_examples 3 (lv_demo_keypad_encoder)
~:lv_examples 4 (lv_demo_stress)
~:lv_monitor