Struct esp32c3_hal::timer::Timer

source ·
pub struct Timer<T> { /* private fields */ }
Expand description

General-purpose timer

Implementations§

source§

impl<T> Timer<T>where T: Instance,

Timer driver

source

pub fn new(timg: T, apb_clk_freq: Rate<u32, 1, 1>) -> Timer<T>

Create a new timer instance

source

pub fn free(self) -> T

Return the raw interface to the underlying timer instance

Trait Implementations§

source§

impl<T> Cancel for Timer<T>where T: Instance,

§

type Error = Error

Error returned when a countdown can’t be canceled.
source§

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

Tries to cancel this countdown. Read more
source§

impl<T> CountDown for Timer<T>where T: Instance,

§

type Time = Duration<u64, 1, 1000000>

The unit of time used by this timer
source§

fn start<Time>(&mut self, timeout: Time)where Time: Into<<Timer<T> as CountDown>::Time>,

Starts a new count down
source§

fn wait(&mut self) -> Result<(), Error<Void>>

Non-blockingly “waits” until the count down finishes Read more
source§

impl<T> Deref for Timer<T>where T: Instance,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Timer<T> as Deref>::Target

Dereferences the value.
source§

impl<T> DerefMut for Timer<T>where T: Instance,

source§

fn deref_mut(&mut self) -> &mut <Timer<T> as Deref>::Target

Mutably dereferences the value.
source§

impl<T> Periodic for Timer<T>where T: Instance,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Timer<T>where T: RefUnwindSafe,

§

impl<T> Send for Timer<T>where T: Send,

§

impl<T> Sync for Timer<T>where T: Sync,

§

impl<T> Unpin for Timer<T>where T: Unpin,

§

impl<T> UnwindSafe for Timer<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.