pub struct Rtc { /* private fields */ }
Expand description
RTC driver.
Implementations§
Source§impl Rtc
impl Rtc
Sourcepub const BACKUP_REGISTER_COUNT: usize = 20usize
pub const BACKUP_REGISTER_COUNT: usize = 20usize
Number of backup registers of this instance.
Sourcepub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self
pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self
Create a new RTC instance.
Sourcepub const fn time_provider(&self) -> RtcTimeProvider
pub const fn time_provider(&self) -> RtcTimeProvider
Acquire a RtcTimeProvider
instance.
Sourcepub fn set_datetime(&mut self, t: DateTime) -> Result<(), RtcError>
pub fn set_datetime(&mut self, t: DateTime) -> Result<(), RtcError>
Set the datetime to a new value.
§Errors
Will return RtcError::InvalidDateTime
if the datetime is not a valid range.
Sourcepub fn get_daylight_savings(&self) -> bool
pub fn get_daylight_savings(&self) -> bool
Check if daylight savings time is active.
Sourcepub fn set_daylight_savings(&mut self, daylight_savings: bool)
pub fn set_daylight_savings(&mut self, daylight_savings: bool)
Enable/disable daylight savings time.
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 Freeze for Rtc
impl RefUnwindSafe for Rtc
impl Send for Rtc
impl Sync for Rtc
impl Unpin for Rtc
impl UnwindSafe for Rtc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more