Littlev Graphics Library
LittlevGL provides everything you need to create a Graphical User Interface (GUI) on embedded systems with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
- Powerful building blocks buttons, charts, lists, sliders, images, etc.
- Advanced graphics with animations, anti-aliasing, opacity, smooth scrolling
- Various input devices touch pad, mouse, keyboard, encoder, buttons, etc.
- Multi-language support with UTF-8 encoding
- Fully customizable graphical elements
- Hardware independent to use with any microcontroller or display
- Scalable to operate with little memory (50 kB Flash, 10 kB RAM)
- OS, External memory and GPU supported but not required
- Single frame buffer operation even with advances graphical effects
- Written in C for maximal compatibility
- Simulator to develop on PC without embedded hardware
- Tutorials, examples, themes for rapid development
- Documentation and API references online
In the simplest case you need 5 things:
xmilliseconds in a Timer or Task (
xshould be between 1 and 10)
- Register a function which can copy a pixel array to an area of the screen.
- Register a function which can read an input device. (E.g. touch pad)
lv_conf.hand set at least
lv_task_handler()periodically every few milliseconds. For a detailed description visit https://littlevgl.com/porting Or check the Porting tutorial
- Clone or Download the lvgl repository:
git clone https://github.com/littlevgl/lvgl.git
- Create project with your preferred IDE and add the lvgl folder
- Copy lvgl/lv_conf_templ.h as lv_conf.h next to the lvgl folder
- In the lv_conf.h delete the first
#if 0and its
#endif. Leave the default configuration for the first try.
- In your main.c: #include "lvgl/lvgl.h"
- In your main function:
- tick, display and input device initialization (see above)
- To test create a label:
lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
- In the main while(1) call
lv_task_handler();and make a few milliseconds delay (e.g.
- Compile the code and load it to your embedded hardware
You can test the graphics library in a PC simulator, if you don't have an embedded hardware. The simulator uses SDL2 library to emulate a display on your monitor and a touch pad with your mouse.
There is a pre-configured PC project for Eclipse CDT in this repository: https://github.com/littlevgl/pc_simulator
- PC simulator: https://github.com/littlevgl/pc_simulator
- Projects: https://github.com/littlevgl/lv_projects
- Examples: https://github.com/littlevgl/lv_examples
- Drivers: https://github.com/littlevgl/lv_drivers
If you are pleased with this graphics library, found it useful, or are happy with the support you got, please help its further development: