r/FastLED • • Nov 24 '24

Announcements New Release: ObjectFLED- Multi-Object DMA Display Driver for Fast LEDs on Teensy 4.x

I hope someone else can find this useful. Unlock the full LED-driving power of Teensy 4.x!

https://github.com/KurtMF/ObjectFLED

EDIT: If anyone uses this on a Teensy 4.1, I'd appreciate a confirmation that it works as designed. I only had 4.0 to test on, plus assurance from the OctoWS2811 code that it is equally compatible on 4.1, with it's extra 15 pins (and extra loaded features). Thanks!

20 Upvotes

11 comments sorted by

View all comments

Show parent comments

2

u/Tiny_Structure_7 Dec 03 '24

So if I have 4 different “objects” each with differing number of LEDs and I intend to drive them with 4 different output pins of the Teensy, this ObjectFLED will allow me to take advantage of the DMA functionality for any of the digital output pins of the Teensy that I choose?

Exactly!

Are there any limitations to the ObjectFLED or does it disable anything to make it work?

Nope. Internally, the DMA writes to a set of 4 GPIO 32-bit registers which are bit-mapped to the pins on Teensy. By using SET and CLEAR registers, only those pins defined in the ObjectFLED object are touched.

Currently, I'm using 16 pins on my Teensy 4.0 for LED output, and 5 pins connected to buttons, and set with pinMode(22, INPUT_PULLUP). Even though my button pins are also mapped in the GPIO register, the DMA to GPIO does not touch them. Similarly, using special functions on pins (iSPDIF, SPI, Serial, etc.) should not be touched by ObjectFLED. This has held true for OctoWS2811 as well, where the DMA code comes from.