#include <stdint.h>
#include "pinouts/chip_includes.h"
Go to the source code of this file.
Defines | |
#define | TLC_BITBANG 1 |
Bit-bang using any two i/o pins. | |
#define | TLC_SPI 2 |
Use the much faster hardware SPI module. | |
#define | NUM_TLCS 1 |
Number of TLCs daisy-chained. | |
#define | DATA_TRANSFER_MODE TLC_SPI |
Determines how data should be transfered to the TLCs. | |
#define | TLC_CHANNEL_TYPE uint8_t |
If more than 16 TLCs are daisy-chained, the channel type has to be uint16_t. | |
#define | TLC_PWM_PERIOD 8192 |
Determines how long each PWM period should be, in clocks. | |
#define | TLC_GSCLK_PERIOD 3 |
Determines how long each period GSCLK is. | |
#define | VPRG_ENABLED 0 |
Enables/disables VPRG (TLC pin 27) functionality. | |
#define | XERR_ENABLED 0 |
Enables/disables XERR (TLC pin 16) functionality to check for shorted/broken LEDs
| |
#define | VPRG_PIN DEFAULT_VPRG_PIN |
VPRG (TLC pin 27). | |
#define | VPRG_PORT DEFAULT_VPRG_PORT |
#define | VPRG_DDR DEFAULT_VPRG_DDR |
#define | XERR_PIN DEFAULT_XERR_PIN |
XERR (TLC pin 16). | |
#define | XERR_PORT DEFAULT_XERR_PORT |
#define | XERR_DDR DEFAULT_XERR_DDR |
#define | XERR_PINS DEFAULT_XERR_PINS |
#define | SIN_PIN TLC_MOSI_PIN |
SIN (TLC pin 26). | |
#define | SIN_PORT TLC_MOSI_PORT |
#define | SIN_DDR TLC_MOSI_DDR |
#define | SCLK_PIN TLC_SCK_PIN |
SCLK (TLC pin 25). | |
#define | SCLK_PORT TLC_SCK_PORT |
#define | SCLK_DDR TLC_SCK_DDR |
#define | GS_DUO(a, b) ((a) >> 4), ((a) << 4) | ((b) >> 8), (b) |
Arranges 2 grayscale values (0 - 4095) in the packed array format (3 bytes). | |
#define | DC_QUARTET(a, b, c, d) |
Arranges 4 dot correction values (0 - 63) in the packed array format. |
After making changes to this file, delete Tlc5940.o in this folder so the changes are applied.
A summary of all the options:
How to change the pin mapping:
#define DATA_TRANSFER_MODE TLC_SPI |
Determines how data should be transfered to the TLCs.
Bit-banging can use any two i/o pins, but the hardware SPI is faster.
#define DC_QUARTET | ( | a, | |||
b, | |||||
c, | |||||
d | ) |
Value:
((a) << 2) | ((b) >> 4), \ ((b) << 4) | ((c) >> 2), \ ((c) << 6) | (d)
#define GS_DUO | ( | a, | |||
b | ) | ((a) >> 4), ((a) << 4) | ((b) >> 8), (b) |
Arranges 2 grayscale values (0 - 4095) in the packed array format (3 bytes).
This is for array initializers only: the output is three comma seperated 8-bit values.
#define NUM_TLCS 1 |
Number of TLCs daisy-chained.
To daisy-chain, attach the SOUT (TLC pin 17) of the first TLC to the SIN (TLC pin 26) of the next. The rest of the pins are attached normally.
#define TLC_CHANNEL_TYPE uint8_t |
If more than 16 TLCs are daisy-chained, the channel type has to be uint16_t.
Default is uint8_t, which supports up to 16 TLCs.
#define TLC_GSCLK_PERIOD 3 |
Determines how long each period GSCLK is.
This is related to TLC_PWM_PERIOD:
#define TLC_PWM_PERIOD 8192 |
Determines how long each PWM period should be, in clocks.
This is related to TLC_GSCLK_PERIOD:
#define VPRG_ENABLED 0 |
Enables/disables VPRG (TLC pin 27) functionality.
If you need to set dot correction data, this needs to be enabled.
#define XERR_ENABLED 0 |
Enables/disables XERR (TLC pin 16) functionality to check for shorted/broken LEDs