Is there an ESPhome equivalent to this?
Have not found a solution for this, I did get the touch screen working.
I did find this: https://github.com/tylercrumpton/CircuitPython_GC9D01 but I am unsure how to adapt it to esphome
The ili9xxx driver should work for that, with a custom init sequence. There are two displays on the board, will need two display configs.
I have tried it using custom, and an the unit code from the circuit python driver. I just get lines on the screen ( I am only testing one at a time).
Post your yaml here and I’ll have a look.
I’d seen this device before, but I have absolutely no idea what it’s good for. I’ve tried to think of possible applications and failed
The original software used it like a keyboard/desk attachment with sound buttons, play/stop/skip buttons.
esphome:
name: s3-touchbar
friendly_name: tiny Touch-Bar
#platformio_options:
# board_build.f_flash: 80000000L
# board_build.partitions: default_16MB.csv
# board_build.arduino.memory_type: qio_opi
esp32:
board: esp32-s3-devkitc-1
# variant: esp32s3
framework:
type: esp-idf
flash_size: 16MB
# Enable logging
logger:
level: VERY_VERBOSE
api:
encryption:
key: "**"
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid2
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "S3 Fallback Hotspot"
password: "zQ9tuPKIfFMu"
time:
- platform: homeassistant
id: ha_time
font:
- file: "gfonts://Roboto"
id: roboto
size: 20
i2c:
- sda: 10
scl: 11
id: touchscreen_bus
spi:
mosi_pin: 18 # was 18
# miso_pin: 41
clk_pin: 17 #was 17
#ft6336 touchscreen
touchscreen:
- platform: ft63x6
interrupt_pin: GPIO12
reset_pin: GPIO9
id: my_touchscreen
display: main_display
i2c_id: touchscreen_bus
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
);
# Define a PWM output on the ESP32
output:
- platform: gpio
pin: GPIO48
id: backlight_pin
# Define a monochromatic, dimmable light for the backlight
light:
- platform: binary
output: backlight_pin
name: "Display Backlight"
id: back_light
restore_mode: ALWAYS_ON
display:
- platform: ili9xxx
model: custom
id: main_display
cs_pin: GPIO13
dc_pin: GPIO16
reset_pin: GPIO15
dimensions:
width: 160
height: 160
rotation: 0
lambda: |-
it.print(10, 10, id(roboto), "Hello World!");
init_sequence:
- [0xFE, 0x00] # Inter Register Enable1
- [0xEF, 0x00] # Inter Register Enable2
- [0x80, 0x01, 0xFF]
- [0x81, 0x01, 0xFF]
- [0x82, 0x01, 0xFF]
- [0x83, 0x01, 0xFF]
- [0x84, 0x01, 0xFF]
- [0x85, 0x01, 0xFF]
- [0x86, 0x01, 0xFF]
- [0x87, 0x01, 0xFF]
- [0x88, 0x01, 0xFF]
- [0x89, 0x01, 0xFF]
- [0x8A, 0x01, 0xFF]
- [0x8B, 0x01, 0xFF]
- [0x8C, 0x01, 0xFF]
- [0x8D, 0x01, 0xFF]
- [0x8E, 0x01, 0xFF]
- [0x8F, 0x01, 0xFF]
- [0x3A, 0x01, 0x05] # COLMOD: Pixel Format Set
- [0xEC, 0x01, 0x10] # Inversion
- [0x7E, 0x01, 0x7A]
- [0x74, 0x07, 0x02, 0x0E, 0x00, 0x00, 0x28, 0x00, 0x00]
- [0x98, 0x01, 0x3E]
- [0x99, 0x01, 0x3E]
- [0xB5, 0x03, 0x0E, 0x0E, 0x00] # Blanking Porch Control
- [0x60, 0x04, 0x38, 0x09, 0x6D, 0x67]
- [0x63, 0x05, 0x38, 0xAD, 0x6D, 0x67, 0x05]
- [0x64, 0x06, 0x38, 0x0B, 0x70, 0xAB, 0x6D, 0x67]
- [0x66, 0x06, 0x38, 0x0F, 0x70, 0xAF, 0x6D, 0x67]
- [0x6A, 0x02, 0x00, 0x00]
- [0x68, 0x07, 0x3B, 0x08, 0x04, 0x00, 0x04, 0x64, 0x67]
- [0x6C, 0x07, 0x22, 0x02, 0x22, 0x02, 0x22, 0x22, 0x50]
- [0x6E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, 0x13, 0x11, 0x0B, 0x09, 0x16, 0x15, 0x1D, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x1D, 0x15, 0x16, 0x0A, 0x0C, 0x12, 0x14, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00] # Long gamma sequence
- [0xA9, 0x01, 0x1B]
- [0xA8, 0x01, 0x6B]
- [0xA8, 0x01, 0x6D]
- [0xA7, 0x01, 0x40]
- [0xAD, 0x01, 0x47]
- [0xAF, 0x01, 0x73]
- [0xAF, 0x01, 0x73]
- [0xAC, 0x01, 0x44]
- [0xA3, 0x01, 0x6C]
- [0xCB, 0x01, 0x00]
- [0xCD, 0x01, 0x22]
- [0xC2, 0x01, 0x10]
- [0xC5, 0x01, 0x00]
- [0xC6, 0x01, 0x0E]
- [0xC7, 0x01, 0x1F]
- [0xC8, 0x01, 0x0E]
- [0xBF, 0x01, 0x00] # Dual-Single Gate Select
- [0xF9, 0x01, 0x20]
- [0x9B, 0x01, 0x3B]
- [0x93, 0x03, 0x33, 0x7F, 0x00]
- [0x70, 0x06, 0x0E, 0x0F, 0x03, 0x0E, 0x0F, 0x03]
- [0x71, 0x03, 0x0E, 0x16, 0x03]
- [0x91, 0x02, 0x0E, 0x09]
- [0xC3, 0x01, 0x2C] # Vreg1a Voltage Control
- [0xC4, 0x01, 0x1A] # Vreg1b Voltage Control
- [0xF0, 0x06, 0x51, 0x13, 0x0C, 0x06, 0x00, 0x2F] # SET_GAMMA1
- [0xF2, 0x06, 0x51, 0x13, 0x0C, 0x06, 0x00, 0x33] # SET_GAMMA3
- [0xF1, 0x06, 0x3C, 0x94, 0x4F, 0x33, 0x34, 0xCF] # SET_GAMMA2
- [0xF3, 0x06, 0x4D, 0x94, 0x4F, 0x33, 0x34, 0xCF] # SET_GAMMA4
- [0x36, 0x01, 0x00] # Memory Access Control
- [0x11, 0x80, 0xC8] # Sleep Out Mode
- [0x29, 0x80, 0x14] # Display ON
- [0x2C, 0x00] # Memory Write
The second byte in each of your sequences is a length, which is not required when specifying in YAML since the length is known.
The MADCTL and memory write instructions are sent automatically by the driver so should not be in the init sequence.
Try the following - if the display is not the right orientation or not the right color, update transform
and invert_colors
as required to make it right.
display:
- platform: ili9xxx
model: custom
id: main_display
cs_pin: GPIO13
dc_pin: GPIO16
reset_pin: GPIO15
invert_colors: false
color_order: rgb
transform:
mirror_x: false
mirror_y: false
swap_xy: false
dimensions:
width: 160
height: 160
show_test_card: true
init_sequence:
- [0xFE, 0x00] # Inter Register Enable1
- [0xEF, 0x00] # Inter Register Enable2
- [0x80, 0xFF]
- [0x81, 0xFF]
- [0x82, 0xFF]
- [0x83, 0xFF]
- [0x84, 0xFF]
- [0x85, 0xFF]
- [0x86, 0xFF]
- [0x87, 0xFF]
- [0x88, 0xFF]
- [0x89, 0xFF]
- [0x8A, 0xFF]
- [0x8B, 0xFF]
- [0x8C, 0xFF]
- [0x8D, 0xFF]
- [0x8E, 0xFF]
- [0x8F, 0xFF]
- [0x3A, 0x05] # COLMOD: Pixel Format Set
- [0xEC, 0x10] # Inversion
- [0x7E, 0x7A]
- [0x74, 0x02, 0x0E, 0x00, 0x00, 0x28, 0x00, 0x00]
- [0x98, 0x3E]
- [0x99, 0x3E]
- [0xB5, 0x0E, 0x0E, 0x00] # Blanking Porch Control
- [0x60, 0x38, 0x09, 0x6D, 0x67]
- [0x63, 0x38, 0xAD, 0x6D, 0x67, 0x05]
- [0x64, 0x38, 0x0B, 0x70, 0xAB, 0x6D, 0x67]
- [0x66, 0x38, 0x0F, 0x70, 0xAF, 0x6D, 0x67]
- [0x6A, 0x00, 0x00]
- [0x68, 0x3B, 0x08, 0x04, 0x00, 0x04, 0x64, 0x67]
- [0x6C, 0x22, 0x02, 0x22, 0x02, 0x22, 0x22, 0x50]
- [0x6E, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, 0x13, 0x11, 0x0B, 0x09, 0x16, 0x15, 0x1D, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x1D, 0x15, 0x16, 0x0A, 0x0C, 0x12, 0x14, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00] # Long gamma sequence
- [0xA9, 0x1B]
- [0xA8, 0x6B]
- [0xA8, 0x6D]
- [0xA7, 0x40]
- [0xAD, 0x47]
- [0xAF, 0x73]
- [0xAF, 0x73]
- [0xAC, 0x44]
- [0xA3, 0x6C]
- [0xCB, 0x00]
- [0xCD, 0x22]
- [0xC2, 0x10]
- [0xC5, 0x00]
- [0xC6, 0x0E]
- [0xC7, 0x1F]
- [0xC8, 0x0E]
- [0xBF, 0x00] # Dual-Single Gate Select
- [0xF9, 0x20]
- [0x9B, 0x3B]
- [0x93, 0x33, 0x7F, 0x00]
- [0x70, 0x0E, 0x0F, 0x03, 0x0E, 0x0F, 0x03]
- [0x71, 0x0E, 0x16, 0x03]
- [0x91, 0x0E, 0x09]
- [0xC3, 0x2C] # Vreg1a Voltage Control
- [0xC4, 0x1A] # Vreg1b Voltage Control
- [0xF0, 0x51, 0x13, 0x0C, 0x06, 0x00, 0x2F] # SET_GAMMA1
- [0xF2, 0x51, 0x13, 0x0C, 0x06, 0x00, 0x33] # SET_GAMMA3
- [0xF1, 0x3C, 0x94, 0x4F, 0x33, 0x34, 0xCF] # SET_GAMMA2
- [0xF3, 0x4D, 0x94, 0x4F, 0x33, 0x34, 0xCF] # SET_GAMMA4
- [0x11] # Sleep Out Mode
- [0x29] # Display ON
Yeah, I saw that. Still seems like a solution in search of a problem, but Lilygo are bit like that - they make a few boards that seem like they just did because it was a cool idea.