cst816 Touch Screen Controller
The cst816 touchscreen platform allows using the touch screen controllers based on the CST816 series of chips with ESPHome.
The I²C is required to be set up in your configuration for this touchscreen to work.
This controller is used in the Lilygo T-Display S3 AMOLED. The component should work with CST716, CST816D, CST816S, CST816T, CST820, CST826, and CST836 controller chips.
Base Touchscreen Configuration
Section titled “Base Touchscreen Configuration”# Example configuration entrytouchscreen: platform: cst816 id: my_touchscreen interrupt_pin: GPIOXX reset_pin: GPIOXXConfiguration variables
Section titled “Configuration variables”-
id (Optional, ID): Manually set the ID of this touchscreen.
-
interrupt_pin (Optional, Pin Schema): The touch detection pin.
-
reset_pin (Optional, Pin Schema): The chip reset pin.
-
skip_probe (Optional, boolean): Skip reading the chip ID on startup. May be required for some variants (e.g. CST816S) that do not respond to i2c commands except after touches are registered. Defaults to false.
-
All other options from Touchscreen.
Binary Sensor
Section titled “Binary Sensor”In addition to touch areas on the screen configured through the Touchscreen component,
the cst816 can report touches on a dedicated button outside the display area. This can be utilised by configuring a touchscreen binary sensor
with the use_raw option and min/max values representing the sensor touch area.
Sample config for the T-Display S3 AMOLED
Section titled “Sample config for the T-Display S3 AMOLED”i2c: sda: GPIO3 scl: GPIO2
touchscreen: - platform: cst816 id: my_touchscreen interrupt_pin: GPIO21