efm32pg1b_pac/rtcc/
cc0_time.rs

1///Register `CC0_TIME` reader
2pub type R = crate::R<CC0_TIMErs>;
3///Register `CC0_TIME` writer
4pub type W = crate::W<CC0_TIMErs>;
5///Field `SECU` reader - Seconds, Units
6pub type SecuR = crate::FieldReader;
7///Field `SECU` writer - Seconds, Units
8pub type SecuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9///Field `SECT` reader - Seconds, Tens
10pub type SectR = crate::FieldReader;
11///Field `SECT` writer - Seconds, Tens
12pub type SectW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13///Field `MINU` reader - Minutes, Units
14pub type MinuR = crate::FieldReader;
15///Field `MINU` writer - Minutes, Units
16pub type MinuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17///Field `MINT` reader - Minutes, Tens
18pub type MintR = crate::FieldReader;
19///Field `MINT` writer - Minutes, Tens
20pub type MintW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
21///Field `HOURU` reader - Hours, Units
22pub type HouruR = crate::FieldReader;
23///Field `HOURU` writer - Hours, Units
24pub type HouruW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25///Field `HOURT` reader - Hours, Tens
26pub type HourtR = crate::FieldReader;
27///Field `HOURT` writer - Hours, Tens
28pub type HourtW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29impl R {
30    ///Bits 0:3 - Seconds, Units
31    #[inline(always)]
32    pub fn secu(&self) -> SecuR {
33        SecuR::new((self.bits & 0x0f) as u8)
34    }
35    ///Bits 4:6 - Seconds, Tens
36    #[inline(always)]
37    pub fn sect(&self) -> SectR {
38        SectR::new(((self.bits >> 4) & 7) as u8)
39    }
40    ///Bits 8:11 - Minutes, Units
41    #[inline(always)]
42    pub fn minu(&self) -> MinuR {
43        MinuR::new(((self.bits >> 8) & 0x0f) as u8)
44    }
45    ///Bits 12:14 - Minutes, Tens
46    #[inline(always)]
47    pub fn mint(&self) -> MintR {
48        MintR::new(((self.bits >> 12) & 7) as u8)
49    }
50    ///Bits 16:19 - Hours, Units
51    #[inline(always)]
52    pub fn houru(&self) -> HouruR {
53        HouruR::new(((self.bits >> 16) & 0x0f) as u8)
54    }
55    ///Bits 20:21 - Hours, Tens
56    #[inline(always)]
57    pub fn hourt(&self) -> HourtR {
58        HourtR::new(((self.bits >> 20) & 3) as u8)
59    }
60}
61impl core::fmt::Debug for R {
62    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
63        f.debug_struct("CC0_TIME")
64            .field("secu", &self.secu())
65            .field("sect", &self.sect())
66            .field("minu", &self.minu())
67            .field("mint", &self.mint())
68            .field("houru", &self.houru())
69            .field("hourt", &self.hourt())
70            .finish()
71    }
72}
73impl W {
74    ///Bits 0:3 - Seconds, Units
75    #[inline(always)]
76    pub fn secu(&mut self) -> SecuW<CC0_TIMErs> {
77        SecuW::new(self, 0)
78    }
79    ///Bits 4:6 - Seconds, Tens
80    #[inline(always)]
81    pub fn sect(&mut self) -> SectW<CC0_TIMErs> {
82        SectW::new(self, 4)
83    }
84    ///Bits 8:11 - Minutes, Units
85    #[inline(always)]
86    pub fn minu(&mut self) -> MinuW<CC0_TIMErs> {
87        MinuW::new(self, 8)
88    }
89    ///Bits 12:14 - Minutes, Tens
90    #[inline(always)]
91    pub fn mint(&mut self) -> MintW<CC0_TIMErs> {
92        MintW::new(self, 12)
93    }
94    ///Bits 16:19 - Hours, Units
95    #[inline(always)]
96    pub fn houru(&mut self) -> HouruW<CC0_TIMErs> {
97        HouruW::new(self, 16)
98    }
99    ///Bits 20:21 - Hours, Tens
100    #[inline(always)]
101    pub fn hourt(&mut self) -> HourtW<CC0_TIMErs> {
102        HourtW::new(self, 20)
103    }
104}
105///Capture/Compare Time Register
106///
107///You can [`read`](crate::Reg::read) this register and get [`cc0_time::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cc0_time::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
108pub struct CC0_TIMErs;
109impl crate::RegisterSpec for CC0_TIMErs {
110    type Ux = u32;
111}
112///`read()` method returns [`cc0_time::R`](R) reader structure
113impl crate::Readable for CC0_TIMErs {}
114///`write(|w| ..)` method takes [`cc0_time::W`](W) writer structure
115impl crate::Writable for CC0_TIMErs {
116    type Safety = crate::Unsafe;
117    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
118    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
119}
120///`reset()` method sets CC0_TIME to value 0
121impl crate::Resettable for CC0_TIMErs {
122    const RESET_VALUE: u32 = 0;
123}