功能
恩智浦 Gui Guider + Platformio + ESP32S3 移植测试
以及 LVGL 优化
UI 移植 1.设计 UI 并导出代码
2.移植 1.在json文件里添加头文件路径,注意 path 和 includePath 都要添加
1 2 3 4 "${workspaceFolder}/**" , "E:/Files/Projects/CXCollege/hardware/Firmware/ESP32-S3-LVGL/ESP32-S3-LVGL-PIO-PROJECT-TFT3.5-ST7796U-CPT/lib/MyUI/custom" , "E:/Files/Projects/CXCollege/hardware/Firmware/ESP32-S3-LVGL/ESP32-S3-LVGL-PIO-PROJECT-TFT3.5-ST7796U-CPT/lib/MyUI/generated" , "E:/Files/Projects/CXCollege/hardware/Firmware/ESP32-S3-LVGL/ESP32-S3-LVGL-PIO-PROJECT-TFT3.5-ST7796U-CPT/lib/MyUI/generated/guider_fonts" ,
2.MYUI 文件下添加 library.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 { "name" : "MYUI" , "keywords" : "myui" , "description" : "myui des" , "version" : "1.0" , "authors" : { "name" : "Bsgbsg7" } , "licence" : "MIT" , "frameworks" : "arduino" , "platforms" : "espressif32" , "build" : { "unflags" : "-std=gnu++11" , "flags" : [ "-std=c99" , "-I custom" , "-I generated" , "-I generated/guider_customer_fonts" , "-I generated/guider_fonts" , "-I generated/images" ] , "srcFilter" : [ "+<*.c>" , "+<custom/*.c>" , "+<generated/*.c>" , "+<generated/guider_customer_fonts/*.c>" , "+<generated/guider_fonts/*.c>" , "+<generated/images/*.c>" ] } }
3.将 LV_VER_RES_MAX 替换为 LV_VER_RES,LV_HOR_RES_MAX 替换为 LV_HOR_RES
优化 参考博主重回桃花源 的《LVGL显示优化—基本优化 》
1.修改帧率 LVGL是有一个帧率刷新周期的宏定义,在lv_conf.h里。LVGL会通过LVGL内部的tick,定时去刷屏幕,也就是说该宏定义限定了LVGL刷屏帧率的上限,默认满帧33帧。
1 #define LV_DISP_DEF_REFR_PERIOD 30 /[ms]/
改成10ms刷新一次,满帧100帧。顺手再把输入设备读取周期也改成10ms。
1 2 3 4 #define LV_DISP_DEF_REFR_PERIOD 10 #define LV_INDEV_DEF_READ_PERIOD 10
最终效果