[][src]Struct trinket_m0::rtc::Rtc

pub struct Rtc { /* fields omitted */ }

Rtc represents the RTC peripheral for either clock/calendar or timer mode.

Implementations

impl Rtc[src]

pub fn new(rtc: RTC, rtc_clock_freq: Hertz, pm: &mut PM) -> Rtc[src]

Resets & does the basic configuration of the RTC peripheral, but doesn't configure it into a specific mode.

pub fn clock_mode(&mut self)[src]

Configures the peripheral for clock/calendar mode. Requires the source clock to be running at 1024 Hz.

pub fn current_time(&self) -> Datetime[src]

Returns the current clock/calendar value.

pub fn set_time(&mut self, time: Datetime)[src]

Updates the current clock/calendar value.

Trait Implementations

impl CountDown for Rtc[src]

type Time = Nanoseconds

The unit of time used by this timer

impl InterruptDrivenTimer for Rtc[src]

pub fn enable_interrupt(&mut self)[src]

Enable the interrupt generation for this hardware timer. This method only sets the clock configuration to trigger the interrupt; it does not configure the interrupt controller or define an interrupt handler.

pub fn disable_interrupt(&mut self)[src]

Disables interrupt generation for this hardware timer. This method only sets the clock configuration to prevent triggering the interrupt; it does not configure the interrupt controller.

impl Periodic for Rtc[src]

Auto Trait Implementations

impl Send for Rtc[src]

impl !Sync for Rtc[src]

impl Unpin for Rtc[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.