Update docker and switch to cmake
|6 days ago|
|.github||2 years ago|
|lv_drivers@1bd4368e71||8 months ago|
|lvgl@23c7b2dbf2||8 months ago|
|.cproject||1 year ago|
|.editorconfig||4 years ago|
|.gitignore||4 months ago|
|.gitmodules||8 months ago|
|.project||2 years ago|
|CMakeLists.txt||2 months ago|
|Dockerfile||1 week ago|
|Makefile||5 months ago|
|README.md||5 months ago|
|confdef.txt||2 years ago|
|licence.txt||5 years ago|
|lv_conf.h||8 months ago|
|lv_drv_conf.h||8 months ago|
|main.c||8 months ago|
|mouse_cursor_icon.c||3 years ago|
|pc_simulator.launch||2 years ago|
Simulator project for LVGL embedded GUI Library
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:
- Costs $0 because you you don't have to buy or design PCB
- Fast because you don't have to design an manufacture PCB
- Collaborative because any number of developers can work in the same environment
- Developer friendly because much easier and faster to debug on PC
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.
- SDL a low level driver library to use graphics, handle mouse, keyboard etc.
- This project (configured for Eclipse CDT IDE)
Get the PC project
Clone the PC project and the related sub modules:
git clone --recursive https://github.com/lvgl/lv_port_pc_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
Install Eclipse CDT
Download and install Eclipse CDT from http://www.eclipse.org/cdt/
Import the PC simulator project
- Open Eclipse CDT
- Click File->Import and choose General->Existing project into Workspace
- Browse the root directory of the project and click Finish
- Build your project and run it
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.
- Ensure CMake is installed, i.e. the
cmakecommand works on the terminal.
- Make a new directory. The name doesn't matter but
buildwill be used for this tutorial.
cmake ... CMake will generate the appropriate build files.
make -j4or (more portable)
cmake --build . --parallel.
--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.
- The binary will be in
../bin/main, and can be run by typing that command.
- Build the docker container
docker build -t lvgl_simulator .
- Run the docker container
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request!
If you find an issue, please report it via GitHub!