A simple arrangement of the lvgl simulator on windows of LVGL based on the Visual Studio construction method
Table of contents
Two, visual studio installation
3. Build the lvgl simulator project
Method 1: git clone download project
Method 2: git directly downloads the compressed package
1. Brief introduction
Use of LVGL's PC emulator. On the one hand, the advantage of the PC simulator is that we can learn lvgl without actual hardware, and on the other hand, we can greatly reduce the number of burning codes when we actually design the GUI interface. We can design it on the PC simulator first, and then move the code to the embedded project, compile and burn it into the board.
Introduction to lvgl emulator
The lvgl emulator can run on different operating systems with different IDE software, such as Windows, Linux or OSX. The following are the types of IDE software supported by littleVGL:
LVGL (Light and Versatile Graphics Library) is a lightweight general-purpose graphics library , which is a free and open-source graphics library that provides everything needed to create embedded GUIs, with easy-to-use components, beautiful visual effects and low memory footprint, etc. features. Support touch screen operation, easy and convenient porting, developers have been constantly improving and updating.
Features:
- Rich and powerful modular graphic components : buttons, charts, lists, sliders, images, etc.
- Advanced graphics engine: animation, anti-aliasing, transparency, smooth scrolling, layer blending and other effects
- Support a variety of input devices : touch screen, keyboard, encoder, keys, etc.
- Support for multiple display devices
- Does not depend on a specific hardware platform and can run on any display
- Configuration can be trimmed (minimum resource usage: 64 kB Flash, 16 kB RAM)
- Multilingual support based on UTF-8, such as Chinese, Japanese, Korean, Arabic, etc.
- Graphical interfaces can be designed and laid out in a CSS-like manner (for example: Flexbox , Grid )
- Support operating system, external memory, and hardware acceleration (LVGL has built-in support for STM32 DMA2D, NXP PXP, and VGLite)
- Even with only a single frame buffer , rendering is guaranteed to be silky smooth
- All are written in C and support C++ calls
- Support Micropython programming, see: LVGL API in Micropython
- Support simulator simulation, can develop without hardware support
- Rich and detailed routines
- Detailed documentation and API reference manual, available online or downloaded in PDF format
Hardware requirements to run:
Related learning website:
- The lvgl 6.0 routines based on the bison development board: LittlevGL_Demo: The demo program of LittlevGL for the bison development board, all the routines share a library, there are MDK version and VS simulator version
- lvgl tutorial based on the Lichee Nano development board: http://nano.lichee.pro/application/littlevgl.html
- lvgl online experience routine (can be experienced in a browser): Live demos - Test LVGL in your browser | LVGL
- lvgl PC simulator based on Visual sudio : GitHub - lvgl/lv_port_win_visual_studio: LVGL Windows Simulator Visual Studio Edition
- LVGL official website: https://lvgl.io
- Official documentation: https://docs.lvgl.io/master/intro/index.html
- Github repository: https://github.com/lvgl/lvgl
- Domestic code cloud warehouse: https://gitee.com/mirrors/lvgl
- Punctual atom tutorial: http://www.openedv.com/docs/book-videos/zdyzshipin/4free/littleVGL.html
This case is based on the environment:
1、windows 10
2、visual studio 2019
3、lvgl 8.3.0
Two, visual studio installation
1. Download and install visual studio from the official website
Download Visual Studio Tools - Free Install for Windows, Mac, Linux
2. Download visual studio and install it, then open the installer and confirm the installation of the C++ environment
3. Build the lvgl simulator project
There are two ways to build here:
1. git clone download project
2. Git directly downloads the compressed package
Method 1: git clone download project
The git environment has been installed by default
1) git get clone address: https://github.com/lvgl/lv_port_win_visual_studio.git
Domestic mirror address: mirrors / lvgl / lv_port_win_visual_studio · GitCode
2) Right click in the folder to be downloaded and open Git Bash
3) Use git clone to download the project
Because the lvgl simulator contains subprojects, use git clone --recursive or git clone --recurse-submodules to recursively download
Command: git clone --recursive https://github.com/lvgl/lv_port_win_visual_studio.git
4) OpenSSL SSL_read: Connection was reset, errno 10054 may be encountered
Use git config --global http.sslVerify "false" to remove SSL authentication, and then repeat the previous command to download
5) After the download is complete, you will find that the subdirectories "freetype", "lv_drivers", "lvgl" are empty
Note: some errors in clone can be ignored first
6) Enter the root directory of the code and use git to download the submodule
Command: cd xxx folder; git submodule update --init --recursive
7) The subdirectories "freetype", "lv_drivers", and "lvgl" have corresponding codes
8) Enter the code project root directory: lv_port_win_visual_studio, double-click LVGL.Simulator.sln to open the project
9) The project opens as shown in the figure
10) Switch platform, switch to x64 here
11) Click "Local Windows Debugger" to run the project
12) The running effect is as shown in the figure
Method 2: git directly downloads the compressed package
1) Download the lvgl emulator compressed package on the official website
Download address: GitHub - lvgl/lv_port_win_visual_studio: LVGL Windows Simulator Visual Studio Edition
2) Unzip the project, download the subdirectory "freetype", "lv_drivers", "lvgl" sub-module code
-
Download the freetype library : https://github.com/freetype and unzip it into the freetype folder above
-
Download the lvgl library : https://github.com/lvgl/lvgl and extract it to the lvgl folder
-
Download the lvgl_drivers library : https://github.com/lvgl/lv_drivers and extract it to the lvgl_drives folder
3) Open lv_port_win_visual_studio, double-click LVGL.Simulator.sln to open the project
4) The project opens as shown in the figure
5) Switch platform, switch to x64 here
6) Click "Local Windows Debugger" to run the project
7) The running effect is as shown in the figure