SmartLedsAdapterAsync

Struct SmartLedsAdapterAsync 

Source
pub struct SmartLedsAdapterAsync<Tx, const BUFFER_SIZE: usize> { /* private fields */ }
Expand description

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

Implementations§

Source§

impl<'d, Tx: TxChannelAsync, const BUFFER_SIZE: usize> SmartLedsAdapterAsync<Tx, BUFFER_SIZE>

Source

pub fn new<C, O>( channel: C, pin: O, rmt_buffer: [u32; BUFFER_SIZE], ) -> SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where O: PeripheralOutput<'d>, C: TxChannelCreatorAsync<'d, Tx>,

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

Trait Implementations§

Source§

impl<Tx: TxChannelAsync, const BUFFER_SIZE: usize> SmartLedsWriteAsync for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>

Source§

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

Convert all RGB8 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 = Rgb<u8>

Auto Trait Implementations§

§

impl<Tx, const BUFFER_SIZE: usize> Freeze for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: Freeze,

§

impl<Tx, const BUFFER_SIZE: usize> RefUnwindSafe for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: RefUnwindSafe,

§

impl<Tx, const BUFFER_SIZE: usize> Send for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: Send,

§

impl<Tx, const BUFFER_SIZE: usize> Sync for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: Sync,

§

impl<Tx, const BUFFER_SIZE: usize> Unpin for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: Unpin,

§

impl<Tx, const BUFFER_SIZE: usize> UnwindSafe for SmartLedsAdapterAsync<Tx, BUFFER_SIZE>
where Tx: 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> 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.