mirror of
https://github.com/PaulStoffregen/Tlc5940
synced 2025-09-27 10:02:20 +02:00
Begin Teensy 3.1 port
This commit is contained in:
38
pinouts/Teensy_KinetisK20.h
Normal file
38
pinouts/Teensy_KinetisK20.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef TLC_Teensy_xxU4_h
|
||||
#define TLC_Teensy_xxU4_h
|
||||
|
||||
#if DATA_TRANSFER_MODE == TLC_BITBANG
|
||||
#error "If you want bitbang mode, insert pin defs here"
|
||||
#endif
|
||||
|
||||
// MOSI (Teensy pin 11) -> SIN (TLC pin 26)
|
||||
#define TLC_MOSI_PIN 11
|
||||
#define TLC_MOSI_PORT 11
|
||||
#define TLC_MOSI_DDR 11
|
||||
|
||||
// SCK (Teensy pin 13) -> SCLK (TLC pin 25)
|
||||
#define TLC_SCK_PIN 13
|
||||
#define TLC_SCK_PORT 13
|
||||
#define TLC_SCK_DDR 13
|
||||
|
||||
// SS (Teensy pin 10)
|
||||
#define TLC_SS_PIN 10
|
||||
#define TLC_SS_DDR 10
|
||||
|
||||
// FTM1_CH0 (Teensy pin 3) -> XLAT (TLC pin 24)
|
||||
#define XLAT_PIN 3
|
||||
#define XLAT_PORT 3
|
||||
#define XLAT_DDR 3
|
||||
|
||||
// FTM1_CH1 (Teensy pin 4) -> BLANK (TLC pin 23)
|
||||
#define BLANK_PIN 4
|
||||
#define BLANK_PORT 4
|
||||
#define BLANK_DDR 4
|
||||
|
||||
// CMTOUT (Teensy pin 5) -> GSCLK (TLC pin 18)
|
||||
#define GSCLK_PIN 5
|
||||
#define GSCLK_PORT 5
|
||||
#define GSCLK_DDR 5
|
||||
|
||||
#endif
|
||||
|
@@ -22,7 +22,9 @@
|
||||
/** \file
|
||||
Includes the chip-specfic defaults and pin definitions. */
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#endif
|
||||
|
||||
#ifndef PB0
|
||||
#define PB0 PORTB0
|
||||
@@ -110,6 +112,13 @@
|
||||
/* Teensy++ 2.0 */
|
||||
#include "Teensypp_xxx6.h"
|
||||
|
||||
#elif defined (__MK20DX128__) \
|
||||
|| defined (__MK20DX256__)
|
||||
|
||||
/* Teensy 3.0 & 3.1 */
|
||||
#include "Teensy_KinetisK20.h"
|
||||
|
||||
|
||||
#else
|
||||
#error "Unknown Chip!"
|
||||
#endif
|
||||
|
24
pinouts/pin_functions.h
Normal file
24
pinouts/pin_functions.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef TLC_pin_functions_h
|
||||
#define TLC_pin_functions_h
|
||||
|
||||
#if defined(__AVR__)
|
||||
#define pulse_pin(port, pin) port |= _BV(pin); port &= ~_BV(pin)
|
||||
#define set_pin(port, pin) port |= _BV(pin)
|
||||
#define clear_pin(port, pin) port &= ~_BV(pin)
|
||||
#define output_pin(ddr, pin) ddr |= _BV(pin)
|
||||
#define pullup_pin(ddr, port, pin) ddr &= ~_BV(pin); port |= _BV(pin)
|
||||
#elif defined(TEENSYDUINO)
|
||||
#define pulse_pin(port, pin) digitalWriteFast(pin, LOW); digitalWriteFast(pin, HIGH)
|
||||
#define set_pin(port, pin) digitalWriteFast(pin, HIGH)
|
||||
#define clear_pin(port, pin) digitalWriteFast(pin, LOW)
|
||||
#define output_pin(ddr, pin) pinMode(pin, OUTPUT)
|
||||
#define pullup_pin(ddr, port, pin) pinMode(pin, INPUT_PULLUP)
|
||||
#else
|
||||
#define pulse_pin(port, pin) digitalWrite(pin, LOW); digitalWrite(pin, HIGH)
|
||||
#define set_pin(port, pin) digitalWrite(pin, HIGH)
|
||||
#define clear_pin(port, pin) digitalWrite(pin, LOW)
|
||||
#define output_pin(ddr, pin) pinMode(pin, OUTPUT)
|
||||
#define pullup_pin(ddr, port, pin) pinMode(pin, INPUT_PULLUP)
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user