pub struct PeriodicTimer<'d, T> { /* private fields */ }Expand description
A periodic timer.
Implementations§
Source§impl<'d, T> PeriodicTimer<'d, T>where
T: Timer,
impl<'d, T> PeriodicTimer<'d, T>where
T: Timer,
Sourcepub fn new(inner: impl Peripheral<P = T> + 'd) -> Self
pub fn new(inner: impl Peripheral<P = T> + 'd) -> Self
Construct a new instance of PeriodicTimer.
Sourcepub fn start(&mut self, timeout: MicrosDurationU64) -> Result<(), Error>
pub fn start(&mut self, timeout: MicrosDurationU64) -> Result<(), Error>
Start a new count down.
Sourcepub fn wait(&mut self) -> Result<(), Void>
pub fn wait(&mut self) -> Result<(), Void>
“Wait” until the count down finishes without blocking.
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Set the interrupt handler
Note that this will replace any previously set interrupt handler
Sourcepub fn enable_interrupt(&mut self, enable: bool)
pub fn enable_interrupt(&mut self, enable: bool)
Enable/disable listening for interrupts
Sourcepub fn clear_interrupt(&mut self)
pub fn clear_interrupt(&mut self)
Clear the interrupt flag
Trait Implementations§
Source§impl<T> Cancel for PeriodicTimer<'_, T>where
T: Timer,
impl<T> Cancel for PeriodicTimer<'_, T>where
T: Timer,
Source§impl<T> InterruptConfigurable for PeriodicTimer<'_, T>where
T: Timer,
impl<T> InterruptConfigurable for PeriodicTimer<'_, T>where
T: Timer,
Source§fn set_interrupt_handler(&mut self, handler: InterruptHandler)
fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Set the interrupt handler Read more
Source§impl<T> CountDown for PeriodicTimer<'_, T>where
T: Timer,
impl<T> CountDown for PeriodicTimer<'_, T>where
T: Timer,
impl<T> Periodic for PeriodicTimer<'_, T>where
T: Timer,
Auto Trait Implementations§
impl<'d, T> Freeze for PeriodicTimer<'d, T>where
T: Freeze,
impl<'d, T> RefUnwindSafe for PeriodicTimer<'d, T>where
T: RefUnwindSafe,
impl<'d, T> Send for PeriodicTimer<'d, T>where
T: Send,
impl<'d, T> Sync for PeriodicTimer<'d, T>where
T: Sync,
impl<'d, T> Unpin for PeriodicTimer<'d, T>where
T: Unpin,
impl<'d, T> !UnwindSafe for PeriodicTimer<'d, T>
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