Struct stm32l4xx_hal::rtc::Rtc
source · [−]pub struct Rtc { /* private fields */ }
Expand description
RTC Abstraction
Implementations
sourceimpl Rtc
impl Rtc
pub fn rtc(
rtc: RTC,
apb1r1: &mut APB1R1,
bdcr: &mut BDCR,
pwrcr1: &mut CR1,
rtc_config: RtcConfig
) -> Self
sourcepub fn set_date_time(&mut self, date: Date, time: Time)
pub fn set_date_time(&mut self, date: Date, time: Time)
Set Date and Time
sourcepub fn set_time(&mut self, time: Time)
pub fn set_time(&mut self, time: Time)
Set Time Note: If setting both time and date, use set_date_time(…) to avoid errors.
sourcepub fn set_date(&mut self, date: Date)
pub fn set_date(&mut self, date: Date)
Set Date Note: If setting both time and date, use set_date_time(…) to avoid errors.
pub fn get_config(&self) -> RtcConfig
sourcepub fn set_alarm(&mut self, alarm: Alarm, date: Date, time: Time)
pub fn set_alarm(&mut self, alarm: Alarm, date: Date, time: Time)
Sets the time at which an alarm will be triggered This also clears the alarm flag if it is set
sourcepub fn listen(&mut self, exti: &mut EXTI, event: Event)
pub fn listen(&mut self, exti: &mut EXTI, event: Event)
Starts listening for an interrupt event
sourcepub fn unlisten(&mut self, exti: &mut EXTI, event: Event)
pub fn unlisten(&mut self, exti: &mut EXTI, event: Event)
Stops listening for an interrupt event
sourcepub fn check_interrupt(&mut self, event: Event, clear: bool) -> bool
pub fn check_interrupt(&mut self, event: Event, clear: bool) -> bool
Checks for an interrupt event
sourcepub fn set_config(
&mut self,
bdcr: &mut BDCR,
pwrcr1: &mut CR1,
rtc_config: RtcConfig
)
pub fn set_config(
&mut self,
bdcr: &mut BDCR,
pwrcr1: &mut CR1,
rtc_config: RtcConfig
)
Applies the RTC config It this changes the RTC clock source the time will be reset
sourcepub fn wakeup_timer(&mut self) -> WakeupTimer<'_>
pub fn wakeup_timer(&mut self) -> WakeupTimer<'_>
Access the wakeup timer
pub const BACKUP_REGISTER_COUNT: usize
sourcepub fn read_backup_register(&self, register: usize) -> Option<u32>
pub fn read_backup_register(&self, register: usize) -> Option<u32>
Read content of the backup register.
The registers retain their values during wakes from standby mode or system resets. They also retain their value when Vdd is switched off as long as V_BAT is powered.
sourcepub fn write_backup_register(&self, register: usize, value: u32)
pub fn write_backup_register(&self, register: usize, value: u32)
Set content of the backup register.
The registers retain their values during wakes from standby mode or system resets. They also retain their value when Vdd is switched off as long as V_BAT is powered.
Auto Trait Implementations
impl RefUnwindSafe for Rtc
impl Send for Rtc
impl !Sync for Rtc
impl Unpin for Rtc
impl UnwindSafe for Rtc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more