Skip to main content

Timer32

Struct Timer32 

Source
pub struct Timer32<TIMERL, TIMERH> { /* private fields */ }
Expand description

HAL struct for a pair of timers of type B (32-bit mode)

Implementations§

Source§

impl Timer32<TMR2, TMR3>

Source

pub fn timer2_3( timer_low: TMR2, timer_high: TMR3, clocking: Clocking, prescale: ClockPrescale, period: u32, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> (TMR2, TMR3)

Turn the timer off

Source

pub fn tmr(&self) -> u32

Read the current timer count value (TMR register)

Source

pub fn set_tmr(&mut self, tmr: u32)

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u32

Read the maximum value (PR register)

Source

pub fn set_pr(&mut self, period: u32)

Set the maximum value (PR register)

Source§

impl Timer32<TMR4, TMR5>

Source

pub fn timer4_5( timer_low: TMR4, timer_high: TMR5, clocking: Clocking, prescale: ClockPrescale, period: u32, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> (TMR4, TMR5)

Turn the timer off

Source

pub fn tmr(&self) -> u32

Read the current timer count value (TMR register)

Source

pub fn set_tmr(&mut self, tmr: u32)

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u32

Read the maximum value (PR register)

Source

pub fn set_pr(&mut self, period: u32)

Set the maximum value (PR register)

Auto Trait Implementations§

§

impl<TIMERL, TIMERH> Freeze for Timer32<TIMERL, TIMERH>
where TIMERL: Freeze, TIMERH: Freeze,

§

impl<TIMERL, TIMERH> RefUnwindSafe for Timer32<TIMERL, TIMERH>
where TIMERL: RefUnwindSafe, TIMERH: RefUnwindSafe,

§

impl<TIMERL, TIMERH> Send for Timer32<TIMERL, TIMERH>
where TIMERL: Send, TIMERH: Send,

§

impl<TIMERL, TIMERH> Sync for Timer32<TIMERL, TIMERH>
where TIMERL: Sync, TIMERH: Sync,

§

impl<TIMERL, TIMERH> Unpin for Timer32<TIMERL, TIMERH>
where TIMERL: Unpin, TIMERH: Unpin,

§

impl<TIMERL, TIMERH> UnsafeUnpin for Timer32<TIMERL, TIMERH>
where TIMERL: UnsafeUnpin, TIMERH: UnsafeUnpin,

§

impl<TIMERL, TIMERH> UnwindSafe for Timer32<TIMERL, TIMERH>
where TIMERL: UnwindSafe, TIMERH: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.