pub struct Timer { /* private fields */ }Expand description
A FreeRTOS software timer.
Note that all operations on a timer are processed by a FreeRTOS internal task that receives messages in a queue. Every operation has an associated waiting time for that queue to get unblocked.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn new<D: DurationTicks>(period: D) -> TimerBuilder<D>
pub fn new<D: DurationTicks>(period: D) -> TimerBuilder<D>
Create a new timer builder.
Sourcepub unsafe fn from_raw_handle(handle: FreeRtosTimerHandle) -> Self
pub unsafe fn from_raw_handle(handle: FreeRtosTimerHandle) -> Self
pub fn raw_handle(&self) -> FreeRtosTimerHandle
Sourcepub fn start<D: DurationTicks>(
&self,
block_time: D,
) -> Result<(), FreeRtosError>
pub fn start<D: DurationTicks>( &self, block_time: D, ) -> Result<(), FreeRtosError>
Start the timer.
Sourcepub fn start_from_isr(
&self,
context: &mut InterruptContext,
) -> Result<(), FreeRtosError>
pub fn start_from_isr( &self, context: &mut InterruptContext, ) -> Result<(), FreeRtosError>
Start the timer from an interrupt.
Sourcepub fn stop<D: DurationTicks>(&self, block_time: D) -> Result<(), FreeRtosError>
pub fn stop<D: DurationTicks>(&self, block_time: D) -> Result<(), FreeRtosError>
Stop the timer.
Sourcepub fn change_period<D: DurationTicks>(
&self,
block_time: D,
new_period: D,
) -> Result<(), FreeRtosError>
pub fn change_period<D: DurationTicks>( &self, block_time: D, new_period: D, ) -> Result<(), FreeRtosError>
Change the period of the timer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Unpin for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
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