efm32gg12b430_pac/rtcc/
cc2_time.rs1#[doc = "Register `CC2_TIME` reader"]
2pub struct R(crate::R<CC2_TIME_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CC2_TIME_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CC2_TIME_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CC2_TIME_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CC2_TIME` writer"]
17pub struct W(crate::W<CC2_TIME_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CC2_TIME_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CC2_TIME_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CC2_TIME_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `SECU` reader - Seconds, Units"]
38pub type SECU_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `SECU` writer - Seconds, Units"]
40pub type SECU_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 4, 0>;
41#[doc = "Field `SECT` reader - Seconds, Tens"]
42pub type SECT_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `SECT` writer - Seconds, Tens"]
44pub type SECT_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 3, 4>;
45#[doc = "Field `MINU` reader - Minutes, Units"]
46pub type MINU_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `MINU` writer - Minutes, Units"]
48pub type MINU_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 4, 8>;
49#[doc = "Field `MINT` reader - Minutes, Tens"]
50pub type MINT_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `MINT` writer - Minutes, Tens"]
52pub type MINT_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 3, 12>;
53#[doc = "Field `HOURU` reader - Hours, Units"]
54pub type HOURU_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `HOURU` writer - Hours, Units"]
56pub type HOURU_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 4, 16>;
57#[doc = "Field `HOURT` reader - Hours, Tens"]
58pub type HOURT_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `HOURT` writer - Hours, Tens"]
60pub type HOURT_W<'a> = crate::FieldWriter<'a, u32, CC2_TIME_SPEC, u8, u8, 2, 20>;
61impl R {
62 #[doc = "Bits 0:3 - Seconds, Units"]
63 #[inline(always)]
64 pub fn secu(&self) -> SECU_R {
65 SECU_R::new((self.bits & 0x0f) as u8)
66 }
67 #[doc = "Bits 4:6 - Seconds, Tens"]
68 #[inline(always)]
69 pub fn sect(&self) -> SECT_R {
70 SECT_R::new(((self.bits >> 4) & 7) as u8)
71 }
72 #[doc = "Bits 8:11 - Minutes, Units"]
73 #[inline(always)]
74 pub fn minu(&self) -> MINU_R {
75 MINU_R::new(((self.bits >> 8) & 0x0f) as u8)
76 }
77 #[doc = "Bits 12:14 - Minutes, Tens"]
78 #[inline(always)]
79 pub fn mint(&self) -> MINT_R {
80 MINT_R::new(((self.bits >> 12) & 7) as u8)
81 }
82 #[doc = "Bits 16:19 - Hours, Units"]
83 #[inline(always)]
84 pub fn houru(&self) -> HOURU_R {
85 HOURU_R::new(((self.bits >> 16) & 0x0f) as u8)
86 }
87 #[doc = "Bits 20:21 - Hours, Tens"]
88 #[inline(always)]
89 pub fn hourt(&self) -> HOURT_R {
90 HOURT_R::new(((self.bits >> 20) & 3) as u8)
91 }
92}
93impl W {
94 #[doc = "Bits 0:3 - Seconds, Units"]
95 #[inline(always)]
96 pub fn secu(&mut self) -> SECU_W {
97 SECU_W::new(self)
98 }
99 #[doc = "Bits 4:6 - Seconds, Tens"]
100 #[inline(always)]
101 pub fn sect(&mut self) -> SECT_W {
102 SECT_W::new(self)
103 }
104 #[doc = "Bits 8:11 - Minutes, Units"]
105 #[inline(always)]
106 pub fn minu(&mut self) -> MINU_W {
107 MINU_W::new(self)
108 }
109 #[doc = "Bits 12:14 - Minutes, Tens"]
110 #[inline(always)]
111 pub fn mint(&mut self) -> MINT_W {
112 MINT_W::new(self)
113 }
114 #[doc = "Bits 16:19 - Hours, Units"]
115 #[inline(always)]
116 pub fn houru(&mut self) -> HOURU_W {
117 HOURU_W::new(self)
118 }
119 #[doc = "Bits 20:21 - Hours, Tens"]
120 #[inline(always)]
121 pub fn hourt(&mut self) -> HOURT_W {
122 HOURT_W::new(self)
123 }
124 #[doc = "Writes raw bits to the register."]
125 #[inline(always)]
126 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
127 self.0.bits(bits);
128 self
129 }
130}
131#[doc = "Capture/Compare Time Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cc2_time](index.html) module"]
132pub struct CC2_TIME_SPEC;
133impl crate::RegisterSpec for CC2_TIME_SPEC {
134 type Ux = u32;
135}
136#[doc = "`read()` method returns [cc2_time::R](R) reader structure"]
137impl crate::Readable for CC2_TIME_SPEC {
138 type Reader = R;
139}
140#[doc = "`write(|w| ..)` method takes [cc2_time::W](W) writer structure"]
141impl crate::Writable for CC2_TIME_SPEC {
142 type Writer = W;
143}
144#[doc = "`reset()` method sets CC2_TIME to value 0"]
145impl crate::Resettable for CC2_TIME_SPEC {
146 #[inline(always)]
147 fn reset_value() -> Self::Ux {
148 0
149 }
150}