WS2812B_STM32F4 icon indicating copy to clipboard operation
WS2812B_STM32F4 copied to clipboard

Question: Disable single channel

Open knathan1987 opened this issue 2 years ago • 1 comments

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 😅😞

knathan1987 avatar Feb 18 '23 20:02 knathan1987

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.

hubmartin avatar Feb 18 '23 21:02 hubmartin