当前位置:网站首页>Developer Growth Incentive Program - Development Notes: The Simplest Steps to Transplant LVGL
Developer Growth Incentive Program - Development Notes: The Simplest Steps to Transplant LVGL
2022-08-07 13:12:00 【flavorfan】
The parameter item "Self-study Companion" needs to display the clock on the LCD, and consider transplanting LVGL.After checking some information, the LVGL ecology is still good, but its power means porting, and application development will not be easy; in addition, lvgl is developing rapidly, thinking that the differences in the versions of various tutorials you find may not work if you integrate them together.The easiest way is to stand on the shoulders of predecessors, and copy the lvgl (seems to be the latest master branch) module (file) of the same hardware platform on the handle to your own project, and then modify the project accordingly.Because the transplant operation is bypassed, the happy path is the most convenient.
Maybe someone will raise the bar, so why not start directly from that lvgl routine?Because lvgl is only for display, not the core of scene business logic, so my base project can be the basic front and back main loop, or it can be the structure of rtos: here I take out the lvgl module, make the smallest changes, and put it where it is needed, to quickly verify porting, as a convenient starting point.
1. File copy, project configuration
Base project:
CH32V307VCT6_test is the project that prints cyclically
lvgl project:
01.lvgl_v8.2_for_ch32v_evb_TencentOS-tiny, transplant a new version of lvgl project
1) File Copy
2) Engineering configuration
This version of lvgl only needs to add its parent directory, and it handles relative paths internally.Unlike previous versions.
2. lvgl module initialization and operation
1) lvglv related initialization
lvgl can also be understood as an os-like framework on top of os that handles ui interaction, with its own heartbeat, input and output processing.Initialization includes the initialization of the framework and the initialization of dependent hardware drivers.
Initialize in a suitable place, if it is a bare project main is a good place, need to include the associated header file.
The parameter 1 of lv_tick_inc(1) is called once every 1ms to give lvgl heartbeat; lv_timer_handler() is because this example is for timer type, and the task handler entry is lv_timer_handler, which is used to respond to external input to lvgl.
2) example of lvgl task
This example copies the code of lvgl, and you can use gui-guider or other tool software to generate application code later.
From the code point of view, the display is a basic lv_obj_t object, lv_exmpale_meter_xxx initializes it, and builds a callback function set_value for external input control.
Operation and other
Other
The above is just the simplest transplant, lvgl still has many topics: file processing, input and output, external image import and so on.If transplanted to RTOS (such as TencentOS Tiny), the difference is the implementation of heartbeat, maybe use a tos timer, or calculate the tick difference in idle tasks?In addition, for the external input of lvgl, can you consider using a mailbox queue for processing?
Reference
1. TencentOS-Tiny's transplant LVGL v8.0.2 - Muzijian - Blog Park
2. AIoT Application Innovation Competition-Smart home control based on TencentOS Tiny
3. Qinheng CH32V307 application solution sharing of LVGL transplantation
边栏推荐
- dynamic memory management
- Postgresql logical backup tools pg_dump and pg_resotre learning
- China University of Petroleum (Beijing) - "Workover Engineering" Phase III Online Work
- 2022年危险化学品生产单位安全生产管理人员考试题模拟考试题库及答案
- Meta提出OmniMAE:用统一架构预训练视频和文本
- Configure code snippets in Visual Studio Code to easily generate code templates with shortcut keys
- [Unity entry plan] GameObject class (1) - GetComponent method
- 红队web打点信息收集
- China university of petroleum (Beijing) - "completion project" the second phase of online operations
- 扬州大学回应「清华博士入职5年,月薪才372元」
猜你喜欢

VMware's record of virtual machine expansion

蓝图传值给Niagara

rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp)

Prometheus 自定义metrics

扬州大学回应「清华博士入职5年,月薪才372元」

金九银十面试季在即,Android程序猿如何斩获offer?

OneNote 教程,如何在 OneNote 中使用绘图和批注?

5 Practical SQL Examples for Mastering SQL GROUP BY in SQL Tutorial (including complete SQL and test data)

The Golden Nine Silver Ten interview season is coming, how does the Android programmer get the offer?

vscode create shortcut key template
随机推荐
微信小程序和微信H5有什么区别?
Meta提出OmniMAE:用统一架构预训练视频和文本
China university of petroleum (Beijing) - the third phase of project completion homework online
方正中期期货是正规期货公司吗?开户安全吗?
5 Practical SQL Examples for Mastering SQL GROUP BY in SQL Tutorial (including complete SQL and test data)
China University of Petroleum (Beijing) - "Workover Engineering" Phase II Online Work
爱可可AI前沿推介(8.7)
Custom types: structs, enums, unions
'utf-8' codec can't decode byte 0xb9 in position 0: invalid start byte
postgresql逻辑备份工具pg_dump和pg_resotre学习
vscode create shortcut key template
字符(串)及内存操作库函数
蓝图传值给Niagara
心态的变化
Altium Designer 19.1.18 - Create a copper sheet with the same shape as the Keep-Out Layer
常用的正则表达式及使用
中国石油大学(北京)-《 完井工程》第二阶段在线作业
Navicat gets stuck for a few seconds after connecting to mysql for a period of time
Installation and usage example of target detection toolbox MMDetection
helm安装报错Request entity too large: limit is 3145728