efm32tg11b_pac/efm32tg11b120/rtcc/
cc1_time.rs1#[doc = "Register `CC1_TIME` reader"]
2pub struct R(crate::R<CC1_TIME_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CC1_TIME_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CC1_TIME_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CC1_TIME_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CC1_TIME` writer"]
17pub struct W(crate::W<CC1_TIME_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CC1_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<CC1_TIME_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CC1_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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 4, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 3, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 4, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 3, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 4, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, CC1_TIME_SPEC, u8, u8, 2, O>;
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 #[must_use]
97 pub fn secu(&mut self) -> SECU_W<0> {
98 SECU_W::new(self)
99 }
100 #[doc = "Bits 4:6 - Seconds, Tens"]
101 #[inline(always)]
102 #[must_use]
103 pub fn sect(&mut self) -> SECT_W<4> {
104 SECT_W::new(self)
105 }
106 #[doc = "Bits 8:11 - Minutes, Units"]
107 #[inline(always)]
108 #[must_use]
109 pub fn minu(&mut self) -> MINU_W<8> {
110 MINU_W::new(self)
111 }
112 #[doc = "Bits 12:14 - Minutes, Tens"]
113 #[inline(always)]
114 #[must_use]
115 pub fn mint(&mut self) -> MINT_W<12> {
116 MINT_W::new(self)
117 }
118 #[doc = "Bits 16:19 - Hours, Units"]
119 #[inline(always)]
120 #[must_use]
121 pub fn houru(&mut self) -> HOURU_W<16> {
122 HOURU_W::new(self)
123 }
124 #[doc = "Bits 20:21 - Hours, Tens"]
125 #[inline(always)]
126 #[must_use]
127 pub fn hourt(&mut self) -> HOURT_W<20> {
128 HOURT_W::new(self)
129 }
130 #[doc = "Writes raw bits to the register."]
131 #[inline(always)]
132 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
133 self.0.bits(bits);
134 self
135 }
136}
137#[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 [cc1_time](index.html) module"]
138pub struct CC1_TIME_SPEC;
139impl crate::RegisterSpec for CC1_TIME_SPEC {
140 type Ux = u32;
141}
142#[doc = "`read()` method returns [cc1_time::R](R) reader structure"]
143impl crate::Readable for CC1_TIME_SPEC {
144 type Reader = R;
145}
146#[doc = "`write(|w| ..)` method takes [cc1_time::W](W) writer structure"]
147impl crate::Writable for CC1_TIME_SPEC {
148 type Writer = W;
149 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
150 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
151}
152#[doc = "`reset()` method sets CC1_TIME to value 0"]
153impl crate::Resettable for CC1_TIME_SPEC {
154 const RESET_VALUE: Self::Ux = 0;
155}