hubmartin / WS2812B_STM32F4

WS2812 DMA library with low RAM needs. Up to 16 paralel outputs and thousands of LEDs on each of them
MIT License
112 stars 32 forks source link

Question: Disable single channel #15

Open knathan1987 opened 1 year ago

knathan1987 commented 1 year ago

Hi!

How can I disable a single channel? Sure - I could set the whole channel to black. But I want the data Pin for that channel to either be high or low for as long the channels is disabled - without any state changes. I would start by adding an "enabled" option to the "WS2812_BufferItem"-Structure. But I don't know where I should continue - and I don't really understand that whole DMA thing 😅😞

hubmartin commented 1 year ago

You can disable bits in this RAM array at runtime. Each bit corresponds to GPIO port 0 to 15. https://github.com/hubmartin/WS2812B_STM32F4/blob/master/Src/ws2812b/ws2812b.c#L23

If the bit is cleared, then the DMA on the begining in the cycle does not write to the bit set register.