leds = new Uint8Array([255,255,255])
SPI1.send4bit(leds, 0b1110, 0b1100);
The bits are already split up for you.
DMA is used on nRF52 but not STM32 - however the code that's in there works great and has been in use for years without trouble, so I'm loathe to change it.
I'm not sure their PWM via DMA approach is better than the current SPI+DMA approach though.
That thing I mentioned about bringing all the code together would hopefully involve using DMA, but that's another can of worms since it has to be made to work on all platforms as well.
© Espruino, powered by microcosm.
Report a problem