2024-03-11 06:35:08 +01:00
|
|
|
cst816 Touch Screen Controller
|
|
|
|
===============================
|
|
|
|
|
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up cst816 touch screen controller with ESPHome
|
|
|
|
:image: cst816.jpg
|
|
|
|
:keywords: CST816, T-DISPLAY, AMOLED
|
|
|
|
|
|
|
|
The ``cst816`` touchscreen platform allows using the touch screen controllers based on the CST816 series of chips with ESPHome.
|
|
|
|
The :ref:`I²C <i2c>` is required to be set up in your configuration for this touchscreen to work.
|
|
|
|
|
2024-05-13 12:21:38 +02:00
|
|
|
This controller is used in the Lilygo T-Display S3 AMOLED. The component should work with CST816T, CST816S, CST820, CST826 and CST716
|
2024-03-11 06:35:08 +01:00
|
|
|
controller chips.
|
|
|
|
|
|
|
|
|
|
|
|
.. figure:: images/cst816.jpg
|
|
|
|
:align: center
|
|
|
|
:width: 50.0%
|
|
|
|
|
|
|
|
cst816t touchscreen on T-Display S3 AMOLED
|
|
|
|
|
|
|
|
Base Touchscreen Configuration
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
touchscreen:
|
|
|
|
platform: cst816
|
|
|
|
id: my_touchscreen
|
2024-05-07 07:40:12 +02:00
|
|
|
interrupt_pin: GPIOXX
|
|
|
|
reset_pin: GPIOXX
|
2024-03-11 06:35:08 +01:00
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
************************
|
|
|
|
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually set the ID of this touchscreen.
|
|
|
|
- **interrupt_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The touch detection pin.
|
2024-05-15 02:56:30 +02:00
|
|
|
- **reset_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The chip reset pin.
|
2024-03-11 06:35:08 +01:00
|
|
|
|
|
|
|
- All other options from :ref:`Touchscreen <config-touchscreen>`.
|
|
|
|
|
|
|
|
Binary Sensor
|
|
|
|
-------------
|
|
|
|
|
|
|
|
In addition to touch areas on the screen configured through the :ref:`Touchscreen <config-touchscreen>` component,
|
|
|
|
the cst816 will report touches on a button outside the screen area.
|
|
|
|
A binary sensor can be configured to react to touching this button.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
binary_sensor:
|
|
|
|
- platform: cst816
|
|
|
|
name: "Home"
|
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
************************
|
|
|
|
|
|
|
|
- **cst816_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the touchscreen.
|
|
|
|
|
|
|
|
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
|
|
|
|
|
2024-05-15 02:56:30 +02:00
|
|
|
Sample config for the T-Display S3 AMOLED
|
|
|
|
*****************************************
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
i2c:
|
|
|
|
sda: GPIO3
|
|
|
|
scl: GPIO2
|
|
|
|
|
|
|
|
touchscreen:
|
|
|
|
- platform: cst816
|
|
|
|
id: my_touchscreen
|
|
|
|
interrupt_pin: GPIO21
|
2024-03-11 06:35:08 +01:00
|
|
|
|
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
|
|
|
- :apiref:`cst816/touchscreen/cst816_touchscreen.h`
|
|
|
|
- :ghedit:`Edit`
|