[][src]Struct stm32f1xx_hal::rtc::Rtc

pub struct Rtc { /* fields omitted */ }

Interface to the real time clock

Implementations

impl Rtc[src]

pub fn rtc(regs: RTC, bkp: &mut BackupDomain) -> Self[src]

Initialises the RTC. The BackupDomain struct is created by Rcc.bkp.constrain().

pub fn select_frequency(&mut self, timeout: impl Into<Hertz>)[src]

Selects the frequency of the RTC Timer NOTE: Maximum frequency of 16384 Hz using the internal LSE

pub fn set_time(&mut self, counter_value: u32)[src]

Set the current RTC counter value to the specified amount

pub fn set_alarm(&mut self, counter_value: u32)[src]

Sets the time at which an alarm will be triggered

This also clears the alarm flag if it is set

pub fn listen_alarm(&mut self)[src]

Enables the RTCALARM interrupt

pub fn unlisten_alarm(&mut self)[src]

Disables the RTCALARM interrupt

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

Reads the current counter

pub fn listen_seconds(&mut self)[src]

Enables the RTC second interrupt

pub fn unlisten_seconds(&mut self)[src]

Disables the RTC second interrupt

pub fn clear_second_flag(&mut self)[src]

Clears the RTC second interrupt flag

pub fn clear_alarm_flag(&mut self)[src]

Clears the RTC alarm interrupt flag

pub fn wait_alarm(&mut self) -> Result<(), Infallible>[src]

Return Ok(()) if the alarm flag is set, Err(nb::WouldBlock) otherwise.

use nb::block;

rtc.set_alarm(rtc.read_counts() + 5);
// NOTE: Safe unwrap because Infallible can't be returned
block!(rtc.wait_alarm()).unwrap();

Auto Trait Implementations

impl Send for Rtc

impl !Sync for Rtc

impl Unpin for Rtc

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.