<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/v6.1.2"><img src="https://img.shields.io/badge/version-6.1.2-blue.svg"></a>
</p>
<p align="center">
<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/en/html/get-started/pc-simulator.html">Simulator</a> ·
<a href="https://forum.littlevgl.com">Forum</a> ·
<a href="https://docs.littlevgl.com/">Docs</a> ·
<a href="https://blog.littlevgl.com/">Blog</a>
</h4>
---
- [Features](#features)
- [Supported devices](#supported-devices)
- [Quick start in a simulator](#quick-start-in-a-simulator)
- [Add LittlevGL to your project](#add-littlevgl-to-your-project)
- [Learn the basics](#learn-the-basics)
- [Examples](#examples)
- [Contributing](#contributing)
- [Donate](#donate)
## Features
* **Powerful building blocks** buttons, charts, lists, sliders, images, etc.
* **Advanced graphics** with animations, anti-aliasing, opacity, smooth scrolling
* **Simultaneously use various input devices** touchscreen, mouse, keyboard, encoder, buttons, etc.
* **Simultaneously use multiple displays** i.e. monochrome and color display
* **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
* **Micropython Binding** exposes [LittlevGL API in Micropython](https://blog.littlevgl.com/2019-02-20/micropython-bindings)
* **Simulator** to develop on PC without embedded hardware
* **Tutorials, examples, themes** for rapid development
* **Documentation** and API references
## 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 is recommended
- Flash/ROM: > 64 kB for the very essential components (> 180 kB is recommended)
- RAM:
- Static RAM usage: ~8..16 kB depending on the used features and objects types
- Stack: > 2kB (> 4 kB is recommended)
- Dynamic data (heap): > 4 KB (> 16 kB is recommended if using several objects).
Set by `LV_MEM_SIZE` in *lv_conf.h*.
- Display buffer: > *"Horizontal resolution"* pixels (> 10 × *"Horizontal resolution"* is recommended)
- C99 or newer compiler
*Note that the memory usage might vary depending on the architecture, compiler and build options.*
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/lv_port_esp32)
- 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 | CodeBlocks | Visual Studio | PlatformIO | 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<br>(Recommended on<br>Linux and Mac) | Native Windows | Windows<br>with SDL | Cross-platform<br>with SDL | Cross-platform<br>with SDL |
## Add LittlevGL to your project
The steps below show how to setup LittlevGL on an embedded system with a display and a touchpad.
You can use the [Simulators](https://docs.littlevgl.com/en/html/get-started/pc-simulator) to get ready to use projects which can be run on your PC.
1. [Download](https://littlevgl.com/download) or [Clone](https://github.com/littlevgl/lvgl) the library
2. Copy the `lvgl` folder into your project
3. Copy `lvgl/lv_conf_template.h` as `lv_conf.h` next to the `lvgl` folder and set at least `LV_HOR_RES_MAX`, `LV_VER_RES_MAX` and `LV_COLOR_DEPTH`.
4. Include `lvgl/lvgl.h` where you need to use LittlevGL related functions.
5. Call `lv_tick_inc(x)` every `x` milliseconds **in a Timer or Task** (`x` should be between 1 and 10). It is required for the internal timing of LittlevGL.
6. Call `lv_init()`
7. Create a display buffer for LittlevGL
```c
static lv_disp_buf_t disp_buf;
static lv_color_t buf[LV_HOR_RES_MAX * 10]; /*Declare a buffer for 10 lines*/
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
```
8. Implement and register a function which can **copy a pixel array** to an area of your display:
```c
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/
disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/
lv_disp_drv_register(&disp_drv); /*Finally register the driver*/
void my_disp_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * color_p)
{
int32_t x, y;
for(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) {
set_pixel(x, y, *color_p); /* Put a pixel to the display.*/
color_p++;
}
}
lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/
}
```
9. Implement and 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_cb = my_touchpad_read; /*Set your driver function*/
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
bool my_touchpad_read(lv_indev_drv_t * indev_driver, 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 coordinate*/
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 coordinates)*/
data->point.x = last_x;
data->point.y = last_y;
return false; /*Return `false` becaus
Mascreda
- 粉丝: 31
- 资源: 7
最新资源
- 滑膜控制下的差动制动防侧翻稳定性精准控制 通过上层滑膜控制产生横摆力矩,结合下层制动力矩分配策略,实现车辆防侧翻稳定控制 联合仿真验证其有效性,资料完备 ,基于滑膜控制的差动制动防侧翻稳定性控制,上
- "移相全桥电源系统仿真建模:全面解析Matlab Simulink仿真与参数设计学习资料集",2KW移相全桥整机Matlab Simulink仿真模型电源学习资料,报告mathcad参数设计,模型搭建
- 基于风光不确定性及信息间隙决策理论的碳捕集综合能源系统鲁棒调度优化策略研究,考虑风光不确定性和IGDT信息间隙决策的综合能源系统优化调度 参考文献:基于信息间隙决策理论的碳捕集电厂调度 非完全复献
- CRUISE纯电动车仿真模型与Simulink DLL联合仿真:电制动优先能量回收策略详解与搭建指南(附详细文档),CRUISE纯电动车仿真模型,simulink DLL联合仿真,实现电制动优先能量回
- 车辆紧急防避撞AEB控制算法实现原理与仿真步骤详解:制动模型、模糊控制、逆动力学及阻力计算,车辆紧急防避撞AEB控制,模型包含建立驾驶员制动模型来模拟制动过程,同时加入模糊控制实现期望减速度的计算,加
- 基于LQR算法的横摆角速度跟踪控制技术研究:四轮独立驱动与动力学模型应用,四轮独立驱动横摆角速度控制,LQR 基于LQR算法的 基于二自由度动力学方程,通过主动转向afs和直接横摆力矩dyc实现的横摆
- 西门子S7-1200与S7-1500的动态加密功能块程序管理:设定停机运行时间,专防不守信客户实用指南及发货清单 ,西门子S7-1200 1500动态加密功能块程序,可以设置停机运行时间,时间到达设备
- MATLAB环境下深度学习预测NASA涡扇发动机退化仿真数据集剩余寿命方法,MATLAB环境下一种基于深度学习的NASA涡扇发动机 化仿真数据集剩余使用寿命预测方法 算法运行环境为matlab r2
- 异步电机矢量控制的Simulink模型设计与实现,异步电机矢量控制simulink模型 ,核心关键词:异步电机;矢量控制;Simulink模型;控制策略;仿真模型;电力传动系统 ,"异步电机矢量控制的
- 基于动态窗口算法的AGV仿真避障:起点至目标点的实时路径规划与障碍物处理,基于动态窗口算法的AGV仿真避障 可设置起点目标点,设置地图,设置移动障碍物起始点目标点,未知静态障碍物 动态窗口方法(Dyn
- 基于三菱PLC的定长送料程序:触摸屏操作,伺服与步进驱动,精准点动与定位控制,定长送料程序,三菱PLC加显触摸屏 伺服或者步进都可以 点动 相对定位 绝对定位 ,定长送料程序; 三菱PLC; 显触摸
- 基于A*算法的三维路径规划算法在无人机中的MATLAB实现,基于A* 算法的无人机三维路径规划算法,MATLAB编程实现 ,核心关键词:A*算法; 无人机; 三维路径规划; MATLAB编程实现
- PID与LQR主动悬架模型对比:汽车平顺性仿真及源代码详解,【PID和LQR主动悬架模型对比】 分别建立了PID控制和LQR控制的的主动悬架模型,比较两种控制器的控制效果 以悬架主动力
- 一维光子晶体态密度案例解析与探讨:理论与实践结合的研究实践,一维光子晶体态密度案例 ,一维光子晶体; 态密度; 案例; 实验结果; 理论分析,一维光子晶体态密度案例:光子态密度的研究与应用
- 级联H桥并网系统性能测试:精准电流控制下的电压稳定性与畸变率优化,级联H桥并网 10KV 每相12个H桥,单个H桥直流电压为850V,采用电流闭环控制 为了测试系统控制性能效果,在1s时,控制输出
- 级联H桥三相逆变器:离散化仿真下的开闭环控制策略与电压电流双闭环控制实现,级联H桥 离网三相逆变器采用级联H桥多电平拓扑,每个H桥直流测电压为24V,5个H桥串联(电压,H桥个数可以自己调加),系统
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈