We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97912d3 commit 1178e24Copy full SHA for 1178e24
hal/src/rtc/mod.rs
@@ -523,6 +523,17 @@ impl Rtc {
523
self.rtc.cr.modify(|_, w| w.wute().clear_bit());
524
}
525
526
+ /// Returns the value of the wakeup timer as calculated by the RTC logic in RTC cycles
527
+ pub fn wakeup_period_cycles(&self) -> u32 {
528
+ let wutr = self.rtc.wutr.read().wut().bits();
529
+ let wucksel_extension = self.rtc.cr.read().wucksel().is_clock_spare_with_offset();
530
+ if wucksel_extension {
531
+ u32::from(wutr) + 0x1_0000
532
+ } else {
533
+ u32::from(wutr)
534
+ }
535
536
+
537
/// Set alarm A.
538
///
539
/// This will disable the alarm if previously enabled.
0 commit comments