2017-11-29 11:32:38 +01:00
# Littlev Graphics Libraray
2016-06-15 11:40:04 +02:00
2017-07-30 23:36:42 +02:00
![LittlevGL cover ](http://www.gl.littlev.hu/home/main_cover_small.png )
2016-06-15 11:40:04 +02:00
2017-12-22 17:08:03 +01:00
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.
2016-06-15 11:40:04 +02:00
2017-12-31 23:17:28 +01:00
Homepage: https://littlevgl.com
2016-06-15 11:40:04 +02:00
2017-11-29 11:41:34 +01:00
### Table Of Content
* [Key features ](#key-features )
* [Porting ](#porting )
* [Project set-up ](#project-set-up )
* [PC simulator ](#pc-simulator )
2017-12-24 11:00:46 +01:00
* [Screenshots ](#screenshots )
2017-11-29 11:42:23 +01:00
* [Contributing ](#contributing )
2017-11-29 11:41:34 +01:00
* [Donate ](#donate )
2017-05-15 14:11:12 +02:00
## Key features
2017-12-31 23:31:10 +01:00
* Powerful building blocks buttons, charts, lists, sliders, images etc
2017-12-24 11:03:16 +01:00
* Advanced graphics with animations, anti-aliasing, opacity, smooth scrolling
2018-03-07 13:51:59 +01:00
* Various input devices touch pad, mouse, keyboard, encoder, buttons etc
2017-12-24 11:04:09 +01:00
* Multi language support with UTF-8 decoding
2017-12-24 11:03:16 +01:00
* Fully customizable graphical elements
* Hardware independent to use with any microcontroller or display
2018-03-07 13:51:59 +01:00
* Scalable to operate with few memory (50 kB Flash, 10 kB RAM)
2017-12-24 11:03:16 +01:00
* OS, External memory and GPU supported but not required
* Single frame buffer operation even with advances graphical effects
* Written in C for maximal compatibility
2017-12-31 23:31:10 +01:00
* Simulator to develop on PC without embedded hardware
2017-12-24 11:03:16 +01:00
* Tutorials, examples, themes for rapid development
* Documentation and API references online
2016-06-15 11:40:04 +02:00
2017-05-15 14:11:12 +02:00
## Porting
2017-12-19 22:09:06 +01:00
In the most sime case you need 4 things:
1. Call `lv_tick_inc(1)` in every millisecods in a Timer or Task
2018-03-10 07:47:28 +01:00
2. Register a function which can **copy a pixel array** to an area of the screen.
2017-12-21 01:06:11 +01:00
3. Register a function which can **read an input device** . (E.g. touch pad)
2018-03-07 13:51:59 +01:00
4. Call `lv_task_handler()` periodically in every few milliseconds
2017-12-31 23:28:28 +01:00
For more information visit https://littlevgl.com/porting
2018-03-10 07:47:28 +01:00
Or check the [Porting tutorial ](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c )
2017-11-29 11:32:38 +01:00
2017-05-15 14:11:12 +02:00
## Project set-up
2018-03-07 13:51:59 +01:00
1. **Clone** or [Download ](https://littlevgl.com/download ) the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
2017-12-21 01:06:11 +01:00
2. **Create project** with your prefered IDE and add the *lvgl* folder
3. Copy **lvgl/lv_conf_templ.h** as **lv_conf.h** next to the *lvgl* folder
2018-03-07 13:51:59 +01:00
4. In the lv_conf.h delete the first `#if 0` and its `#endif` . Let the default configurations at first.
2017-11-29 11:10:12 +01:00
5. In your *main.c* : #include "lvgl/lvgl.h"
6. In your *main function* :
* lvgl_init();
2017-11-29 11:32:38 +01:00
* tick, display and input device initialization (see above)
2017-11-29 11:37:26 +01:00
7. To **test** create a label: `lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);`
8. In the main *while(1)* call `lv_task_handler();` and make a few milliseconds delay (e.g. `my_delay_ms(5);` )
9. Compile the code and load it to your embedded hardware
2017-05-15 14:11:12 +02:00
2017-05-15 15:09:22 +02:00
## PC Simulator
2017-05-15 15:22:03 +02:00
If you don't have got an embedded hardware you can test the graphics library in a PC simulator. The simulator uses [SDL2 ](https://www.libsdl.org/ ) to emulate a display on your monitor and a touch pad with your mouse.
2017-05-15 14:11:12 +02:00
2017-12-19 22:09:06 +01:00
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/pc_simulator
2017-05-15 14:11:12 +02:00
2017-12-24 11:00:46 +01:00
## Screenshots
![TFT material ](http://www.gl.littlev.hu/github_res/tft_material.png )
![TFT zen ](http://www.gl.littlev.hu/github_res/tft_zen.png )
![TFT alien ](http://www.gl.littlev.hu/github_res/tft_alien.png )
![TFT night ](http://www.gl.littlev.hu/github_res/tft_night.png )
2017-05-15 14:11:12 +02:00
## Contributing
2017-07-30 15:50:04 +02:00
See [CONTRIBUTING.md ](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md )
2017-05-15 14:11:12 +02:00
## Donate
2017-12-31 23:31:10 +01:00
If you are pleased with the graphics library, found it useful or be happy with the support you got, please help its further development:
2017-05-15 14:11:12 +02:00
2018-01-29 12:32:14 +01:00
[![Donate ](https://littlevgl.com/donate_dir/donate_btn.png )](https://littlevgl.com/donate)