[−][src]Struct stm32f1xx_hal::rtc::Rtc
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,