These are chat archives for Makuna/NeoPixelBus

30th
Aug 2016
Aditya Tannu
@AdySan
Aug 30 2016 05:02

Hello, I’ve stumbled upon a DMA based NeoPixel library for NXP Kinesis ARM M4 MCUs that uses code that looks something like

#define NEO_NOF_PIXEL       3
#define NEO_NOF_BITS_PIXEL 24
static uint8_t transmitBuf[NEO_NOF_PIXEL*NEO_NOF_BITS_PIXEL] =
    {
        /* pixel 0: */
        1, 1, 1, 1, 1, 1, 1, 1, /* green */
        0, 0, 0, 0, 0, 0, 0, 0, /* red */
        0, 0, 0, 0, 0, 0, 0, 0, /* blue */
        /* pixel 1: */
        1, 1, 1, 1, 1, 1, 1, 1, /* green */
        1, 1, 1, 1, 1, 1, 1, 1, /* red */
        0, 0, 0, 0, 0, 0, 0, 0,  /* blue */
        /* pixel 2: */
        1, 1, 1, 1, 1, 1, 1, 1, /* green */
        1, 1, 1, 1, 1, 1, 1, 1, /* red */
        1, 1, 1, 1, 1, 1, 1, 1  /* blue */
    };

This is porbably good for static pixels, but if I want to do even simple animations, it might get a little too much. Do you think I can leverage/use some methods from your library to make this a little easier?

I’m somewhat of a noob when it comes to open source licenses, but please also feel free to guide me on how to add proper attribution.
Michael Miller
@Makuna
Aug 30 2016 06:11
Is that hardware an Arduino target?
@AdySan Look at FillBuffers which fills the DMA buffer from the color buffer, you will see a lookup table that is converting them in a dynamic way that the code above is doing statically.
Aditya Tannu
@AdySan
Aug 30 2016 14:43
nope sorry, just running their SDK directly on this board. Thanks a lot, this looks like a good start.
Michael Miller
@Makuna
Aug 30 2016 15:00
@AdySan There is also the difference in the back DMA buffers, the code above is using a byte per bit sent; my implementation uses only 4 bits per bit sent.
Aditya Tannu
@AdySan
Aug 30 2016 15:33
yeah I noticed that, the code above can actually drive 8 lanes in parallel, hence the 8 bits. Somehwat of a memory waste, but I’m only driving a few pixels, shouldnt be an issue.
Michael Miller
@Makuna
Aug 30 2016 17:17
That is some interesting DMA support to drive multiple IO lines; I would love to have that on the hardware I support ;-)