<h1 align="center"> LittlevGL - Open-source Embedded GUI Library</h1>
<p align="center">
<a href="https://github.com/littlevgl/lvgl/blob/master/LICENCE.txt"><img src="https://img.shields.io/badge/licence-MIT-blue.svg"></a>
<a href="https://github.com/littlevgl/lvgl/releases/tag/v5.3"><img src="https://img.shields.io/badge/version-v5.3-blue.svg"></a>
<br>
<img src="https://littlevgl.com/github/cover_ori_reduced_2.gif">
</p>
<p align="center">
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.
</p>
<h4 align="center">
<a href="https://littlevgl.com">Website </a> ·
<a href="https://littlevgl.com/live-demo">Live demo</a> ·
<a href="https://docs.littlevgl.com/#PC-simulator">Simulator</a> ·
<a href="https://docs.littlevgl.com/">Docs</a> ·
<a href="https://blog.littlevgl.com/">Blog</a>
</h4>
<!--
<p align="center">
:star: Star the project if you like it! And share with your friends <a href="https://twitter.com/intent/tweet?text=LittlevGL%20is%20a%20free%20and%20open%20source%20embedded%20GUI%20library%20with%20easy-to-use%20graphical%20elements,%20beautiful%20visual%20effects%20and%20low%20memory%20footprint.&url=https://littlevgl.com/&hashtags=littlevgl,embedded,gui,free,opensource"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social"></a>
</p>
-->
### Features
* **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 (64 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
### Supported devices
Basically, every modern controller - which is able to drive a display - is suitable to run LittlevGL. The minimal requirements:
- **16, 32 or 64-bit** microcontroller or processor
- **> 16 MHz** clock speed
- **> 8 kB RAM for static data** and **> 2 KB RAM for dynamic data** (graphical objects)
- **> 64 kB flash** program memory
- **Optionally ~1/10 screen sized memory** for buffered drawing (on 240 × 320, 16-bit colors it's 15 kB)
Just to mention some **platforms**:
- STM32F1, STM32F3, [STM32F4](https://blog.littlevgl.com/2017-07-15/stm32f429_disco_port), [STM32F7](https://github.com/littlevgl/stm32f746_disco_no_os_sw4stm32)
- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ
- NXP Kinetis, LPC, iMX
- [Linux frame buffer](https://blog.littlevgl.com/2018-01-03/linux_fb) (/dev/fb)
- [Raspberry PI](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl)
- [Espressif ESP32](https://github.com/littlevgl/esp32_ili9431)
- Nordic nrf52
- Quectell M66
### Quick start in a simulator
The easiest way to get started with LittlevGL is to run it in a simulator on your PC without any embedded hardware.
Choose a project with your favourite IDE:
| Eclipse | CodeBlock | Visual Studio | PlatfomIO | Qt Creator |
|-------------|----------- |---------------|-----------|------------|
| [![Eclipse](https://littlevgl.com/logo/ide/eclipse.jpg)](https://github.com/littlevgl/pc_simulator_sdl_eclipse) | [![CodeBlocks](https://littlevgl.com/logo/ide/codeblocks.jpg)](https://github.com/littlevgl/pc_simulator_win_codeblocks) | [![VisualStudio](https://littlevgl.com/logo/ide/visualstudio.jpg)](https://github.com/littlevgl/visual_studio_2017_sdl_x64) | [![PlatformIO](https://littlevgl.com/logo/ide/platformio.jpg)](https://github.com/littlevgl/pc_simulator_sdl_platformio) | [![QtCreator](https://littlevgl.com/logo/ide/qtcreator.jpg)](https://blog.littlevgl.com/2019-01-03/qt-creator) |
| Cross-platform<br>with SDL | Native Windows | Cross-platform<br>with SDL | Cross-platform<br>with SDL | Cross-platform<br>with SDL |
### Porting to an embedded hardware
In the most simple case you need to do these steps:
1. Copy `lv_conf_templ.h` as `lv_conf.h` next to `lvgl` and set at least `LV_HOR_RES`, `LV_VER_RES` and `LV_COLOR_DEPTH`.
2. Call `lv_tick_inc(x)` every `x` milliseconds in a Timer or Task (`x` should be between 1 and 10)
3. Call `lv_init()`
4. Register a function which can **copy a pixel array** to an area of the screen:
```c
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
disp_drv.disp_flush = disp_flush; /*Set your driver function*/
lv_disp_drv_register(&disp_drv); /*Finally register the driver*/
void disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
{
int32_t x, y;
for(y = y1; y <= y2; y++) {
for(x = x1; x <= x2; x++) {
sep_pixel(x, y, *color_p); /* Put a pixel to the display.*/
color_p++;
}
}
lv_flush_ready(); /* Tell you are ready with the flushing*/
}
```
5. Register a function which can **read an input device**. E.g. for a touch pad:
```c
lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/
indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/
indev_drv.read = touchpad_read; /*Set your driver function*/
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
bool touchpad_read(lv_indev_data_t * data)
{
static lv_coord_t last_x = 0;
static lv_coord_t last_y = 0;
/*Save the state and save the pressed cooridnate*/
data->state = touchpad_is_pressed() ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
if(data->state == LV_INDEV_STATE_PR) touchpad_get_xy(&last_x, &last_y);
/*Set the coordinates (if released use the last pressed cooridantes)*/
data->point.x = last_x;
data->point.y = last_y;
return false; /*Return `false` because we are not buffering and no more data to read*/
}
```
6. Call `lv_task_handler()` periodically every few milliseconds.
For a detailed description check the [Online documatation](https://docs.littlevgl.com/#Porting) or the [Porting tutorial](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c)
### Code examples
#### Create a button with a label and assign a click callback
```c
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 100, 50); /*Set its size*/
lv_btn_set_action(btn, LV_BTN_ACTION_CLICK, btn_action);/*Assign a callback to the button*/
lv_obj_t * label = lv_label_create(btn, NULL); /*Add a label to the button*/
lv_label_set_text(label, "Button"); /*Set the labels text*/
lv_res_t btn_action(lv_obj_t * btn)
{
printf("Clicked\n");
return LV_RES_OK;
}
```
![Simple button with LittelvGL](https://littlevgl.com/github/btn1.gif)
#### Modify the styles
```c
static lv_style_t style_btn_rel; /*A variable to store the released style*/
lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/
style_btn_rel.body.border.color = LV_COLOR_HEX3(0x269);
style_btn_rel.body.border.width = 1;
style_btn_rel.body.main_color = LV_COLOR_HEX3(0xADF);
style_btn_rel.body.grad_color = LV_COLOR_HEX3(0x46B);
style_btn_rel.body.shadow.width = 4;
style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM;
style_btn_rel.body
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
esp32 MIPI驱动程序 (286个子文件)
libdrv.a 4KB
libLittlevGL.a 3KB
astyle_c 169B
astyle_h 33B
hello-world.bin 143KB
polynesia.c 2.97MB
child.c 2.97MB
cat.c 2.97MB
lv_font_symbol_40.c 1.12MB
lv_font_dejavu_40_latin_sup.c 1.11MB
lv_font_dejavu_40.c 1.05MB
lv_font_dejavu_40_cyrillic.c 885KB
lv_font_dejavu_30_latin_sup.c 700KB
lv_font_symbol_30.c 667KB
lv_font_dejavu_30.c 661KB
lv_font_dejavu_30_cyrillic.c 532KB
lv_font_dejavu_20_latin_sup.c 370KB
lv_font_dejavu_20.c 352KB
lv_font_symbol_20.c 322KB
lv_font_dejavu_20_cyrillic.c 279KB
lv_font_dejavu_10_latin_sup.c 137KB
lv_font_dejavu_10.c 132KB
lv_font_monospace_8.c 126KB
lv_font_symbol_10.c 105KB
lv_font_dejavu_10_cyrillic.c 98KB
lv_draw_rect.c 55KB
lv_obj.c 53KB
lv_ta.c 44KB
lv_page.c 43KB
lv_calendar.c 38KB
lv_indev.c 33KB
lv_label.c 33KB
lv_list.c 32KB
lv_btnm.c 31KB
lv_tabview.c 30KB
lv_table.c 28KB
lv_ddlist.c 28KB
lv_txt.c 27KB
lv_draw_vbasic.c 26KB
lv_draw_img.c 25KB
lv_chart.c 25KB
lv_btn.c 25KB
lv_theme_alien.c 24KB
lv_theme_nemo.c 24KB
lv_theme_material.c 22KB
lv_draw_line.c 22KB
lv_roller.c 21KB
lv_theme_night.c 21KB
lv_cont.c 21KB
lv_theme_zen.c 20KB
i2s_lcd.c 19KB
lv_tileview.c 19KB
lv_slider.c 18KB
lv_refr.c 18KB
lv_canvas.c 17KB
lv_win.c 17KB
lv_gauge.c 15KB
lv_fs.c 15KB
lv_group.c 15KB
lv_mbox.c 15KB
lv_kb.c 14KB
lv_ufs.c 14KB
SSD2805_8080_drv.c 13KB
lv_style.c 13KB
lv_spinbox.c 13KB
lv_bar.c 13KB
lv_sw.c 12KB
lv_img.c 12KB
lv_anim.c 12KB
lv_imgbtn.c 12KB
lv_mem.c 12KB
lv_lmeter.c 11KB
lv_preload.c 11KB
lv_cb.c 11KB
lv_port_indev_templ.c 10KB
lv_theme_mono.c 10KB
lv_ll.c 10KB
lv_task.c 10KB
lv_line.c 9KB
lv_port_fs_templ.c 9KB
lv_draw_arc.c 9KB
SSD2541.c 9KB
lv_draw_rbasic.c 9KB
lv_theme_default.c 9KB
lv_arc.c 8KB
lv_draw_label.c 8KB
lv_led.c 7KB
lv_font.c 7KB
lv_theme_templ.c 7KB
lv_hal_disp.c 6KB
lv_objx_templ.c 6KB
lv_draw.c 6KB
lv_port_disp_templ.c 5KB
lv_area.c 5KB
lv_vdb.c 5KB
lv_draw_triangle.c 4KB
lv_math.c 4KB
littlevgl_example.c 4KB
lv_font_builtin.c 4KB
lv_theme.c 3KB
共 286 条
- 1
- 2
- 3
huahaoyueyuan1234
- 粉丝: 14
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0