Class that stores state and functions for interacting with the AW9523 I2C GPIO expander.
More...
#include <Adafruit_AW9523.h>
|
Adafruit_I2CDevice * | i2c_dev = NULL |
| Pointer to I2C bus interface.
|
|
Class that stores state and functions for interacting with the AW9523 I2C GPIO expander.
◆ begin()
Sets up the hardware and initializes I2C.
- Parameters
-
addr | The I2C address for the expander |
wire | The Wire object to be used for I2C connections. |
- Returns
- True if initialization was successful, otherwise false.
◆ reset()
bool Adafruit_AW9523::reset |
( |
void |
| ) |
|
Perform a soft reset over I2C.
- Returns
- True I2C reset command was acknowledged
◆ openDrainPort0()
bool Adafruit_AW9523::openDrainPort0 |
( |
bool |
od | ) |
|
Turns on/off open drain output for ALL port 0 pins (GPIO 0-7)
- Parameters
-
od | True to enable open drain, False for push-pull |
- Returns
- True if I2C write command was acknowledged, otherwise false
◆ outputGPIO()
bool Adafruit_AW9523::outputGPIO |
( |
uint16_t |
pins | ) |
|
Sets output value (1 == high) for all 16 GPIO.
- Parameters
-
pins | 16-bits of binary output settings |
- Returns
- True I2C write command was acknowledged
◆ inputGPIO()
uint16_t Adafruit_AW9523::inputGPIO |
( |
void |
| ) |
|
Reads input value (1 == high) for all 16 GPIO.
- Returns
- 16-bits of binary input (0 == low & 1 == high)
◆ configureDirection()
bool Adafruit_AW9523::configureDirection |
( |
uint16_t |
pins | ) |
|
Sets direction for all 16 GPIO, 1 == output, 0 == input.
- Parameters
-
pins | 16-bits of pins we want to set direction |
- Returns
- True I2C write command was acknowledged
◆ configureLEDMode()
bool Adafruit_AW9523::configureLEDMode |
( |
uint16_t |
pins | ) |
|
Sets constant-current mode for all 16 GPIO.
- Parameters
-
pins | 16-bits of pins we want to set CC mode (1 == enabled) |
- Returns
- True I2C write command was acknowledged
◆ interruptEnableGPIO()
bool Adafruit_AW9523::interruptEnableGPIO |
( |
uint16_t |
pins | ) |
|
Sets interrupt watch for all 16 GPIO, 1 == enabled.
- Parameters
-
pins | 16-bits of pins we may want INT enabled |
- Returns
- True I2C write command was acknowledged
◆ pinMode()
void Adafruit_AW9523::pinMode |
( |
uint8_t |
pin, |
|
|
uint8_t |
mode |
|
) |
| |
Sets pin mode / direction for one pin.
- Parameters
-
pin | GPIO to set, from 0 to 15 inclusive |
mode | Can be INPUT, OUTPUT for GPIO digital, or AW9523_LED_MODE for constant current LED drive |
◆ digitalWrite()
void Adafruit_AW9523::digitalWrite |
( |
uint8_t |
pin, |
|
|
bool |
val |
|
) |
| |
Sets digital output for one pin.
- Parameters
-
pin | GPIO to set, from 0 to 15 inclusive |
val | True for high value, False for low value |
◆ digitalRead()
bool Adafruit_AW9523::digitalRead |
( |
uint8_t |
pin | ) |
|
Reads digital input for one pin.
- Parameters
-
pin | GPIO to set, from 0 to 15 inclusive |
- Returns
- True for high value read, False for low value read
◆ analogWrite()
void Adafruit_AW9523::analogWrite |
( |
uint8_t |
pin, |
|
|
uint8_t |
val |
|
) |
| |
Sets constant-current setting for one pin.
- Parameters
-
pin | GPIO to set, from 0 to 15 inclusive |
val | Ratio to set, from 0 (off) to 255 (max current) |
◆ enableInterrupt()
void Adafruit_AW9523::enableInterrupt |
( |
uint8_t |
pin, |
|
|
bool |
en |
|
) |
| |
Sets interrupt enable for one pin.
- Parameters
-
pin | GPIO to set, from 0 to 15 inclusive |
en | True to enable Interrupt detect, False for ignore |
The documentation for this class was generated from the following files: