mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
drivers/ioexpander/aw9523b: New driver for AW9523B i/o expander
This is an I2C driver for the Awinic AW9523B I/O expander. As well as the supporting usual digital I/Os, this device features the ability to drive LEDs directly, and can control the drive current to each LED individually. The driver was derived from the PCA9555 driver, provides all the standard interfaces of an i/o expander driver. It also features support for the special features of the AW9523B through pin direction IOEXPANDER_DIRECTION_OUT_LED and IOEXPANDER_OPTION_NONGENERIC with AW9523B_OPTION_* options. The driver has a number of configurable features including interrupt handling and a shadow register mode based on the PCA9555 driver, plus new LED/dimming support. Testing was done using an ESP32S3 host and I2C connection to the Adafruit AW9523 breakout board. Signed-off-by: Zik Saleeba <zik@zikzak.net>
This commit is contained in:
committed by
Alan C. Assis
parent
8fc63aaa10
commit
835c535e18
@@ -495,6 +495,63 @@ config SX1509_RETRY
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user