pub struct TimerDriver<'d> { /* private fields */ }

Implementations§

source§

impl<'d> TimerDriver<'d>

source

pub fn new<TIMER: Timer>( _timer: impl Peripheral<P = TIMER> + 'd, config: &Config ) -> Result<Self, EspError>

source

pub fn enable(&mut self, enable: bool) -> Result<(), EspError>

source

pub fn counter(&self) -> Result<u64, EspError>

source

pub fn set_counter(&mut self, value: u64) -> Result<(), EspError>

source

pub fn enable_alarm(&mut self, enable: bool) -> Result<(), EspError>

source

pub fn alarm(&self) -> Result<u64, EspError>

source

pub fn set_alarm(&mut self, value: u64) -> Result<(), EspError>

source

pub fn enable_interrupt(&mut self) -> Result<(), EspError>

source

pub fn disable_interrupt(&mut self) -> Result<(), EspError>

source

pub unsafe fn subscribe( &mut self, callback: impl FnMut() + 'static ) -> Result<(), EspError>

Safety

Care should be taken not to call STD, libc or FreeRTOS APIs (except for a few allowed ones) in the callback passed to this function, as it is executed in an ISR context.

source

pub fn unsubscribe(&mut self) -> Result<(), EspError>

source

pub fn group(&self) -> timer_group_t

source

pub fn index(&self) -> timer_idx_t

Trait Implementations§

source§

impl<'d> Drop for TimerDriver<'d>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'d> Send for TimerDriver<'d>

Auto Trait Implementations§

§

impl<'d> RefUnwindSafe for TimerDriver<'d>

§

impl<'d> Sync for TimerDriver<'d>

§

impl<'d> Unpin for TimerDriver<'d>

§

impl<'d> !UnwindSafe for TimerDriver<'d>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.