pub struct Timer<T, DM>where
DM: Mode,{ /* private fields */ }Expand description
General-purpose timer.
Implementations§
Trait Implementations§
Source§impl<T> DelayNs for Timer<T, Async>where
T: Instance,
impl<T> DelayNs for Timer<T, Async>where
T: Instance,
Source§async fn delay_ns(&mut self, ns: u32)
async fn delay_ns(&mut self, ns: u32)
Pauses execution for at minimum
ns nanoseconds. Pause can be longer
if the implementation requires it due to precision/timing issues.Source§impl<T> InterruptConfigurable for Timer<T, Blocking>where
T: Instance,
impl<T> InterruptConfigurable for Timer<T, Blocking>where
T: Instance,
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, DM> Peripheral for Timer<T, DM>where
T: Instance,
DM: Mode,
impl<T, DM> Peripheral for Timer<T, DM>where
T: Instance,
DM: Mode,
Source§impl<T, DM> Timer for Timer<T, DM>where
T: Instance,
DM: Mode,
impl<T, DM> Timer for Timer<T, DM>where
T: Instance,
DM: Mode,
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Is the timer running?
Source§fn load_value(&self, value: MicrosDurationU64) -> Result<(), Error>
fn load_value(&self, value: MicrosDurationU64) -> Result<(), Error>
Load a target value into the timer.
Source§fn enable_auto_reload(&self, auto_reload: bool)
fn enable_auto_reload(&self, auto_reload: bool)
Enable auto reload of the loaded value.
Source§fn enable_interrupt(&self, state: bool)
fn enable_interrupt(&self, state: bool)
Enable or disable the timer’s interrupt.
Source§fn clear_interrupt(&self)
fn clear_interrupt(&self)
Clear the timer’s interrupt.
Source§fn set_interrupt_handler(&self, handler: InterruptHandler)
fn set_interrupt_handler(&self, handler: InterruptHandler)
Set the interrupt handler Read more
Source§fn is_interrupt_set(&self) -> bool
fn is_interrupt_set(&self) -> bool
Has the timer triggered?
impl<T, DM> Periodic for Timer<T, DM>
Auto Trait Implementations§
impl<T, DM> Freeze for Timer<T, DM>where
T: Freeze,
impl<T, DM> RefUnwindSafe for Timer<T, DM>where
T: RefUnwindSafe,
DM: RefUnwindSafe,
impl<T, DM> Send for Timer<T, DM>
impl<T, DM> Sync for Timer<T, DM>
impl<T, DM> Unpin for Timer<T, DM>
impl<T, DM> UnwindSafe for Timer<T, DM>where
T: UnwindSafe,
DM: 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