File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,28 @@ impl Rtc {
466
466
467
467
result
468
468
}
469
+
470
+ /// Read content of the backup register.
471
+ ///
472
+ /// The registers retain their values during wakes from standby mode or system resets. They also
473
+ /// retain their value when Vdd is switched off as long as V_BAT is powered.
474
+ pub fn read_backup_register ( & self , register : usize ) -> Option < u32 > {
475
+ if register < 32 {
476
+ Some ( self . rtc . bkpr [ register] . read ( ) . bits ( ) )
477
+ } else {
478
+ None
479
+ }
480
+ }
481
+
482
+ /// Set content of the backup register.
483
+ ///
484
+ /// The registers retain their values during wakes from standby mode or system resets. They also
485
+ /// retain their value when Vdd is switched off as long as V_BAT is powered.
486
+ pub fn write_backup_register ( & self , register : usize , value : u32 ) {
487
+ if register < 32 {
488
+ unsafe { self . rtc . bkpr [ register] . write ( |w| w. bits ( value) ) }
489
+ }
490
+ }
469
491
}
470
492
471
493
/// The RTC wakeup timer
You can’t perform that action at this time.
0 commit comments