The LVGL is written mainly for microcontrollers and embedded systems however you can run the library on your PC as well without any embedded hardware. The code written on PC can be simply copied when your are using an embedded system.
Using a PC simulator instead of an embedded hardware has several advantages:
This project is configured for VSCode and only tested on Linux, although this may work on OSx or WSL. It requires a working version of GCC, GDB and make in your path.
To allow debugging inside VSCode you will also require a GDB extension or other suitable debugger.
Clone the PC project and the related sub modules:
git clone --recursive https://github.com/lvgl/lv_sim_vscode_sdl
You can download SDL from https://www.libsdl.org/
On on Linux you can install it via terminal:
sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev
To allow custom UI code an lv_conf.h
file placed at ui/simulator/inc
will automatically override this projects lv_conf.h file. By default code under ui
is ignored so you can reuse this repository for multiple projects. You will need to place a call from main.c
to your UI's entry function.
To build and debug, press F5. You should now have your UI displayed in a new window and can access all the debug features of VSCode through GDB.
To allow temporary modification between simulator and device code, a SIMULATOR=1 define is added globally.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。