API Reference
pca9955b
CircuitPython helper library for the NXP 16-Channel I�C-Bus Constant-Current LED Driver
Author(s): Noel Anderson
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- class pca9955b.pca9955b.LedChannel(device: PCA9955, index: int)
A class representing a single PCA9955 channel.
- E_NONE = 0
Constant for no error.
- E_OPEN_CIRCUIT = 2
Constant for open circuit error.
- E_SHORT_CIRCUIT = 1
Constant for short circuit error.
- OFF = 0
Constant for channel off state.
- ON = 1
Constant for channel full on state.
- PWM = 2
Constant for channel PWM state.
- PWM_GRP = 3
Constant for channel PWM group state.
- class pca9955b.pca9955b.LedChannels(device: PCA9955)
Lazily creates and caches channel objects as needed. Treat it like a sequence.
- Parameters:
device (PCA9955) – The PCA9955 device object
- class pca9955b.pca9955b.PCA9955(i2c: I2C, address: int = _PCA9955B_DEFAULT_I2C_ADDR, oe_pin: Pin | None = None, reset_pin: Pin | None = None)
A class representing a PCA9955 device.
This class provides an interface to control the PCA9955 LED driver via I2C. It allows for setting various properties such as brightness, gain, and different modes of operation. It also provides methods to read and write to the device’s registers.
- channels
An collection of LedChannels objects.
- Type:
- subaddresses
A collection of I2CSubAddress objects.
- Type:
I2CSubAddresses
Initialize the PCA9955B device at
addressoni2c_busIf oe and/or reset pins are connected to GPIO outputs, as per the nxp application note then these can be passed in asoe_pinandreset_pinrespectively and will be used by the reset and output_enable properties.- Parameters:
i2c (I2C) – The I2C bus the device is connected to.
address (int, optional) – The I2C address of the device. Default is _PCA9955B_DEFAULT_I2C_ADDR (0x3F).
oe_pin (Optional[microcontroller.Pin], optional) – GPIO pin connected to the Output Enable (OE) pin of the device.
reset_pin (Optional[microcontroller.Pin], optional) – GPIO pin connected to the Reset pin of the device. Default is None.
- Returns:
None
- property errors_exist: bool
True indicates errors exist. Use LedChannel.error to determine which channel(s) has an error.
- property exponential_graduation: bool
1 = exponential adjustment for gradation control, 0 = linear adjustment for gradation control (default)
- property output_delay: int
Output delay offset. Turn-on delay between LED outputs. This helps to reduce peak current for the VDD supply and reduces EMI.
- class pca9955b.pca9955b.SubAddress(device: PCA9955, index: int)
A single PCA9955 I2C Sub Address.
- ALLCALLADR = 3
Constant for ALLCALLADR.
- SUBADR1 = 0
Constant for SUBADR1.
- SUBADR2 = 1
Constant for SUBADR2.
- SUBADR3 = 2
Constant for SUBADR3.
- class pca9955b.pca9955b.SubAddresses(device: PCA9955)
Lazily creates and caches I2CSubAddress objects as needed. Treat it like a sequence.
- Parameters:
device (PCA9955) – The PCA9955 device object
pca9955b_groups
CircuitPython helper library for Group Control of the NXP 16-Channel I�C-Bus Constant-Current LED Driver
Author(s): Noel Anderson
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- class pca9955b.pca9955b_groups.Group(device: <module 'pca9955b.pca9955b' from '/home/docs/checkouts/readthedocs.org/user_builds/circuitpython-pca9955b/checkouts/stable/pca9955b/pca9955b.py'>, index: int)
A single PCA9955 Graduation Group.
- property hold_off_time: int
Hold On time - 0 (0s), 1 (0.25s), 2 (0.5s), 3 (0.75s) , 4 (1s), 5 (2s), 6 (4s), 7 (6s).
- class pca9955b.pca9955b_groups.Groups(device: <module 'pca9955b.pca9955b' from '/home/docs/checkouts/readthedocs.org/user_builds/circuitpython-pca9955b/checkouts/stable/pca9955b/pca9955b.py'>)
Lazily creates and caches Group objects as needed. Treat it like a sequence.
- Parameters:
device (PCA9955) – The PCA9955 device object