Skip to main content

SmartLedsAdapterAsync

Struct SmartLedsAdapterAsync 

Source
pub struct SmartLedsAdapterAsync<'ch, const BUFFER_SIZE: usize, Color = Grb<u8>> { /* private fields */ }
Expand description

Adapter taking an RMT channel and a specific pin and providing RGB LED interaction functionality.

Implementations§

Source§

impl<'ch, const BUFFER_SIZE: usize> SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Grb<u8>>

Source

pub fn new<C, O>( channel: C, pin: O, rmt_buffer: &'ch mut [PulseCode; BUFFER_SIZE], ) -> Self
where O: PeripheralOutput<'ch>, C: TxChannelCreator<'ch, Async>,

Create a new adapter object that drives the pin using the RMT channel.

Source§

impl<'ch, const BUFFER_SIZE: usize, Color> SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where Color: ComponentSlice<u8>,

Source

pub fn new_with_color<C, O>( channel: C, pin: O, rmt_buffer: &'ch mut [PulseCode; BUFFER_SIZE], ) -> SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where O: PeripheralOutput<'ch>, C: TxChannelCreator<'ch, Async>,

Create a new adapter object that drives the pin using the RMT channel.

Trait Implementations§

Source§

impl<'ch, const BUFFER_SIZE: usize, Color> SmartLedsWriteAsync for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where Color: ComponentSlice<u8>,

Source§

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

Convert all items of the iterator to the RMT format and add them to internal buffer, then start perform all asynchronous operations based on that buffer.

Source§

type Error = LedAdapterError

Source§

type Color = Color

Auto Trait Implementations§

§

impl<'ch, const BUFFER_SIZE: usize, Color = Grb<u8>> !Send for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>

§

impl<'ch, const BUFFER_SIZE: usize, Color = Grb<u8>> !UnwindSafe for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>

§

impl<'ch, const BUFFER_SIZE: usize, Color> Freeze for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>

§

impl<'ch, const BUFFER_SIZE: usize, Color> RefUnwindSafe for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where Color: RefUnwindSafe,

§

impl<'ch, const BUFFER_SIZE: usize, Color> Sync for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where Color: Sync,

§

impl<'ch, const BUFFER_SIZE: usize, Color> Unpin for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>
where Color: Unpin,

§

impl<'ch, const BUFFER_SIZE: usize, Color> UnsafeUnpin for SmartLedsAdapterAsync<'ch, BUFFER_SIZE, Color>

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> Same for T

Source§

type Output = T

Should always be Self
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.