Finally had time to look at the @HIP22 badge and have some initial #Rust code working as well as one of the 16 #LED s driven by the #WS2812 #NeoPixel #SmartLed 's.
Something I haven't yet seen (but seems to be quite common) is (ab-)using the #SPI to produce the waves for the DIN for the LEDs:
To recap, SPI uses SCLK, PICO/MOSI, POCI/MISO, CS/SS for communication, that is clock, data to and from peripheral and chip-select. The LED stripe only uses one "data in" port however, with a peculiar square-wave protocol that requires precise timing. One popular way to achieve that is to program the SPI to leave SCLK, POCI and CS unconfigured and only hook up PICO<->DIN. Further, since the SPI works at roughly 4x the speed the LED strips operate, to send one bit of value X over to the LED, you need to tell the SPI to send four such X valued bits.
Now I need to figure out whether the Rust crate for this allows "empty" or dangling SPI GPIO Pins as well...
https://docs.rs/crate/ws2812-spi/latest
Some articles around this technique:
https://ioprog.com/2016/04/09/stm32f042-driving-a-ws2812b-using-spi/
https://github.com/benwilliam/equinox_clock/tree/master/WS2812b_SPI
There are some people basically doing the same in hardware:
https://sites.google.com/site/wayneholder/besting-ben-heck
https://www.elektormagazine.com/news/spi-to-ws2812b-converter-more-leds-more-power
https://www.youtube.com/watch?v=aCK0SpZ2ueg
#rust #led #ws2812 #neopixel #smartled #spi