pub struct Blinker<P: StatefulOutputPin, const N: usize> { /* private fields */ }Expand description
controls an output pin to create blinking patterns.
Implementations§
Source§impl<P: StatefulOutputPin, const N: usize> Blinker<P, N>
impl<P: StatefulOutputPin, const N: usize> Blinker<P, N>
Sourcepub fn push_schedule(&mut self, schedule: Schedule) -> Result<(), Schedule>
pub fn push_schedule(&mut self, schedule: Schedule) -> Result<(), Schedule>
Push a new schedule to the stack Returns an error if the stack is full
Sourcepub fn reset(&mut self) -> Result<(), P::Error>
pub fn reset(&mut self) -> Result<(), P::Error>
Clears schedules and sets the pin to low. Returns an error if the pin is in a bad state(check if your environment supports “infallible” GPIO operations)
Sourcepub async fn step(&mut self) -> Result<(), P::Error>
pub async fn step(&mut self) -> Result<(), P::Error>
Executes one step of the schedule that is on the top of the stack. If there is no schedule, does nothing(so be careful if you call this function in a loop). Returns an error if the pin is in a bad state(check if your environment supports “infallible” GPIO operations).
Auto Trait Implementations§
impl<P, const N: usize> Freeze for Blinker<P, N>where
P: Freeze,
impl<P, const N: usize> RefUnwindSafe for Blinker<P, N>where
P: RefUnwindSafe,
impl<P, const N: usize> Send for Blinker<P, N>where
P: Send,
impl<P, const N: usize> Sync for Blinker<P, N>where
P: Sync,
impl<P, const N: usize> Unpin for Blinker<P, N>where
P: Unpin,
impl<P, const N: usize> UnwindSafe for Blinker<P, N>where
P: 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