33 #if defined(__arm__) && !defined(ARDUINO_ARCH_NRF52840)
35 template<
typename T_SPEED>
class NeoArmMethodBase
40 NeoArmMethodBase(uint8_t pin, uint16_t pixelCount,
size_t elementSize,
size_t settingsSize) :
41 _sizeData(pixelCount * elementSize + settingsSize),
46 _data =
static_cast<uint8_t*
>(malloc(_sizeData));
57 bool IsReadyToUpdate()
const
59 uint32_t delta = micros() - _endTime;
61 return (delta >= T_SPEED::ResetTimeUs);
66 digitalWrite(_pin, LOW);
79 while (!IsReadyToUpdate())
86 T_SPEED::send_pixels(_data, _sizeData, _pin);
100 uint8_t* getData()
const
105 size_t getDataSize()
const
110 void applySettings([[maybe_unused]]
const SettingsObject& settings)
115 const size_t _sizeData;
123 #if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
125 class NeoArmMk20dxSpeedProps800KbpsBase
128 static const uint32_t CyclesT0h = (F_CPU / 4000000);
129 static const uint32_t CyclesT1h = (F_CPU / 1250000);
130 static const uint32_t Cycles = (F_CPU / 800000);
133 class NeoArmMk20dxSpeedPropsWs2812x :
public NeoArmMk20dxSpeedProps800KbpsBase
136 static const uint32_t ResetTimeUs = 300;
139 class NeoArmMk20dxSpeedPropsSk6812 :
public NeoArmMk20dxSpeedProps800KbpsBase
142 static const uint32_t ResetTimeUs = 80;
145 class NeoArmMk20dxSpeedPropsTm1814 :
public NeoArmMk20dxSpeedProps800KbpsBase
148 static const uint32_t ResetTimeUs = 200;
151 class NeoArmMk20dxSpeedPropsTm1829 :
public NeoArmMk20dxSpeedProps800KbpsBase
154 static const uint32_t ResetTimeUs = 200;
157 class NeoArmMk20dxSpeedProps800Kbps :
public NeoArmMk20dxSpeedProps800KbpsBase
160 static const uint32_t ResetTimeUs = 50;
163 class NeoArmMk20dxSpeedProps400Kbps
166 static const uint32_t CyclesT0h = (F_CPU / 2000000);
167 static const uint32_t CyclesT1h = (F_CPU / 833333);
168 static const uint32_t Cycles = (F_CPU / 400000);
169 static const uint32_t ResetTimeUs = 50;
172 class NeoArmMk20dxSpeedPropsApa106
175 static const uint32_t CyclesT0h = (F_CPU / 4000000);
176 static const uint32_t CyclesT1h = (F_CPU / 913750);
177 static const uint32_t Cycles = (F_CPU / 584800);
178 static const uint32_t ResetTimeUs = 50;
181 template<
typename T_SPEEDPROPS>
class NeoArmMk20dxSpeedBase
184 static const uint32_t ResetTimeUs = T_SPEEDPROPS::ResetTimeUs;
186 static void send_pixels(uint8_t* pixels,
size_t sizePixels, uint8_t pin)
189 uint8_t* end = p + sizePixels;
193 volatile uint8_t* set = portSetRegister(pin);
194 volatile uint8_t* clr = portClearRegister(pin);
198 ARM_DEMCR |= ARM_DEMCR_TRCENA;
199 ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;
201 cyc = ARM_DWT_CYCCNT + T_SPEEDPROPS::Cycles;
205 for (mask = 0x80; mask; mask >>= 1)
207 while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::Cycles);
209 cyc = ARM_DWT_CYCCNT;
213 while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::CyclesT1h);
217 while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::CyclesT0h);
225 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedPropsWs2812x>> NeoArmWs2812xMethod;
226 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedPropsSk6812>> NeoArmSk6812Method;
227 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedPropsTm1814>> NeoArmTm1814InvertedMethod;
228 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedPropsTm1829>> NeoArmTm1829InvertedMethod;
229 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedPropsApa106>> NeoArmApa106Method;
230 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedProps800Kbps>> NeoArm800KbpsMethod;
231 typedef NeoArmMethodBase<NeoArmMk20dxSpeedBase<NeoArmMk20dxSpeedProps400Kbps>> NeoArm400KbpsMethod;
233 typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod;
235 #elif defined(__MKL26Z64__)
237 #if F_CPU == 48000000
239 class NeoArmMk26z64Speed800KbpsBase
242 static void send_pixels(uint8_t* pixels,
size_t sizePixels, uint8_t pin)
248 uint8_t bitmask = digitalPinToBitMask(pin);
249 volatile uint8_t* reg = portSetRegister(pin);
250 uint32_t num = sizePixels;
254 "ldrb %[pix], [%[p], #0]" "\n\t"
255 "lsl %[pix], #24" "\n\t"
256 "movs %[count], #7" "\n\t"
258 "lsl %[pix], #1" "\n\t"
259 "bcs L%=_loop_one" "\n\t"
261 "strb %[bitmask], [%[reg], #0]" "\n\t"
262 "movs %[dly], #4" "\n\t"
263 "L%=_loop_delay_T0H:" "\n\t"
264 "sub %[dly], #1" "\n\t"
265 "bne L%=_loop_delay_T0H" "\n\t"
266 "strb %[bitmask], [%[reg], #4]" "\n\t"
267 "movs %[dly], #13" "\n\t"
268 "L%=_loop_delay_T0L:" "\n\t"
269 "sub %[dly], #1" "\n\t"
270 "bne L%=_loop_delay_T0L" "\n\t"
273 "strb %[bitmask], [%[reg], #0]" "\n\t"
274 "movs %[dly], #13" "\n\t"
275 "L%=_loop_delay_T1H:" "\n\t"
276 "sub %[dly], #1" "\n\t"
277 "bne L%=_loop_delay_T1H" "\n\t"
278 "strb %[bitmask], [%[reg], #4]" "\n\t"
279 "movs %[dly], #4" "\n\t"
280 "L%=_loop_delay_T1L:" "\n\t"
281 "sub %[dly], #1" "\n\t"
282 "bne L%=_loop_delay_T1L" "\n\t"
285 "sub %[count], #1" "\n\t"
286 "bne L%=_loop" "\n\t"
287 "lsl %[pix], #1" "\n\t"
288 "bcs L%=_last_one" "\n\t"
290 "strb %[bitmask], [%[reg], #0]" "\n\t"
291 "movs %[dly], #4" "\n\t"
292 "L%=_last_delay_T0H:" "\n\t"
293 "sub %[dly], #1" "\n\t"
294 "bne L%=_last_delay_T0H" "\n\t"
295 "strb %[bitmask], [%[reg], #4]" "\n\t"
296 "movs %[dly], #10" "\n\t"
297 "L%=_last_delay_T0L:" "\n\t"
298 "sub %[dly], #1" "\n\t"
299 "bne L%=_last_delay_T0L" "\n\t"
300 "b L%=_repeat" "\n\t"
302 "strb %[bitmask], [%[reg], #0]" "\n\t"
303 "movs %[dly], #13" "\n\t"
304 "L%=_last_delay_T1H:" "\n\t"
305 "sub %[dly], #1" "\n\t"
306 "bne L%=_last_delay_T1H" "\n\t"
307 "strb %[bitmask], [%[reg], #4]" "\n\t"
308 "movs %[dly], #1" "\n\t"
309 "L%=_last_delay_T1L:" "\n\t"
310 "sub %[dly], #1" "\n\t"
311 "bne L%=_last_delay_T1L" "\n\t"
314 "add %[p], #1" "\n\t"
315 "sub %[num], #1" "\n\t"
316 "bne L%=_begin" "\n\t"
320 [count]
"=&r" (count),
323 : [bitmask]
"r" (bitmask),
329 class NeoArmMk26z64SpeedWs2812x :
public NeoArmMk26z64Speed800KbpsBase
332 const static uint32_t ResetTimeUs = 300;
335 class NeoArmMk26z64SpeedSk6812 :
public NeoArmMk26z64Speed800KbpsBase
338 const static uint32_t ResetTimeUs = 80;
341 class NeoArmMk26z64SpeedTm1814 :
public NeoArmMk26z64Speed800KbpsBase
344 const static uint32_t ResetTimeUs = 200;
347 class NeoArmMk26z64SpeedTm1829 :
public NeoArmMk26z64Speed800KbpsBase
350 const static uint32_t ResetTimeUs = 200;
353 class NeoArmMk26z64Speed800Kbps :
public NeoArmMk26z64Speed800KbpsBase
356 const static uint32_t ResetTimeUs = 50;
359 typedef NeoArmMethodBase<NeoArmMk26z64SpeedWs2812x> NeoArmWs2812xMethod;
360 typedef NeoArmMethodBase<NeoArmMk26z64SpeedSk6812> NeoArmSk6812Method;
361 typedef NeoArmMethodBase<NeoArmMk26z64SpeedTm1814> NeoArmTm1814InvertedMethod;
362 typedef NeoArmMethodBase<NeoArmMk26z64SpeedTm1829> NeoArmTm1829InvertedMethod;
363 typedef NeoArmMethodBase<NeoArmMk26z64Speed800Kbps> NeoArm800KbpsMethod;
364 typedef NeoArm800KbpsMethod NeoArmApa106Method;
365 typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod;
368 #error "Teensy-LC: Sorry, only 48 MHz is supported, please set Tools > CPU Speed to 48 MHz"
371 #elif defined(__SAMD21G18A__)
374 class NeoArmSamd21g18aSpeedProps800KbpsBase
377 static void BitPreWait()
379 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;");
381 static void BitT1hWait()
383 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
384 "nop; nop; nop; nop; nop; nop; nop; nop;"
385 "nop; nop; nop; nop;");
387 static void BitT0lWait()
389 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
390 "nop; nop; nop; nop; nop; nop; nop; nop;"
391 "nop; nop; nop; nop;");
393 static void BitPostWait()
395 asm(
"nop; nop; nop; nop; nop; nop; nop; nop; nop;");
399 class NeoArmSamd21g18aSpeedPropsWs2812x :
public NeoArmSamd21g18aSpeedProps800KbpsBase
402 static const uint32_t ResetTimeUs = 300;
405 class NeoArmSamd21g18aSpeedPropsSk6812 :
public NeoArmSamd21g18aSpeedProps800KbpsBase
408 static const uint32_t ResetTimeUs = 80;
411 class NeoArmSamd21g18aSpeedPropsTm1814 :
public NeoArmSamd21g18aSpeedProps800KbpsBase
414 static const uint32_t ResetTimeUs = 200;
417 class NeoArmSamd21g18aSpeedPropsTm1829 :
public NeoArmSamd21g18aSpeedProps800KbpsBase
420 static const uint32_t ResetTimeUs = 200;
423 class NeoArmSamd21g18aSpeedProps800Kbps :
public NeoArmSamd21g18aSpeedProps800KbpsBase
426 static const uint32_t ResetTimeUs = 50;
430 class NeoArmSamd21g18aSpeedProps400Kbps
433 static void BitPreWait()
435 asm(
"nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;");
437 static void BitT1hWait()
439 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
440 "nop; nop; nop; nop; nop; nop; nop; nop;"
441 "nop; nop; nop; nop; nop; nop; nop; nop;"
444 static void BitT0lWait()
446 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
447 "nop; nop; nop; nop; nop; nop; nop; nop;"
448 "nop; nop; nop; nop; nop; nop; nop; nop;"
451 static void BitPostWait()
453 asm(
"nop; nop; nop; nop; nop; nop; nop;");
455 static const uint32_t ResetTimeUs = 50;
458 template<
typename T_SPEEDPROPS>
class NeoArmSamd21g18aSpeedBase
461 static const uint32_t ResetTimeUs = T_SPEEDPROPS::ResetTimeUs;
463 static void send_pixels(uint8_t* pixels,
size_t sizePixels, uint8_t pin)
467 uint8_t* ptr = pixels;
468 uint8_t* end = ptr + sizePixels;;
470 uint8_t bitMask = 0x80;
471 uint8_t portNum = g_APinDescription[pin].ulPort;
472 uint32_t pinMask = 1ul << g_APinDescription[pin].ulPin;
474 volatile uint32_t* set = &(PORT->Group[portNum].OUTSET.reg);
475 volatile uint32_t* clr = &(PORT->Group[portNum].OUTCLR.reg);
480 T_SPEEDPROPS::BitPreWait();
484 T_SPEEDPROPS::BitT1hWait();
490 T_SPEEDPROPS::BitT0lWait();
494 T_SPEEDPROPS::BitPostWait();
509 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedPropsWs2812x>> NeoArmWs2812xMethod;
510 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedPropsSk6812>> NeoArmSk6812Method;
511 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedPropsTm1814>> NeoArmTm1814InvertedMethod;
512 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedPropsTm1829>> NeoArmTm1829InvertedMethod;
513 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedProps800Kbps>> NeoArm800KbpsMethod;
514 typedef NeoArmMethodBase<NeoArmSamd21g18aSpeedBase<NeoArmSamd21g18aSpeedProps400Kbps>> NeoArm400KbpsMethod;
515 typedef NeoArm400KbpsMethod NeoArmApa106Method;
516 typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod;
518 #elif defined(ARDUINO_STM32_FEATHER) || defined(ARDUINO_ARCH_STM32L4) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32F1)
520 class NeoArmStm32SpeedProps800KbpsBase
523 static void BitT1hWait()
525 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
526 "nop; nop; nop; nop; nop; nop; nop; nop;"
527 "nop; nop; nop; nop; nop; nop; nop; nop;"
528 "nop; nop; nop; nop; nop; nop; nop; nop;"
529 "nop; nop; nop; nop; nop; nop; nop; nop;"
530 "nop; nop; nop; nop; nop; nop; nop; nop;"
531 "nop; nop; nop; nop; nop; nop; nop; nop;"
532 "nop; nop; nop; nop; nop; nop; nop; nop;"
533 "nop; nop; nop; nop; nop; nop; nop; nop;"
534 "nop; nop; nop; nop; nop; nop; nop; nop;"
535 "nop; nop; nop; nop; nop; nop; nop; nop;"
536 "nop; nop; nop; nop; nop; nop;");
538 static void BitT1lWait()
540 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
541 "nop; nop; nop; nop; nop; nop; nop; nop;"
542 "nop; nop; nop; nop; nop; nop; nop; nop;"
543 "nop; nop; nop; nop; nop; nop; nop; nop;"
544 "nop; nop; nop; nop; nop; nop;");
546 static void BitT0hWait()
548 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
549 "nop; nop; nop; nop; nop; nop; nop; nop;"
550 "nop; nop; nop; nop; nop; nop; nop; nop;"
551 "nop; nop; nop; nop; nop; nop; nop; nop;"
552 "nop; nop; nop; nop; nop; nop; nop; nop;"
555 static void BitT0lWait()
557 asm(
"nop; nop; nop; nop; nop; nop; nop; nop;"
558 "nop; nop; nop; nop; nop; nop; nop; nop;"
559 "nop; nop; nop; nop; nop; nop; nop; nop;"
560 "nop; nop; nop; nop; nop; nop; nop; nop;"
561 "nop; nop; nop; nop; nop; nop; nop; nop;"
562 "nop; nop; nop; nop; nop; nop; nop; nop;"
563 "nop; nop; nop; nop; nop; nop; nop; nop;"
564 "nop; nop; nop; nop; nop; nop; nop; nop;"
565 "nop; nop; nop; nop; nop; nop; nop; nop;"
566 "nop; nop; nop; nop; nop; nop; nop; nop;"
567 "nop; nop; nop; nop; nop; nop; nop; nop;"
568 "nop; nop; nop; nop;");
572 class NeoArmStm32SpeedPropsWs2812x :
public NeoArmStm32SpeedProps800KbpsBase
575 static const uint32_t ResetTimeUs = 300;
578 class NeoArmStm32SpeedPropsSk6812 :
public NeoArmStm32SpeedProps800KbpsBase
581 static const uint32_t ResetTimeUs = 80;
584 class NeoArmStm32SpeedPropsTm1814 :
public NeoArmStm32SpeedProps800KbpsBase
587 static const uint32_t ResetTimeUs = 200;
590 class NeoArmStm32SpeedPropsTm1829 :
public NeoArmStm32SpeedProps800KbpsBase
593 static const uint32_t ResetTimeUs = 200;
596 class NeoArmStm32SpeedProps800Kbps :
public NeoArmStm32SpeedProps800KbpsBase
599 static const uint32_t ResetTimeUs = 50;
620 template<
typename T_SPEEDPROPS>
class NeoArmStm32SpeedBase
623 static const uint32_t ResetTimeUs = T_SPEEDPROPS::ResetTimeUs;
625 static void send_pixels(uint8_t* pixels,
size_t sizePixels, uint8_t pin)
630 uint8_t* ptr = pixels;
631 uint8_t* end = ptr + sizePixels;
633 uint8_t bitMask = 0x80;
635 #if defined(ARDUINO_STM32_FEATHER)
636 uint32_t pinMask = BIT(PIN_MAP[pin].gpio_bit);
638 volatile uint16_t* set = &(PIN_MAP[pin].gpio_device->regs->BSRRL);
639 volatile uint16_t* clr = &(PIN_MAP[pin].gpio_device->regs->BSRRH);
641 #elif defined(ARDUINO_ARCH_STM32F4)
642 uint32_t pinMask = BIT(pin & 0x0f);
644 volatile uint16_t* set = &(PIN_MAP[pin].gpio_device->regs->BSRRL);
645 volatile uint16_t* clr = &(PIN_MAP[pin].gpio_device->regs->BSRRH);
647 #elif defined(ARDUINO_ARCH_STM32F1)
649 uint32_t pinMask = BIT(PIN_MAP[pin].gpio_bit);
651 volatile uint32_t* set = &(PIN_MAP[pin].gpio_device->regs->BRR);
652 volatile uint32_t* clr = &(PIN_MAP[pin].gpio_device->regs->BSRR);
654 #elif defined(ARDUINO_ARCH_STM32L4)
656 uint32_t pinMask = g_APinDescription[pin].bit;
658 GPIO_TypeDef* GPIO =
static_cast<GPIO_TypeDef*
>(g_APinDescription[pin].GPIO);
660 volatile uint32_t* set = &(GPIO->BRR);
661 volatile uint32_t* clr = &(GPIO->BSRR);
671 T_SPEEDPROPS::BitT1hWait();
674 T_SPEEDPROPS::BitT1lWait();
681 T_SPEEDPROPS::BitT0hWait();
684 T_SPEEDPROPS::BitT0lWait();
705 typedef NeoArmMethodBase<NeoArmStm32SpeedBase<NeoArmStm32SpeedPropsWs2812x>> NeoArmWs2812xMethod;
706 typedef NeoArmMethodBase<NeoArmStm32SpeedBase<NeoArmStm32SpeedPropsSk6812>> NeoArmSk6812Method;
707 typedef NeoArmMethodBase<NeoArmStm32SpeedBase<NeoArmStm32SpeedPropsTm1814>> NeoArmTm1814InvertedMethod;
708 typedef NeoArmMethodBase<NeoArmStm32SpeedBase<NeoArmStm32SpeedPropsTm1829>> NeoArmTm1829InvertedMethod;
709 typedef NeoArmMethodBase<NeoArmStm32SpeedBase<NeoArmStm32SpeedProps800Kbps>> NeoArm800KbpsMethod;
710 typedef NeoArm800KbpsMethod NeoArmApa106Method;
711 typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod;
716 #define ARM_OTHER_SCALE VARIANT_MCK / 2UL / 1000000UL
717 #define ARM_OTHER_INST (2UL * F_CPU / VARIANT_MCK)
719 class NeoArmOtherSpeedProps800KbpsBase
722 static const uint32_t CyclesT0h =
static_cast<uint32_t
>((0.40 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
723 static const uint32_t CyclesT1h =
static_cast<uint32_t
>((0.80 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
724 static const uint32_t Cycles =
static_cast<uint32_t
>((1.25 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
727 class NeoArmOtherSpeedPropsWs2812x :
public NeoArmOtherSpeedProps800KbpsBase
730 static const uint32_t ResetTimeUs = 300;
733 class NeoArmOtherSpeedPropsSk6812 :
public NeoArmOtherSpeedProps800KbpsBase
736 static const uint32_t ResetTimeUs = 80;
739 class NeoArmOtherSpeedPropsTm1814 :
public NeoArmOtherSpeedProps800KbpsBase
742 static const uint32_t ResetTimeUs = 200;
745 class NeoArmOtherSpeedPropsTm1829 :
public NeoArmOtherSpeedProps800KbpsBase
748 static const uint32_t ResetTimeUs = 200;
751 class NeoArmOtherSpeedProps800Kbps :
public NeoArmOtherSpeedProps800KbpsBase
754 static const uint32_t ResetTimeUs = 50;
757 class NeoArmOtherSpeedProps400Kbps
760 static const uint32_t CyclesT0h =
static_cast<uint32_t
>((0.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
761 static const uint32_t CyclesT1h =
static_cast<uint32_t
>((1.20 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
762 static const uint32_t Cycles =
static_cast<uint32_t
>((2.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST));
763 static const uint32_t ResetTimeUs = 50;
766 template<
typename T_SPEEDPROPS>
class NeoArmOtherSpeedBase
769 static const uint32_t ResetTimeUs = T_SPEEDPROPS::ResetTimeUs;
771 static void send_pixels(uint8_t* pixels,
size_t sizePixels, uint8_t pin)
776 volatile WoReg* portSet;
777 volatile WoReg* portClear;
778 volatile WoReg* timeValue;
779 volatile WoReg* timeReset;
785 pmc_set_writeprotect(
false);
786 pmc_enable_periph_clk(
static_cast<uint32_t
>(TC3_IRQn));
789 TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
792 pinMask = g_APinDescription[pin].ulPin;
793 port = g_APinDescription[pin].pPort;
794 portSet = &(port->PIO_SODR);
795 portClear = &(port->PIO_CODR);
796 timeValue = &(TC1->TC_CHANNEL[0].TC_CV);
797 timeReset = &(TC1->TC_CHANNEL[0].TC_CCR);
799 end = p + sizePixels;
807 t = T_SPEEDPROPS::CyclesT1h;
811 t = T_SPEEDPROPS::CyclesT0h;
815 while (*timeValue < T_SPEEDPROPS::Cycles);
818 *timeReset = TC_CCR_CLKEN | TC_CCR_SWTRG;
820 while (*timeValue < t);
822 *portClear = pinMask;
842 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsWs2812x>> NeoArmWs2812xMethod;
843 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsSk6812>> NeoArmSk6812Method;
844 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsTm1814>> NeoArmTm1814InvertedMethod;
845 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsTm1829>> NeoArmTm1829InvertedMethod;
846 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedProps800Kbps>> NeoArm800KbpsMethod;
847 typedef NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedProps400Kbps>> NeoArm400KbpsMethod;
848 typedef NeoArm400KbpsMethod NeoArmApa106Method;
849 typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod;
855 typedef NeoArmWs2812xMethod NeoWs2813Method;
856 typedef NeoArmWs2812xMethod NeoWs2812xMethod;
857 typedef NeoArmWs2812xMethod NeoWs2811Method;
858 typedef NeoArmWs2812xMethod NeoWs2816Method;
859 typedef NeoArmSk6812Method NeoSk6812Method;
860 typedef NeoArmSk6812Method NeoLc8812Method;
861 typedef NeoArm800KbpsMethod NeoWs2812Method;
862 typedef NeoArmApa106Method NeoApa106Method;
863 typedef NeoArmWs2812xMethod Neo800KbpsMethod;
864 #ifdef NeoArm400KbpsMethod
865 typedef NeoArm400KbpsMethod Neo400KbpsMethod;
868 typedef NeoArmTm1814InvertedMethod NeoTm1814InvertedMethod;
869 typedef NeoArmTm1914InvertedMethod NeoTm1914InvertedMethod;
870 typedef NeoArmTm1829InvertedMethod NeoTm1829InvertedMethod;
Definition: NeoSettings.h:29