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, *, pixel_count=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=18, IoutR=17, IoutG=15, IoutB=9)[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=2.48)[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 tuple: Ioclmax (mA)
-
static
calculate_Riref
(*, Ioclmax=20)[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 tuple: Riref (kΩ)
-
set_chipheader_bits_in_buffer
(*, chip_index=0, part_bit_offset=0, field=None, value=0)[source]¶ Set chip header bits in buffer.
-
set_pixel
(pixel_index, value)[source]¶ Set the R, G, B values for the pixel.
this funciton hase some advanced error checking. it is much slower than the other provided ‘bare’ variants.. but therefor gives clues to what is going wrong.. ;-)
Parameters:
-
set_pixel_16bit_color
(pixel_index, color)[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
Parameters:
-
set_pixel_16bit_value
(pixel_index, value_r, value_g, value_b)[source]¶ Set the value for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done.
Parameters:
-
set_pixel_all
(color)[source]¶ Set the R, G, B values for all pixels.
:param tuple 3-tuple of R, G, B; each int 0..65535 or float 0..1
-
set_pixel_all_16bit_value
(value_r, value_g, value_b)[source]¶ Set the R, G, B values for all pixels.
fast. without error checking.
Parameters:
-
set_pixel_float_color
(pixel_index, color)[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
Parameters: - pixel_index (int) – 0..(pixel_count)
- color (tuple/float) – 3-tuple of R, G, B; 0..1
-
set_pixel_float_value
(pixel_index, value_r, value_g, value_b)[source]¶ Set the value for pixel.
This is a Fast UNPROTECTED function: no error / range checking is done.
Parameters:
-
static
-
class
adafruit_tlc59711.
TLC59711AutoShow
(spi, pixel_count=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 usefull if you only have a very small number of pixels.
Parameters: