Skip to main content

Timer

Struct Timer 

Source
pub struct Timer<TIMER> { /* private fields */ }
Expand description

HAL struct of timer type B

Implementations§

Source§

impl Timer<TMR2>

Source

pub fn timer2( timer: TMR2, clocking: Clocking, prescale: ClockPrescale, period: u16, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> TMR2

Turn the timer off

Source

pub fn tmr(&self) -> u16

Read the current timer count value (TMR register)

Source

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

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u16

Read the maximum value (PR register)

Source

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

Set the maximum value (PR register)

Source§

impl Timer<TMR3>

Source

pub fn timer3( timer: TMR3, clocking: Clocking, prescale: ClockPrescale, period: u16, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> TMR3

Turn the timer off

Source

pub fn tmr(&self) -> u16

Read the current timer count value (TMR register)

Source

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

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u16

Read the maximum value (PR register)

Source

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

Set the maximum value (PR register)

Source§

impl Timer<TMR4>

Source

pub fn timer4( timer: TMR4, clocking: Clocking, prescale: ClockPrescale, period: u16, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> TMR4

Turn the timer off

Source

pub fn tmr(&self) -> u16

Read the current timer count value (TMR register)

Source

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

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u16

Read the maximum value (PR register)

Source

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

Set the maximum value (PR register)

Source§

impl Timer<TMR5>

Source

pub fn timer5( timer: TMR5, clocking: Clocking, prescale: ClockPrescale, period: u16, stop_in_idle_mode: bool, ) -> Self

Initialize the timer

Source

pub fn free(self) -> TMR5

Turn the timer off

Source

pub fn tmr(&self) -> u16

Read the current timer count value (TMR register)

Source

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

Set the current timer count value (TMR register)

Source

pub fn pr(&self) -> u16

Read the maximum value (PR register)

Source

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

Set the maximum value (PR register)

Auto Trait Implementations§

§

impl<TIMER> Freeze for Timer<TIMER>
where TIMER: Freeze,

§

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

§

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

§

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

§

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

§

impl<TIMER> UnsafeUnpin for Timer<TIMER>
where TIMER: UnsafeUnpin,

§

impl<TIMER> UnwindSafe for Timer<TIMER>
where TIMER: 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.