stm32wb_pac/rtc/
tsdr.rs

1#[doc = "Reader of register TSDR"]
2pub type R = crate::R<u32, super::TSDR>;
3#[doc = "Reader of field `WDU`"]
4pub type WDU_R = crate::R<u8, u8>;
5#[doc = "Reader of field `MT`"]
6pub type MT_R = crate::R<bool, bool>;
7#[doc = "Reader of field `MU`"]
8pub type MU_R = crate::R<u8, u8>;
9#[doc = "Reader of field `DT`"]
10pub type DT_R = crate::R<u8, u8>;
11#[doc = "Reader of field `DU`"]
12pub type DU_R = crate::R<u8, u8>;
13impl R {
14    #[doc = "Bits 13:15 - Week day units"]
15    #[inline(always)]
16    pub fn wdu(&self) -> WDU_R {
17        WDU_R::new(((self.bits >> 13) & 0x07) as u8)
18    }
19    #[doc = "Bit 12 - Month tens in BCD format"]
20    #[inline(always)]
21    pub fn mt(&self) -> MT_R {
22        MT_R::new(((self.bits >> 12) & 0x01) != 0)
23    }
24    #[doc = "Bits 8:11 - Month units in BCD format"]
25    #[inline(always)]
26    pub fn mu(&self) -> MU_R {
27        MU_R::new(((self.bits >> 8) & 0x0f) as u8)
28    }
29    #[doc = "Bits 4:5 - Date tens in BCD format"]
30    #[inline(always)]
31    pub fn dt(&self) -> DT_R {
32        DT_R::new(((self.bits >> 4) & 0x03) as u8)
33    }
34    #[doc = "Bits 0:3 - Date units in BCD format"]
35    #[inline(always)]
36    pub fn du(&self) -> DU_R {
37        DU_R::new((self.bits & 0x0f) as u8)
38    }
39}