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:
The PC simulator is cross platform. Windows, Linux and OSX are supported, however on Windows it's easier to get started with a another simulator project.
Clone the PC project and the related sub modules:
git clone --recursive https://github.com/littlevgl/pc_simulator_sdl_eclipse.git
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
Download and install Eclipse CDT from http://www.eclipse.org/cdt/
The following steps can be used with CMake on a Unix-like system. This may also work on other OSes but has not been tested.
cmake
command works on the terminal.build
will be used for this tutorial.cd build
.cmake ..
. CMake will generate the appropriate build files.make -j4
or (more portable) cmake --build . --parallel
.NOTE: --parallel
is supported from CMake v3.12 onwards. If you are using an older version of CMake, remove --parallel
from the command or use the make option.
../bin/main
, and can be run by typing that command.docker build -t lvgl_simulator .
docker run lvgl_simulator
GUI with docker is platform dependent. For example, on macOS you can follow this tutorial and run a command similar to:
docker run -e DISPLAY=10.103.56.101:0 lvgl_simulator
Note that on macOS, you may need to enable indirect GLX rendering before starting Xquartz:
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
open -a Xquartz
For Linux environments with X Server, the following will the docker run
command. Note that the first command, xhost +
grants access to X server to everyone.
xhost +
docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix:ro -t lvgl_simulator
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
If you find an issue, please report it via GitHub!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。