efm32pg12b500_pac/cmu/
hfperclken0.rs1#[doc = "Register `HFPERCLKEN0` reader"]
2pub struct R(crate::R<HFPERCLKEN0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HFPERCLKEN0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HFPERCLKEN0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HFPERCLKEN0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HFPERCLKEN0` writer"]
17pub struct W(crate::W<HFPERCLKEN0_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HFPERCLKEN0_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<HFPERCLKEN0_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HFPERCLKEN0_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `TIMER0` reader - Timer 0 Clock Enable"]
38pub type TIMER0_R = crate::BitReader<bool>;
39#[doc = "Field `TIMER0` writer - Timer 0 Clock Enable"]
40pub type TIMER0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 0>;
41#[doc = "Field `TIMER1` reader - Timer 1 Clock Enable"]
42pub type TIMER1_R = crate::BitReader<bool>;
43#[doc = "Field `TIMER1` writer - Timer 1 Clock Enable"]
44pub type TIMER1_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 1>;
45#[doc = "Field `WTIMER0` reader - Wide Timer 0 Clock Enable"]
46pub type WTIMER0_R = crate::BitReader<bool>;
47#[doc = "Field `WTIMER0` writer - Wide Timer 0 Clock Enable"]
48pub type WTIMER0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 2>;
49#[doc = "Field `WTIMER1` reader - Wide Timer 1 Clock Enable"]
50pub type WTIMER1_R = crate::BitReader<bool>;
51#[doc = "Field `WTIMER1` writer - Wide Timer 1 Clock Enable"]
52pub type WTIMER1_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 3>;
53#[doc = "Field `USART0` reader - Universal Synchronous/Asynchronous Receiver/Transmitter 0 Clock Enable"]
54pub type USART0_R = crate::BitReader<bool>;
55#[doc = "Field `USART0` writer - Universal Synchronous/Asynchronous Receiver/Transmitter 0 Clock Enable"]
56pub type USART0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 4>;
57#[doc = "Field `USART1` reader - Universal Synchronous/Asynchronous Receiver/Transmitter 1 Clock Enable"]
58pub type USART1_R = crate::BitReader<bool>;
59#[doc = "Field `USART1` writer - Universal Synchronous/Asynchronous Receiver/Transmitter 1 Clock Enable"]
60pub type USART1_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 5>;
61#[doc = "Field `USART2` reader - Universal Synchronous/Asynchronous Receiver/Transmitter 2 Clock Enable"]
62pub type USART2_R = crate::BitReader<bool>;
63#[doc = "Field `USART2` writer - Universal Synchronous/Asynchronous Receiver/Transmitter 2 Clock Enable"]
64pub type USART2_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 6>;
65#[doc = "Field `USART3` reader - Universal Synchronous/Asynchronous Receiver/Transmitter 3 Clock Enable"]
66pub type USART3_R = crate::BitReader<bool>;
67#[doc = "Field `USART3` writer - Universal Synchronous/Asynchronous Receiver/Transmitter 3 Clock Enable"]
68pub type USART3_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 7>;
69#[doc = "Field `I2C0` reader - I2C 0 Clock Enable"]
70pub type I2C0_R = crate::BitReader<bool>;
71#[doc = "Field `I2C0` writer - I2C 0 Clock Enable"]
72pub type I2C0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 8>;
73#[doc = "Field `I2C1` reader - I2C 1 Clock Enable"]
74pub type I2C1_R = crate::BitReader<bool>;
75#[doc = "Field `I2C1` writer - I2C 1 Clock Enable"]
76pub type I2C1_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 9>;
77#[doc = "Field `ACMP0` reader - Analog Comparator 0 Clock Enable"]
78pub type ACMP0_R = crate::BitReader<bool>;
79#[doc = "Field `ACMP0` writer - Analog Comparator 0 Clock Enable"]
80pub type ACMP0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 10>;
81#[doc = "Field `ACMP1` reader - Analog Comparator 1 Clock Enable"]
82pub type ACMP1_R = crate::BitReader<bool>;
83#[doc = "Field `ACMP1` writer - Analog Comparator 1 Clock Enable"]
84pub type ACMP1_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 11>;
85#[doc = "Field `CRYOTIMER` reader - CRYOTIMER Clock Enable"]
86pub type CRYOTIMER_R = crate::BitReader<bool>;
87#[doc = "Field `CRYOTIMER` writer - CRYOTIMER Clock Enable"]
88pub type CRYOTIMER_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 12>;
89#[doc = "Field `ADC0` reader - Analog to Digital Converter 0 Clock Enable"]
90pub type ADC0_R = crate::BitReader<bool>;
91#[doc = "Field `ADC0` writer - Analog to Digital Converter 0 Clock Enable"]
92pub type ADC0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 13>;
93#[doc = "Field `IDAC0` reader - Current Digital to Analog Converter 0 Clock Enable"]
94pub type IDAC0_R = crate::BitReader<bool>;
95#[doc = "Field `IDAC0` writer - Current Digital to Analog Converter 0 Clock Enable"]
96pub type IDAC0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 14>;
97#[doc = "Field `VDAC0` reader - Digital to Analog Converter 0 Clock Enable"]
98pub type VDAC0_R = crate::BitReader<bool>;
99#[doc = "Field `VDAC0` writer - Digital to Analog Converter 0 Clock Enable"]
100pub type VDAC0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 15>;
101#[doc = "Field `CSEN` reader - Capacitive touch sense module Clock Enable"]
102pub type CSEN_R = crate::BitReader<bool>;
103#[doc = "Field `CSEN` writer - Capacitive touch sense module Clock Enable"]
104pub type CSEN_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 16>;
105#[doc = "Field `TRNG0` reader - True Random Number Generator 0 Clock Enable"]
106pub type TRNG0_R = crate::BitReader<bool>;
107#[doc = "Field `TRNG0` writer - True Random Number Generator 0 Clock Enable"]
108pub type TRNG0_W<'a> = crate::BitWriter<'a, u32, HFPERCLKEN0_SPEC, bool, 17>;
109impl R {
110 #[doc = "Bit 0 - Timer 0 Clock Enable"]
111 #[inline(always)]
112 pub fn timer0(&self) -> TIMER0_R {
113 TIMER0_R::new((self.bits & 1) != 0)
114 }
115 #[doc = "Bit 1 - Timer 1 Clock Enable"]
116 #[inline(always)]
117 pub fn timer1(&self) -> TIMER1_R {
118 TIMER1_R::new(((self.bits >> 1) & 1) != 0)
119 }
120 #[doc = "Bit 2 - Wide Timer 0 Clock Enable"]
121 #[inline(always)]
122 pub fn wtimer0(&self) -> WTIMER0_R {
123 WTIMER0_R::new(((self.bits >> 2) & 1) != 0)
124 }
125 #[doc = "Bit 3 - Wide Timer 1 Clock Enable"]
126 #[inline(always)]
127 pub fn wtimer1(&self) -> WTIMER1_R {
128 WTIMER1_R::new(((self.bits >> 3) & 1) != 0)
129 }
130 #[doc = "Bit 4 - Universal Synchronous/Asynchronous Receiver/Transmitter 0 Clock Enable"]
131 #[inline(always)]
132 pub fn usart0(&self) -> USART0_R {
133 USART0_R::new(((self.bits >> 4) & 1) != 0)
134 }
135 #[doc = "Bit 5 - Universal Synchronous/Asynchronous Receiver/Transmitter 1 Clock Enable"]
136 #[inline(always)]
137 pub fn usart1(&self) -> USART1_R {
138 USART1_R::new(((self.bits >> 5) & 1) != 0)
139 }
140 #[doc = "Bit 6 - Universal Synchronous/Asynchronous Receiver/Transmitter 2 Clock Enable"]
141 #[inline(always)]
142 pub fn usart2(&self) -> USART2_R {
143 USART2_R::new(((self.bits >> 6) & 1) != 0)
144 }
145 #[doc = "Bit 7 - Universal Synchronous/Asynchronous Receiver/Transmitter 3 Clock Enable"]
146 #[inline(always)]
147 pub fn usart3(&self) -> USART3_R {
148 USART3_R::new(((self.bits >> 7) & 1) != 0)
149 }
150 #[doc = "Bit 8 - I2C 0 Clock Enable"]
151 #[inline(always)]
152 pub fn i2c0(&self) -> I2C0_R {
153 I2C0_R::new(((self.bits >> 8) & 1) != 0)
154 }
155 #[doc = "Bit 9 - I2C 1 Clock Enable"]
156 #[inline(always)]
157 pub fn i2c1(&self) -> I2C1_R {
158 I2C1_R::new(((self.bits >> 9) & 1) != 0)
159 }
160 #[doc = "Bit 10 - Analog Comparator 0 Clock Enable"]
161 #[inline(always)]
162 pub fn acmp0(&self) -> ACMP0_R {
163 ACMP0_R::new(((self.bits >> 10) & 1) != 0)
164 }
165 #[doc = "Bit 11 - Analog Comparator 1 Clock Enable"]
166 #[inline(always)]
167 pub fn acmp1(&self) -> ACMP1_R {
168 ACMP1_R::new(((self.bits >> 11) & 1) != 0)
169 }
170 #[doc = "Bit 12 - CRYOTIMER Clock Enable"]
171 #[inline(always)]
172 pub fn cryotimer(&self) -> CRYOTIMER_R {
173 CRYOTIMER_R::new(((self.bits >> 12) & 1) != 0)
174 }
175 #[doc = "Bit 13 - Analog to Digital Converter 0 Clock Enable"]
176 #[inline(always)]
177 pub fn adc0(&self) -> ADC0_R {
178 ADC0_R::new(((self.bits >> 13) & 1) != 0)
179 }
180 #[doc = "Bit 14 - Current Digital to Analog Converter 0 Clock Enable"]
181 #[inline(always)]
182 pub fn idac0(&self) -> IDAC0_R {
183 IDAC0_R::new(((self.bits >> 14) & 1) != 0)
184 }
185 #[doc = "Bit 15 - Digital to Analog Converter 0 Clock Enable"]
186 #[inline(always)]
187 pub fn vdac0(&self) -> VDAC0_R {
188 VDAC0_R::new(((self.bits >> 15) & 1) != 0)
189 }
190 #[doc = "Bit 16 - Capacitive touch sense module Clock Enable"]
191 #[inline(always)]
192 pub fn csen(&self) -> CSEN_R {
193 CSEN_R::new(((self.bits >> 16) & 1) != 0)
194 }
195 #[doc = "Bit 17 - True Random Number Generator 0 Clock Enable"]
196 #[inline(always)]
197 pub fn trng0(&self) -> TRNG0_R {
198 TRNG0_R::new(((self.bits >> 17) & 1) != 0)
199 }
200}
201impl W {
202 #[doc = "Bit 0 - Timer 0 Clock Enable"]
203 #[inline(always)]
204 pub fn timer0(&mut self) -> TIMER0_W {
205 TIMER0_W::new(self)
206 }
207 #[doc = "Bit 1 - Timer 1 Clock Enable"]
208 #[inline(always)]
209 pub fn timer1(&mut self) -> TIMER1_W {
210 TIMER1_W::new(self)
211 }
212 #[doc = "Bit 2 - Wide Timer 0 Clock Enable"]
213 #[inline(always)]
214 pub fn wtimer0(&mut self) -> WTIMER0_W {
215 WTIMER0_W::new(self)
216 }
217 #[doc = "Bit 3 - Wide Timer 1 Clock Enable"]
218 #[inline(always)]
219 pub fn wtimer1(&mut self) -> WTIMER1_W {
220 WTIMER1_W::new(self)
221 }
222 #[doc = "Bit 4 - Universal Synchronous/Asynchronous Receiver/Transmitter 0 Clock Enable"]
223 #[inline(always)]
224 pub fn usart0(&mut self) -> USART0_W {
225 USART0_W::new(self)
226 }
227 #[doc = "Bit 5 - Universal Synchronous/Asynchronous Receiver/Transmitter 1 Clock Enable"]
228 #[inline(always)]
229 pub fn usart1(&mut self) -> USART1_W {
230 USART1_W::new(self)
231 }
232 #[doc = "Bit 6 - Universal Synchronous/Asynchronous Receiver/Transmitter 2 Clock Enable"]
233 #[inline(always)]
234 pub fn usart2(&mut self) -> USART2_W {
235 USART2_W::new(self)
236 }
237 #[doc = "Bit 7 - Universal Synchronous/Asynchronous Receiver/Transmitter 3 Clock Enable"]
238 #[inline(always)]
239 pub fn usart3(&mut self) -> USART3_W {
240 USART3_W::new(self)
241 }
242 #[doc = "Bit 8 - I2C 0 Clock Enable"]
243 #[inline(always)]
244 pub fn i2c0(&mut self) -> I2C0_W {
245 I2C0_W::new(self)
246 }
247 #[doc = "Bit 9 - I2C 1 Clock Enable"]
248 #[inline(always)]
249 pub fn i2c1(&mut self) -> I2C1_W {
250 I2C1_W::new(self)
251 }
252 #[doc = "Bit 10 - Analog Comparator 0 Clock Enable"]
253 #[inline(always)]
254 pub fn acmp0(&mut self) -> ACMP0_W {
255 ACMP0_W::new(self)
256 }
257 #[doc = "Bit 11 - Analog Comparator 1 Clock Enable"]
258 #[inline(always)]
259 pub fn acmp1(&mut self) -> ACMP1_W {
260 ACMP1_W::new(self)
261 }
262 #[doc = "Bit 12 - CRYOTIMER Clock Enable"]
263 #[inline(always)]
264 pub fn cryotimer(&mut self) -> CRYOTIMER_W {
265 CRYOTIMER_W::new(self)
266 }
267 #[doc = "Bit 13 - Analog to Digital Converter 0 Clock Enable"]
268 #[inline(always)]
269 pub fn adc0(&mut self) -> ADC0_W {
270 ADC0_W::new(self)
271 }
272 #[doc = "Bit 14 - Current Digital to Analog Converter 0 Clock Enable"]
273 #[inline(always)]
274 pub fn idac0(&mut self) -> IDAC0_W {
275 IDAC0_W::new(self)
276 }
277 #[doc = "Bit 15 - Digital to Analog Converter 0 Clock Enable"]
278 #[inline(always)]
279 pub fn vdac0(&mut self) -> VDAC0_W {
280 VDAC0_W::new(self)
281 }
282 #[doc = "Bit 16 - Capacitive touch sense module Clock Enable"]
283 #[inline(always)]
284 pub fn csen(&mut self) -> CSEN_W {
285 CSEN_W::new(self)
286 }
287 #[doc = "Bit 17 - True Random Number Generator 0 Clock Enable"]
288 #[inline(always)]
289 pub fn trng0(&mut self) -> TRNG0_W {
290 TRNG0_W::new(self)
291 }
292 #[doc = "Writes raw bits to the register."]
293 #[inline(always)]
294 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
295 self.0.bits(bits);
296 self
297 }
298}
299#[doc = "High Frequency Peripheral Clock Enable Register 0\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 [hfperclken0](index.html) module"]
300pub struct HFPERCLKEN0_SPEC;
301impl crate::RegisterSpec for HFPERCLKEN0_SPEC {
302 type Ux = u32;
303}
304#[doc = "`read()` method returns [hfperclken0::R](R) reader structure"]
305impl crate::Readable for HFPERCLKEN0_SPEC {
306 type Reader = R;
307}
308#[doc = "`write(|w| ..)` method takes [hfperclken0::W](W) writer structure"]
309impl crate::Writable for HFPERCLKEN0_SPEC {
310 type Writer = W;
311}
312#[doc = "`reset()` method sets HFPERCLKEN0 to value 0"]
313impl crate::Resettable for HFPERCLKEN0_SPEC {
314 #[inline(always)]
315 fn reset_value() -> Self::Ux {
316 0
317 }
318}