adafruit_aw9523
¶
Python library for AW9523 GPIO expander and LED driver
Author(s): ladyada
Implementation Notes¶
Hardware:
Adafruit AW9523 Breakout https://www.adafruit.com/product/4886
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class adafruit_aw9523.AW9523(i2c_bus: I2C, address: int = 88, reset: bool = True)¶
CircuitPython helper class for using the AW9523 GPIO expander
- get_pin(pin: int) DigitalInOut ¶
Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this AW9523 device. :param int pin: pin to use for digital IO, 0 to 15
- class adafruit_aw9523.DigitalInOut(pin_number: int, aw: AW9523)¶
Digital input/output of the AW9523. The interface is exactly the same as the digitalio.DigitalInOut class, however:
AW9523 family does not support pull-up or -down resistors
Exceptions will be thrown when attempting to set unsupported pull configurations.
Specify the pin number of the AW9523 0..15, and instance.
- property direction: bool¶
The direction of the pin, either True for an input or False for an output.
- switch_to_input(pull: bool | None = None, **kwargs) None ¶
Switch the pin state to a digital input with the provided starting pull-up resistor state (optional, no pull-up by default) and input polarity. Note that pull-down resistors are NOT supported!