LVGL提供了使用易于使用的图形元素,精美的视觉效果和低内存占用量来创建嵌入式GUI所需的一切。
强大的构建块:按钮,图表,列表,滑块,图像等。 先进的图形:动画,抗锯齿,不透明度,平滑滚动 使用各种输入设备:触摸屏,鼠标,键盘,编码器,按钮等。 使用多种显示方式:例如单色和彩色显示 独立于任何微控制器或显示器使用的硬件 可扩展以使用很少的内存(64 kB闪存,10 kB RAM) 支持UTF-8的多语言支持,双向和阿拉伯脚本支持 通过类似CSS的样式完全可自定义的图形元素 支持操作系统,外部存储器和GPU,但不是必需的 即使只有一个帧缓冲区也可以平滑渲染 用C语言编写,以实现最大的兼容性(与C ++兼容) Micropython Binding在Micropython中公开了LVGL API 无需嵌入式硬件即可在PC上开发的模拟器 快速开发的示例和教程 文档和API参考
Basically, every modern controller (which is able to drive a display) is suitable to run LVGL. The minimal requirements are:
Name | Minimal | Recommended |
Architecture | 16, 32 or 64 bit microcontroller or processor | |
Clock | > 16 MHz | > 48 MHz |
Flash/ROM | > 64 kB | > 180 kB |
Static RAM | > 2 kB | > 4 kB |
Stack | > 2 kB | > 8 kB |
Heap | > 2 kB | > 8 kB |
Display buffer | > 1 × hor. res. pixels | > 10 × hor. res. pixels |
Compiler | C99 or newer |
Note that the memory usage might vary depending on the architecture, compiler and build options.
Just to mention some platforms:
This list shows the recommended way of learning the library:
For more examples see the lv_examples repository.
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button to the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 100, 50); /*Set its size*/
lv_obj_set_event_cb(btn, btn_event_cb); /*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*/
...
void btn_event_cb(lv_obj_t * btn, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
printf("Clicked\n");
}
}
Learn more about Micropython.
# Create a Button and a Label
scr = lv.obj()
btn = lv.btn(scr)
btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0)
label = lv.label(btn)
label.set_text("Button")
# Load the screen
lv.scr_load(scr)
LVGL is an open project and contribution is very welcome. There are many ways to contribute from simply speaking about your project, through writing examples, improving the documentation, fixing bugs to hosing your own project under in LVGL.
For a detailed description of contribution opportunities visit the Contributing section of the documentation.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。