adafruit_tlc59711
¶
CircuitPython module for the TLC59711 or TLC5971 16-bit 12 channel LED PWM driver. See examples/tlc59711_simpletest.py for a demo of the usage.
Author(s): Tony DiCola, Stefan Kruger
Implementation Notes¶
Hardware:
Adafruit 12-Channel 16-bit PWM LED Driver - SPI Interface - TLC59711 (Product ID: 1455) or TLC5971
Software and Dependencies:
- The API is mostly compatible to the DotStar / NeoPixel Libraries
and is therefore also compatible with FancyLED.
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- class adafruit_tlc59711.TLC59711(spi: SPI, *, pixel_count: int = 4)[source]¶
TLC5971 & TLC59711 16-bit 12 channel LED PWM driver.
The TLC59711 & TLC5971 chip is designed to drive 4 RGB LEDs with 16-bit PWM per Color. This Library can control 1..many chips. The class has an interface compatible with the FancyLED library - and the API is similar to the NeoPixel and DotStar Interfaces.
- Parameters:
- static calculate_BCData(*, Ioclmax: float = 18, IoutR: float = 17, IoutG: float = 15, IoutB: float = 9) Tuple[float, float, float] [source]¶
Calculate Global Brightness Control Values.
see: 8.5.1 Global Brightness Control (BC) Function (Sink Current Control) http://www.ti.com/lit/ds/symlink/tlc5971.pdf#page=19&zoom=200,0,697
Iout = Ioclmax * (BCX / 127) BCX = Iout / Ioclmax * 127
- Parameters:
- Return tuple:
(bcr, bcg, bcb)
- static calculate_Ioclmax(*, Riref: float = 2.48) float [source]¶
Calculate Maximum Constant Sink Current Value.
see: 8.4.1 Maximum Constant Sink Current Setting http://www.ti.com/lit/ds/symlink/tlc5971.pdf#page=18&zoom=160,0,524
Riref = (Viref / Ioclmax) * 41 Ioclmax = (41 / Riref) * Viref
- Parameters:
Riref (float) – resistor value (kΩ) (default=20)
- Return float:
Ioclmax (mA)
- static calculate_Riref(*, Ioclmax: float = 20) float [source]¶
Calculate Maximum Constant Sink Current Value.
see: 8.4.1 Maximum Constant Sink Current Setting http://www.ti.com/lit/ds/symlink/tlc5971.pdf#page=19&zoom=200,0,697
Riref = (Viref / Ioclmax) * 41
- Parameters:
Ioclmax (float) – target max output current (mA) (default=20)
- Return float:
Riref (kΩ)
- chip_set_BCData(chip_index: int, bcr: int = 127, bcg: int = 127, bcb: int = 127) None [source]¶
Set BC-Data.
- set_chipheader_bits_in_buffer(*, chip_index: int = 0, part_bit_offset: int = 0, field: Dict[str, int] | None = None, value: int = 0) None [source]¶
Set chip header bits in buffer.
- set_pixel(pixel_index: int, value: Tuple[float, float, float]) None [source]¶
Set the R, G, B values for the pixel.
this function hase some advanced error checking. it is much slower than the other provided ‘bare’ variants.. but therefor gives clues to what is going wrong.. ;-)
- set_pixel_16bit_color(pixel_index: int, color: Tuple[int, int, int]) None [source]¶
Set color for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done. its a little bit slower as
set_pixel_16bit_value
- set_pixel_16bit_value(pixel_index: int, value_r: int, value_g: int, value_b: int) None [source]¶
Set the value for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done.
- set_pixel_all(color: Tuple[float, float, float]) None [source]¶
Set the R, G, B values for all pixels.
- Parameters:
color (tuple) – 3-tuple of R, G, B; each int 0..65535 or float 0..1
- set_pixel_all_16bit_value(value_r: int, value_g: int, value_b: int) None [source]¶
Set the R, G, B values for all pixels.
fast. without error checking.
- set_pixel_float_color(pixel_index: int, color: Tuple[float, float, float]) None [source]¶
Set color for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done. it’s a little bit slower as
set_pixel_16bit_value
- Parameters:
pixel_index (int) – 0..(pixel_count)
color (tuple/float) – 3-tuple of R, G, B; 0..1
- set_pixel_float_value(pixel_index: int, value_r: int, value_g: int, value_b: int) None [source]¶
Set the value for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done.
- class adafruit_tlc59711.TLC59711AutoShow(spi: SPI, pixel_count: int = 4)[source]¶
TLC59711 16-bit 12 channel LED PWM driver with Auto-Show.
This chip is designed to drive 4 RGB LEDs with 16-bit PWM per Color. The class has an interface compatible with the FancyLED library. and with this is similar to the NeoPixel and DotStar Interfaces.
this TLC59711AutoShow is a subclass of TLC59711 that adds automatically sending changed data to the chips. this creates very slows responses on big changes. It is mainly useful if you only have a very small number of pixels.
- Parameters: