# LVGL project for ESP32
This is an ESP32 demo project showcasing LVGL v7 with support for several display controllers and touch controllers.
The demo application is the `lv_demo_widgets` project from the [lv_examples](https://github.com/lvgl/lv_examples) repository.
- Version of ESP-IDF required 4.2. NOTE: We're trying to make this repo backwards compatible, usage of idf.py is encouraged.
- Version of LVGL used: 7.9.
- Version of lv_examples used: 7.9.
#### Table of content
- [Get started](#get-started)
- [Use LVGL in your ESP-IDF project](#use-lvgl-in-your-esp-idf-project)
- [Use lvgl_esp32_drivers in your project](#use-lvgl_esp32_drivers-in-your-project)
- [Platformio support](#platformio-support)
- [ESP32-S2 Support](#esp32-s2-support)
Example demo for TFT displays:
![Example GUI_DEMO with ESP32 using LVGL](images/new_photo.jpg)
Monochrome support:
![Example_monochrome demo with ESP32 using LVGL](images/new_mono.jpg)
## Display and touch controllers
The display and touch (indev) controllers are now into it's own repository, you can find it [here](https://github.com/lvgl/lvgl_esp32_drivers).
To report any issue or add new display or touch (indev) drivers you can do so in the `lvgl_esp32_drivers` repo.
## Get started
### Prerequisites
- ESP-IDF Framework.
### Note
This project tries to be compatible with both the ESP-IDF v3.x and v4.0, but using v4.0 is recommended.
Instructions assume you are using the v4.x toolchain, otherwise use the make commands, e.g. instead of running `idf.py menuconfig`, run `make menuconfig`.
### Build and run the demo.
1. Clone this project by `git clone --recurse-submodules https://github.com/lvgl/lv_port_esp32.git`, this will pull this repo and its submodules.
2. Get into the created `lv_port_esp32` directory.
3. Run `idf.py menuconfig`
4. Configure LVGL in `Components config->LVGL Configuration`. For monochrome displays use the mono theme and we suggest enabling the `unscii 8` font.
5. Configure your display and/or touch controllers in `Components config->LVGL TFT Display Configuration` and `Components config->LVGL TOUCH Configuration`.
6. Store your project configuration.
7. Build the project with `idf.py build`
8. If the build don't throw any errors, flash the demo with `idf.py -p (YOUR SERIAL PORT) flash` (with `make` this is just `make flash` - in 3.x PORT is configured in `menuconfig`)
## Use LVGL in your ESP-IDF project
LVGL now includes a Kconfig file which is used to configure most of the LVGL configuration options via menuconfig, so it's not necessary to use a custom `lv_conf.h` file.
It is recommended to add LVGL as a submodule in your IDF project's git repo.
From your project's root directory:
1. Create a directory named `components` (if you don't have one already) with `mkdir -p components`.
2. Clone the lvgl repository inside the `components` directory with `git submodule add https://github.com/lvgl/lvgl.git components/lvgl`
3. Run `idf.py menuconfig`, go to `Component config` then `LVGL configuration` to configure LVGL.
## Use lvgl_esp32_drivers in your project
It is recommended to add [lvgl_esp32_drivers](https://github.com/lvgl/lvgl_esp32_drivers) as a submodule in your IDF project's git repo.
From your project's root directory:
1. Create a directory named `components` (if you don't have one already) with `mkdir -p components`.
2. Clone the lvgl_esp32_drivers repository inside the `components` directory with `git submodule add https://github.com/lvgl/lvgl_esp32_drivers.git components/lvgl_esp32_drivers`
3. Run `idf.py menuconfig`, go to `Component config` then `LVGL TFT configuration` and `LVGL TFT Display configuration` to configure lvgl_esp32_drivers.
## Platformio support
Using the [lv_platformio](https://github.com/lvgl/lv_platformio) project add the following lines to `platformio.ini` file:
```
[env:esp32]
platform = espressif32
framework = espidf
board = esp-wrover-kit
```
Change the default environment to `default_envs = esp32`.
Modify the `main.c` like this:
```c
#include "lvgl.h"
// #include "driver.h"
#include "demo.h"
int app_main(void)
{
lv_init();
/* Initialize your hardware. */
/* hw_init(); */
demo_create();
/* Create the UI or start a task for it.
* In the end, don't forget to call `lv_task_handler` in a loop. */
/* hw_loop(); */
return 0;
}
```
For more information see: [platformio with espidf framework compability](https://github.com/lvgl/lv_port_esp32/issues/168).
# ESP32-S2 Support
Support for ESP32-S2 variant is Work In Progress.
Smaller displays (e.g. 320x240) work fine, but larger ones need testing.
## Background
ESP32-S2 has less on-chip SRAM than its predecessor ESP32 (520kB vs. 320kB).
This causes problems with memory allocation with large LVGL display buffers as they don't fit into the on-chip memory
and external PSRAM is not accessible by DMA.
Moreover, static allocation to external PSRAM is not yet supported
(see [GitHub issue](https://github.com/espressif/esp-idf/issues/6162)).
At this momement, the buffers are dynamicaly allocated with DMA capabilty and memory allocator handles the rest.
没有合适的资源?快使用搜索试试~ 我知道了~
lv_port_esp32:LVGL移植到ESP32,包括各种显示和触摸板驱动程序
共54个文件
png:24个
jpg:8个
txt:3个
1星 需积分: 44 34 下载量 77 浏览量
2021-05-13
10:48:16
上传
评论 2
收藏 10.92MB ZIP 举报
温馨提示
用于ESP32的LVGL项目 这是一个ESP32演示项目,展示了LVGL v7,并支持多个显示控制器和触摸控制器。 该演示应用程序是存储库中的lv_demo_widgets项目。 ESP-IDF版本需要4.2。 注意:我们正在尝试使此存储库向后兼容,鼓励使用idf.py。 使用的LVGL版本:7.9。 使用的lv_examples版本:7.9。 表中的内容 TFT显示器的示例演示: 单色支持: 显示和触摸控制器 现在,显示和触摸(indev)控制器位于其自己的存储库中,您可以在找到它。 要报告任何问题或添加新的显示或触摸(indev)驱动程序,可以在lvgl_esp32_drivers库中进行。 开始吧 先决条件 ESP-IDF框架。 笔记 该项目尝试与ESP-IDF v3.x和v4.0兼容,但建议使用v4.0。 说明假设您使用的是v4.x工具链,否则请使用make命令,例如,而不
资源详情
资源评论
资源推荐
收起资源包目录
lv_port_esp32-master.zip (54个子文件)
lv_port_esp32-master
.gitignore 588B
components
lvgl_esp32_drivers
lv_examples
Kconfig 781B
component.mk 455B
lv_examples
lv_ex_conf.h 2KB
CMakeLists.txt 293B
lvgl
images
tft_spi_bus.png 13KB
touch_spi_bus.png 26KB
sparkfun_adafruit.png 1.24MB
ESP32_DevkitV1_30_GPIO.png 59KB
ssd1306_wemos_lolin.jpg 1.26MB
menu-pins.png 13KB
touch_touch_panel_config.png 40KB
esp_wrover_kit.jpg 5.78MB
menu-predefined.png 9KB
tft_display_controller.png 15KB
touch_pinout.png 35KB
menu-main.png 13KB
tft_predefined_display_config.png 19KB
menu-predefined-displays.png 8KB
new_photo.jpg 293KB
m5stickc.jpg 128KB
ssd1306_wemos_lolin_configuration.png 12KB
touch_menu.png 35KB
tft_backlight_control.png 50KB
new_lvgl_options.png 51KB
menu-lvgl.png 17KB
tft_predefined_board_pinouts.png 18KB
menu-component.png 5KB
tft_width_height.png 51KB
new_mono.jpg 299KB
tft_controllers_options.png 46KB
menu-pins-tp.png 13KB
m5stick.jpg 876KB
touch_controllers_options.png 16KB
m5stack.jpg 421KB
screenshot.jpg 195KB
tft_pin_assignments.png 38KB
Makefile 179B
PRECONFIGURED_KITS.md 7KB
LICENSE 1KB
.settings
org.eclipse.cdt.core.prefs 655B
language.settings.xml 1KB
.gitmodules 372B
.github
stale.yml 703B
auto-comment.yml 736B
ISSUE_TEMPLATE
issue-template.md 579B
scripts
code-format.cfg 463B
run-code-format.sh 294B
README.md 5KB
main
component.mk 182B
main.c 6KB
CMakeLists.txt 36B
.cproject 8KB
CMakeLists.txt 247B
共 54 条
- 1
佳同学
- 粉丝: 28
- 资源: 4583
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1