Struct PeriodicTimer

Source
pub struct PeriodicTimer<'d, Dm: DriverMode> { /* private fields */ }
Available on crate feature unstable only.
Expand description

A periodic timer.

Implementations§

Source§

impl<'d> PeriodicTimer<'d, Blocking>

Source

pub fn new( inner: impl Peripheral<P = impl Timer> + 'd, ) -> PeriodicTimer<'d, Blocking>

Construct a new instance of PeriodicTimer.

Source§

impl<Dm> PeriodicTimer<'_, Dm>
where Dm: DriverMode,

Source

pub fn start(&mut self, period: Duration) -> Result<(), Error>

Start a new count down.

Source

pub fn wait(&mut self)

“Wait”, by blocking, until the count down finishes.

Source

pub fn cancel(&mut self) -> Result<(), Error>

Tries to cancel the active count down.

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Set the interrupt handler

Note that this will replace any previously set interrupt handler

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn enable_interrupt(&mut self, enable: bool)

Enable/disable listening for interrupts

Source

pub fn clear_interrupt(&mut self)

Clear the interrupt flag

Trait Implementations§

Source§

impl<Dm> InterruptConfigurable for PeriodicTimer<'_, Dm>
where Dm: DriverMode,

Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for PeriodicTimer<'d, Dm>

§

impl<'d, Dm> !RefUnwindSafe for PeriodicTimer<'d, Dm>

§

impl<'d, Dm> Send for PeriodicTimer<'d, Dm>
where Dm: Send,

§

impl<'d, Dm> !Sync for PeriodicTimer<'d, Dm>

§

impl<'d, Dm> Unpin for PeriodicTimer<'d, Dm>
where Dm: Unpin,

§

impl<'d, Dm> !UnwindSafe for PeriodicTimer<'d, Dm>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.