1#[doc = "Register `CFG` reader"]
2pub struct R(crate::R<CFG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CFG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CFG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CFG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CFG` writer"]
17pub struct W(crate::W<CFG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CFG_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<CFG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CFG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CLRSRC` reader - WDOG Clear Source"]
38pub type CLRSRC_R = crate::BitReader<CLRSRC_A>;
39#[doc = "WDOG Clear Source\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum CLRSRC_A {
42 #[doc = "0: A write to the clear bit will clear the WDOG counter"]
43 SW = 0,
44 #[doc = "1: A rising edge on the PRS Source 0 will clear the WDOG counter"]
45 PRSSRC0 = 1,
46}
47impl From<CLRSRC_A> for bool {
48 #[inline(always)]
49 fn from(variant: CLRSRC_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl CLRSRC_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> CLRSRC_A {
57 match self.bits {
58 false => CLRSRC_A::SW,
59 true => CLRSRC_A::PRSSRC0,
60 }
61 }
62 #[doc = "Checks if the value of the field is `SW`"]
63 #[inline(always)]
64 pub fn is_sw(&self) -> bool {
65 *self == CLRSRC_A::SW
66 }
67 #[doc = "Checks if the value of the field is `PRSSRC0`"]
68 #[inline(always)]
69 pub fn is_prssrc0(&self) -> bool {
70 *self == CLRSRC_A::PRSSRC0
71 }
72}
73#[doc = "Field `CLRSRC` writer - WDOG Clear Source"]
74pub type CLRSRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, CLRSRC_A, O>;
75impl<'a, const O: u8> CLRSRC_W<'a, O> {
76 #[doc = "A write to the clear bit will clear the WDOG counter"]
77 #[inline(always)]
78 pub fn sw(self) -> &'a mut W {
79 self.variant(CLRSRC_A::SW)
80 }
81 #[doc = "A rising edge on the PRS Source 0 will clear the WDOG counter"]
82 #[inline(always)]
83 pub fn prssrc0(self) -> &'a mut W {
84 self.variant(CLRSRC_A::PRSSRC0)
85 }
86}
87#[doc = "Field `EM2RUN` reader - EM2 Run"]
88pub type EM2RUN_R = crate::BitReader<EM2RUN_A>;
89#[doc = "EM2 Run\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum EM2RUN_A {
92 #[doc = "0: WDOG timer is frozen in EM2."]
93 DISABLE = 0,
94 #[doc = "1: WDOG timer is running in EM2."]
95 ENABLE = 1,
96}
97impl From<EM2RUN_A> for bool {
98 #[inline(always)]
99 fn from(variant: EM2RUN_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl EM2RUN_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> EM2RUN_A {
107 match self.bits {
108 false => EM2RUN_A::DISABLE,
109 true => EM2RUN_A::ENABLE,
110 }
111 }
112 #[doc = "Checks if the value of the field is `DISABLE`"]
113 #[inline(always)]
114 pub fn is_disable(&self) -> bool {
115 *self == EM2RUN_A::DISABLE
116 }
117 #[doc = "Checks if the value of the field is `ENABLE`"]
118 #[inline(always)]
119 pub fn is_enable(&self) -> bool {
120 *self == EM2RUN_A::ENABLE
121 }
122}
123#[doc = "Field `EM2RUN` writer - EM2 Run"]
124pub type EM2RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM2RUN_A, O>;
125impl<'a, const O: u8> EM2RUN_W<'a, O> {
126 #[doc = "WDOG timer is frozen in EM2."]
127 #[inline(always)]
128 pub fn disable(self) -> &'a mut W {
129 self.variant(EM2RUN_A::DISABLE)
130 }
131 #[doc = "WDOG timer is running in EM2."]
132 #[inline(always)]
133 pub fn enable(self) -> &'a mut W {
134 self.variant(EM2RUN_A::ENABLE)
135 }
136}
137#[doc = "Field `EM3RUN` reader - EM3 Run"]
138pub type EM3RUN_R = crate::BitReader<EM3RUN_A>;
139#[doc = "EM3 Run\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum EM3RUN_A {
142 #[doc = "0: WDOG timer is frozen in EM3."]
143 DISABLE = 0,
144 #[doc = "1: WDOG timer is running in EM3."]
145 ENABLE = 1,
146}
147impl From<EM3RUN_A> for bool {
148 #[inline(always)]
149 fn from(variant: EM3RUN_A) -> Self {
150 variant as u8 != 0
151 }
152}
153impl EM3RUN_R {
154 #[doc = "Get enumerated values variant"]
155 #[inline(always)]
156 pub fn variant(&self) -> EM3RUN_A {
157 match self.bits {
158 false => EM3RUN_A::DISABLE,
159 true => EM3RUN_A::ENABLE,
160 }
161 }
162 #[doc = "Checks if the value of the field is `DISABLE`"]
163 #[inline(always)]
164 pub fn is_disable(&self) -> bool {
165 *self == EM3RUN_A::DISABLE
166 }
167 #[doc = "Checks if the value of the field is `ENABLE`"]
168 #[inline(always)]
169 pub fn is_enable(&self) -> bool {
170 *self == EM3RUN_A::ENABLE
171 }
172}
173#[doc = "Field `EM3RUN` writer - EM3 Run"]
174pub type EM3RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM3RUN_A, O>;
175impl<'a, const O: u8> EM3RUN_W<'a, O> {
176 #[doc = "WDOG timer is frozen in EM3."]
177 #[inline(always)]
178 pub fn disable(self) -> &'a mut W {
179 self.variant(EM3RUN_A::DISABLE)
180 }
181 #[doc = "WDOG timer is running in EM3."]
182 #[inline(always)]
183 pub fn enable(self) -> &'a mut W {
184 self.variant(EM3RUN_A::ENABLE)
185 }
186}
187#[doc = "Field `EM4BLOCK` reader - EM4 Block"]
188pub type EM4BLOCK_R = crate::BitReader<EM4BLOCK_A>;
189#[doc = "EM4 Block\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum EM4BLOCK_A {
192 #[doc = "0: EM4 can be entered by software. See EMU for detailed description."]
193 DISABLE = 0,
194 #[doc = "1: EM4 cannot be entered by software."]
195 ENABLE = 1,
196}
197impl From<EM4BLOCK_A> for bool {
198 #[inline(always)]
199 fn from(variant: EM4BLOCK_A) -> Self {
200 variant as u8 != 0
201 }
202}
203impl EM4BLOCK_R {
204 #[doc = "Get enumerated values variant"]
205 #[inline(always)]
206 pub fn variant(&self) -> EM4BLOCK_A {
207 match self.bits {
208 false => EM4BLOCK_A::DISABLE,
209 true => EM4BLOCK_A::ENABLE,
210 }
211 }
212 #[doc = "Checks if the value of the field is `DISABLE`"]
213 #[inline(always)]
214 pub fn is_disable(&self) -> bool {
215 *self == EM4BLOCK_A::DISABLE
216 }
217 #[doc = "Checks if the value of the field is `ENABLE`"]
218 #[inline(always)]
219 pub fn is_enable(&self) -> bool {
220 *self == EM4BLOCK_A::ENABLE
221 }
222}
223#[doc = "Field `EM4BLOCK` writer - EM4 Block"]
224pub type EM4BLOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM4BLOCK_A, O>;
225impl<'a, const O: u8> EM4BLOCK_W<'a, O> {
226 #[doc = "EM4 can be entered by software. See EMU for detailed description."]
227 #[inline(always)]
228 pub fn disable(self) -> &'a mut W {
229 self.variant(EM4BLOCK_A::DISABLE)
230 }
231 #[doc = "EM4 cannot be entered by software."]
232 #[inline(always)]
233 pub fn enable(self) -> &'a mut W {
234 self.variant(EM4BLOCK_A::ENABLE)
235 }
236}
237#[doc = "Field `DEBUGRUN` reader - Debug Mode Run"]
238pub type DEBUGRUN_R = crate::BitReader<DEBUGRUN_A>;
239#[doc = "Debug Mode Run\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
241pub enum DEBUGRUN_A {
242 #[doc = "0: WDOG timer is frozen in debug mode"]
243 DISABLE = 0,
244 #[doc = "1: WDOG timer is running in debug mode"]
245 ENABLE = 1,
246}
247impl From<DEBUGRUN_A> for bool {
248 #[inline(always)]
249 fn from(variant: DEBUGRUN_A) -> Self {
250 variant as u8 != 0
251 }
252}
253impl DEBUGRUN_R {
254 #[doc = "Get enumerated values variant"]
255 #[inline(always)]
256 pub fn variant(&self) -> DEBUGRUN_A {
257 match self.bits {
258 false => DEBUGRUN_A::DISABLE,
259 true => DEBUGRUN_A::ENABLE,
260 }
261 }
262 #[doc = "Checks if the value of the field is `DISABLE`"]
263 #[inline(always)]
264 pub fn is_disable(&self) -> bool {
265 *self == DEBUGRUN_A::DISABLE
266 }
267 #[doc = "Checks if the value of the field is `ENABLE`"]
268 #[inline(always)]
269 pub fn is_enable(&self) -> bool {
270 *self == DEBUGRUN_A::ENABLE
271 }
272}
273#[doc = "Field `DEBUGRUN` writer - Debug Mode Run"]
274pub type DEBUGRUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, DEBUGRUN_A, O>;
275impl<'a, const O: u8> DEBUGRUN_W<'a, O> {
276 #[doc = "WDOG timer is frozen in debug mode"]
277 #[inline(always)]
278 pub fn disable(self) -> &'a mut W {
279 self.variant(DEBUGRUN_A::DISABLE)
280 }
281 #[doc = "WDOG timer is running in debug mode"]
282 #[inline(always)]
283 pub fn enable(self) -> &'a mut W {
284 self.variant(DEBUGRUN_A::ENABLE)
285 }
286}
287#[doc = "Field `WDOGRSTDIS` reader - WDOG Reset Disable"]
288pub type WDOGRSTDIS_R = crate::BitReader<WDOGRSTDIS_A>;
289#[doc = "WDOG Reset Disable\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq, Eq)]
291pub enum WDOGRSTDIS_A {
292 #[doc = "0: A timeout will cause a WDOG reset"]
293 EN = 0,
294 #[doc = "1: A timeout will not cause a WDOG reset"]
295 DIS = 1,
296}
297impl From<WDOGRSTDIS_A> for bool {
298 #[inline(always)]
299 fn from(variant: WDOGRSTDIS_A) -> Self {
300 variant as u8 != 0
301 }
302}
303impl WDOGRSTDIS_R {
304 #[doc = "Get enumerated values variant"]
305 #[inline(always)]
306 pub fn variant(&self) -> WDOGRSTDIS_A {
307 match self.bits {
308 false => WDOGRSTDIS_A::EN,
309 true => WDOGRSTDIS_A::DIS,
310 }
311 }
312 #[doc = "Checks if the value of the field is `EN`"]
313 #[inline(always)]
314 pub fn is_en(&self) -> bool {
315 *self == WDOGRSTDIS_A::EN
316 }
317 #[doc = "Checks if the value of the field is `DIS`"]
318 #[inline(always)]
319 pub fn is_dis(&self) -> bool {
320 *self == WDOGRSTDIS_A::DIS
321 }
322}
323#[doc = "Field `WDOGRSTDIS` writer - WDOG Reset Disable"]
324pub type WDOGRSTDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, WDOGRSTDIS_A, O>;
325impl<'a, const O: u8> WDOGRSTDIS_W<'a, O> {
326 #[doc = "A timeout will cause a WDOG reset"]
327 #[inline(always)]
328 pub fn en(self) -> &'a mut W {
329 self.variant(WDOGRSTDIS_A::EN)
330 }
331 #[doc = "A timeout will not cause a WDOG reset"]
332 #[inline(always)]
333 pub fn dis(self) -> &'a mut W {
334 self.variant(WDOGRSTDIS_A::DIS)
335 }
336}
337#[doc = "Field `PRS0MISSRSTEN` reader - PRS Src0 Missing Event WDOG Reset"]
338pub type PRS0MISSRSTEN_R = crate::BitReader<bool>;
339#[doc = "Field `PRS0MISSRSTEN` writer - PRS Src0 Missing Event WDOG Reset"]
340pub type PRS0MISSRSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>;
341#[doc = "Field `PRS1MISSRSTEN` reader - PRS Src1 Missing Event WDOG Reset"]
342pub type PRS1MISSRSTEN_R = crate::BitReader<bool>;
343#[doc = "Field `PRS1MISSRSTEN` writer - PRS Src1 Missing Event WDOG Reset"]
344pub type PRS1MISSRSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>;
345#[doc = "Field `PERSEL` reader - WDOG Timeout Period Select"]
346pub type PERSEL_R = crate::FieldReader<u8, PERSEL_A>;
347#[doc = "WDOG Timeout Period Select\n\nValue on reset: 15"]
348#[derive(Clone, Copy, Debug, PartialEq, Eq)]
349#[repr(u8)]
350pub enum PERSEL_A {
351 #[doc = "0: Timeout period of 9 wdog cycles"]
352 SEL0 = 0,
353 #[doc = "1: Timeout period of 17 wdog cycles"]
354 SEL1 = 1,
355 #[doc = "2: Timeout period of 33 wdog cycles"]
356 SEL2 = 2,
357 #[doc = "3: Timeout period of 65 wdog cycles"]
358 SEL3 = 3,
359 #[doc = "4: Timeout period of 129 wdog cycles"]
360 SEL4 = 4,
361 #[doc = "5: Timeout period of 257 wdog cycles"]
362 SEL5 = 5,
363 #[doc = "6: Timeout period of 513 wdog cycles"]
364 SEL6 = 6,
365 #[doc = "7: Timeout period of 1k wdog cycles"]
366 SEL7 = 7,
367 #[doc = "8: Timeout period of 2k wdog cycles"]
368 SEL8 = 8,
369 #[doc = "9: Timeout period of 4k wdog cycles"]
370 SEL9 = 9,
371 #[doc = "10: Timeout period of 8k wdog cycles"]
372 SEL10 = 10,
373 #[doc = "11: Timeout period of 16k wdog cycles"]
374 SEL11 = 11,
375 #[doc = "12: Timeout period of 32k wdog cycles"]
376 SEL12 = 12,
377 #[doc = "13: Timeout period of 64k wdog cycles"]
378 SEL13 = 13,
379 #[doc = "14: Timeout period of 128k wdog cycles"]
380 SEL14 = 14,
381 #[doc = "15: Timeout period of 256k wdog cycles"]
382 SEL15 = 15,
383}
384impl From<PERSEL_A> for u8 {
385 #[inline(always)]
386 fn from(variant: PERSEL_A) -> Self {
387 variant as _
388 }
389}
390impl PERSEL_R {
391 #[doc = "Get enumerated values variant"]
392 #[inline(always)]
393 pub fn variant(&self) -> PERSEL_A {
394 match self.bits {
395 0 => PERSEL_A::SEL0,
396 1 => PERSEL_A::SEL1,
397 2 => PERSEL_A::SEL2,
398 3 => PERSEL_A::SEL3,
399 4 => PERSEL_A::SEL4,
400 5 => PERSEL_A::SEL5,
401 6 => PERSEL_A::SEL6,
402 7 => PERSEL_A::SEL7,
403 8 => PERSEL_A::SEL8,
404 9 => PERSEL_A::SEL9,
405 10 => PERSEL_A::SEL10,
406 11 => PERSEL_A::SEL11,
407 12 => PERSEL_A::SEL12,
408 13 => PERSEL_A::SEL13,
409 14 => PERSEL_A::SEL14,
410 15 => PERSEL_A::SEL15,
411 _ => unreachable!(),
412 }
413 }
414 #[doc = "Checks if the value of the field is `SEL0`"]
415 #[inline(always)]
416 pub fn is_sel0(&self) -> bool {
417 *self == PERSEL_A::SEL0
418 }
419 #[doc = "Checks if the value of the field is `SEL1`"]
420 #[inline(always)]
421 pub fn is_sel1(&self) -> bool {
422 *self == PERSEL_A::SEL1
423 }
424 #[doc = "Checks if the value of the field is `SEL2`"]
425 #[inline(always)]
426 pub fn is_sel2(&self) -> bool {
427 *self == PERSEL_A::SEL2
428 }
429 #[doc = "Checks if the value of the field is `SEL3`"]
430 #[inline(always)]
431 pub fn is_sel3(&self) -> bool {
432 *self == PERSEL_A::SEL3
433 }
434 #[doc = "Checks if the value of the field is `SEL4`"]
435 #[inline(always)]
436 pub fn is_sel4(&self) -> bool {
437 *self == PERSEL_A::SEL4
438 }
439 #[doc = "Checks if the value of the field is `SEL5`"]
440 #[inline(always)]
441 pub fn is_sel5(&self) -> bool {
442 *self == PERSEL_A::SEL5
443 }
444 #[doc = "Checks if the value of the field is `SEL6`"]
445 #[inline(always)]
446 pub fn is_sel6(&self) -> bool {
447 *self == PERSEL_A::SEL6
448 }
449 #[doc = "Checks if the value of the field is `SEL7`"]
450 #[inline(always)]
451 pub fn is_sel7(&self) -> bool {
452 *self == PERSEL_A::SEL7
453 }
454 #[doc = "Checks if the value of the field is `SEL8`"]
455 #[inline(always)]
456 pub fn is_sel8(&self) -> bool {
457 *self == PERSEL_A::SEL8
458 }
459 #[doc = "Checks if the value of the field is `SEL9`"]
460 #[inline(always)]
461 pub fn is_sel9(&self) -> bool {
462 *self == PERSEL_A::SEL9
463 }
464 #[doc = "Checks if the value of the field is `SEL10`"]
465 #[inline(always)]
466 pub fn is_sel10(&self) -> bool {
467 *self == PERSEL_A::SEL10
468 }
469 #[doc = "Checks if the value of the field is `SEL11`"]
470 #[inline(always)]
471 pub fn is_sel11(&self) -> bool {
472 *self == PERSEL_A::SEL11
473 }
474 #[doc = "Checks if the value of the field is `SEL12`"]
475 #[inline(always)]
476 pub fn is_sel12(&self) -> bool {
477 *self == PERSEL_A::SEL12
478 }
479 #[doc = "Checks if the value of the field is `SEL13`"]
480 #[inline(always)]
481 pub fn is_sel13(&self) -> bool {
482 *self == PERSEL_A::SEL13
483 }
484 #[doc = "Checks if the value of the field is `SEL14`"]
485 #[inline(always)]
486 pub fn is_sel14(&self) -> bool {
487 *self == PERSEL_A::SEL14
488 }
489 #[doc = "Checks if the value of the field is `SEL15`"]
490 #[inline(always)]
491 pub fn is_sel15(&self) -> bool {
492 *self == PERSEL_A::SEL15
493 }
494}
495#[doc = "Field `PERSEL` writer - WDOG Timeout Period Select"]
496pub type PERSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, PERSEL_A, 4, O>;
497impl<'a, const O: u8> PERSEL_W<'a, O> {
498 #[doc = "Timeout period of 9 wdog cycles"]
499 #[inline(always)]
500 pub fn sel0(self) -> &'a mut W {
501 self.variant(PERSEL_A::SEL0)
502 }
503 #[doc = "Timeout period of 17 wdog cycles"]
504 #[inline(always)]
505 pub fn sel1(self) -> &'a mut W {
506 self.variant(PERSEL_A::SEL1)
507 }
508 #[doc = "Timeout period of 33 wdog cycles"]
509 #[inline(always)]
510 pub fn sel2(self) -> &'a mut W {
511 self.variant(PERSEL_A::SEL2)
512 }
513 #[doc = "Timeout period of 65 wdog cycles"]
514 #[inline(always)]
515 pub fn sel3(self) -> &'a mut W {
516 self.variant(PERSEL_A::SEL3)
517 }
518 #[doc = "Timeout period of 129 wdog cycles"]
519 #[inline(always)]
520 pub fn sel4(self) -> &'a mut W {
521 self.variant(PERSEL_A::SEL4)
522 }
523 #[doc = "Timeout period of 257 wdog cycles"]
524 #[inline(always)]
525 pub fn sel5(self) -> &'a mut W {
526 self.variant(PERSEL_A::SEL5)
527 }
528 #[doc = "Timeout period of 513 wdog cycles"]
529 #[inline(always)]
530 pub fn sel6(self) -> &'a mut W {
531 self.variant(PERSEL_A::SEL6)
532 }
533 #[doc = "Timeout period of 1k wdog cycles"]
534 #[inline(always)]
535 pub fn sel7(self) -> &'a mut W {
536 self.variant(PERSEL_A::SEL7)
537 }
538 #[doc = "Timeout period of 2k wdog cycles"]
539 #[inline(always)]
540 pub fn sel8(self) -> &'a mut W {
541 self.variant(PERSEL_A::SEL8)
542 }
543 #[doc = "Timeout period of 4k wdog cycles"]
544 #[inline(always)]
545 pub fn sel9(self) -> &'a mut W {
546 self.variant(PERSEL_A::SEL9)
547 }
548 #[doc = "Timeout period of 8k wdog cycles"]
549 #[inline(always)]
550 pub fn sel10(self) -> &'a mut W {
551 self.variant(PERSEL_A::SEL10)
552 }
553 #[doc = "Timeout period of 16k wdog cycles"]
554 #[inline(always)]
555 pub fn sel11(self) -> &'a mut W {
556 self.variant(PERSEL_A::SEL11)
557 }
558 #[doc = "Timeout period of 32k wdog cycles"]
559 #[inline(always)]
560 pub fn sel12(self) -> &'a mut W {
561 self.variant(PERSEL_A::SEL12)
562 }
563 #[doc = "Timeout period of 64k wdog cycles"]
564 #[inline(always)]
565 pub fn sel13(self) -> &'a mut W {
566 self.variant(PERSEL_A::SEL13)
567 }
568 #[doc = "Timeout period of 128k wdog cycles"]
569 #[inline(always)]
570 pub fn sel14(self) -> &'a mut W {
571 self.variant(PERSEL_A::SEL14)
572 }
573 #[doc = "Timeout period of 256k wdog cycles"]
574 #[inline(always)]
575 pub fn sel15(self) -> &'a mut W {
576 self.variant(PERSEL_A::SEL15)
577 }
578}
579#[doc = "Field `WARNSEL` reader - WDOG Warning Period Select"]
580pub type WARNSEL_R = crate::FieldReader<u8, WARNSEL_A>;
581#[doc = "WDOG Warning Period Select\n\nValue on reset: 0"]
582#[derive(Clone, Copy, Debug, PartialEq, Eq)]
583#[repr(u8)]
584pub enum WARNSEL_A {
585 #[doc = "0: Disable"]
586 DIS = 0,
587 #[doc = "1: Warning timeout is 25% of the Timeout."]
588 SEL1 = 1,
589 #[doc = "2: Warning timeout is 50% of the Timeout."]
590 SEL2 = 2,
591 #[doc = "3: Warning timeout is 75% of the Timeout."]
592 SEL3 = 3,
593}
594impl From<WARNSEL_A> for u8 {
595 #[inline(always)]
596 fn from(variant: WARNSEL_A) -> Self {
597 variant as _
598 }
599}
600impl WARNSEL_R {
601 #[doc = "Get enumerated values variant"]
602 #[inline(always)]
603 pub fn variant(&self) -> WARNSEL_A {
604 match self.bits {
605 0 => WARNSEL_A::DIS,
606 1 => WARNSEL_A::SEL1,
607 2 => WARNSEL_A::SEL2,
608 3 => WARNSEL_A::SEL3,
609 _ => unreachable!(),
610 }
611 }
612 #[doc = "Checks if the value of the field is `DIS`"]
613 #[inline(always)]
614 pub fn is_dis(&self) -> bool {
615 *self == WARNSEL_A::DIS
616 }
617 #[doc = "Checks if the value of the field is `SEL1`"]
618 #[inline(always)]
619 pub fn is_sel1(&self) -> bool {
620 *self == WARNSEL_A::SEL1
621 }
622 #[doc = "Checks if the value of the field is `SEL2`"]
623 #[inline(always)]
624 pub fn is_sel2(&self) -> bool {
625 *self == WARNSEL_A::SEL2
626 }
627 #[doc = "Checks if the value of the field is `SEL3`"]
628 #[inline(always)]
629 pub fn is_sel3(&self) -> bool {
630 *self == WARNSEL_A::SEL3
631 }
632}
633#[doc = "Field `WARNSEL` writer - WDOG Warning Period Select"]
634pub type WARNSEL_W<'a, const O: u8> =
635 crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, WARNSEL_A, 2, O>;
636impl<'a, const O: u8> WARNSEL_W<'a, O> {
637 #[doc = "Disable"]
638 #[inline(always)]
639 pub fn dis(self) -> &'a mut W {
640 self.variant(WARNSEL_A::DIS)
641 }
642 #[doc = "Warning timeout is 25% of the Timeout."]
643 #[inline(always)]
644 pub fn sel1(self) -> &'a mut W {
645 self.variant(WARNSEL_A::SEL1)
646 }
647 #[doc = "Warning timeout is 50% of the Timeout."]
648 #[inline(always)]
649 pub fn sel2(self) -> &'a mut W {
650 self.variant(WARNSEL_A::SEL2)
651 }
652 #[doc = "Warning timeout is 75% of the Timeout."]
653 #[inline(always)]
654 pub fn sel3(self) -> &'a mut W {
655 self.variant(WARNSEL_A::SEL3)
656 }
657}
658#[doc = "Field `WINSEL` reader - WDOG Illegal Window Select"]
659pub type WINSEL_R = crate::FieldReader<u8, WINSEL_A>;
660#[doc = "WDOG Illegal Window Select\n\nValue on reset: 0"]
661#[derive(Clone, Copy, Debug, PartialEq, Eq)]
662#[repr(u8)]
663pub enum WINSEL_A {
664 #[doc = "0: Disabled."]
665 DIS = 0,
666 #[doc = "1: Window timeout is 12.5% of the Timeout."]
667 SEL1 = 1,
668 #[doc = "2: Window timeout is 25% of the Timeout."]
669 SEL2 = 2,
670 #[doc = "3: Window timeout is 37.5% of the Timeout."]
671 SEL3 = 3,
672 #[doc = "4: Window timeout is 50% of the Timeout."]
673 SEL4 = 4,
674 #[doc = "5: Window timeout is 62.5% of the Timeout."]
675 SEL5 = 5,
676 #[doc = "6: Window timeout is 75.5% of the Timeout."]
677 SEL6 = 6,
678 #[doc = "7: Window timeout is 87.5% of the Timeout."]
679 SEL7 = 7,
680}
681impl From<WINSEL_A> for u8 {
682 #[inline(always)]
683 fn from(variant: WINSEL_A) -> Self {
684 variant as _
685 }
686}
687impl WINSEL_R {
688 #[doc = "Get enumerated values variant"]
689 #[inline(always)]
690 pub fn variant(&self) -> WINSEL_A {
691 match self.bits {
692 0 => WINSEL_A::DIS,
693 1 => WINSEL_A::SEL1,
694 2 => WINSEL_A::SEL2,
695 3 => WINSEL_A::SEL3,
696 4 => WINSEL_A::SEL4,
697 5 => WINSEL_A::SEL5,
698 6 => WINSEL_A::SEL6,
699 7 => WINSEL_A::SEL7,
700 _ => unreachable!(),
701 }
702 }
703 #[doc = "Checks if the value of the field is `DIS`"]
704 #[inline(always)]
705 pub fn is_dis(&self) -> bool {
706 *self == WINSEL_A::DIS
707 }
708 #[doc = "Checks if the value of the field is `SEL1`"]
709 #[inline(always)]
710 pub fn is_sel1(&self) -> bool {
711 *self == WINSEL_A::SEL1
712 }
713 #[doc = "Checks if the value of the field is `SEL2`"]
714 #[inline(always)]
715 pub fn is_sel2(&self) -> bool {
716 *self == WINSEL_A::SEL2
717 }
718 #[doc = "Checks if the value of the field is `SEL3`"]
719 #[inline(always)]
720 pub fn is_sel3(&self) -> bool {
721 *self == WINSEL_A::SEL3
722 }
723 #[doc = "Checks if the value of the field is `SEL4`"]
724 #[inline(always)]
725 pub fn is_sel4(&self) -> bool {
726 *self == WINSEL_A::SEL4
727 }
728 #[doc = "Checks if the value of the field is `SEL5`"]
729 #[inline(always)]
730 pub fn is_sel5(&self) -> bool {
731 *self == WINSEL_A::SEL5
732 }
733 #[doc = "Checks if the value of the field is `SEL6`"]
734 #[inline(always)]
735 pub fn is_sel6(&self) -> bool {
736 *self == WINSEL_A::SEL6
737 }
738 #[doc = "Checks if the value of the field is `SEL7`"]
739 #[inline(always)]
740 pub fn is_sel7(&self) -> bool {
741 *self == WINSEL_A::SEL7
742 }
743}
744#[doc = "Field `WINSEL` writer - WDOG Illegal Window Select"]
745pub type WINSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, WINSEL_A, 3, O>;
746impl<'a, const O: u8> WINSEL_W<'a, O> {
747 #[doc = "Disabled."]
748 #[inline(always)]
749 pub fn dis(self) -> &'a mut W {
750 self.variant(WINSEL_A::DIS)
751 }
752 #[doc = "Window timeout is 12.5% of the Timeout."]
753 #[inline(always)]
754 pub fn sel1(self) -> &'a mut W {
755 self.variant(WINSEL_A::SEL1)
756 }
757 #[doc = "Window timeout is 25% of the Timeout."]
758 #[inline(always)]
759 pub fn sel2(self) -> &'a mut W {
760 self.variant(WINSEL_A::SEL2)
761 }
762 #[doc = "Window timeout is 37.5% of the Timeout."]
763 #[inline(always)]
764 pub fn sel3(self) -> &'a mut W {
765 self.variant(WINSEL_A::SEL3)
766 }
767 #[doc = "Window timeout is 50% of the Timeout."]
768 #[inline(always)]
769 pub fn sel4(self) -> &'a mut W {
770 self.variant(WINSEL_A::SEL4)
771 }
772 #[doc = "Window timeout is 62.5% of the Timeout."]
773 #[inline(always)]
774 pub fn sel5(self) -> &'a mut W {
775 self.variant(WINSEL_A::SEL5)
776 }
777 #[doc = "Window timeout is 75.5% of the Timeout."]
778 #[inline(always)]
779 pub fn sel6(self) -> &'a mut W {
780 self.variant(WINSEL_A::SEL6)
781 }
782 #[doc = "Window timeout is 87.5% of the Timeout."]
783 #[inline(always)]
784 pub fn sel7(self) -> &'a mut W {
785 self.variant(WINSEL_A::SEL7)
786 }
787}
788impl R {
789 #[doc = "Bit 0 - WDOG Clear Source"]
790 #[inline(always)]
791 pub fn clrsrc(&self) -> CLRSRC_R {
792 CLRSRC_R::new((self.bits & 1) != 0)
793 }
794 #[doc = "Bit 1 - EM2 Run"]
795 #[inline(always)]
796 pub fn em2run(&self) -> EM2RUN_R {
797 EM2RUN_R::new(((self.bits >> 1) & 1) != 0)
798 }
799 #[doc = "Bit 2 - EM3 Run"]
800 #[inline(always)]
801 pub fn em3run(&self) -> EM3RUN_R {
802 EM3RUN_R::new(((self.bits >> 2) & 1) != 0)
803 }
804 #[doc = "Bit 3 - EM4 Block"]
805 #[inline(always)]
806 pub fn em4block(&self) -> EM4BLOCK_R {
807 EM4BLOCK_R::new(((self.bits >> 3) & 1) != 0)
808 }
809 #[doc = "Bit 4 - Debug Mode Run"]
810 #[inline(always)]
811 pub fn debugrun(&self) -> DEBUGRUN_R {
812 DEBUGRUN_R::new(((self.bits >> 4) & 1) != 0)
813 }
814 #[doc = "Bit 8 - WDOG Reset Disable"]
815 #[inline(always)]
816 pub fn wdogrstdis(&self) -> WDOGRSTDIS_R {
817 WDOGRSTDIS_R::new(((self.bits >> 8) & 1) != 0)
818 }
819 #[doc = "Bit 9 - PRS Src0 Missing Event WDOG Reset"]
820 #[inline(always)]
821 pub fn prs0missrsten(&self) -> PRS0MISSRSTEN_R {
822 PRS0MISSRSTEN_R::new(((self.bits >> 9) & 1) != 0)
823 }
824 #[doc = "Bit 10 - PRS Src1 Missing Event WDOG Reset"]
825 #[inline(always)]
826 pub fn prs1missrsten(&self) -> PRS1MISSRSTEN_R {
827 PRS1MISSRSTEN_R::new(((self.bits >> 10) & 1) != 0)
828 }
829 #[doc = "Bits 16:19 - WDOG Timeout Period Select"]
830 #[inline(always)]
831 pub fn persel(&self) -> PERSEL_R {
832 PERSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
833 }
834 #[doc = "Bits 24:25 - WDOG Warning Period Select"]
835 #[inline(always)]
836 pub fn warnsel(&self) -> WARNSEL_R {
837 WARNSEL_R::new(((self.bits >> 24) & 3) as u8)
838 }
839 #[doc = "Bits 28:30 - WDOG Illegal Window Select"]
840 #[inline(always)]
841 pub fn winsel(&self) -> WINSEL_R {
842 WINSEL_R::new(((self.bits >> 28) & 7) as u8)
843 }
844}
845impl W {
846 #[doc = "Bit 0 - WDOG Clear Source"]
847 #[inline(always)]
848 #[must_use]
849 pub fn clrsrc(&mut self) -> CLRSRC_W<0> {
850 CLRSRC_W::new(self)
851 }
852 #[doc = "Bit 1 - EM2 Run"]
853 #[inline(always)]
854 #[must_use]
855 pub fn em2run(&mut self) -> EM2RUN_W<1> {
856 EM2RUN_W::new(self)
857 }
858 #[doc = "Bit 2 - EM3 Run"]
859 #[inline(always)]
860 #[must_use]
861 pub fn em3run(&mut self) -> EM3RUN_W<2> {
862 EM3RUN_W::new(self)
863 }
864 #[doc = "Bit 3 - EM4 Block"]
865 #[inline(always)]
866 #[must_use]
867 pub fn em4block(&mut self) -> EM4BLOCK_W<3> {
868 EM4BLOCK_W::new(self)
869 }
870 #[doc = "Bit 4 - Debug Mode Run"]
871 #[inline(always)]
872 #[must_use]
873 pub fn debugrun(&mut self) -> DEBUGRUN_W<4> {
874 DEBUGRUN_W::new(self)
875 }
876 #[doc = "Bit 8 - WDOG Reset Disable"]
877 #[inline(always)]
878 #[must_use]
879 pub fn wdogrstdis(&mut self) -> WDOGRSTDIS_W<8> {
880 WDOGRSTDIS_W::new(self)
881 }
882 #[doc = "Bit 9 - PRS Src0 Missing Event WDOG Reset"]
883 #[inline(always)]
884 #[must_use]
885 pub fn prs0missrsten(&mut self) -> PRS0MISSRSTEN_W<9> {
886 PRS0MISSRSTEN_W::new(self)
887 }
888 #[doc = "Bit 10 - PRS Src1 Missing Event WDOG Reset"]
889 #[inline(always)]
890 #[must_use]
891 pub fn prs1missrsten(&mut self) -> PRS1MISSRSTEN_W<10> {
892 PRS1MISSRSTEN_W::new(self)
893 }
894 #[doc = "Bits 16:19 - WDOG Timeout Period Select"]
895 #[inline(always)]
896 #[must_use]
897 pub fn persel(&mut self) -> PERSEL_W<16> {
898 PERSEL_W::new(self)
899 }
900 #[doc = "Bits 24:25 - WDOG Warning Period Select"]
901 #[inline(always)]
902 #[must_use]
903 pub fn warnsel(&mut self) -> WARNSEL_W<24> {
904 WARNSEL_W::new(self)
905 }
906 #[doc = "Bits 28:30 - WDOG Illegal Window Select"]
907 #[inline(always)]
908 #[must_use]
909 pub fn winsel(&mut self) -> WINSEL_W<28> {
910 WINSEL_W::new(self)
911 }
912 #[doc = "Writes raw bits to the register."]
913 #[inline(always)]
914 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
915 self.0.bits(bits);
916 self
917 }
918}
919#[doc = "No Description\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)."]
920pub struct CFG_SPEC;
921impl crate::RegisterSpec for CFG_SPEC {
922 type Ux = u32;
923}
924#[doc = "`read()` method returns [cfg::R](R) reader structure"]
925impl crate::Readable for CFG_SPEC {
926 type Reader = R;
927}
928#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"]
929impl crate::Writable for CFG_SPEC {
930 type Writer = W;
931 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
932 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
933}
934#[doc = "`reset()` method sets CFG to value 0x000f_0000"]
935impl crate::Resettable for CFG_SPEC {
936 const RESET_VALUE: Self::Ux = 0x000f_0000;
937}