[][src]Struct ws2812_spi::prerendered::Ws2812

pub struct Ws2812<'a, SPI> { /* fields omitted */ }

Methods

impl<'a, SPI, E> Ws2812<'a, SPI> where
    SPI: FullDuplex<u8, Error = E>, 
[src]

pub fn new(spi: SPI, timing: Timing, data: &'a mut [u8]) -> Ws2812<'a, SPI>[src]

The SPI bus should run exactly with the provided frequency

You may need to look at the datasheet and your own hal to verify this.

You need to provide a buffer data, whoose length is at least 3 the length of the led strip. You can calculate the exact amount for frequencies >= 3 MHz with "spi frequency / 1_100_00" rounded up

Trait Implementations

impl<SPI, E, '_> SmartLedsWrite for Ws2812<'_, SPI> where
    SPI: FullDuplex<u8, Error = E>, 
[src]

type Error = E

fn write<T>(&mut self, iterator: T) -> Result<(), E> where
    T: Iterator<Item = Color>, 
[src]

Write all the items of an iterator to a ws2812 strip

Auto Trait Implementations

impl<'a, SPI> Send for Ws2812<'a, SPI> where
    SPI: Send

impl<'a, SPI> Sync for Ws2812<'a, SPI> where
    SPI: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]