pub fn time(&self) -> Option<NaiveTime> {
        loop {
            self.calendar_initialized()?;
            let ss: u32 = self.rtc.ssr.read().ss().bits();
            let data = self.rtc.tr.read();

            // If an RTCCLK edge occurs during read we may see inconsistent values
            // so read ssr again and see if it has changed
            // see RM0453 Rev 2 32.3.10 page 1002 "Reading the calendar"
            let ss_after: u32 = self.rtc.ssr.read().ss().bits();
            if ss == ss_after {
                let mut hour: u8 = data.ht().bits() * 10 + data.hu().bits();
                if data.pm().is_pm() {
                    hour += 12;
                }
                let minute: u8 = data.mnt().bits() * 10 + data.mnu().bits();
                let second: u8 = data.st().bits() * 10 + data.su().bits();
                let micro: u32 = self.ss_to_us(ss);

                return NaiveTime::from_hms_micro_opt(
                    hour as u32,
                    minute as u32,
                    second as u32,
                    micro,
                );
            }
        }
    }
/// Current Time
///
/// Returns `None` if the calendar has not been initialized.
Current Time
Returns `None` if the calendar has not been initialized.
Current Time Returns ` None ` if the calendar has not been initialized .
pub fn time(&self) -> Option<NaiveTime> {
        loop {
            self.calendar_initialized()?;
            let ss: u32 = self.rtc.ssr.read().ss().bits();
            let data = self.rtc.tr.read();
            // If an RTCCLK edge occurs during read we may see inconsistent values
            // so read ssr again and see if it has changed
            // see RM0453 Rev 2 32.3.10 page 1002 "Reading the calendar"
            let ss_after: u32 = self.rtc.ssr.read().ss().bits();
            if ss == ss_after {
                let mut hour: u8 = data.ht().bits() * 10 + data.hu().bits();
                if data.pm().is_pm() {
                    hour += 12;
                }
                let minute: u8 = data.mnt().bits() * 10 + data.mnu().bits();
                let second: u8 = data.st().bits() * 10 + data.su().bits();
                let micro: u32 = self.ss_to_us(ss);
                return NaiveTime::from_hms_micro_opt(
                    hour as u32,
                    minute as u32,
                    second as u32,
                    micro,
                );
            }
        }
    }
pub fn time ( & self ) -> Option < NaiveTime > { loop { self . calendar_initialized ( ) ? ; let ss : u32 = self . rtc . ssr . read ( ) . ss ( ) . bits ( ) ; let data = self . rtc . tr . read ( ) ; // If an RTCCLK edge occurs during read we may see inconsistent values // so read ssr again and see if it has changed // see RM0453 Rev 2 32.3.10 page 1002 "Reading the calendar" let ss_after : u32 = self . rtc . ssr . read ( ) . ss ( ) . bits ( ) ; if ss == ss_after { let mut hour : u8 = data . ht ( ) . bits ( ) * 10 + data . hu ( ) . bits ( ) ; if data . pm ( ) . is_pm ( ) { hour += 12 ; } let minute : u8 = data . mnt ( ) . bits ( ) * 10 + data . mnu ( ) . bits ( ) ; let second : u8 = data . st ( ) . bits ( ) * 10 + data . su ( ) . bits ( ) ; let micro : u32 = self . ss_to_us ( ss ) ; return NaiveTime :: from_hms_micro_opt ( hour as u32 , minute as u32 , second as u32 , micro , ) ; } } }
Current Time
Returns `None` if the calendar has not been initialized.
Current Time Returns ` None ` if the calendar has not been initialized .
&self