nuttx/Documentation/components/drivers/special
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
..
image docs/syslog: add syslog configuration options documentation 2026-02-27 08:09:31 -03:00
mtd Documentation: add pages for supported MTD devices 2025-12-31 11:37:49 +08:00
net net/vlan: add some macro for vlan 2025-12-27 11:36:39 +08:00
pci drivers/net: add IGB network card support 2025-07-08 10:02:15 +02:00
power drivers/power: Describe the regulators through procfs. 2026-08-18 17:28:02 +08:00
rpmsg Documentation/rpmsg: add rpmsg dump documentation 2026-01-30 07:50:11 -03:00
rptun Documents/rptun: add the new rptun framework documents 2026-01-19 14:18:27 +08:00
sensors sensors/tmp112: Add a uORB interface. 2026-08-18 10:35:28 -03:00
vhost Documentation/vhost: add Vhost framework documentation 2026-02-04 02:32:02 +08:00
virtio Documentation/virtio: add VirtIO framework documentation 2026-01-28 13:09:19 -03:00
wireless Documentation: Add documentation for RN2XX3 driver 2025-03-06 06:10:19 -03:00
audio.rst docs/audio_tone: Add documentation about the audio tone driver 2026-07-13 09:42:26 +08:00
clk.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
devfreq.rst sim/thermal: Exercise the devfreq cooling path. 2026-08-18 09:46:47 -03:00
devicetree.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
devmem.rst driver/mem:add Mem Driver. 2024-08-28 13:59:04 +08:00
dma.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
framebuffer.rst
i2c.rst Documentation: Add I2C bit-bang IO expander driver documentation 2026-01-01 17:08:47 +08:00
i3c.rst drivers/i3c: update i3c driver documentation 2024-09-24 23:36:50 +08:00
index.rst Documentation: add devfreq framework documentation 2026-08-08 15:23:54 -03:00
ioexpander.rst ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
lcd.rst !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
mmcsd.rst drivers/mmcsd: Switch SD cards into high speed. 2026-08-18 09:38:45 +08:00
pinctrl.rst drivers/pinctrl: Add pad read-back and a procfs entry. 2026-08-21 20:04:59 +08:00
pipes.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
ptp.rst Documentation: Add PTP clock driver framework documentation 2025-12-30 10:22:09 -03:00
regmap.rst
reset.rst drivers/reset: Add line read-back and a procfs entry. 2026-08-21 20:07:01 +08:00
rwbuffer.rst
sdio.rst drivers/mmcsd: Switch SD cards into high speed. 2026-08-18 09:38:45 +08:00
segger.rst style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
sensors.rst sensors/tmp112: Add a uORB interface. 2026-08-18 10:35:28 -03:00
spi.rst
syslog.rst include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
sysview.png Documentation: add segger sysview heap trace example 2024-10-07 17:34:59 +08:00
usbdev.rst !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
usbhost.rst !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
usbmisc.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
usbmonitor.rst style: fix typos 2025-04-30 13:45:46 +08:00
usbmonitor_wireshark_linux_example_adb.pcapng Documentation: Add usage of Wireshark for USB monitor 2025-01-22 15:17:38 +08:00
usbmonitor_wireshark_linux_example_adb.png Documentation: Add usage of Wireshark for USB monitor 2025-01-22 15:17:38 +08:00
usrsock.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
uvc.rst drivers/usbdev: add UVC gadget class driver 2026-03-29 12:35:22 -03:00
video.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
wireless.rst Documentation: Add documentation for RN2XX3 driver 2025-03-06 06:10:19 -03:00