pub struct PioWs2812<'d, P: Instance, const S: usize, ORDER>where
ORDER: RgbColorOrder,{ /* private fields */ }Expand description
Pio backed RGB ws2812 driver Const N is the number of ws2812 leds attached to this pin
Implementations§
Source§impl<'d, P: Instance, const S: usize> PioWs2812<'d, P, S, Grb>
impl<'d, P: Instance, const S: usize> PioWs2812<'d, P, S, Grb>
Sourcepub fn new<D: ChannelInstance>(
pio: &mut Common<'d, P>,
sm: StateMachine<'d, P, S>,
pin: Peri<'d, impl PioPin>,
dma: Peri<'d, D>,
irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
program: &PioWs2812Program<'d, P>,
) -> Self
pub fn new<D: ChannelInstance>( pio: &mut Common<'d, P>, sm: StateMachine<'d, P, S>, pin: Peri<'d, impl PioPin>, dma: Peri<'d, D>, irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, program: &PioWs2812Program<'d, P>, ) -> Self
Configure a pio state machine to use the loaded ws2812 program. Uses the default GRB order.
Source§impl<'d, P: Instance, const S: usize, ORDER> PioWs2812<'d, P, S, ORDER>where
ORDER: RgbColorOrder,
impl<'d, P: Instance, const S: usize, ORDER> PioWs2812<'d, P, S, ORDER>where
ORDER: RgbColorOrder,
Sourcepub fn with_color_order<D: ChannelInstance>(
pio: &mut Common<'d, P>,
sm: StateMachine<'d, P, S>,
pin: Peri<'d, impl PioPin>,
dma: Peri<'d, D>,
irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
program: &PioWs2812Program<'d, P>,
) -> Self
pub fn with_color_order<D: ChannelInstance>( pio: &mut Common<'d, P>, sm: StateMachine<'d, P, S>, pin: Peri<'d, impl PioPin>, dma: Peri<'d, D>, irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, program: &PioWs2812Program<'d, P>, ) -> Self
Configure a pio state machine to use the loaded ws2812 program. Uses the specified color order.
Sourcepub async fn write_slice<const N: usize>(&mut self, colors: &[RGB8; N])
pub async fn write_slice<const N: usize>(&mut self, colors: &[RGB8; N])
Write a buffer of [smart_leds::RGB8] to the ws2812 string
Trait Implementations§
Auto Trait Implementations§
impl<'d, P, const S: usize, ORDER> !UnwindSafe for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> Freeze for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> RefUnwindSafe for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> Send for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> Sync for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> Unpin for PioWs2812<'d, P, S, ORDER>
impl<'d, P, const S: usize, ORDER> UnsafeUnpin for PioWs2812<'d, P, S, ORDER>
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