adafruit_tca8418
¶
CircuitPython / Python library for TCA8418 Keyboard Multiplexor
Author(s): ladyada
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloadss
# * 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_tca8418.DigitalInOut(pin_number: int, tca: TCA8418)¶
Digital input/output of the TCA8418. The interface is exactly the same as the digitalio.DigitalInOut class, however:
TCA8418 does not support pull-down resistors
Exceptions will be thrown when attempting to set unsupported pull configurations.
Author(s): Tony DiCola
- Parameters:
Specify the pin number of the TCA8418 0..17, and instance.
- property pull: Literal[digitalio.Pull.UP] | None¶
The pull setting for the digital IO, either
digitalio.Pull.UP
for pull up, orNone
for no pull up
- 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_tca8418.TCA8418(i2c_bus: I2C, address: int = 52)¶
Driver for the TCA8418 I2C Keyboard expander / multiplexor.
- Parameters:
i2c_bus (I2C) – The I2C bus the TCA8418 is connected to.
address – The I2C device address. Defaults to
0x34
- get_pin(pin: int) DigitalInOut ¶
Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this TCA8418 device.
- Parameters:
pin (int) – Pin to use for digital IO, 0 to 17 inclusive; you can use the pins like TCA8418.R3 or TCA8418.C4 for convenience
- class adafruit_tca8418.TCA8418_register(tca: TCA8418, base_addr: int, invert_value: bool = False, read_only: bool = False, initial_value: int | None = None)¶
A class for interacting with the TCA8418 registers
- Parameters:
tca (TCA8418) – The associated TCA8418 object
base_addr (int) – The base address for this register
invert_value (bool) – Whether the value given should be interpreted as inverted (True -> False), default is False (inputs are as-is, not inverted)
read_only (bool) – Whether the register is read-only or read/write, default is False (register is read/write)
initial_value (int|None) – An initial value to provide to the register, default is
None
(no default is provided)