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