• Stars
    star
    1,011
  • Rank 45,471 (Top 0.9 %)
  • Language
    C
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LVGL ported to ESP32 including various display and touchpad drivers

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 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

Example demo for TFT displays:

Example GUI_DEMO with ESP32 using LVGL

Monochrome support:

Example_monochrome demo with ESP32 using LVGL

Display and touch controllers

The display and touch (indev) controllers are now into it's own repository, you can find it here. 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 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 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:

#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.

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).

At this momement, the buffers are dynamicaly allocated with DMA capabilty and memory allocator handles the rest.

More Repositories

1

lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
C
16,168
star
2

lv_binding_rust

LVGL bindings for Rust. A powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash).
Rust
676
star
3

lv_port_pc_visual_studio

Visual Studio projects for LVGL embedded graphics library. Recommended on Windows. Linux support with Wayland is work in progress.
C
572
star
4

lv_demos

Examples, tutorials and applications for the LVGL embedded GUI library
C
480
star
5

lvgl_esp32_drivers

Drivers for ESP32 to be used with LVGL
C
321
star
6

lv_drivers

TFT and touch pad drivers for LVGL embedded GUI library
C
295
star
7

lv_binding_micropython

LVGL binding for MicroPython
C
250
star
8

lv_port_pc_vscode

C
244
star
9

lv_platformio

PlatformIO project example for LVGL
C
241
star
10

lv_port_linux

LVGL configured to work with a standard Linux framebuffer
C
237
star
11

lv_port_pc_eclipse

PC simulator project for LVGL embedded GUI Library. Recommended on Linux and Mac.
C
235
star
12

lv_font_conv

Converts TTF/WOFF fonts to compact bitmap format
JavaScript
175
star
13

lv_arduino

LVGL as Arduino Library + example sketch
C
147
star
14

lv_port_win_codeblocks

Windows PC simulator project for LVGL embedded GUI Library
C
145
star
15

lv_binding_js

React bindings for LVGL ⚛️
C++
141
star
16

lv_port_windows

LVGL ported to Windows
C
83
star
17

lv_img_conv

Image converter for LVGL, written in JS
TypeScript
72
star
18

lv_port_stm32f429_disco

LVGL ported to STM32F429I-DISC1 using SW4STM32 (Ac6) IDE
C
71
star
19

lv_lib_png

PNG decoder for LVGL
C
60
star
20

lv_i18n

Internationalization (i18n) for LVGL
JavaScript
58
star
21

lv_web_emscripten

LVGL ported to Emscripten to be converted to JavaScript
C
55
star
22

lv_port_stm32f746_disco

LVGL ported to STM32F746G-DISCO using STM32CubeIDE
C
50
star
23

lv_lib_qrcode

QR code generation with LVGL
C
50
star
24

lv_utils

Convert images or system fonts to C arrays. Written for LVGL embedded GUI library
PHP
49
star
25

lv_lib_freetype

Interface to FreeType to generate font bitmaps run time
C
47
star
26

lv_binding_cpp

[WIP] C++ binding for LVGL
C++
45
star
27

docs_old

DEPRECATED: Documentation for LVGL is now located in the main repository: https://github.com/lvgl/lvgl
HTML
42
star
28

lv_fs_if

LVGL interfaces to various file systems (PC, FatFS)
C
40
star
29

lv_lib_split_jpg

JPG decoder for LVGL
C
32
star
30

lv_lib_gif

GIF library for LVGL
C
32
star
31

lv_lib_rlottie

Lottie animation support for LVGL
C
29
star
32

lv_port_stm32f769_disco

LVGL ported to STM32F769 Discovery using CubeIDE
C
26
star
33

lv_gui_builder

[WIP] Drag end drop GUI designer for LVGL
24
star
34

lv_lib_tinygl

EXPERIMENTAL - 3D extension for lvgl using TinyGL
C
21
star
35

lv_port_raspberry_pi_pico_mdk

An MDK template for Raspberry Pi Pico + LVGL
C
19
star
36

blog

Post, News and Tutorials about LVGL embedded GUI library
C
19
star
37

lv_port_stm32f469_disco

LVGL ported to STM32F469 Discovery using SWSTM32 (Ac6) IDE
C
14
star
38

lv_lib_bmp

BMP decoder library for LVGL
C
12
star
39

lv_binding_pikascript

C
11
star
40

lv_port_stm32h7b3i_disco

This repository contains the Light and Versatile Graphics Library (LVGL) port for the STM32H7B3I-DK development board.
C
11
star
41

lv_port_stm32h745i_disco

LVGL ported to STM32H745I DISCO
C
11
star
42

lv_apps

Ready to use UIs and high level components for applications
C
10
star
43

lv_port_maixduino

Maixduino GUI project with LVGL
C
10
star
44

docs

Meta repository for compiled documentation. Do not send PRs here - they will be closed. The Markdown files are now located in the main repository: https://github.com/lvgl/lvgl
HTML
10
star
45

lvgl-project-creator

Create LVGL projects quickly and easily
Python
9
star
46

sim

Meta repository for online LVGL simulators
JavaScript
8
star
47

lv_port_xilinx_zedboard_vitis

This repository contains a template AMP project for the Zedboard using VGA, FreeRTOS, LVGL and USB peripherals
C
8
star
48

lv_port_aurix

LVGL ported to Aurix TFT board
C
7
star
49

lv_port_an547_cm55_sim

A LVGL porting for Cortex-M55 running on an Arm official FPGA prototyping development board called MPS3 (AN547), see Figure 1. It is also possible to run the project template on an emulator called Corstone-300-FVP, which is free. Topics Resources
C
7
star
50

lv_port_stm_nucleo_g071rb

LVGL ported to ST's NUCLEO G071RB board
C
3
star
51

lv_binding_berry

Binding to Berry language
C
3
star
52

lv_port_stm32f746_disco_atollic

DEPRECATED: LittlevGL ported to STM32F746G-DISCO using Atollic IDE
C
2
star
53

template

Template repo with README and CI settings
2
star
54

markup_temporary

Temporary repository to evaluate the markup language support
1
star
55

pic32mx_r61581_no_os

LittlevGL ported to PIC32MX with R61581 display controller
C
1
star