Lilygo T-RGB 2.1 Round

Lilygo T-RGB 2.1 Round - image0.webp
Lilygo T-RGB 2.1 Round - LILYGO-T-RGB.webp

Overview

The Lilygo T-RGB 2.1 Round is a unique circular display module featuring:

  • 2.1" round LCD display with RGB interface
  • Capacitive touchscreen
  • ESP32-S3 microcontroller
  • SD card support
  • I2C interface

Hardware Features

  • Display: 2.1" round LCD with RGB interface (480x480 pixels)
  • Touch: Capacitive touchscreen with interrupt support
  • Processor: ESP32-S3 with WiFi and Bluetooth LE
  • Storage: MicroSD card slot
  • Interfaces: I2C, RGB LCD
  • Power: USB Type-C

GPIO Configuration

The board uses the following GPIO pins:

Display Interface

  • Red Channel: GPIO02-07 (RED1-5)
  • Green Channel: GPIO09-14 (GREEN0-5)
  • Blue Channel: GPIO15-18, GPIO21 (BLUE1-5)
  • Control: GPIO41 (VSYNC), GPIO42 (PCLK), GPIO45 (DE), GPIO47 (HSYNC)
  • Backlight: GPIO46

Other Interfaces

  • I2C: GPIO08 (SDA), GPIO48 (SCL)
  • Touch: GPIO01 (INT)
  • SD Card: GPIO38 (DO), GPIO39 (CLK), GPIO40 (CMD)
  • Boot: GPIO00

GPIO Pin Reference

GPIO PinFunction
System
GPIO00BOOT
Display
GPIO02LCD_RED1
GPIO03LCD_RED2
GPIO05LCD_RED3
GPIO06LCD_RED4
GPIO07LCD_RED5
GPIO09LCD_GREEN0
GPIO10LCD_GREEN1
GPIO11LCD_GREEN2
GPIO12LCD_GREEN3
GPIO13LCD_GREEN4
GPIO14LCD_GREEN5
GPIO15LCD_BLUE1
GPIO16LCD_BLUE2
GPIO17LCD_BLUE3
GPIO18LCD_BLUE4
GPIO21LCD_BLUE5
GPIO41VSYNC
GPIO42PCLK
GPIO45DE
GPIO46LCD Backlight
GPIO47HSYNC
Touchscreen
GPIO01TP_INT
I2C
GPIO08I2C_SDA
GPIO48I2C_SCL
Storage
GPIO38SD_DO
GPIO39SD_CLK
GPIO40SD_CMD

Sample YAML configuration


#-------------------------------------------
substitutions:
  name: lilygo-t-rgb-2-1
  friendly_name: Lilygo T-RGB 2.1in

esphome:
  name: "${name}"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
      CONFIG_SPIRAM_RODATA: y

logger:


psram:
  mode: octal
  speed: 80MHz

i2c:
  - id: tp_i2c
    sda: 8
    scl: 48
    scan: true
    frequency: 400kHz

xl9535:
  id: expander

power_supply:
  - id: pwr_en
    pin:
      xl9535: expander
      number: 2
    enable_on_boot: true
  - id: lcd_bl
    pin:
      number: 46
    enable_on_boot: true

touchscreen:
  - platform: cst816
    id: my_touchscreen
    reset_pin:
      xl9535: expander
      number: 1
    update_interval: 16ms
    skip_probe: true
    interrupt_pin: 1
    on_touch:
    - lambda: |-
          ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
              touch.x,
              touch.y,
              touch.x_raw,
              touch.y_raw
              );


spi:
  - id: lcd_spi
    clk_pin:
      xl9535: expander
      number: 5
    mosi_pin:
      xl9535: expander
      number: 4
    interface: software
    
display:
  - platform: st7701s
    id: st7701s_disp
    update_interval: never
    auto_clear_enabled: false
    data_rate: 75kHz
    spi_mode: MODE3
    color_order: BGR
    invert_colors: true
    dimensions:
      width: 480
      height: 480
    transform:
      mirror_x: false
      mirror_y: false
    cs_pin:
      xl9535: expander
      number: 3
    de_pin: GPIO45
    hsync_pin: GPIO47
    vsync_pin: GPIO41
    pclk_pin: GPIO42
    pclk_frequency: 12MHz
    pclk_inverted: false
#
    data_pins:
      red:
        - GPIO2       #r1
        - GPIO3       #r2
        - GPIO5       #r3
        - GPIO6       #r4
        - GPIO7       #r5
      green:
        - GPIO9       #g0
        - GPIO10       #g1
        - GPIO11       #g2
        - GPIO12       #g3
        - GPIO13       #g4
        - GPIO14     #g5
      blue:
        - GPIO15       #b1
        - GPIO16       #b2
        - GPIO17       #b3
        - GPIO18       #b4
        - GPIO21       #b5`

lvgl: