efm32gg11b510_pac/wdog0/
pch0_prsctrl.rs1#[doc = "Register `PCH0_PRSCTRL` reader"]
2pub struct R(crate::R<PCH0_PRSCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PCH0_PRSCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PCH0_PRSCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PCH0_PRSCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PCH0_PRSCTRL` writer"]
17pub struct W(crate::W<PCH0_PRSCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PCH0_PRSCTRL_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<PCH0_PRSCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PCH0_PRSCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "PRS Channel PRS Select\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum PRSSEL_A {
41 #[doc = "0: PRS Channel 0 selected as input"]
42 PRSCH0 = 0,
43 #[doc = "1: PRS Channel 1 selected as input"]
44 PRSCH1 = 1,
45 #[doc = "2: PRS Channel 2 selected as input"]
46 PRSCH2 = 2,
47 #[doc = "3: PRS Channel 3 selected as input"]
48 PRSCH3 = 3,
49 #[doc = "4: PRS Channel 4 selected as input"]
50 PRSCH4 = 4,
51 #[doc = "5: PRS Channel 5 selected as input"]
52 PRSCH5 = 5,
53 #[doc = "6: PRS Channel 6 selected as input"]
54 PRSCH6 = 6,
55 #[doc = "7: PRS Channel 7 selected as input"]
56 PRSCH7 = 7,
57 #[doc = "8: PRS Channel 8 selected as input"]
58 PRSCH8 = 8,
59 #[doc = "9: PRS Channel 9 selected as input"]
60 PRSCH9 = 9,
61 #[doc = "10: PRS Channel 10 selected as input"]
62 PRSCH10 = 10,
63 #[doc = "11: PRS Channel 11 selected as input"]
64 PRSCH11 = 11,
65 #[doc = "12: PRS Channel 12 selected as input"]
66 PRSCH12 = 12,
67 #[doc = "13: PRS Channel 13 selected as input"]
68 PRSCH13 = 13,
69 #[doc = "14: PRS Channel 14 selected as input"]
70 PRSCH14 = 14,
71 #[doc = "15: PRS Channel 15 selected as input"]
72 PRSCH15 = 15,
73 #[doc = "16: PRS Channel 16 selected as input"]
74 PRSCH16 = 16,
75 #[doc = "17: PRS Channel 17 selected as input"]
76 PRSCH17 = 17,
77 #[doc = "18: PRS Channel 18 selected as input"]
78 PRSCH18 = 18,
79 #[doc = "19: PRS Channel 19 selected as input"]
80 PRSCH19 = 19,
81 #[doc = "20: PRS Channel 20 selected as input"]
82 PRSCH20 = 20,
83 #[doc = "21: PRS Channel 21 selected as input"]
84 PRSCH21 = 21,
85 #[doc = "22: PRS Channel 22 selected as input"]
86 PRSCH22 = 22,
87 #[doc = "23: PRS Channel 23 selected as input"]
88 PRSCH23 = 23,
89}
90impl From<PRSSEL_A> for u8 {
91 #[inline(always)]
92 fn from(variant: PRSSEL_A) -> Self {
93 variant as _
94 }
95}
96#[doc = "Field `PRSSEL` reader - PRS Channel PRS Select"]
97pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
98impl PRSSEL_R {
99 #[doc = "Get enumerated values variant"]
100 #[inline(always)]
101 pub fn variant(&self) -> Option<PRSSEL_A> {
102 match self.bits {
103 0 => Some(PRSSEL_A::PRSCH0),
104 1 => Some(PRSSEL_A::PRSCH1),
105 2 => Some(PRSSEL_A::PRSCH2),
106 3 => Some(PRSSEL_A::PRSCH3),
107 4 => Some(PRSSEL_A::PRSCH4),
108 5 => Some(PRSSEL_A::PRSCH5),
109 6 => Some(PRSSEL_A::PRSCH6),
110 7 => Some(PRSSEL_A::PRSCH7),
111 8 => Some(PRSSEL_A::PRSCH8),
112 9 => Some(PRSSEL_A::PRSCH9),
113 10 => Some(PRSSEL_A::PRSCH10),
114 11 => Some(PRSSEL_A::PRSCH11),
115 12 => Some(PRSSEL_A::PRSCH12),
116 13 => Some(PRSSEL_A::PRSCH13),
117 14 => Some(PRSSEL_A::PRSCH14),
118 15 => Some(PRSSEL_A::PRSCH15),
119 16 => Some(PRSSEL_A::PRSCH16),
120 17 => Some(PRSSEL_A::PRSCH17),
121 18 => Some(PRSSEL_A::PRSCH18),
122 19 => Some(PRSSEL_A::PRSCH19),
123 20 => Some(PRSSEL_A::PRSCH20),
124 21 => Some(PRSSEL_A::PRSCH21),
125 22 => Some(PRSSEL_A::PRSCH22),
126 23 => Some(PRSSEL_A::PRSCH23),
127 _ => None,
128 }
129 }
130 #[doc = "Checks if the value of the field is `PRSCH0`"]
131 #[inline(always)]
132 pub fn is_prsch0(&self) -> bool {
133 *self == PRSSEL_A::PRSCH0
134 }
135 #[doc = "Checks if the value of the field is `PRSCH1`"]
136 #[inline(always)]
137 pub fn is_prsch1(&self) -> bool {
138 *self == PRSSEL_A::PRSCH1
139 }
140 #[doc = "Checks if the value of the field is `PRSCH2`"]
141 #[inline(always)]
142 pub fn is_prsch2(&self) -> bool {
143 *self == PRSSEL_A::PRSCH2
144 }
145 #[doc = "Checks if the value of the field is `PRSCH3`"]
146 #[inline(always)]
147 pub fn is_prsch3(&self) -> bool {
148 *self == PRSSEL_A::PRSCH3
149 }
150 #[doc = "Checks if the value of the field is `PRSCH4`"]
151 #[inline(always)]
152 pub fn is_prsch4(&self) -> bool {
153 *self == PRSSEL_A::PRSCH4
154 }
155 #[doc = "Checks if the value of the field is `PRSCH5`"]
156 #[inline(always)]
157 pub fn is_prsch5(&self) -> bool {
158 *self == PRSSEL_A::PRSCH5
159 }
160 #[doc = "Checks if the value of the field is `PRSCH6`"]
161 #[inline(always)]
162 pub fn is_prsch6(&self) -> bool {
163 *self == PRSSEL_A::PRSCH6
164 }
165 #[doc = "Checks if the value of the field is `PRSCH7`"]
166 #[inline(always)]
167 pub fn is_prsch7(&self) -> bool {
168 *self == PRSSEL_A::PRSCH7
169 }
170 #[doc = "Checks if the value of the field is `PRSCH8`"]
171 #[inline(always)]
172 pub fn is_prsch8(&self) -> bool {
173 *self == PRSSEL_A::PRSCH8
174 }
175 #[doc = "Checks if the value of the field is `PRSCH9`"]
176 #[inline(always)]
177 pub fn is_prsch9(&self) -> bool {
178 *self == PRSSEL_A::PRSCH9
179 }
180 #[doc = "Checks if the value of the field is `PRSCH10`"]
181 #[inline(always)]
182 pub fn is_prsch10(&self) -> bool {
183 *self == PRSSEL_A::PRSCH10
184 }
185 #[doc = "Checks if the value of the field is `PRSCH11`"]
186 #[inline(always)]
187 pub fn is_prsch11(&self) -> bool {
188 *self == PRSSEL_A::PRSCH11
189 }
190 #[doc = "Checks if the value of the field is `PRSCH12`"]
191 #[inline(always)]
192 pub fn is_prsch12(&self) -> bool {
193 *self == PRSSEL_A::PRSCH12
194 }
195 #[doc = "Checks if the value of the field is `PRSCH13`"]
196 #[inline(always)]
197 pub fn is_prsch13(&self) -> bool {
198 *self == PRSSEL_A::PRSCH13
199 }
200 #[doc = "Checks if the value of the field is `PRSCH14`"]
201 #[inline(always)]
202 pub fn is_prsch14(&self) -> bool {
203 *self == PRSSEL_A::PRSCH14
204 }
205 #[doc = "Checks if the value of the field is `PRSCH15`"]
206 #[inline(always)]
207 pub fn is_prsch15(&self) -> bool {
208 *self == PRSSEL_A::PRSCH15
209 }
210 #[doc = "Checks if the value of the field is `PRSCH16`"]
211 #[inline(always)]
212 pub fn is_prsch16(&self) -> bool {
213 *self == PRSSEL_A::PRSCH16
214 }
215 #[doc = "Checks if the value of the field is `PRSCH17`"]
216 #[inline(always)]
217 pub fn is_prsch17(&self) -> bool {
218 *self == PRSSEL_A::PRSCH17
219 }
220 #[doc = "Checks if the value of the field is `PRSCH18`"]
221 #[inline(always)]
222 pub fn is_prsch18(&self) -> bool {
223 *self == PRSSEL_A::PRSCH18
224 }
225 #[doc = "Checks if the value of the field is `PRSCH19`"]
226 #[inline(always)]
227 pub fn is_prsch19(&self) -> bool {
228 *self == PRSSEL_A::PRSCH19
229 }
230 #[doc = "Checks if the value of the field is `PRSCH20`"]
231 #[inline(always)]
232 pub fn is_prsch20(&self) -> bool {
233 *self == PRSSEL_A::PRSCH20
234 }
235 #[doc = "Checks if the value of the field is `PRSCH21`"]
236 #[inline(always)]
237 pub fn is_prsch21(&self) -> bool {
238 *self == PRSSEL_A::PRSCH21
239 }
240 #[doc = "Checks if the value of the field is `PRSCH22`"]
241 #[inline(always)]
242 pub fn is_prsch22(&self) -> bool {
243 *self == PRSSEL_A::PRSCH22
244 }
245 #[doc = "Checks if the value of the field is `PRSCH23`"]
246 #[inline(always)]
247 pub fn is_prsch23(&self) -> bool {
248 *self == PRSSEL_A::PRSCH23
249 }
250}
251#[doc = "Field `PRSSEL` writer - PRS Channel PRS Select"]
252pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, PCH0_PRSCTRL_SPEC, u8, PRSSEL_A, 5, 0>;
253impl<'a> PRSSEL_W<'a> {
254 #[doc = "PRS Channel 0 selected as input"]
255 #[inline(always)]
256 pub fn prsch0(self) -> &'a mut W {
257 self.variant(PRSSEL_A::PRSCH0)
258 }
259 #[doc = "PRS Channel 1 selected as input"]
260 #[inline(always)]
261 pub fn prsch1(self) -> &'a mut W {
262 self.variant(PRSSEL_A::PRSCH1)
263 }
264 #[doc = "PRS Channel 2 selected as input"]
265 #[inline(always)]
266 pub fn prsch2(self) -> &'a mut W {
267 self.variant(PRSSEL_A::PRSCH2)
268 }
269 #[doc = "PRS Channel 3 selected as input"]
270 #[inline(always)]
271 pub fn prsch3(self) -> &'a mut W {
272 self.variant(PRSSEL_A::PRSCH3)
273 }
274 #[doc = "PRS Channel 4 selected as input"]
275 #[inline(always)]
276 pub fn prsch4(self) -> &'a mut W {
277 self.variant(PRSSEL_A::PRSCH4)
278 }
279 #[doc = "PRS Channel 5 selected as input"]
280 #[inline(always)]
281 pub fn prsch5(self) -> &'a mut W {
282 self.variant(PRSSEL_A::PRSCH5)
283 }
284 #[doc = "PRS Channel 6 selected as input"]
285 #[inline(always)]
286 pub fn prsch6(self) -> &'a mut W {
287 self.variant(PRSSEL_A::PRSCH6)
288 }
289 #[doc = "PRS Channel 7 selected as input"]
290 #[inline(always)]
291 pub fn prsch7(self) -> &'a mut W {
292 self.variant(PRSSEL_A::PRSCH7)
293 }
294 #[doc = "PRS Channel 8 selected as input"]
295 #[inline(always)]
296 pub fn prsch8(self) -> &'a mut W {
297 self.variant(PRSSEL_A::PRSCH8)
298 }
299 #[doc = "PRS Channel 9 selected as input"]
300 #[inline(always)]
301 pub fn prsch9(self) -> &'a mut W {
302 self.variant(PRSSEL_A::PRSCH9)
303 }
304 #[doc = "PRS Channel 10 selected as input"]
305 #[inline(always)]
306 pub fn prsch10(self) -> &'a mut W {
307 self.variant(PRSSEL_A::PRSCH10)
308 }
309 #[doc = "PRS Channel 11 selected as input"]
310 #[inline(always)]
311 pub fn prsch11(self) -> &'a mut W {
312 self.variant(PRSSEL_A::PRSCH11)
313 }
314 #[doc = "PRS Channel 12 selected as input"]
315 #[inline(always)]
316 pub fn prsch12(self) -> &'a mut W {
317 self.variant(PRSSEL_A::PRSCH12)
318 }
319 #[doc = "PRS Channel 13 selected as input"]
320 #[inline(always)]
321 pub fn prsch13(self) -> &'a mut W {
322 self.variant(PRSSEL_A::PRSCH13)
323 }
324 #[doc = "PRS Channel 14 selected as input"]
325 #[inline(always)]
326 pub fn prsch14(self) -> &'a mut W {
327 self.variant(PRSSEL_A::PRSCH14)
328 }
329 #[doc = "PRS Channel 15 selected as input"]
330 #[inline(always)]
331 pub fn prsch15(self) -> &'a mut W {
332 self.variant(PRSSEL_A::PRSCH15)
333 }
334 #[doc = "PRS Channel 16 selected as input"]
335 #[inline(always)]
336 pub fn prsch16(self) -> &'a mut W {
337 self.variant(PRSSEL_A::PRSCH16)
338 }
339 #[doc = "PRS Channel 17 selected as input"]
340 #[inline(always)]
341 pub fn prsch17(self) -> &'a mut W {
342 self.variant(PRSSEL_A::PRSCH17)
343 }
344 #[doc = "PRS Channel 18 selected as input"]
345 #[inline(always)]
346 pub fn prsch18(self) -> &'a mut W {
347 self.variant(PRSSEL_A::PRSCH18)
348 }
349 #[doc = "PRS Channel 19 selected as input"]
350 #[inline(always)]
351 pub fn prsch19(self) -> &'a mut W {
352 self.variant(PRSSEL_A::PRSCH19)
353 }
354 #[doc = "PRS Channel 20 selected as input"]
355 #[inline(always)]
356 pub fn prsch20(self) -> &'a mut W {
357 self.variant(PRSSEL_A::PRSCH20)
358 }
359 #[doc = "PRS Channel 21 selected as input"]
360 #[inline(always)]
361 pub fn prsch21(self) -> &'a mut W {
362 self.variant(PRSSEL_A::PRSCH21)
363 }
364 #[doc = "PRS Channel 22 selected as input"]
365 #[inline(always)]
366 pub fn prsch22(self) -> &'a mut W {
367 self.variant(PRSSEL_A::PRSCH22)
368 }
369 #[doc = "PRS Channel 23 selected as input"]
370 #[inline(always)]
371 pub fn prsch23(self) -> &'a mut W {
372 self.variant(PRSSEL_A::PRSCH23)
373 }
374}
375#[doc = "Field `PRSMISSRSTEN` reader - PRS Missing Event Will Trigger a Watchdog Reset"]
376pub type PRSMISSRSTEN_R = crate::BitReader<bool>;
377#[doc = "Field `PRSMISSRSTEN` writer - PRS Missing Event Will Trigger a Watchdog Reset"]
378pub type PRSMISSRSTEN_W<'a> = crate::BitWriter<'a, u32, PCH0_PRSCTRL_SPEC, bool, 8>;
379impl R {
380 #[doc = "Bits 0:4 - PRS Channel PRS Select"]
381 #[inline(always)]
382 pub fn prssel(&self) -> PRSSEL_R {
383 PRSSEL_R::new((self.bits & 0x1f) as u8)
384 }
385 #[doc = "Bit 8 - PRS Missing Event Will Trigger a Watchdog Reset"]
386 #[inline(always)]
387 pub fn prsmissrsten(&self) -> PRSMISSRSTEN_R {
388 PRSMISSRSTEN_R::new(((self.bits >> 8) & 1) != 0)
389 }
390}
391impl W {
392 #[doc = "Bits 0:4 - PRS Channel PRS Select"]
393 #[inline(always)]
394 pub fn prssel(&mut self) -> PRSSEL_W {
395 PRSSEL_W::new(self)
396 }
397 #[doc = "Bit 8 - PRS Missing Event Will Trigger a Watchdog Reset"]
398 #[inline(always)]
399 pub fn prsmissrsten(&mut self) -> PRSMISSRSTEN_W {
400 PRSMISSRSTEN_W::new(self)
401 }
402 #[doc = "Writes raw bits to the register."]
403 #[inline(always)]
404 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
405 self.0.bits(bits);
406 self
407 }
408}
409#[doc = "PRS Control 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 [pch0_prsctrl](index.html) module"]
410pub struct PCH0_PRSCTRL_SPEC;
411impl crate::RegisterSpec for PCH0_PRSCTRL_SPEC {
412 type Ux = u32;
413}
414#[doc = "`read()` method returns [pch0_prsctrl::R](R) reader structure"]
415impl crate::Readable for PCH0_PRSCTRL_SPEC {
416 type Reader = R;
417}
418#[doc = "`write(|w| ..)` method takes [pch0_prsctrl::W](W) writer structure"]
419impl crate::Writable for PCH0_PRSCTRL_SPEC {
420 type Writer = W;
421}
422#[doc = "`reset()` method sets PCH0_PRSCTRL to value 0"]
423impl crate::Resettable for PCH0_PRSCTRL_SPEC {
424 #[inline(always)]
425 fn reset_value() -> Self::Ux {
426 0
427 }
428}