I recently purchased a new WaveShare ESP32-S3-LCD-3.16 display and created a basic configuration. I couldn’t find any examples through searching, so I made one myself using Gemini. If you have any ideas for improvement, please feel free to add to this thread.
This example only covers the display-related parts; it’s not the complete code (the rest is standard).
esphome:
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
psram:
mode: octal
speed: 80MHz
esp32:
variant: esp32s3
flash_size: 16MB
cpu_frequency: 240MHz
framework:
type: esp-idf
sdkconfig_options:
#The following LVGL configuration option is for improving the frame rate (LVGL v8.3):
CONFIG_LV_MEM_CUSTOM: y
CONFIG_LV_MEMCPY_MEMSET_STD: y
CONFIG_LV_ATTRIBUTE_FAST_MEM: y
advanced:
enable_idf_experimental_features: true
spi:
clk_pin: GPIO2 #SCK
mosi_pin: GPIO1 #SDO
display:
- platform: mipi_rgb #rpi_dpi_rgb
model: custom
id: ips01
update_interval: never
auto_clear_enabled: false
#color_order: RGB
dimensions:
width: 320
height: 820
de_pin: 40
hsync_pin: 38
vsync_pin: 39
pclk_pin: 41
cs_pin: 0
#pclk_inverted: true
pclk_frequency: 18MHz
reset_pin: 16
hsync_back_porch: 30
hsync_front_porch: 30
hsync_pulse_width: 6
vsync_back_porch: 20
vsync_front_porch: 20
vsync_pulse_width: 40
data_pins:
red:
- 17 #r0
- 46 #r1
- 3 #r2
- 8 #r3
- 18 #r4
blue:
- 21 #b0
- 5 #b1
- 45 #b2
- 48 #b3
- 47 #b4
green:
- 14 #g0
- 13 #g1
- 12 #g2
- 11 #g3
- 10 #g4
- 9 #g5
init_sequence:
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x13]
- [0xEF, 0x08]
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10]
- [0xC0, 0xE5, 0x02]
- [0xC1, 0x15, 0x0A]
- [0xC2, 0x07, 0x02]
- [0xCC, 0x10]
- [0xB0, 0x00, 0x08, 0x51, 0x0D, 0xCE, 0x06, 0x00, 0x08, 0x08, 0x24, 0x05, 0xD0, 0x0F, 0x6F, 0x36, 0x1F]
- [0xB1, 0x00, 0x10, 0x4F, 0x0C, 0x11, 0x05, 0x00, 0x07, 0x07, 0x18, 0x02, 0xD3, 0x11, 0x6E, 0x34, 0x1F]
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x11]
- [0xB0, 0x4D]
- [0xB1, 0x37]
- [0xB2, 0x87]
- [0xB3, 0x80]
- [0xB5, 0x4A]
- [0xB7, 0x85]
- [0xB8, 0x21]
- [0xB9, 0x00, 0x13]
- [0xC0, 0x09]
- [0xC1, 0x78]
- [0xC2, 0x78]
- [0xD0, 0x88]
- [0xE0, 0x80, 0x00, 0x02] # <-- Задержка 100 мс
- delay 100ms
- [0xE1, 0x0F, 0xA0, 0x00, 0x00, 0x10, 0xA0, 0x00, 0x00, 0x00, 0x60, 0x60]
- [0xE2, 0x30, 0x30, 0x60, 0x60, 0x45, 0xA0, 0x00, 0x00, 0x46, 0xA0, 0x00, 0x00, 0x00]
- [0xE3, 0x00, 0x00, 0x33, 0x33]
- [0xE4, 0x44, 0x44]
- [0xE5, 0x0F, 0x4A, 0xA0, 0xA0, 0x11, 0x4A, 0xA0, 0xA0, 0x13, 0x4A, 0xA0, 0xA0, 0x15, 0x4A, 0xA0, 0xA0]
- [0xE6, 0x00, 0x00, 0x33, 0x33]
- [0xE7, 0x44, 0x44]
- [0xE8, 0x10, 0x4A, 0xA0, 0xA0, 0x12, 0x4A, 0xA0, 0xA0, 0x14, 0x4A, 0xA0, 0xA0, 0x16, 0x4A, 0xA0, 0xA0]
- [0xEB, 0x02, 0x00, 0x4E, 0x4E, 0xEE, 0x44, 0x00]
- [0xED, 0xFF, 0xFF, 0x04, 0x56, 0x72, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x27, 0x65, 0x40, 0xFF, 0xFF]
- [0xEF, 0x08, 0x08, 0x08, 0x40, 0x3F, 0x64]
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x13]
- [0xE8, 0x00, 0x0E]
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x00]
- [0x11]
- delay 120ms
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x13]
- [0xE8, 0x00, 0x0C] # <-- Задержка 10 мс
- delay 10ms
- [0xE8, 0x00, 0x00]
- [0xFF, 0x77, 0x01, 0x00, 0x00, 0x00]
- [0x3A, 0x55]
- [0x36, 0x00]
- [0x35, 0x00]
- [0x29]
- delay 20ms
lvgl:
id: lvgl_comp
displays:
- ips01
Device info: https://www.waveshare.com/wiki/ESP32-S3-LCD-3.16
Circuit diagram: https://files.waveshare.com/wiki/ESP32-S3-LCD-3.16/ESP32-S3-LCD-3.16-schematic.pdf