[−][src]Struct stm32f1xx_hal::rtc::Rtc
Interface to the real time clock
Methods
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 set_seconds(&mut self, seconds: u32)[src]
Set the current rtc value to the specified amount of seconds
pub fn set_alarm(&mut self, seconds: 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 seconds(&self) -> u32[src]
Reads the current time
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<(), Void>[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 Void can't be returned block!(rtc.wait_alarm()).unwrap();
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
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>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
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>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self