Bläddra i källkod

Merge pull request #11 from KurtE/teensy41

Add support for Teensy 4.1 specific pins
main_ledos
Paul Stoffregen 4 år sedan
förälder
incheckning
8c22c5a657
Inget konto är kopplat till bidragsgivarens mejladress
4 ändrade filer med 18 tillägg och 0 borttagningar
  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 Visa fil

@@ -121,6 +121,9 @@ bool WS2812Serial::begin()

#elif defined(__IMXRT1062__)
case 1: // Serial1
#if defined(ARDUINO_TEENSY41)
case 53:
#endif
uart = &IMXRT_LPUART6;
CCM_CCGR3 |= CCM_CCGR3_LPUART6(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART6_TX;
@@ -141,7 +144,11 @@ bool WS2812Serial::begin()
hwtrigger = DMAMUX_SOURCE_LPUART3_TX;
break;
case 20: // Serial5
#if defined(ARDUINO_TEENSY40)
case 39: // Serial5 alt
#elif defined(ARDUINO_TEENSY41)
case 47:
#endif
uart = &IMXRT_LPUART8;
CCM_CCGR6 |= CCM_CCGR6_LPUART8(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART8_TX;
@@ -156,6 +163,13 @@ bool WS2812Serial::begin()
CCM_CCGR5 |= CCM_CCGR5_LPUART7(CCM_CCGR_ON);
hwtrigger = DMAMUX_SOURCE_LPUART7_TX;
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
default:
return false; // pin not supported

+ 1
- 0
examples/BasicTest/BasicTest.ino Visa fil

@@ -15,6 +15,7 @@ const int pin = 1;
// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// 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
DMAMEM byte displayMemory[numled*12]; // 12 bytes per LED

+ 1
- 0
examples/BasicTest_RGBW/BasicTest_RGBW.ino Visa fil

@@ -15,6 +15,7 @@ const int pin = 1;
// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// 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
DMAMEM byte displayMemory[numled*16]; // 16 bytes per LED for RGBW

+ 2
- 0
examples/FastLED_Cylon/FastLED_Cylon.ino Visa fil

@@ -13,6 +13,8 @@
// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
// 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 the array of leds

Laddar…
Avbryt
Spara