Module ws2818_rgb_led_spi_driver::encoding[][src]

Utility functions for the encoding of data. This functions respect the restrictions from timings-module. This whole module works with and only with a frequency of crate::timings::PI_SPI_HZ. If you can’t use the optional “adapter_spidev”-feature then take this as a template and build your own encoding functions. So far this file and it’s functions are static and not dynamic.

Constants

SPI_BYTES_PER_RGB_PIXEL

The number of bytes that must be send over SPI to transfer the data of a single RGB pixel.

Functions

encode_rgb

Encodes RGB-Values to the bytes that must be transferred via SPI MOSI. These SPI bytes represent the logical zeros and ones for WS2818. This counts in the constraints that come from crate::timings-module. Due to the specification the data is send this way: G7..G0,R7..R0,B7..B0

encode_rgb_slice

Encodes multiple RGB values in a slice. Uses encode_rgb for each value.