[][src]Struct ws2812_spi::Ws2812

pub struct Ws2812<SPI, DEVICE = Ws2812> { /* fields omitted */ }

Implementations

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

pub fn new(spi: SPI) -> Self[src]

Use ws2812 devices via spi

The SPI bus should run within 2 MHz to 3.8 MHz

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

Please ensure that the mcu is pretty fast, otherwise weird timing issues will occur

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

pub fn new_sk6812w(spi: SPI) -> Self[src]

Use sk6812w devices via spi

The SPI bus should run within 2.3 MHz to 3.8 MHz at least.

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

Please ensure that the mcu is pretty fast, otherwise weird timing issues will occur

Trait Implementations

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

type Error = E

type Color = RGB8

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

Write all the items of an iterator to a ws2812 strip

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

type Error = E

type Color = RGBW<u8, u8>

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

Write all the items of an iterator to a ws2812 strip

Auto Trait Implementations

impl<SPI, DEVICE> Send for Ws2812<SPI, DEVICE> where
    DEVICE: Send,
    SPI: Send

impl<SPI, DEVICE> Sync for Ws2812<SPI, DEVICE> where
    DEVICE: Sync,
    SPI: Sync

impl<SPI, DEVICE> Unpin for Ws2812<SPI, DEVICE> where
    DEVICE: Unpin,
    SPI: Unpin

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.