nuttx/drivers/ioexpander
Alan Carvalho de Assis 8342c51d59 ioexpander/ch422g: add a driver for the WCH CH422G I/O
The CH422G offers eight bi-directional pins, IO0-IO7, and four open-drain
outputs, OC0-OC3.  It appears on boards that have run out of usable GPIOs
once a parallel RGB panel has taken its share, the Waveshare
ESP32-S3-Touch-LCD-7 among them, where it holds the panel and touch
controller in and out of reset and switches the backlight.

Two things about the device do not fit the shape a register-per-address
I2C driver usually takes, and both are handled here rather than pushed on
to board logic:

  - A register is selected by the I2C address the transfer is addressed
    to, not by a register address written ahead of the data.  Each access
    carries a single byte to one of four addresses.
  - None of the write-only registers can be read back, so the driver
    keeps a shadow copy of each and updates it in step with the device.

IO0-IO7 have no individual direction control; one bit of the system
parameter register drives the whole group.  The driver records the
direction asked of each pin and puts the group in output mode once at
least one of them is an output, which is what a board that drives some of
the pins would expect.  Reading a pin of a group held in output mode
reports the value last written, because the hardware cannot report the
level, and that is documented rather than hidden.

The four open-drain outputs are presented as pins 8-11 of the same
ioexpander_dev_s so that one instance covers the chip, which means
CONFIG_IOEXPANDER_NPINS must be at least 12.

Builds clean with no new warnings on esp32s3-touch-lcd7:usbnsh and passes
nxstyle.

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
..
aw9523b.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
aw9523b.h drivers/ioexpander/aw9523b: New driver for AW9523B i/o expander 2025-08-29 09:10:50 -03:00
ch422g.c ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
CMakeLists.txt ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
gpio.c drivers/ioexpander: List the registered pins in /proc/gpio. 2026-08-19 00:46:56 +08:00
gpio_lower_half.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
icjx.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
icjx.h drivers/ioexpander/icjx: add option to set filters during initialization 2025-04-24 10:05:56 -03:00
ioe_dummy.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ioe_rpmsg.c sim/configs/rpserver/rpproxy_virtio: Change the sim 32bit to 64bit compilation 2024-11-15 14:01:11 +08:00
iso1h812g.c gpio: Fix GPIO expanders warnings 2026-08-01 11:15:11 +08:00
iso1h812g.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
iso1i813t.c gpio: Fix GPIO expanders warnings 2026-08-01 11:15:11 +08:00
iso1i813t.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
Kconfig ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
Make.defs ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
mcp23x08.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mcp23x08.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
mcp23x17.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mcp23x17.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pca9538.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pca9538.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pca9555.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pca9555.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pca9557.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pca9557.h drivers/ioexpander: Add support for PCA9557 2025-03-25 15:46:09 -03:00
pcf8574.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pcf8574.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pcf8575.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pcf8575.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pi4ioe5v6408.c drives/ioexpander: add support to PI4IOE IO Expander 2026-07-28 10:18:01 +08:00
skeleton.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
sx1509.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
sx1509.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
tca64xx.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
tca64xx.h drivers/tca64xx: Add support for PCAL6416 2025-08-26 09:46:09 +08:00