Struct ws2811_spi::Ws2811

source ·
pub struct Ws2811<SPI, DEVICE = Ws2811> { /* private fields */ }

Implementations§

source§

impl<SPI, E> Ws2811<SPI>where SPI: FullDuplex<u8, Error = E>,

source

pub fn new(spi: SPI) -> Self

Use Ws2811 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

Trait Implementations§

source§

impl<SPI, E> SmartLedsWrite for Ws2811<SPI>where SPI: FullDuplex<u8, Error = E>,

source§

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

Write all the items of an iterator to a Ws2811 strip

§

type Error = E

§

type Color = RGB<u8>

Auto Trait Implementations§

§

impl<SPI, DEVICE> RefUnwindSafe for Ws2811<SPI, DEVICE>where DEVICE: RefUnwindSafe, SPI: RefUnwindSafe,

§

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

§

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

§

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

§

impl<SPI, DEVICE> UnwindSafe for Ws2811<SPI, DEVICE>where DEVICE: UnwindSafe, SPI: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.