目的
本文档主要记录在windows环境下使用模拟器搭建LVGL开发环境的各个步骤
开发环境
windows7
资源
- lvgl官网:https://lvgl.io/
- simulator:https://github.com/lvgl/lv_port_win_visual_studio
- lv_drivers:https://github.com/lvgl/lv_drivers/
- lvgl:https://github.com/lvgl/lvgl/
- freetype:https://github.com/freetype/freetype/
lvgl simulator所需要的lvgl/lv_drivers./freetype源码地址及相应版号均可在https://github.com/lvgl/lv_port_win_visual_studio/tree/master/LVGL.Simulator中查看。
版本选择
lvgl 7.x和lvgl 8.x差异较大,目录结构和名字都有所变化,甚至接口也有变化。所以具体选择哪一个版本,根据实际需求决定。我这里选择的是当前的最新版8.2.0。
文件布局
模拟器
从https://github.com/lvgl/lv_port_win_visual_studio抓取特定版本的visual studio 模拟器代码并且解压,进入到LVGL_Simulator目录。
lvgl
从https://github.com/lvgl/lvgl/下载特定版本的lvgl源码到本地,解压后将其目录名修改为lvgl,并且替换LVGL_Simulator中的lvgl目录。
lv_drivers
从https://github.com/lvgl/lv_drivers/下载特定版本的driver源码到本地,解压后将其目录名修改为lv_drivers,并且替换LVGL_Simulator中的lv_drivers目录。
freetype
从https://github.com/freetype/freetype/抓取特定版本的freetype源码,解压后替换LVGL_Simulator中的freetype目录。
编译运行
- 使用visual studio2019打开LVGL项目。
- 将解决方案平台修改为X64,默认应该是ARM64。
- 生成解决方案。
- 运行程序,出现如下画面即成功。