esphome-docs/components/touchscreen/xpt2046.rst

85 lines
3.0 KiB
ReStructuredText
Raw Normal View History

XPT2046 Touch Screen Controller (Updated version)
==================================================
.. seo::
:description: Instructions for setting up XPT2046 touch screen controller with ESPHome
:image: xpt2046.jpg
:keywords: XPT2046
.. _xpt2046-component:
The ``xpt2046`` touchscreen platform allows using the touch screen controllers
based on the XPT2046 chip
(`datasheet <https://datasheetspdf.com/pdf-file/746665/XPTEK/XPT2046/1>`__,
`AZ-Delivery`_) with ESPHome. Many cheap LCD displays contain this controller.
The :ref:`SPI <spi>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/xpt2046-full.jpg
:align: center
:width: 50.0%
XPT2046 Touch Screen Controller
.. _AZ-Delivery: https://www.az-delivery.de/en/products/2-4-tft-lcd-touch-display
.. code-block:: yaml
# Example configuration entry
touchscreen:
platform: xpt2046
id: my_touchscreen
cs_pin: GPIOXX
interrupt_pin: GPIOXX
update_interval: 50ms
threshold: 400
Update the touchscreen document's (#3487) * Update Touchscreen documentation move the XPT2046 component to the right section. * search what is wrong * fix typo * restore last fix * Update index.rst * try to resolve the issue by removing the ref-link * Update index.rst * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * opdate xpt2046 doc for new Touchscreen component. * add documentation for the ft63x6 touchscreen * add new-line * Move image around * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update touchscreen documentation needed to be updated * fix reported issue * fix reported issue * fix reported ref issue --------- Co-authored-by: Keith Burzinski <kbx81x@gmail.com> Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-01-03 17:01:11 +01:00
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
Configuration variables:
------------------------
The configuration is made up of two parts: The touch screen component, and optional individual binary sensors.
Base Configuration:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor.
- **cs_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The chip select pin.
Often marked ``T_CS`` on the board.
- **interrupt_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The touch detection pin.
Often marked ``T_IRQ`` on the board. If not specified the component will use polling
via SPI. This key is renamed from **irq_pin**
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
2023-01-24 18:56:46 +01:00
sensor. If ``interrupt_pin`` is specified the touch will be detected nearly instantaneously and this setting
will be used only for the release detection. Defaults to ``50ms``.
- **threshold** (*Optional*, int): The value to detect the touch or release. Defaults to ``400``.
2024-05-15 02:56:30 +02:00
- **calibration_x_min** (*Deprecated*): This value is moved to the ``calibration`` values
2024-05-15 02:56:30 +02:00
- **calibration_x_max** (*Deprecated*): This value is moved to the ``calibration`` values.
2024-05-15 02:56:30 +02:00
- **calibration_y_min** (*Deprecated*): This value is moved to the ``calibration`` values.
2024-05-15 02:56:30 +02:00
- **calibration_y_max** (*Deprecated*): This value is moved to the ``calibration`` values.
2024-05-15 02:56:30 +02:00
- **swap_x_y** (*Deprecated*): This value is moved to the ``transform`` values as ``swap_xy`` see :ref:`config-touchscreen`.
2024-05-15 02:56:30 +02:00
- **report_interval** (*Deprecated*): This interval is removed in favor of the ``update_interval``.
Update the touchscreen document's (#3487) * Update Touchscreen documentation move the XPT2046 component to the right section. * search what is wrong * fix typo * restore last fix * Update index.rst * try to resolve the issue by removing the ref-link * Update index.rst * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * Update components/touchscreen/index.rst Co-authored-by: Keith Burzinski <kbx81x@gmail.com> * opdate xpt2046 doc for new Touchscreen component. * add documentation for the ft63x6 touchscreen * add new-line * Move image around * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update components/touchscreen/index.rst * Update touchscreen documentation needed to be updated * fix reported issue * fix reported issue * fix reported ref issue --------- Co-authored-by: Keith Burzinski <kbx81x@gmail.com> Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-01-03 17:01:11 +01:00
- All other options from :ref:`config-touchscreen`.
See Also
--------
- :ref:`Binary Sensor Filters <binary_sensor-filters>`
- :apiref:`xpt2046/xpt2046.h`
- `XPT2046 Library <https://platformio.org/lib/show/542/XPT2046_Touchscreen>`__ by `Paul Stoffregen <https://github.com/PaulStoffregen>`__
- :ghedit:`Edit`