2017-11-29 18:32:38 +08:00
# Littlev Graphics Libraray
2016-06-15 17:40:04 +08:00
2017-07-31 05:36:42 +08:00
![LittlevGL cover ](http://www.gl.littlev.hu/home/main_cover_small.png )
2016-06-15 17:40:04 +08:00
2017-12-23 00:08:03 +08: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 17:40:04 +08:00
2017-12-23 00:08:17 +08:00
Homepage: http://www.gl.littlev.hu
2016-06-15 17:40:04 +08:00
2017-11-29 18:41:34 +08:00
### Table Of Content
* [Key features ](#key-features )
* [Porting ](#porting )
* [Project set-up ](#project-set-up )
* [PC simulator ](#pc-simulator )
2017-11-29 18:42:23 +08:00
* [Contributing ](#contributing )
2017-11-29 18:41:34 +08:00
* [Donate ](#donate )
2017-05-15 20:11:12 +08:00
## Key features
2017-12-20 05:09:06 +08:00
- 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 and external buttons
- Multi language support with UTF-8 support
- Fully customizable graphical elements
2017-12-23 00:08:03 +08:00
- Hardware independent to use with any microcontroller or display
2017-12-20 05:09:06 +08:00
- Scalable to operate with few memory (80 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
2017-11-29 18:10:12 +08:00
- PC simulator to develop without embedded hardware
2017-12-20 05:09:06 +08:00
- Tutorials, examples, themes for rapid development
- Advanced support and professional GUI development service
- Documentation and API references online
- Free and open source under MIT licence
2016-06-15 17:40:04 +08:00
2017-05-15 20:11:12 +08:00
## Porting
2017-12-20 05:09:06 +08:00
In the most sime case you need 4 things:
1. Call `lv_tick_inc(1)` in every millisecods in a Timer or Task
2017-12-21 08:06:11 +08:00
2. Register a function which can **copy a pixel array** to an area of the screen
3. Register a function which can **read an input device** . (E.g. touch pad)
2017-12-20 05:09:06 +08:00
4. Call `lv_task_handler()` periodically in every few milliseconds ()
2017-11-29 18:10:12 +08:00
2017-12-23 00:09:44 +08:00
For more information visit http://www.gl.littlev.hu/porting
2017-11-29 18:32:38 +08:00
2017-05-15 20:11:12 +08:00
## Project set-up
2017-12-21 08:06:11 +08:00
1. **Clone** or download the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
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
2017-11-29 18:10:12 +08:00
4. In the *_conf.h files delete the first `#if 0` and its `#endif` . Let the default configurations at first.
5. In your *main.c* : #include "lvgl/lvgl.h"
6. In your *main function* :
* lvgl_init();
2017-11-29 18:32:38 +08:00
* tick, display and input device initialization (see above)
2017-11-29 18:37:26 +08: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 20:11:12 +08:00
2017-05-15 21:09:22 +08:00
## PC Simulator
2017-05-15 21:22:03 +08: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 20:11:12 +08:00
2017-12-20 05:09:06 +08:00
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/pc_simulator
2017-05-15 20:11:12 +08:00
## Contributing
2017-07-30 21:50:04 +08:00
See [CONTRIBUTING.md ](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md )
2017-05-15 20:11:12 +08:00
## Donate
2017-07-31 05:36:42 +08:00
If you are pleased with the graphics library and found it useful please support its further development:
2017-05-15 20:11:12 +08:00
2017-07-09 20:39:28 +08:00
[![Donate ](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif )](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick& hosted_button_id=GJV3SC5EHDANS)
2016-06-15 17:40:04 +08:00