Lvgl setup for esp32-s3-lcd-1.47 st7789

For anyone who wants to get the LCD just working or working with LVGL, here is my yaml setup for the :slight_smile:

https://www.waveshare.com/esp32-s3-lcd-1.47.htm

esphome:
  name: control-panel
  friendly_name: Control Panel

psram:

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

# Enable logging
logger:
  level: VERBOSE
# Enable Home Assistant API
api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Control-Panel Fallback Hotspot"

web_server:
  port: 80

captive_portal:

# Example minimal configuration entry
spi:
  clk_pin: GPIO40
  mosi_pin: GPIO45
  interface: hardware

display:
  - platform: st7789v
    model: CUSTOM
    height: 320
    width: 172
    offset_height: 34
    offset_width: 0
    spi_mode: 0
    data_rate: 80000000.0
    auto_clear_enabled: false
    backlight_pin: GPIO48
    cs_pin: GPIO42
    dc_pin: GPIO41
    reset_pin: GPIO39
    id: my_display
    # lambda: |-
    #   // Draw a circle in the middle of the display
    #   it.filled_circle(it.get_width() / 2, it.get_height() / 2, 20);

lvgl:
  displays:
    - my_display
  pages:
    - id: main_page
      widgets:
        - label:
            align: CENTER
            text: 'Hello World!'

This will display a white screen with black hello world in the center.
If you uncomment the lamda code, comment out the lvgl code. Cannot use both at the same time, compiler complains.

1 Like