60 lines
1.9 KiB
ReStructuredText
60 lines
1.9 KiB
ReStructuredText
TCA9555 I/O Expander
|
|
====================
|
|
|
|
.. seo::
|
|
:description: Instructions for setting up TCA9555 digital port expanders in ESPHome.
|
|
|
|
The TCA9555 component allows you to use TCA955 I/O expanders
|
|
(`datasheet <https://www.ti.com/lit/ds/symlink/tca9555.pdf>`__) in ESPHome. It uses :ref:`I²C Bus <i2c>` for communication.
|
|
|
|
Once configured, you can use any of the 16 pins (TCA9555) as
|
|
pins for your projects. Within ESPHome they emulate a real internal GPIO pin
|
|
and can therefore be used with many of ESPHome's components such as the GPIO
|
|
binary sensor or GPIO switch.
|
|
|
|
Any option accepting a :ref:`Pin Schema <config-pin_schema>` can theoretically be used, but some more
|
|
complicated components that do communication through this I/O expander will
|
|
not work.
|
|
|
|
.. code-block:: yaml
|
|
|
|
# Example configuration entry
|
|
tca9555:
|
|
- id: 'TCA9555_hub'
|
|
|
|
# Individual outputs
|
|
switch:
|
|
- platform: gpio
|
|
name: "TCA9555 Pin #0"
|
|
pin:
|
|
tca9555: tca9555_hub
|
|
# Use pin number 0
|
|
number: 0
|
|
|
|
Configuration variables:
|
|
************************
|
|
|
|
- **id** (**Required**, :ref:`config-id`): The id to use for this TCA9555 component.
|
|
- **address** (*Optional*, int): The I²C address of the driver.
|
|
Defaults to ``0x21``.
|
|
|
|
Pin configuration variables:
|
|
****************************
|
|
|
|
- **TCA9555** (**Required**, :ref:`config-id`): The id of the TCA9555 component of the pin.
|
|
- **number** (**Required**, int): The pin number.
|
|
- **inverted** (*Optional*, boolean): If all read and written values
|
|
should be treated as inverted. Defaults to ``false``.
|
|
- **mode** (*Optional*, string): A pin mode to set for the pin at. One of ``INPUT`` or ``OUTPUT``.
|
|
|
|
|
|
See Also
|
|
--------
|
|
|
|
- :ref:`i2c`
|
|
- :doc:`switch/gpio`
|
|
- :doc:`binary_sensor/gpio`
|
|
- `TCA9555 Arduino Library <https://github.com/RobTillaart/TCA9555>`__ by `Rob Tillaart <https://github.com/RobTillaart>`__
|
|
- :apiref:`TCA9555/TCA9555.h`
|
|
- :ghedit:`Edit`
|