Struct Ws2812

Source
pub struct Ws2812<SPI: SpiBus<u8>, C: OrderedColors, const N: usize> { /* private fields */ }
Expand description

N = 12 * NUM_LEDS

Implementations§

Source§

impl<SPI: SpiBus<u8>, C: OrderedColors, const N: usize> Ws2812<SPI, C, N>

Source

pub fn new(spi: SPI) -> Self

Create a new WS2812 driver, with the given SPI bus Colors default to RGB order

Trait Implementations§

Source§

impl<SPI, E, C: OrderedColors, const N: usize> SmartLedsWriteAsync for Ws2812<SPI, C, N>
where SPI: SpiBus<u8, Error = E>,

Source§

type Error = E

Source§

type Color = Rgb<u8>

Source§

async fn write<T, I>( &mut self, iter: T, ) -> Result<(), <SPI as ErrorType>::Error>
where T: IntoIterator<Item = I>, I: Into<Self::Color>,

Auto Trait Implementations§

§

impl<SPI, C, const N: usize> Freeze for Ws2812<SPI, C, N>
where SPI: Freeze,

§

impl<SPI, C, const N: usize> RefUnwindSafe for Ws2812<SPI, C, N>

§

impl<SPI, C, const N: usize> Send for Ws2812<SPI, C, N>
where SPI: Send, C: Send,

§

impl<SPI, C, const N: usize> Sync for Ws2812<SPI, C, N>
where SPI: Sync, C: Sync,

§

impl<SPI, C, const N: usize> Unpin for Ws2812<SPI, C, N>
where SPI: Unpin, C: Unpin,

§

impl<SPI, C, const N: usize> UnwindSafe for Ws2812<SPI, C, N>
where SPI: UnwindSafe, C: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.