Stellaris/Tiva C WS28142b Driver
I’ve been playing around with WS2812b LEDs lately, and have been using my trusty TI Tiva C Series and Stellaris Launchpads as a controller for them. The first thing I did with these was to use a timer to bit bang the control codes for LEDs on a GPIO pin. This ended up being very resource intensive, so I started looking around for other options. After a bit of digging into the datasheet, I realized that the SPI peripheral allows you to specify a byte to transfer onto the bus bit for bit, and that you can specify any clock rate you want for the peripheral. This easily lends itself to creating a WS2812b driver that uses the SPI hardware to free up processor resources. Further processor time can be freed by using the uDMA engine to handle transferring data from the LED control buffer to the SPI peripheral’s transmit buffer. The resulting driver can be accessed on my github.
In the future, I plan on making this driver more generic and better able to be run with multiple instances. For example, it would be very nice to have three strips controlled by three separate SPI buffers, which right now is not a possibility with how the driver is architected. I have a new architecture in mind that elegantly solves this problem, but I have not yet had the time, resources, or motivation to implement them.