[ch422g] Document additional pin support (#4261)

This commit is contained in:
Clyde Stubbs 2024-09-27 07:51:11 +10:00 committed by GitHub
parent 376621b5eb
commit d0c2ca35bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,22 +7,23 @@ CH422G I/O Expander
The CH422G component allows you to use the **CH422G** I/O expander in ESPHome.
It uses an :ref:`I²C Bus <i2c>` for communication.
It uses an :ref:`I²C Bus <i2c>` for communication. The I²C address is not configurable as the CH422G has a separate address for each internal register.
Once configured, you can use any of the 8 available GPIO pins for your projects.
Once configured, you can use any of the 12 available GPIO pins in many places a GPIO pin is required.
Within ESPHome they can be used in place of internal GPIO pins in many of ESPHome's components such as the GPIO Binary Sensor or GPIO Switch. They are not usable for PWM or other situations requiring an internal GPIO pin.
Pins 0-7 correspond to the bidirectional I/O (segment) pins on the CH422G. Pins 8-11 correspond to the OC (digit) output pins 0-3.
.. note::
This I/O Expander chip is used in the *Waveshare ESP32-S3-Touch-LCD-4.3*
This I/O Expander chip is used in several Waveshare ESP32-S3 display boards.
.. code-block:: yaml
# Example configuration entry
ch422g:
- id: ch422g_hub
address: 0x24
# Individual outputs
switch:
- platform: gpio
@ -39,10 +40,6 @@ Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this ``ch422g`` component.
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x24``.
- **restore_value** (*Optional*, boolean): Writes default flags on setup, overriding values from chips cache.
Defaults to ``false``.
@ -50,10 +47,12 @@ Pin configuration variables:
****************************
- **ch422g** (**Required**, :ref:`config-id`): The id of the ``ch422g`` component of the pin.
- **number** (**Required**, int): The pin number. Valid numbers are 0-7.
- **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 the pin at. One of ``INPUT`` or ``OUTPUT``.
- **number** (**Required**, int): The pin number. Valid numbers are 0-11.
- **inverted** (*Optional*, boolean): If the pin state should be inverted. Defaults to ``false``.
- **mode** (*Optional*, string): A pin mode to set the pin at. One of ``INPUT`` or ``OUTPUT``, or ``OUTPUT_OPEN_DRAIN``.
Open drain mode is supported only on pins 8-11. Input is supported only on pins 0-7.
See Also