Board: ESP32-C6-LCD-1.47
waveshare URL
Connect VS Code COM port as following: ESP32-C6 chip via ... USB-JTAG
Initial setup:
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
Use partitions from example:
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap,,,,
nvs, data, nvs, 0x9000, 0x6000,
factory,0,0, 0x10000, 2M,
flash_test, data, fat, , 528K,
Model: ST7789
LCD type TFT172(H)RGB x320(V)Drive IC ST7789V3
LCD Pin ESP32C6
MOSI GPIO6
SCLK GPIO7
LCD_CS GPIO14
LCD_DC GPIO15
LCD_RST GPIO21
LCD_BL GPIO22
Driver: components/esp_lcd/src/esp_lcd_panel_st7789.c
RGB_Control GPIO8
TF Card ESP32C6
MISO GPIO5
MOSI GPIO6
SCLK GPIO7
CS GPIO4
SD_D1 NC
SD_D2 NC
LVGL Start DOC
Requre older LVGL 8, not suitable now
Use example dir hierarchy and files from:
- https://www.waveshare.com/wiki/ESP32-C6-LCD-1.47
- File
ESP32-S3-LCD-1.47-Demo
Just use as project example. Cannot be used with latest version 9+
Read this forum
It has a great example of everything without a hustle.
For deep understanding it can be usefull to read the complex way later.
Continue to study:
Install:
Usual 1st cmd OR better local (to be able to configure lvgl for once)
idf.py add-dependency "lvgl/lvgl^9.2.2"git submodule add https://github.com/lvgl/lvgl.git components/lvgl
Into the ignored folder (not to add the full other repo in my repo):
git submodule add -f https://github.com/lvgl/lvgl.git components/lvgl
IMPORTANT: Switch branch to a released last: 9.2.2
cd .\components\lvgl\git checkout v9.2.2
Optional, not need LED for LCD to work
idf.py add-dependency "espressif/led_strip^3.0.1"
Other module help driver for display, probably (not actually, try to use lvgl pure, as it already has a driver for our display and board):
idf.py add-dependency "espressif/esp_lvgl_port^2.5.0"
According to the doc
-
Copy
lv_conf_template.h- to
components/lv_conf.h- Should be a path:
{PROJECT_ROOT}/components/lvgl/..{PROJECT_ROOT}/components/lv_conf.h
- Should be a path:
- Open and change the following to 1:
#if 0(/* Set this to "1" to enable content */) - Define
LV_COLOR_DEPTH 16for LCD:Display: ST7789 - Define
LV_USE_ST7789 1for LCD:Display: ST7789 - Optional: disable examples:
LV_BUILD_EXAMPLES 0 - Optional: disable demo:
LV_USE_DEMO_WIDGETS 0
- to
-
Optional: config LVGL at
menuconfigidf.py menuconfig->LVGL configuration(most bottom) - >Color depth: 24
-
Try build the project first time.
- Do not flash, just builds.
- Everything should be fine.
According to the DOC
Help example
-
Modify
main.cadding#include <lvgl.h>and init at theapp_main:lv_init(); -
Init drivers for our display:
ST7789 -
Using
-
Create a dir for LVGL 'Squareline studio' export:
{PROJECT_ROOT}/components/screen/- It's not used yet
Using as example: https://github.com/hiruna/esp-idf-t-display-s3/tree/main
Create a board:
C:\Program Files\SquareLine Studio 1.5.1\boards..
OR
C:\Users\%USER%\SquareLine\boards
Using VS code:
Project example
- https://github.com/Omegaki113r/lvgl_demo/tree/main
- https://github.com/VolosR/waveshareBoards/tree/main/C6example
Waveshare:
LVGL Espressif
LVGL:
Espressif:
Other:
- https://components.espressif.com/components/lvgl/lvgl/versions/9.2.2
- https://components.espressif.com/components/espressif/esp_lvgl_port/versions/2.5.0
Similar projects for reference