pub fn time(&self) -> Option<NaiveTime> {
        loop {
            self.calendar_initialized()?;
            let ss = self.reg.ssr.read().ss().bits();
            let data = self.reg.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 RM0433 Rev 7 46.3.9)
            let ss_after = self.reg.ssr.read().ss().bits();
            if ss == ss_after {
                let mut hour = data.ht().bits() * 10 + data.hu().bits();
                if data.pm().bit_is_set() {
                    hour += 12;
                }
                let minute = data.mnt().bits() * 10 + data.mnu().bits();
                let second = data.st().bits() * 10 + data.su().bits();
                let micro = self.ss_to_us(ss);

                return NaiveTime::from_hms_micro_opt(
                    u32(hour),
                    u32(minute),
                    u32(second),
                    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 = self.reg.ssr.read().ss().bits();
            let data = self.reg.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 RM0433 Rev 7 46.3.9)
            let ss_after = self.reg.ssr.read().ss().bits();
            if ss == ss_after {
                let mut hour = data.ht().bits() * 10 + data.hu().bits();
                if data.pm().bit_is_set() {
                    hour += 12;
                }
                let minute = data.mnt().bits() * 10 + data.mnu().bits();
                let second = data.st().bits() * 10 + data.su().bits();
                let micro = self.ss_to_us(ss);
                return NaiveTime::from_hms_micro_opt(
                    u32(hour),
                    u32(minute),
                    u32(second),
                    micro,
                );
            }
        }
    }
pub fn time ( & self ) -> Option < NaiveTime > { loop { self . calendar_initialized ( ) ? ; let ss = self . reg . ssr . read ( ) . ss ( ) . bits ( ) ; let data = self . reg . 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 RM0433 Rev 7 46.3.9) let ss_after = self . reg . ssr . read ( ) . ss ( ) . bits ( ) ; if ss == ss_after { let mut hour = data . ht ( ) . bits ( ) * 10 + data . hu ( ) . bits ( ) ; if data . pm ( ) . bit_is_set ( ) { hour += 12 ; } let minute = data . mnt ( ) . bits ( ) * 10 + data . mnu ( ) . bits ( ) ; let second = data . st ( ) . bits ( ) * 10 + data . su ( ) . bits ( ) ; let micro = self . ss_to_us ( ss ) ; return NaiveTime :: from_hms_micro_opt ( u32 ( hour ) , u32 ( minute ) , u32 ( second ) , micro , ) ; } } }
Current Time
Returns `None` if the calendar has not been initialized
Current Time Returns ` None ` if the calendar has not been initialized
&self
&self