nuttx/drivers/ioexpander/Kconfig

683 lines
17 KiB
Text
Raw Normal View History

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "IO Expander/GPIO Support"
config IOEXPANDER
bool "Enable IO Expander Support"
default n
---help---
This directory holds implementations of IO expander drivers.
See include/nuttx/ioexpander/ioexpander.h for registration information.
if IOEXPANDER
config IOEXPANDER_RPMSG
bool "IO expander RPMSG server and client"
depends on RPMSG
default n
select IOEXPANDER_INT_ENABLE
---help---
This settings enable ioexpander RPMSG server and client.
if IOEXPANDER_RPMSG
config IOEXPANDER_RPMSG_INT_NCALLBACKS
int "number of ioexpander RPMSG interrupt callbacks"
default 32
---help---
This set the IO expander number in interrupt callbacks.
endif # IOEXPANDER_RPMSG
config IOEXPANDER_DUMMY
bool "Simulated I/O Expander"
default n
select IOEXPANDER_INT_ENABLE
---help---
Build a simple, simulated I/O Expander chip simulation (for testing
purposes only).
if IOEXPANDER_DUMMY
config IOEXPANDER_DUMMY_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
---help---
This is the maximum number of interrupt callbacks supported
config IOEXPANDER_DUMMY_INT_POLLDELAY
int "Interrupt poll delay (used)"
default 500000
---help---
This microsecond delay defines the polling rate for missed interrupts.
endif # IOEXPANDER_DUMMY
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-23 13:34:17 -03:00
config IOEXPANDER_CH422G
bool "CH422G I2C IO expander"
default n
depends on I2C
---help---
Enable support for the WCH CH422G IO Expander, which offers eight
bi-directional pins, IO0-IO7, and four open-drain outputs, OC0-OC3.
IO0-IO7 share a single direction control in the hardware. The
driver puts the group in output mode when at least one of them has
been configured as an output.
config IOEXPANDER_ICJX
bool "iC-JX SPI IO expander"
default n
depends on SPI
---help---
Enable support for the iC-JX expander from iC-Haus GmbH manufacturer.
SPI peripheral is used for the communication.
if IOEXPANDER_ICJX
config ICJX_MULTIPLE
bool "Multiple iC-JX Devices"
default n
---help---
Can be defined to support multiple iC-JX devices on board.
config ICJX_INT_ENABLE
bool "Enable iC-JX Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
endif # IOEXPANDER_ICJX
config IOEXPANDER_ISO1H812G
bool "ISO1H812G SPI IO expander"
default n
depends on SPI
---help---
Enable support for the ISO1H812G SPI IO expander.
if IOEXPANDER_ISO1H812G
config ISO1H812G_MULTIPLE
bool "Multiple ISO1H812G Devices"
default n
---help---
Can be defined to support multiple ISO1H812G devices on board.
endif # IOEXPANDER_ISO1H812G
config IOEXPANDER_ISO1I813T
bool "ISO1I813T SPI IO expander"
default n
depends on SPI
---help---
Enable support for the ISO1I813T SPI IO expander.
if IOEXPANDER_ISO1I813T
config ISO1I813T_MULTIPLE
bool "Multiple ISO1I813T Devices"
default n
---help---
Can be defined to support multiple ISO1I813T devices on board.
endif # IOEXPANDER_ISO1I813T
2023-09-02 09:59:20 -03:00
config IOEXPANDER_MCP23X08
bool "MCP23008/MCP23S08 I2C/SPI IO expander"
default n
depends on I2C
---help---
Enable support for the MCP23008/MCP23S08 IO Expander
if IOEXPANDER_MCP23X08
config MCP23X08_MULTIPLE
bool "Multiple MCP23x08 Devices"
default n
---help---
Can be defined to support multiple MCP23x08 devices on board.
config MCP23X08_INT_ENABLE
bool "Enable MCP23x08 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config MCP23X08_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on MCP23X08_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config MCP23X08_INT_POLL
bool "Enable interrupt poll"
default n
---help---
Enable polling for missed interrupts.
config MCP23X08_INT_POLLDELAY
int "Interrupt poll delay (used)"
default 500000
depends on MCP23X08_INT_POLL
---help---
This microsecond delay defines the polling rate for missed interrupts.
endif # IOEXPANDER_MCP23X08
config IOEXPANDER_MCP23X17
bool "MCP23017/MCP23S17 I2C/SPI IO expander"
default n
depends on I2C
---help---
Enable support for the MCP23017/MCP23S17 IO Expander
if IOEXPANDER_MCP23X17
config MCP23X17_MULTIPLE
bool "Multiple MCP23x17 Devices"
default n
---help---
Can be defined to support multiple MCP23x17 devices on board.
config MCP23X17_INT_ENABLE
bool "Enable MCP23x17 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config MCP23X17_INT_MIRROR
bool "Enable MCP23x17 Interrupt Mirror"
default n
select MCP23X17_INT_ENABLE
---help---
Enable driver interrupt mirror functionality
config MCP23X17_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on MCP23X17_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config MCP23X17_INT_POLL
bool "Enable interrupt poll"
default n
---help---
Enable polling for missed interrupts.
config MCP23X17_INT_POLLDELAY
int "Interrupt poll delay (used)"
default 500000
depends on MCP23X17_INT_POLL
---help---
This microsecond delay defines the polling rate for missed interrupts.
endif # IOEXPANDER_MCP23X17
config IOEXPANDER_PCA9555
bool "PCA9555 I2C IO expander"
default n
depends on I2C
---help---
Enable support for the NXP PCA9555 IO Expander
if IOEXPANDER_PCA9555
config PCA9555_MULTIPLE
bool "Multiple PCA9555 Devices"
default n
---help---
Can be defined to support multiple PCA9555 devices on board.
config PCA9555_INT_ENABLE
bool "Enable PCA9555 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config PCA9555_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on PCA9555_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config PCA9555_SHADOW_MODE
bool "Use Shadow Mode instead of Read-Modify-Write Operations"
default n
---help---
This setting enables a mode where the output and pin
configuration registers are held in RAM.
With this for example we do not need to read back the
output-register every time we want to change one pin.
We do instead change the bit in the internal register
and then just write this register to the IO-Expander.
This reduces bus traffic and eliminates the problem of
EMC-caused toggling of output pins.
config PCA9555_RETRY
bool "Retry to send commands and data at I2C communication errors"
default n
---help---
Retry to send commands and data if a I2C-communication
error occurs (eg. caused by EMC).
endif # IOEXPANDER_PCA9555
config IOEXPANDER_PCA9538
bool "PCA9538 I2C IO expander"
default n
depends on I2C
---help---
Enable support for the NXP PCA9538 IO Expander
if IOEXPANDER_PCA9538
config PCA9538_MULTIPLE
bool "Multiple PCA9538 Devices"
default n
---help---
Can be defined to support multiple PCA9538 devices on board.
config PCA9538_INT_ENABLE
bool "Enable PCA9538 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config PCA9538_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on PCA9538_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config PCA9538_SHADOW_MODE
bool "Use Shadow Mode instead of Read-Modify-Write Operations"
default n
---help---
This setting enables a mode where the output and pin
configuration registers are held in RAM.
With this for example we do not need to read back the
output-register every time we want to change one pin.
We do instead change the bit in the internal register
and then just write this register to the IO-Expander.
This reduces bus traffic and eliminates the problem of
EMC-caused toggling of output pins.
config PCA9538_RETRY
bool "Retry to send commands and data at I2C communication errors"
default n
---help---
Retry to send commands and data if a I2C-communication
error occurs (eg. caused by EMC).
endif # IOEXPANDER_PCA9538
config IOEXPANDER_PI4IOE5V6408
bool "PI4IOE5V6408 I2C IO expander"
default n
depends on I2C
---help---
Enable support for the Diodes Incorporated PI4IOE5V6408
8-bit I2C I/O expander.
if IOEXPANDER_PI4IOE5V6408
config PI4IOE5V6408_INT_ENABLE
bool "Enable PI4IOE5V6408 interrupt support"
default n
select IOEXPANDER_INT_ENABLE
select SCHED_HPWORK
---help---
Enable the PI4IOE5V6408 interrupt callback interface. The board
must provide hooks for the device's active-low interrupt pin.
config PI4IOE5V6408_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on PI4IOE5V6408_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported.
endif # IOEXPANDER_PI4IOE5V6408
config IOEXPANDER_PCA9557
bool "PCA9557 I2C IO expander"
default n
depends on I2C
---help---
Enable support for the NXP PCA9557 IO Expander
if IOEXPANDER_PCA9557
config PCA9557_SHADOW_MODE
bool "Use Shadow Mode instead of Read-Modify-Write Operations"
default n
---help---
This setting enables a mode where the output and pin
configuration registers are held in RAM.
With this for example we do not need to read back the
output-register every time we want to change one pin.
We do instead change the bit in the internal register
and then just write this register to the IO-Expander.
This reduces bus traffic and eliminates the problem of
EMC-caused toggling of output pins.
config PCA9557_RETRY
bool "Retry to send commands and data at I2C communication errors"
default n
---help---
Retry to send commands and data if a I2C-communication
error occurs (eg. caused by EMC).
endif # IOEXPANDER_PCA9557
config IOEXPANDER_TCA64XX
bool "TCA64XX I2C IO expander"
default n
depends on I2C && EXPERIMENTAL
---help---
Enable support for the TCA64XX IO Expander
if IOEXPANDER_TCA64XX
config TCA64XX_MULTIPLE
bool "Multiple TCA64XX Devices"
default n
---help---
Can be defined to support multiple TCA64XX devices on board.
config TCA64XX_INT_ENABLE
bool "Enable TCA64XX Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config TCA64XX_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on TCA64XX_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config TCA64XX_INT_POLL
bool "Enable interrupt poll"
default n
---help---
Enable polling for missed interrupts.
config TCA64XX_INT_POLLDELAY
int "Interrupt poll delay (used)"
default 500000
depends on TCA64XX_INT_POLL
---help---
This microsecond delay defines the polling rate for missed interrupts.
endif # IOEXPANDER_TCA64XX
config IOEXPANDER_PCF8574
bool "PCF8574 I2C IO expander"
default n
depends on I2C && EXPERIMENTAL
---help---
Enable support for the PCF8574 IO Expander
if IOEXPANDER_PCF8574
config PCF8574_MULTIPLE
bool "Multiple PCF8574 Devices"
default n
---help---
Can be defined to support multiple PCF8574 devices on board.
config PCF8574_INT_ENABLE
bool "Enable PCF8574 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config PCF8574_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on PCF8574_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config PCF8574_INT_POLL
bool "Enable interrupt poll"
default n
---help---
Enable polling for missed interrupts.
config PCF8574_INT_POLLDELAY
int "Interrupt poll delay (used)"
default 500000
depends on PCF8574_INT_POLL
---help---
This microsecond delay defines the polling rate for missed interrupts.
endif # IOEXPANDER_PCF8574
config IOEXPANDER_PCF8575
bool "PCF8575 I2C IO expander"
default n
depends on I2C
---help---
Enable support for 16 bit PCF8575 IO Expander. Software driver
interrupt is currently not supported therefore decated HW interrupt
pin should be used.
if IOEXPANDER_PCF8575
config PCF8575_MULTIPLE
bool "Multiple PCF8575 Devices"
default n
---help---
Can be defined to support multiple PCF8575 devices on board.
endif # IOEXPANDER_PCF8575
config IOEXPANDER_SX1509
bool "SX1509 I2C IO expander"
default n
depends on I2C
---help---
Enable support for the SX1509 IO Expander
if IOEXPANDER_SX1509
config SX1509_MULTIPLE
bool "Multiple SX1509 Devices"
default n
---help---
Can be defined to support multiple SX1509 devices on board.
config SX1509_INT_ENABLE
bool "Enable SX1509 Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config SX1509_LED_ENABLE
bool "Enable SX1509 LED Support"
default n
select IOEXPANDER_LED_ENABLE
---help---
Enable driver LED functionality
config SX1509_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on SX1509_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config SX1509_RETRY
bool "Retry to send commands and data at I2C communication errors"
default n
---help---
Retry to send commands and data if a I2C-communication
error occurs (eg. caused by EMC).
endif # IOEXPANDER_SX1509
config IOEXPANDER_AW9523B
bool "AW9523B I2C IO expander"
default n
depends on I2C
---help---
Enable support for the Awinic AW9523B IO Expander
if IOEXPANDER_AW9523B
config AW9523B_MULTIPLE
bool "Multiple AW9523B Devices"
default n
---help---
Can be defined to support multiple AW9523B devices on board.
config AW9523B_LED_ENABLE
bool "Enable AW9523B LED Support"
default y
---help---
Enable driver LED functionality
config AW9523B_INT_ENABLE
bool "Enable AW9523B Interrupt Support"
default n
select IOEXPANDER_INT_ENABLE
---help---
Enable driver interrupt functionality
config AW9523B_INT_NCALLBACKS
int "Max number of interrupt callbacks"
default 4
depends on AW9523B_INT_ENABLE
---help---
This is the maximum number of interrupt callbacks supported
config AW9523B_SHADOW_MODE
bool "Use Shadow Mode instead of Read-Modify-Write Operations"
default n
---help---
This setting enables a mode where the output and pin
configuration registers are held in RAM.
With this for example we do not need to read back the
output-register every time we want to change one pin.
We do instead change the bit in the internal register
and then just write this register to the IO-Expander.
This reduces bus traffic and eliminates the problem of
EMC-caused toggling of output pins.
config AW9523B_RETRY
bool "Retry to send commands and data at I2C communication errors"
default n
---help---
Retry to send commands and data if a I2C-communication
error occurs (eg. caused by EMC).
endif # IOEXPANDER_AW9523B
config IOEXPANDER_INT_ENABLE
bool
default n
---help---
This is the global INT supported flag for io expanders
config IOEXPANDER_LED_ENABLE
bool
default n
select USERLED
---help---
This is the global LED supported flag for io expanders
config IOEXPANDER_NPINS
int "Number of pins"
default 16
---help---
Maximum number of pins supported per driver.
config IOEXPANDER_MULTIPIN
bool "Support multi-pin access routines"
default n
---help---
This settings enable the definition of routines for
optimized simultaneous access to multiple pins.
endif # IOEXPANDER
config DEV_GPIO
bool "GPIO driver"
default n
---help---
Enables a simple GPIO input/output driver to support application-
space testing of hardware.
drivers/ioexpander: List the registered pins in /proc/gpio. The pins a board publishes are visible in /dev and each can be read through its own node, but surveying a whole board that way means an open and two ioctls per pin, and the signal and interrupt counters the upper half keeps are not reachable through any of them. Adds a list of registered pins and publishes it as /proc/gpio, behind GPIO_PROCFS: a quality of life view of the same kind as /proc/pinctrl and /proc/reset. Every common field comes from state the upper half already holds: the pin type, the value through go_read(), how many times the pin has been registered for signals, and how many interrupts it has taken. Lines carry the same key:value tokens in the same order, so the file is machine parseable. Lower halves may supply an optional go_describe() adding what only they can say, such as which pad carries the line or how its trigger is configured. It writes text into a caller supplied buffer and the upper half owns the line, so a lower half needs no procfs knowledge. A lower half without it is listed with the common tokens alone. The pin type index is bounded before use: it comes from the lower half and the name table cannot cover a type the enumeration does not define. A pin that cannot be read reports val:- rather than a zero that would read as a real level. procfs_register() appends without checking for duplicates, so the entry is claimed once for the lifetime of the system rather than whenever the list is empty; pins come and go at run time. The name is held in a buffer as long as the one gpio_pin_register() accepts, so a listing always names the same string as /dev. The pin type name table is declared without an explicit size so that the assertion beside it compares against the enumeration and can fail; sized as [GPIO_NPINTYPES] it would have been tautological. Documents the entry, its tokens, and how a lower half describes a pin. Off by default: with GPIO_PROCFS unset the list, the lock and the procfs entry are compiled out, and go_describe() is one more member at the end of a structure existing lower halves do not reach. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-02 18:54:39 +08:00
config GPIO_PROCFS
bool "GPIO procfs entry"
default n
depends on DEV_GPIO && FS_PROCFS && FS_PROCFS_REGISTER
---help---
Create /proc/gpio, listing every registered pin with its type,
its current value, and how many times it has been registered for
signals and taken an interrupt.
The pins are visible in /dev and each can be read through its own
node, but surveying a board that way means an open and two ioctls
per pin, and the counters are not reachable through any of them.
A lower half that supplies the optional go_describe method also
contributes whatever only it can say, such as which pad carries
the line.
config DEV_GPIO_NPOLLWAITERS
int "Max number of polls"
default 1
depends on DEV_GPIO
---help---
The maximum number of polls that can be registered with the GPIO
driver
config DEV_GPIO_NSIGNALS
int "Max number of signals"
default 1
depends on DEV_GPIO && !DISABLE_ALL_SIGNALS
---help---
The maximum number of signals that can be registered with the GPIO
driver
config GPIO_LOWER_HALF
bool "GPIO Lower Half"
default n
depends on DEV_GPIO && IOEXPANDER
---help---
Enable support for a lower half driver that provides GPIO driver
support for I/O expander pins.
if GPIO_LOWER_HALF
config GPIO_LOWER_HALF_INTTYPE
int "default interrupt type for GPIO_INTERRUPT_PIN pintype"
default 14
---help---
This is the default interrupt type (IOEXPANDER_VAL_BOTH) for
GPIO_INTERRUPT_PIN pintype in gplf driver register.
endif
endmenu # IO Expander/GPIO Support