Struct esp_hal_smartled::SmartLedsAdapter
source · pub struct SmartLedsAdapter<CHANNEL, const BUFFER_SIZE: usize> { /* private fields */ }
Expand description
Adapter taking an RMT channel and a specific pin and providing RGB LED
interaction functionality using the smart-leds
crate
Implementations§
source§impl<'d, CHANNEL, const BUFFER_SIZE: usize> SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where
CHANNEL: ConfiguredChannel,
impl<'d, CHANNEL, const BUFFER_SIZE: usize> SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: ConfiguredChannel,
sourcepub fn new<UnconfiguredChannel, O: OutputPin + 'd>(
channel: UnconfiguredChannel,
pin: impl Peripheral<P = O> + 'd
) -> SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where
UnconfiguredChannel: OutputChannel<ConfiguredChannel<'d, O> = CHANNEL>,
pub fn new<UnconfiguredChannel, O: OutputPin + 'd>( channel: UnconfiguredChannel, pin: impl Peripheral<P = O> + 'd ) -> SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where UnconfiguredChannel: OutputChannel<ConfiguredChannel<'d, O> = CHANNEL>,
Create a new adapter object that drives the pin using the RMT channel.
Trait Implementations§
source§impl<CHANNEL, const BUFFER_SIZE: usize> SmartLedsWrite for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where
CHANNEL: ConfiguredChannel,
impl<CHANNEL, const BUFFER_SIZE: usize> SmartLedsWrite for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: ConfiguredChannel,
source§fn write<T, I>(&mut self, iterator: T) -> Result<(), Self::Error>where
T: Iterator<Item = I>,
I: Into<Self::Color>,
fn write<T, I>(&mut self, iterator: T) -> Result<(), Self::Error>where T: Iterator<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 a singular RMT operation based on that buffer.
type Error = LedAdapterError
type Color = RGB<u8>
Auto Trait Implementations§
impl<CHANNEL, const BUFFER_SIZE: usize> RefUnwindSafe for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: RefUnwindSafe,
impl<CHANNEL, const BUFFER_SIZE: usize> Send for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: Send,
impl<CHANNEL, const BUFFER_SIZE: usize> Sync for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: Sync,
impl<CHANNEL, const BUFFER_SIZE: usize> Unpin for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: Unpin,
impl<CHANNEL, const BUFFER_SIZE: usize> UnwindSafe for SmartLedsAdapter<CHANNEL, BUFFER_SIZE>where CHANNEL: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more