adafruit_pca9554
¶
CircuitPython library for Adafruit PCA9554 GPIO expanders
Author(s): Melissa LeBlanc-Williams
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_pca9554.DigitalInOut(pin_number: int, pcf: PCA9554)¶
Digital input/output of the PCA9554. The interface is exactly the same as the digitalio.DigitalInOut class, however:
PCA9554 does not support pull-down resistors
PCA9554 does not actually have a sourcing transistor, instead there’s an internal pullup
Exceptions will be thrown when attempting to set unsupported pull configurations.
Specify the pin number of the PCA9554 0..7, and instance.
- property direction: Direction¶
Setting a pin to OUTPUT drives it low, setting it to an INPUT enables the light pullup.
- property pull: digitalio.Pull.UP¶
Pull-up is always activated so always return the same thing
- switch_to_input(pull: Pull | None = None, **kwargs) None ¶
Switch the pin state to a digital input which is the same as setting the light pullup on. Note that true tri-state or pull-down resistors are NOT supported!
- class adafruit_pca9554.PCA9554(i2c_bus: I2C, address: int = PCA9554_I2CADDR_DEFAULT)¶
Interface library for PCA9554 GPIO expanders :param ~busio.I2C i2c_bus: The I2C bus the PCA9554 is connected to. :param int address: The I2C device address. Default is
0x3F
- get_pin(pin: int) DigitalInOut ¶
Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this PCA9554 device. :param int pin: pin to use for digital IO, 0 to 7