1#[doc = "Reader of register FLTCTRL"]
2pub type R = crate::R<u32, super::FLTCTRL>;
3#[doc = "Writer for register FLTCTRL"]
4pub type W = crate::W<u32, super::FLTCTRL>;
5#[doc = "Register FLTCTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::FLTCTRL {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Fault Input 0 Enable\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum FAULT0EN_A {
16 #[doc = "0: Fault input is disabled."]
17 _0 = 0,
18 #[doc = "1: Fault input is enabled."]
19 _1 = 1,
20}
21impl From<FAULT0EN_A> for bool {
22 #[inline(always)]
23 fn from(variant: FAULT0EN_A) -> Self {
24 variant as u8 != 0
25 }
26}
27#[doc = "Reader of field `FAULT0EN`"]
28pub type FAULT0EN_R = crate::R<bool, FAULT0EN_A>;
29impl FAULT0EN_R {
30 #[doc = r"Get enumerated values variant"]
31 #[inline(always)]
32 pub fn variant(&self) -> FAULT0EN_A {
33 match self.bits {
34 false => FAULT0EN_A::_0,
35 true => FAULT0EN_A::_1,
36 }
37 }
38 #[doc = "Checks if the value of the field is `_0`"]
39 #[inline(always)]
40 pub fn is_0(&self) -> bool {
41 *self == FAULT0EN_A::_0
42 }
43 #[doc = "Checks if the value of the field is `_1`"]
44 #[inline(always)]
45 pub fn is_1(&self) -> bool {
46 *self == FAULT0EN_A::_1
47 }
48}
49#[doc = "Write proxy for field `FAULT0EN`"]
50pub struct FAULT0EN_W<'a> {
51 w: &'a mut W,
52}
53impl<'a> FAULT0EN_W<'a> {
54 #[doc = r"Writes `variant` to the field"]
55 #[inline(always)]
56 pub fn variant(self, variant: FAULT0EN_A) -> &'a mut W {
57 {
58 self.bit(variant.into())
59 }
60 }
61 #[doc = "Fault input is disabled."]
62 #[inline(always)]
63 pub fn _0(self) -> &'a mut W {
64 self.variant(FAULT0EN_A::_0)
65 }
66 #[doc = "Fault input is enabled."]
67 #[inline(always)]
68 pub fn _1(self) -> &'a mut W {
69 self.variant(FAULT0EN_A::_1)
70 }
71 #[doc = r"Sets the field bit"]
72 #[inline(always)]
73 pub fn set_bit(self) -> &'a mut W {
74 self.bit(true)
75 }
76 #[doc = r"Clears the field bit"]
77 #[inline(always)]
78 pub fn clear_bit(self) -> &'a mut W {
79 self.bit(false)
80 }
81 #[doc = r"Writes raw bits to the field"]
82 #[inline(always)]
83 pub fn bit(self, value: bool) -> &'a mut W {
84 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
85 self.w
86 }
87}
88#[doc = "Fault Input 1 Enable\n\nValue on reset: 0"]
89#[derive(Clone, Copy, Debug, PartialEq)]
90pub enum FAULT1EN_A {
91 #[doc = "0: Fault input is disabled."]
92 _0 = 0,
93 #[doc = "1: Fault input is enabled."]
94 _1 = 1,
95}
96impl From<FAULT1EN_A> for bool {
97 #[inline(always)]
98 fn from(variant: FAULT1EN_A) -> Self {
99 variant as u8 != 0
100 }
101}
102#[doc = "Reader of field `FAULT1EN`"]
103pub type FAULT1EN_R = crate::R<bool, FAULT1EN_A>;
104impl FAULT1EN_R {
105 #[doc = r"Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> FAULT1EN_A {
108 match self.bits {
109 false => FAULT1EN_A::_0,
110 true => FAULT1EN_A::_1,
111 }
112 }
113 #[doc = "Checks if the value of the field is `_0`"]
114 #[inline(always)]
115 pub fn is_0(&self) -> bool {
116 *self == FAULT1EN_A::_0
117 }
118 #[doc = "Checks if the value of the field is `_1`"]
119 #[inline(always)]
120 pub fn is_1(&self) -> bool {
121 *self == FAULT1EN_A::_1
122 }
123}
124#[doc = "Write proxy for field `FAULT1EN`"]
125pub struct FAULT1EN_W<'a> {
126 w: &'a mut W,
127}
128impl<'a> FAULT1EN_W<'a> {
129 #[doc = r"Writes `variant` to the field"]
130 #[inline(always)]
131 pub fn variant(self, variant: FAULT1EN_A) -> &'a mut W {
132 {
133 self.bit(variant.into())
134 }
135 }
136 #[doc = "Fault input is disabled."]
137 #[inline(always)]
138 pub fn _0(self) -> &'a mut W {
139 self.variant(FAULT1EN_A::_0)
140 }
141 #[doc = "Fault input is enabled."]
142 #[inline(always)]
143 pub fn _1(self) -> &'a mut W {
144 self.variant(FAULT1EN_A::_1)
145 }
146 #[doc = r"Sets the field bit"]
147 #[inline(always)]
148 pub fn set_bit(self) -> &'a mut W {
149 self.bit(true)
150 }
151 #[doc = r"Clears the field bit"]
152 #[inline(always)]
153 pub fn clear_bit(self) -> &'a mut W {
154 self.bit(false)
155 }
156 #[doc = r"Writes raw bits to the field"]
157 #[inline(always)]
158 pub fn bit(self, value: bool) -> &'a mut W {
159 self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
160 self.w
161 }
162}
163#[doc = "Fault Input 2 Enable\n\nValue on reset: 0"]
164#[derive(Clone, Copy, Debug, PartialEq)]
165pub enum FAULT2EN_A {
166 #[doc = "0: Fault input is disabled."]
167 _0 = 0,
168 #[doc = "1: Fault input is enabled."]
169 _1 = 1,
170}
171impl From<FAULT2EN_A> for bool {
172 #[inline(always)]
173 fn from(variant: FAULT2EN_A) -> Self {
174 variant as u8 != 0
175 }
176}
177#[doc = "Reader of field `FAULT2EN`"]
178pub type FAULT2EN_R = crate::R<bool, FAULT2EN_A>;
179impl FAULT2EN_R {
180 #[doc = r"Get enumerated values variant"]
181 #[inline(always)]
182 pub fn variant(&self) -> FAULT2EN_A {
183 match self.bits {
184 false => FAULT2EN_A::_0,
185 true => FAULT2EN_A::_1,
186 }
187 }
188 #[doc = "Checks if the value of the field is `_0`"]
189 #[inline(always)]
190 pub fn is_0(&self) -> bool {
191 *self == FAULT2EN_A::_0
192 }
193 #[doc = "Checks if the value of the field is `_1`"]
194 #[inline(always)]
195 pub fn is_1(&self) -> bool {
196 *self == FAULT2EN_A::_1
197 }
198}
199#[doc = "Write proxy for field `FAULT2EN`"]
200pub struct FAULT2EN_W<'a> {
201 w: &'a mut W,
202}
203impl<'a> FAULT2EN_W<'a> {
204 #[doc = r"Writes `variant` to the field"]
205 #[inline(always)]
206 pub fn variant(self, variant: FAULT2EN_A) -> &'a mut W {
207 {
208 self.bit(variant.into())
209 }
210 }
211 #[doc = "Fault input is disabled."]
212 #[inline(always)]
213 pub fn _0(self) -> &'a mut W {
214 self.variant(FAULT2EN_A::_0)
215 }
216 #[doc = "Fault input is enabled."]
217 #[inline(always)]
218 pub fn _1(self) -> &'a mut W {
219 self.variant(FAULT2EN_A::_1)
220 }
221 #[doc = r"Sets the field bit"]
222 #[inline(always)]
223 pub fn set_bit(self) -> &'a mut W {
224 self.bit(true)
225 }
226 #[doc = r"Clears the field bit"]
227 #[inline(always)]
228 pub fn clear_bit(self) -> &'a mut W {
229 self.bit(false)
230 }
231 #[doc = r"Writes raw bits to the field"]
232 #[inline(always)]
233 pub fn bit(self, value: bool) -> &'a mut W {
234 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
235 self.w
236 }
237}
238#[doc = "Fault Input 3 Enable\n\nValue on reset: 0"]
239#[derive(Clone, Copy, Debug, PartialEq)]
240pub enum FAULT3EN_A {
241 #[doc = "0: Fault input is disabled."]
242 _0 = 0,
243 #[doc = "1: Fault input is enabled."]
244 _1 = 1,
245}
246impl From<FAULT3EN_A> for bool {
247 #[inline(always)]
248 fn from(variant: FAULT3EN_A) -> Self {
249 variant as u8 != 0
250 }
251}
252#[doc = "Reader of field `FAULT3EN`"]
253pub type FAULT3EN_R = crate::R<bool, FAULT3EN_A>;
254impl FAULT3EN_R {
255 #[doc = r"Get enumerated values variant"]
256 #[inline(always)]
257 pub fn variant(&self) -> FAULT3EN_A {
258 match self.bits {
259 false => FAULT3EN_A::_0,
260 true => FAULT3EN_A::_1,
261 }
262 }
263 #[doc = "Checks if the value of the field is `_0`"]
264 #[inline(always)]
265 pub fn is_0(&self) -> bool {
266 *self == FAULT3EN_A::_0
267 }
268 #[doc = "Checks if the value of the field is `_1`"]
269 #[inline(always)]
270 pub fn is_1(&self) -> bool {
271 *self == FAULT3EN_A::_1
272 }
273}
274#[doc = "Write proxy for field `FAULT3EN`"]
275pub struct FAULT3EN_W<'a> {
276 w: &'a mut W,
277}
278impl<'a> FAULT3EN_W<'a> {
279 #[doc = r"Writes `variant` to the field"]
280 #[inline(always)]
281 pub fn variant(self, variant: FAULT3EN_A) -> &'a mut W {
282 {
283 self.bit(variant.into())
284 }
285 }
286 #[doc = "Fault input is disabled."]
287 #[inline(always)]
288 pub fn _0(self) -> &'a mut W {
289 self.variant(FAULT3EN_A::_0)
290 }
291 #[doc = "Fault input is enabled."]
292 #[inline(always)]
293 pub fn _1(self) -> &'a mut W {
294 self.variant(FAULT3EN_A::_1)
295 }
296 #[doc = r"Sets the field bit"]
297 #[inline(always)]
298 pub fn set_bit(self) -> &'a mut W {
299 self.bit(true)
300 }
301 #[doc = r"Clears the field bit"]
302 #[inline(always)]
303 pub fn clear_bit(self) -> &'a mut W {
304 self.bit(false)
305 }
306 #[doc = r"Writes raw bits to the field"]
307 #[inline(always)]
308 pub fn bit(self, value: bool) -> &'a mut W {
309 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
310 self.w
311 }
312}
313#[doc = "Fault Input 0 Filter Enable\n\nValue on reset: 0"]
314#[derive(Clone, Copy, Debug, PartialEq)]
315pub enum FFLTR0EN_A {
316 #[doc = "0: Fault input filter is disabled."]
317 _0 = 0,
318 #[doc = "1: Fault input filter is enabled."]
319 _1 = 1,
320}
321impl From<FFLTR0EN_A> for bool {
322 #[inline(always)]
323 fn from(variant: FFLTR0EN_A) -> Self {
324 variant as u8 != 0
325 }
326}
327#[doc = "Reader of field `FFLTR0EN`"]
328pub type FFLTR0EN_R = crate::R<bool, FFLTR0EN_A>;
329impl FFLTR0EN_R {
330 #[doc = r"Get enumerated values variant"]
331 #[inline(always)]
332 pub fn variant(&self) -> FFLTR0EN_A {
333 match self.bits {
334 false => FFLTR0EN_A::_0,
335 true => FFLTR0EN_A::_1,
336 }
337 }
338 #[doc = "Checks if the value of the field is `_0`"]
339 #[inline(always)]
340 pub fn is_0(&self) -> bool {
341 *self == FFLTR0EN_A::_0
342 }
343 #[doc = "Checks if the value of the field is `_1`"]
344 #[inline(always)]
345 pub fn is_1(&self) -> bool {
346 *self == FFLTR0EN_A::_1
347 }
348}
349#[doc = "Write proxy for field `FFLTR0EN`"]
350pub struct FFLTR0EN_W<'a> {
351 w: &'a mut W,
352}
353impl<'a> FFLTR0EN_W<'a> {
354 #[doc = r"Writes `variant` to the field"]
355 #[inline(always)]
356 pub fn variant(self, variant: FFLTR0EN_A) -> &'a mut W {
357 {
358 self.bit(variant.into())
359 }
360 }
361 #[doc = "Fault input filter is disabled."]
362 #[inline(always)]
363 pub fn _0(self) -> &'a mut W {
364 self.variant(FFLTR0EN_A::_0)
365 }
366 #[doc = "Fault input filter is enabled."]
367 #[inline(always)]
368 pub fn _1(self) -> &'a mut W {
369 self.variant(FFLTR0EN_A::_1)
370 }
371 #[doc = r"Sets the field bit"]
372 #[inline(always)]
373 pub fn set_bit(self) -> &'a mut W {
374 self.bit(true)
375 }
376 #[doc = r"Clears the field bit"]
377 #[inline(always)]
378 pub fn clear_bit(self) -> &'a mut W {
379 self.bit(false)
380 }
381 #[doc = r"Writes raw bits to the field"]
382 #[inline(always)]
383 pub fn bit(self, value: bool) -> &'a mut W {
384 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
385 self.w
386 }
387}
388#[doc = "Fault Input 1 Filter Enable\n\nValue on reset: 0"]
389#[derive(Clone, Copy, Debug, PartialEq)]
390pub enum FFLTR1EN_A {
391 #[doc = "0: Fault input filter is disabled."]
392 _0 = 0,
393 #[doc = "1: Fault input filter is enabled."]
394 _1 = 1,
395}
396impl From<FFLTR1EN_A> for bool {
397 #[inline(always)]
398 fn from(variant: FFLTR1EN_A) -> Self {
399 variant as u8 != 0
400 }
401}
402#[doc = "Reader of field `FFLTR1EN`"]
403pub type FFLTR1EN_R = crate::R<bool, FFLTR1EN_A>;
404impl FFLTR1EN_R {
405 #[doc = r"Get enumerated values variant"]
406 #[inline(always)]
407 pub fn variant(&self) -> FFLTR1EN_A {
408 match self.bits {
409 false => FFLTR1EN_A::_0,
410 true => FFLTR1EN_A::_1,
411 }
412 }
413 #[doc = "Checks if the value of the field is `_0`"]
414 #[inline(always)]
415 pub fn is_0(&self) -> bool {
416 *self == FFLTR1EN_A::_0
417 }
418 #[doc = "Checks if the value of the field is `_1`"]
419 #[inline(always)]
420 pub fn is_1(&self) -> bool {
421 *self == FFLTR1EN_A::_1
422 }
423}
424#[doc = "Write proxy for field `FFLTR1EN`"]
425pub struct FFLTR1EN_W<'a> {
426 w: &'a mut W,
427}
428impl<'a> FFLTR1EN_W<'a> {
429 #[doc = r"Writes `variant` to the field"]
430 #[inline(always)]
431 pub fn variant(self, variant: FFLTR1EN_A) -> &'a mut W {
432 {
433 self.bit(variant.into())
434 }
435 }
436 #[doc = "Fault input filter is disabled."]
437 #[inline(always)]
438 pub fn _0(self) -> &'a mut W {
439 self.variant(FFLTR1EN_A::_0)
440 }
441 #[doc = "Fault input filter is enabled."]
442 #[inline(always)]
443 pub fn _1(self) -> &'a mut W {
444 self.variant(FFLTR1EN_A::_1)
445 }
446 #[doc = r"Sets the field bit"]
447 #[inline(always)]
448 pub fn set_bit(self) -> &'a mut W {
449 self.bit(true)
450 }
451 #[doc = r"Clears the field bit"]
452 #[inline(always)]
453 pub fn clear_bit(self) -> &'a mut W {
454 self.bit(false)
455 }
456 #[doc = r"Writes raw bits to the field"]
457 #[inline(always)]
458 pub fn bit(self, value: bool) -> &'a mut W {
459 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
460 self.w
461 }
462}
463#[doc = "Fault Input 2 Filter Enable\n\nValue on reset: 0"]
464#[derive(Clone, Copy, Debug, PartialEq)]
465pub enum FFLTR2EN_A {
466 #[doc = "0: Fault input filter is disabled."]
467 _0 = 0,
468 #[doc = "1: Fault input filter is enabled."]
469 _1 = 1,
470}
471impl From<FFLTR2EN_A> for bool {
472 #[inline(always)]
473 fn from(variant: FFLTR2EN_A) -> Self {
474 variant as u8 != 0
475 }
476}
477#[doc = "Reader of field `FFLTR2EN`"]
478pub type FFLTR2EN_R = crate::R<bool, FFLTR2EN_A>;
479impl FFLTR2EN_R {
480 #[doc = r"Get enumerated values variant"]
481 #[inline(always)]
482 pub fn variant(&self) -> FFLTR2EN_A {
483 match self.bits {
484 false => FFLTR2EN_A::_0,
485 true => FFLTR2EN_A::_1,
486 }
487 }
488 #[doc = "Checks if the value of the field is `_0`"]
489 #[inline(always)]
490 pub fn is_0(&self) -> bool {
491 *self == FFLTR2EN_A::_0
492 }
493 #[doc = "Checks if the value of the field is `_1`"]
494 #[inline(always)]
495 pub fn is_1(&self) -> bool {
496 *self == FFLTR2EN_A::_1
497 }
498}
499#[doc = "Write proxy for field `FFLTR2EN`"]
500pub struct FFLTR2EN_W<'a> {
501 w: &'a mut W,
502}
503impl<'a> FFLTR2EN_W<'a> {
504 #[doc = r"Writes `variant` to the field"]
505 #[inline(always)]
506 pub fn variant(self, variant: FFLTR2EN_A) -> &'a mut W {
507 {
508 self.bit(variant.into())
509 }
510 }
511 #[doc = "Fault input filter is disabled."]
512 #[inline(always)]
513 pub fn _0(self) -> &'a mut W {
514 self.variant(FFLTR2EN_A::_0)
515 }
516 #[doc = "Fault input filter is enabled."]
517 #[inline(always)]
518 pub fn _1(self) -> &'a mut W {
519 self.variant(FFLTR2EN_A::_1)
520 }
521 #[doc = r"Sets the field bit"]
522 #[inline(always)]
523 pub fn set_bit(self) -> &'a mut W {
524 self.bit(true)
525 }
526 #[doc = r"Clears the field bit"]
527 #[inline(always)]
528 pub fn clear_bit(self) -> &'a mut W {
529 self.bit(false)
530 }
531 #[doc = r"Writes raw bits to the field"]
532 #[inline(always)]
533 pub fn bit(self, value: bool) -> &'a mut W {
534 self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
535 self.w
536 }
537}
538#[doc = "Fault Input 3 Filter Enable\n\nValue on reset: 0"]
539#[derive(Clone, Copy, Debug, PartialEq)]
540pub enum FFLTR3EN_A {
541 #[doc = "0: Fault input filter is disabled."]
542 _0 = 0,
543 #[doc = "1: Fault input filter is enabled."]
544 _1 = 1,
545}
546impl From<FFLTR3EN_A> for bool {
547 #[inline(always)]
548 fn from(variant: FFLTR3EN_A) -> Self {
549 variant as u8 != 0
550 }
551}
552#[doc = "Reader of field `FFLTR3EN`"]
553pub type FFLTR3EN_R = crate::R<bool, FFLTR3EN_A>;
554impl FFLTR3EN_R {
555 #[doc = r"Get enumerated values variant"]
556 #[inline(always)]
557 pub fn variant(&self) -> FFLTR3EN_A {
558 match self.bits {
559 false => FFLTR3EN_A::_0,
560 true => FFLTR3EN_A::_1,
561 }
562 }
563 #[doc = "Checks if the value of the field is `_0`"]
564 #[inline(always)]
565 pub fn is_0(&self) -> bool {
566 *self == FFLTR3EN_A::_0
567 }
568 #[doc = "Checks if the value of the field is `_1`"]
569 #[inline(always)]
570 pub fn is_1(&self) -> bool {
571 *self == FFLTR3EN_A::_1
572 }
573}
574#[doc = "Write proxy for field `FFLTR3EN`"]
575pub struct FFLTR3EN_W<'a> {
576 w: &'a mut W,
577}
578impl<'a> FFLTR3EN_W<'a> {
579 #[doc = r"Writes `variant` to the field"]
580 #[inline(always)]
581 pub fn variant(self, variant: FFLTR3EN_A) -> &'a mut W {
582 {
583 self.bit(variant.into())
584 }
585 }
586 #[doc = "Fault input filter is disabled."]
587 #[inline(always)]
588 pub fn _0(self) -> &'a mut W {
589 self.variant(FFLTR3EN_A::_0)
590 }
591 #[doc = "Fault input filter is enabled."]
592 #[inline(always)]
593 pub fn _1(self) -> &'a mut W {
594 self.variant(FFLTR3EN_A::_1)
595 }
596 #[doc = r"Sets the field bit"]
597 #[inline(always)]
598 pub fn set_bit(self) -> &'a mut W {
599 self.bit(true)
600 }
601 #[doc = r"Clears the field bit"]
602 #[inline(always)]
603 pub fn clear_bit(self) -> &'a mut W {
604 self.bit(false)
605 }
606 #[doc = r"Writes raw bits to the field"]
607 #[inline(always)]
608 pub fn bit(self, value: bool) -> &'a mut W {
609 self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
610 self.w
611 }
612}
613#[doc = "Reader of field `FFVAL`"]
614pub type FFVAL_R = crate::R<u8, u8>;
615#[doc = "Write proxy for field `FFVAL`"]
616pub struct FFVAL_W<'a> {
617 w: &'a mut W,
618}
619impl<'a> FFVAL_W<'a> {
620 #[doc = r"Writes raw bits to the field"]
621 #[inline(always)]
622 pub unsafe fn bits(self, value: u8) -> &'a mut W {
623 self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
624 self.w
625 }
626}
627#[doc = "Fault output state\n\nValue on reset: 0"]
628#[derive(Clone, Copy, Debug, PartialEq)]
629pub enum FSTATE_A {
630 #[doc = "0: FTM outputs will be placed into safe values when fault events in ongoing (defined by POL bits)."]
631 _0 = 0,
632 #[doc = "1: FTM outputs will be tri-stated when fault event is ongoing"]
633 _1 = 1,
634}
635impl From<FSTATE_A> for bool {
636 #[inline(always)]
637 fn from(variant: FSTATE_A) -> Self {
638 variant as u8 != 0
639 }
640}
641#[doc = "Reader of field `FSTATE`"]
642pub type FSTATE_R = crate::R<bool, FSTATE_A>;
643impl FSTATE_R {
644 #[doc = r"Get enumerated values variant"]
645 #[inline(always)]
646 pub fn variant(&self) -> FSTATE_A {
647 match self.bits {
648 false => FSTATE_A::_0,
649 true => FSTATE_A::_1,
650 }
651 }
652 #[doc = "Checks if the value of the field is `_0`"]
653 #[inline(always)]
654 pub fn is_0(&self) -> bool {
655 *self == FSTATE_A::_0
656 }
657 #[doc = "Checks if the value of the field is `_1`"]
658 #[inline(always)]
659 pub fn is_1(&self) -> bool {
660 *self == FSTATE_A::_1
661 }
662}
663#[doc = "Write proxy for field `FSTATE`"]
664pub struct FSTATE_W<'a> {
665 w: &'a mut W,
666}
667impl<'a> FSTATE_W<'a> {
668 #[doc = r"Writes `variant` to the field"]
669 #[inline(always)]
670 pub fn variant(self, variant: FSTATE_A) -> &'a mut W {
671 {
672 self.bit(variant.into())
673 }
674 }
675 #[doc = "FTM outputs will be placed into safe values when fault events in ongoing (defined by POL bits)."]
676 #[inline(always)]
677 pub fn _0(self) -> &'a mut W {
678 self.variant(FSTATE_A::_0)
679 }
680 #[doc = "FTM outputs will be tri-stated when fault event is ongoing"]
681 #[inline(always)]
682 pub fn _1(self) -> &'a mut W {
683 self.variant(FSTATE_A::_1)
684 }
685 #[doc = r"Sets the field bit"]
686 #[inline(always)]
687 pub fn set_bit(self) -> &'a mut W {
688 self.bit(true)
689 }
690 #[doc = r"Clears the field bit"]
691 #[inline(always)]
692 pub fn clear_bit(self) -> &'a mut W {
693 self.bit(false)
694 }
695 #[doc = r"Writes raw bits to the field"]
696 #[inline(always)]
697 pub fn bit(self, value: bool) -> &'a mut W {
698 self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
699 self.w
700 }
701}
702impl R {
703 #[doc = "Bit 0 - Fault Input 0 Enable"]
704 #[inline(always)]
705 pub fn fault0en(&self) -> FAULT0EN_R {
706 FAULT0EN_R::new((self.bits & 0x01) != 0)
707 }
708 #[doc = "Bit 1 - Fault Input 1 Enable"]
709 #[inline(always)]
710 pub fn fault1en(&self) -> FAULT1EN_R {
711 FAULT1EN_R::new(((self.bits >> 1) & 0x01) != 0)
712 }
713 #[doc = "Bit 2 - Fault Input 2 Enable"]
714 #[inline(always)]
715 pub fn fault2en(&self) -> FAULT2EN_R {
716 FAULT2EN_R::new(((self.bits >> 2) & 0x01) != 0)
717 }
718 #[doc = "Bit 3 - Fault Input 3 Enable"]
719 #[inline(always)]
720 pub fn fault3en(&self) -> FAULT3EN_R {
721 FAULT3EN_R::new(((self.bits >> 3) & 0x01) != 0)
722 }
723 #[doc = "Bit 4 - Fault Input 0 Filter Enable"]
724 #[inline(always)]
725 pub fn ffltr0en(&self) -> FFLTR0EN_R {
726 FFLTR0EN_R::new(((self.bits >> 4) & 0x01) != 0)
727 }
728 #[doc = "Bit 5 - Fault Input 1 Filter Enable"]
729 #[inline(always)]
730 pub fn ffltr1en(&self) -> FFLTR1EN_R {
731 FFLTR1EN_R::new(((self.bits >> 5) & 0x01) != 0)
732 }
733 #[doc = "Bit 6 - Fault Input 2 Filter Enable"]
734 #[inline(always)]
735 pub fn ffltr2en(&self) -> FFLTR2EN_R {
736 FFLTR2EN_R::new(((self.bits >> 6) & 0x01) != 0)
737 }
738 #[doc = "Bit 7 - Fault Input 3 Filter Enable"]
739 #[inline(always)]
740 pub fn ffltr3en(&self) -> FFLTR3EN_R {
741 FFLTR3EN_R::new(((self.bits >> 7) & 0x01) != 0)
742 }
743 #[doc = "Bits 8:11 - Fault Input Filter"]
744 #[inline(always)]
745 pub fn ffval(&self) -> FFVAL_R {
746 FFVAL_R::new(((self.bits >> 8) & 0x0f) as u8)
747 }
748 #[doc = "Bit 15 - Fault output state"]
749 #[inline(always)]
750 pub fn fstate(&self) -> FSTATE_R {
751 FSTATE_R::new(((self.bits >> 15) & 0x01) != 0)
752 }
753}
754impl W {
755 #[doc = "Bit 0 - Fault Input 0 Enable"]
756 #[inline(always)]
757 pub fn fault0en(&mut self) -> FAULT0EN_W {
758 FAULT0EN_W { w: self }
759 }
760 #[doc = "Bit 1 - Fault Input 1 Enable"]
761 #[inline(always)]
762 pub fn fault1en(&mut self) -> FAULT1EN_W {
763 FAULT1EN_W { w: self }
764 }
765 #[doc = "Bit 2 - Fault Input 2 Enable"]
766 #[inline(always)]
767 pub fn fault2en(&mut self) -> FAULT2EN_W {
768 FAULT2EN_W { w: self }
769 }
770 #[doc = "Bit 3 - Fault Input 3 Enable"]
771 #[inline(always)]
772 pub fn fault3en(&mut self) -> FAULT3EN_W {
773 FAULT3EN_W { w: self }
774 }
775 #[doc = "Bit 4 - Fault Input 0 Filter Enable"]
776 #[inline(always)]
777 pub fn ffltr0en(&mut self) -> FFLTR0EN_W {
778 FFLTR0EN_W { w: self }
779 }
780 #[doc = "Bit 5 - Fault Input 1 Filter Enable"]
781 #[inline(always)]
782 pub fn ffltr1en(&mut self) -> FFLTR1EN_W {
783 FFLTR1EN_W { w: self }
784 }
785 #[doc = "Bit 6 - Fault Input 2 Filter Enable"]
786 #[inline(always)]
787 pub fn ffltr2en(&mut self) -> FFLTR2EN_W {
788 FFLTR2EN_W { w: self }
789 }
790 #[doc = "Bit 7 - Fault Input 3 Filter Enable"]
791 #[inline(always)]
792 pub fn ffltr3en(&mut self) -> FFLTR3EN_W {
793 FFLTR3EN_W { w: self }
794 }
795 #[doc = "Bits 8:11 - Fault Input Filter"]
796 #[inline(always)]
797 pub fn ffval(&mut self) -> FFVAL_W {
798 FFVAL_W { w: self }
799 }
800 #[doc = "Bit 15 - Fault output state"]
801 #[inline(always)]
802 pub fn fstate(&mut self) -> FSTATE_W {
803 FSTATE_W { w: self }
804 }
805}