Browse Source

Merge pull request #11 from KurtE/teensy41

Add support for Teensy 4.1 specific pins
main_ledos
Paul Stoffregen 4 years ago
parent
commit
8c22c5a657
No account linked to committer's email address
4 changed files with 18 additions and 0 deletions
  1. +14
    -0
      WS2812Serial.cpp
  2. +1
    -0
      examples/BasicTest/BasicTest.ino
  3. +1
    -0
      examples/BasicTest_RGBW/BasicTest_RGBW.ino
  4. +2
    -0
      examples/FastLED_Cylon/FastLED_Cylon.ino

+ 14
- 0
WS2812Serial.cpp View File



#elif defined(__IMXRT1062__) #elif defined(__IMXRT1062__)
case 1: // Serial1 case 1: // Serial1
#if defined(ARDUINO_TEENSY41)
case 53:
#endif
uart = &IMXRT_LPUART6; uart = &IMXRT_LPUART6;
CCM_CCGR3 |= CCM_CCGR3_LPUART6(CCM_CCGR_ON); CCM_CCGR3 |= CCM_CCGR3_LPUART6(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART6_TX; hwtrigger = DMAMUX_SOURCE_LPUART6_TX;
hwtrigger = DMAMUX_SOURCE_LPUART3_TX; hwtrigger = DMAMUX_SOURCE_LPUART3_TX;
break; break;
case 20: // Serial5 case 20: // Serial5
#if defined(ARDUINO_TEENSY40)
case 39: // Serial5 alt case 39: // Serial5 alt
#elif defined(ARDUINO_TEENSY41)
case 47:
#endif
uart = &IMXRT_LPUART8; uart = &IMXRT_LPUART8;
CCM_CCGR6 |= CCM_CCGR6_LPUART8(CCM_CCGR_ON); CCM_CCGR6 |= CCM_CCGR6_LPUART8(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART8_TX; hwtrigger = DMAMUX_SOURCE_LPUART8_TX;
CCM_CCGR5 |= CCM_CCGR5_LPUART7(CCM_CCGR_ON); CCM_CCGR5 |= CCM_CCGR5_LPUART7(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART7_TX; hwtrigger = DMAMUX_SOURCE_LPUART7_TX;
break; break;
#if defined(ARDUINO_TEENSY41)
case 35:
uart = &IMXRT_LPUART5;
CCM_CCGR3 |= CCM_CCGR3_LPUART5(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART5_TX;
break;
#endif
#endif #endif
default: default:
return false; // pin not supported return false; // pin not supported

+ 1
- 0
examples/BasicTest/BasicTest.ino View File

// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48 // Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33 // Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39 // Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39
// Teensy 4.1: 1, 8, 14, 17, 20, 24, 29, 35, 47, 53


byte drawingMemory[numled*3]; // 3 bytes per LED byte drawingMemory[numled*3]; // 3 bytes per LED
DMAMEM byte displayMemory[numled*12]; // 12 bytes per LED DMAMEM byte displayMemory[numled*12]; // 12 bytes per LED

+ 1
- 0
examples/BasicTest_RGBW/BasicTest_RGBW.ino View File

// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48 // Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33 // Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39 // Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39
// Teensy 4.1: 1, 8, 14, 17, 20, 24, 29, 35, 47, 53


byte drawingMemory[numled*4]; // 4 bytes per LED for RGBW byte drawingMemory[numled*4]; // 4 bytes per LED for RGBW
DMAMEM byte displayMemory[numled*16]; // 16 bytes per LED for RGBW DMAMEM byte displayMemory[numled*16]; // 16 bytes per LED for RGBW

+ 2
- 0
examples/FastLED_Cylon/FastLED_Cylon.ino View File

// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48 // Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33 // Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39 // Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39
// Teensy 4.1: 1, 8, 14, 17, 20, 24, 29, 35, 47, 53

#define DATA_PIN 1 #define DATA_PIN 1


// Define the array of leds // Define the array of leds

Loading…
Cancel
Save