Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef TEENSY_TLC5940_h
- #define TEENSY_TLC5940_h
- #include <Arduino.h>
- #include <inttypes.h>
- ////////////////////////////////////////////////////////////////////////////////
- /// Configuration
- ///
- /// Timers and Pins on the Teensy 3
- /// - Timer 0:
- /// -- ch 0 = pin 22 (native pin 44)
- /// -- ch 1 = pin 23 (native pin 45)
- /// -- ch 2 = pin 9 (native pin 46)
- /// -- ch 3 = pin 10 (native pin 49)
- /// -- ch 4 = pin 6 (native pin 61)
- /// -- ch 5 = pin 20 (native pin 62)
- /// -- ch 6 = pin 21 (native pin 63)
- /// -- ch 7 = pin 5 (native pin 64)
- /// - Timer 1:
- /// -- ch 0 = pin 3 (native pin 28)
- /// -- ch 1 = pin 4 (native pin 29)
- ///
- // # of TLC5940 chips daisy-chained:
- #define NUM_TLCS 3
- // The following array specifies the initial dot-correction data for the
- // TLC5940 output channels. 0 disables all output on that channel, 63 means
- // that maximum output is allowed. There should be as many entries as there
- // are TLC5940 output channels (i.e. NUM_TLCS * 16). The first entry is
- // channel 0.
- #define INITIAL_DCDATA {23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23, \
- 23, 23, 23 }
- //#define INITIAL_DCDATA {63, 63, 63, \
- // 63, 63, 63, \
- // 63, 63, 63, \
- // 63, 63, 63, \
- // 63, 63, 63, \
- // 63}
- ////////////////////////////////////////////////////////////////////////////////
- /// External functions
- extern void initTLC5940 ();
- extern void sleepTLC5940 ();
- extern void wakeTLC5940 ();
- extern void setGSData(int tlcOutput, uint16_t value);
- extern uint16_t getGSData(int tlcOutput);
- extern void setAllGSData(uint16_t value);
- extern void sendGSData (byte leds);
- extern boolean unlatchedGSData();
- extern volatile boolean tlc_needXLAT;
- extern void setDCData(int tlcOutput, uint8_t value);
- extern uint8_t getDCData(int tlcOutput);
- extern void sendDCData ();
- #endif // TEENSY_TLC5940_h
- ////////////////////////////////////////////////////////////////////////////////
- /// End of Code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement