s32k142_pac/ftm2/
mode.rs

1#[doc = "Register `MODE` reader"]
2pub struct R(crate::R<MODE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MODE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MODE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MODE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MODE` writer"]
17pub struct W(crate::W<MODE_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MODE_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<MODE_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MODE_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "FTM Enable\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum FTMEN_A {
40    #[doc = "0: TPM compatibility. Free running counter and synchronization compatible with TPM."]
41    _0 = 0,
42    #[doc = "1: Free running counter and synchronization are different from TPM behavior."]
43    _1 = 1,
44}
45impl From<FTMEN_A> for bool {
46    #[inline(always)]
47    fn from(variant: FTMEN_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `FTMEN` reader - FTM Enable"]
52pub struct FTMEN_R(crate::FieldReader<bool, FTMEN_A>);
53impl FTMEN_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        FTMEN_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> FTMEN_A {
61        match self.bits {
62            false => FTMEN_A::_0,
63            true => FTMEN_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 == FTMEN_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 == FTMEN_A::_1
75    }
76}
77impl core::ops::Deref for FTMEN_R {
78    type Target = crate::FieldReader<bool, FTMEN_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `FTMEN` writer - FTM Enable"]
85pub struct FTMEN_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> FTMEN_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: FTMEN_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "TPM compatibility. Free running counter and synchronization compatible with TPM."]
95    #[inline(always)]
96    pub fn _0(self) -> &'a mut W {
97        self.variant(FTMEN_A::_0)
98    }
99    #[doc = "Free running counter and synchronization are different from TPM behavior."]
100    #[inline(always)]
101    pub fn _1(self) -> &'a mut W {
102        self.variant(FTMEN_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 = "Field `INIT` writer - Initialize The Channels Output"]
122pub struct INIT_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> INIT_W<'a> {
126    #[doc = r"Sets the field bit"]
127    #[inline(always)]
128    pub fn set_bit(self) -> &'a mut W {
129        self.bit(true)
130    }
131    #[doc = r"Clears the field bit"]
132    #[inline(always)]
133    pub fn clear_bit(self) -> &'a mut W {
134        self.bit(false)
135    }
136    #[doc = r"Writes raw bits to the field"]
137    #[inline(always)]
138    pub fn bit(self, value: bool) -> &'a mut W {
139        self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
140        self.w
141    }
142}
143#[doc = "Write Protection Disable\n\nValue on reset: 1"]
144#[derive(Clone, Copy, Debug, PartialEq)]
145pub enum WPDIS_A {
146    #[doc = "0: Write protection is enabled."]
147    _0 = 0,
148    #[doc = "1: Write protection is disabled."]
149    _1 = 1,
150}
151impl From<WPDIS_A> for bool {
152    #[inline(always)]
153    fn from(variant: WPDIS_A) -> Self {
154        variant as u8 != 0
155    }
156}
157#[doc = "Field `WPDIS` reader - Write Protection Disable"]
158pub struct WPDIS_R(crate::FieldReader<bool, WPDIS_A>);
159impl WPDIS_R {
160    #[inline(always)]
161    pub(crate) fn new(bits: bool) -> Self {
162        WPDIS_R(crate::FieldReader::new(bits))
163    }
164    #[doc = r"Get enumerated values variant"]
165    #[inline(always)]
166    pub fn variant(&self) -> WPDIS_A {
167        match self.bits {
168            false => WPDIS_A::_0,
169            true => WPDIS_A::_1,
170        }
171    }
172    #[doc = "Checks if the value of the field is `_0`"]
173    #[inline(always)]
174    pub fn is_0(&self) -> bool {
175        **self == WPDIS_A::_0
176    }
177    #[doc = "Checks if the value of the field is `_1`"]
178    #[inline(always)]
179    pub fn is_1(&self) -> bool {
180        **self == WPDIS_A::_1
181    }
182}
183impl core::ops::Deref for WPDIS_R {
184    type Target = crate::FieldReader<bool, WPDIS_A>;
185    #[inline(always)]
186    fn deref(&self) -> &Self::Target {
187        &self.0
188    }
189}
190#[doc = "Field `WPDIS` writer - Write Protection Disable"]
191pub struct WPDIS_W<'a> {
192    w: &'a mut W,
193}
194impl<'a> WPDIS_W<'a> {
195    #[doc = r"Writes `variant` to the field"]
196    #[inline(always)]
197    pub fn variant(self, variant: WPDIS_A) -> &'a mut W {
198        self.bit(variant.into())
199    }
200    #[doc = "Write protection is enabled."]
201    #[inline(always)]
202    pub fn _0(self) -> &'a mut W {
203        self.variant(WPDIS_A::_0)
204    }
205    #[doc = "Write protection is disabled."]
206    #[inline(always)]
207    pub fn _1(self) -> &'a mut W {
208        self.variant(WPDIS_A::_1)
209    }
210    #[doc = r"Sets the field bit"]
211    #[inline(always)]
212    pub fn set_bit(self) -> &'a mut W {
213        self.bit(true)
214    }
215    #[doc = r"Clears the field bit"]
216    #[inline(always)]
217    pub fn clear_bit(self) -> &'a mut W {
218        self.bit(false)
219    }
220    #[doc = r"Writes raw bits to the field"]
221    #[inline(always)]
222    pub fn bit(self, value: bool) -> &'a mut W {
223        self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
224        self.w
225    }
226}
227#[doc = "PWM Synchronization Mode\n\nValue on reset: 0"]
228#[derive(Clone, Copy, Debug, PartialEq)]
229pub enum PWMSYNC_A {
230    #[doc = "0: No restrictions. Software and hardware triggers can be used by MOD, CnV, OUTMASK, and FTM counter synchronization."]
231    _0 = 0,
232    #[doc = "1: Software trigger can only be used by MOD and CnV synchronization, and hardware triggers can only be used by OUTMASK and FTM counter synchronization."]
233    _1 = 1,
234}
235impl From<PWMSYNC_A> for bool {
236    #[inline(always)]
237    fn from(variant: PWMSYNC_A) -> Self {
238        variant as u8 != 0
239    }
240}
241#[doc = "Field `PWMSYNC` reader - PWM Synchronization Mode"]
242pub struct PWMSYNC_R(crate::FieldReader<bool, PWMSYNC_A>);
243impl PWMSYNC_R {
244    #[inline(always)]
245    pub(crate) fn new(bits: bool) -> Self {
246        PWMSYNC_R(crate::FieldReader::new(bits))
247    }
248    #[doc = r"Get enumerated values variant"]
249    #[inline(always)]
250    pub fn variant(&self) -> PWMSYNC_A {
251        match self.bits {
252            false => PWMSYNC_A::_0,
253            true => PWMSYNC_A::_1,
254        }
255    }
256    #[doc = "Checks if the value of the field is `_0`"]
257    #[inline(always)]
258    pub fn is_0(&self) -> bool {
259        **self == PWMSYNC_A::_0
260    }
261    #[doc = "Checks if the value of the field is `_1`"]
262    #[inline(always)]
263    pub fn is_1(&self) -> bool {
264        **self == PWMSYNC_A::_1
265    }
266}
267impl core::ops::Deref for PWMSYNC_R {
268    type Target = crate::FieldReader<bool, PWMSYNC_A>;
269    #[inline(always)]
270    fn deref(&self) -> &Self::Target {
271        &self.0
272    }
273}
274#[doc = "Field `PWMSYNC` writer - PWM Synchronization Mode"]
275pub struct PWMSYNC_W<'a> {
276    w: &'a mut W,
277}
278impl<'a> PWMSYNC_W<'a> {
279    #[doc = r"Writes `variant` to the field"]
280    #[inline(always)]
281    pub fn variant(self, variant: PWMSYNC_A) -> &'a mut W {
282        self.bit(variant.into())
283    }
284    #[doc = "No restrictions. Software and hardware triggers can be used by MOD, CnV, OUTMASK, and FTM counter synchronization."]
285    #[inline(always)]
286    pub fn _0(self) -> &'a mut W {
287        self.variant(PWMSYNC_A::_0)
288    }
289    #[doc = "Software trigger can only be used by MOD and CnV synchronization, and hardware triggers can only be used by OUTMASK and FTM counter synchronization."]
290    #[inline(always)]
291    pub fn _1(self) -> &'a mut W {
292        self.variant(PWMSYNC_A::_1)
293    }
294    #[doc = r"Sets the field bit"]
295    #[inline(always)]
296    pub fn set_bit(self) -> &'a mut W {
297        self.bit(true)
298    }
299    #[doc = r"Clears the field bit"]
300    #[inline(always)]
301    pub fn clear_bit(self) -> &'a mut W {
302        self.bit(false)
303    }
304    #[doc = r"Writes raw bits to the field"]
305    #[inline(always)]
306    pub fn bit(self, value: bool) -> &'a mut W {
307        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
308        self.w
309    }
310}
311#[doc = "Capture Test Mode Enable\n\nValue on reset: 0"]
312#[derive(Clone, Copy, Debug, PartialEq)]
313pub enum CAPTEST_A {
314    #[doc = "0: Capture test mode is disabled."]
315    _0 = 0,
316    #[doc = "1: Capture test mode is enabled."]
317    _1 = 1,
318}
319impl From<CAPTEST_A> for bool {
320    #[inline(always)]
321    fn from(variant: CAPTEST_A) -> Self {
322        variant as u8 != 0
323    }
324}
325#[doc = "Field `CAPTEST` reader - Capture Test Mode Enable"]
326pub struct CAPTEST_R(crate::FieldReader<bool, CAPTEST_A>);
327impl CAPTEST_R {
328    #[inline(always)]
329    pub(crate) fn new(bits: bool) -> Self {
330        CAPTEST_R(crate::FieldReader::new(bits))
331    }
332    #[doc = r"Get enumerated values variant"]
333    #[inline(always)]
334    pub fn variant(&self) -> CAPTEST_A {
335        match self.bits {
336            false => CAPTEST_A::_0,
337            true => CAPTEST_A::_1,
338        }
339    }
340    #[doc = "Checks if the value of the field is `_0`"]
341    #[inline(always)]
342    pub fn is_0(&self) -> bool {
343        **self == CAPTEST_A::_0
344    }
345    #[doc = "Checks if the value of the field is `_1`"]
346    #[inline(always)]
347    pub fn is_1(&self) -> bool {
348        **self == CAPTEST_A::_1
349    }
350}
351impl core::ops::Deref for CAPTEST_R {
352    type Target = crate::FieldReader<bool, CAPTEST_A>;
353    #[inline(always)]
354    fn deref(&self) -> &Self::Target {
355        &self.0
356    }
357}
358#[doc = "Field `CAPTEST` writer - Capture Test Mode Enable"]
359pub struct CAPTEST_W<'a> {
360    w: &'a mut W,
361}
362impl<'a> CAPTEST_W<'a> {
363    #[doc = r"Writes `variant` to the field"]
364    #[inline(always)]
365    pub fn variant(self, variant: CAPTEST_A) -> &'a mut W {
366        self.bit(variant.into())
367    }
368    #[doc = "Capture test mode is disabled."]
369    #[inline(always)]
370    pub fn _0(self) -> &'a mut W {
371        self.variant(CAPTEST_A::_0)
372    }
373    #[doc = "Capture test mode is enabled."]
374    #[inline(always)]
375    pub fn _1(self) -> &'a mut W {
376        self.variant(CAPTEST_A::_1)
377    }
378    #[doc = r"Sets the field bit"]
379    #[inline(always)]
380    pub fn set_bit(self) -> &'a mut W {
381        self.bit(true)
382    }
383    #[doc = r"Clears the field bit"]
384    #[inline(always)]
385    pub fn clear_bit(self) -> &'a mut W {
386        self.bit(false)
387    }
388    #[doc = r"Writes raw bits to the field"]
389    #[inline(always)]
390    pub fn bit(self, value: bool) -> &'a mut W {
391        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
392        self.w
393    }
394}
395#[doc = "Fault Control Mode\n\nValue on reset: 0"]
396#[derive(Clone, Copy, Debug, PartialEq)]
397#[repr(u8)]
398pub enum FAULTM_A {
399    #[doc = "0: Fault control is disabled for all channels."]
400    _00 = 0,
401    #[doc = "1: Fault control is enabled for even channels only (channels 0, 2, 4, and 6), and the selected mode is the manual fault clearing."]
402    _01 = 1,
403    #[doc = "2: Fault control is enabled for all channels, and the selected mode is the manual fault clearing."]
404    _10 = 2,
405    #[doc = "3: Fault control is enabled for all channels, and the selected mode is the automatic fault clearing."]
406    _11 = 3,
407}
408impl From<FAULTM_A> for u8 {
409    #[inline(always)]
410    fn from(variant: FAULTM_A) -> Self {
411        variant as _
412    }
413}
414#[doc = "Field `FAULTM` reader - Fault Control Mode"]
415pub struct FAULTM_R(crate::FieldReader<u8, FAULTM_A>);
416impl FAULTM_R {
417    #[inline(always)]
418    pub(crate) fn new(bits: u8) -> Self {
419        FAULTM_R(crate::FieldReader::new(bits))
420    }
421    #[doc = r"Get enumerated values variant"]
422    #[inline(always)]
423    pub fn variant(&self) -> FAULTM_A {
424        match self.bits {
425            0 => FAULTM_A::_00,
426            1 => FAULTM_A::_01,
427            2 => FAULTM_A::_10,
428            3 => FAULTM_A::_11,
429            _ => unreachable!(),
430        }
431    }
432    #[doc = "Checks if the value of the field is `_00`"]
433    #[inline(always)]
434    pub fn is_00(&self) -> bool {
435        **self == FAULTM_A::_00
436    }
437    #[doc = "Checks if the value of the field is `_01`"]
438    #[inline(always)]
439    pub fn is_01(&self) -> bool {
440        **self == FAULTM_A::_01
441    }
442    #[doc = "Checks if the value of the field is `_10`"]
443    #[inline(always)]
444    pub fn is_10(&self) -> bool {
445        **self == FAULTM_A::_10
446    }
447    #[doc = "Checks if the value of the field is `_11`"]
448    #[inline(always)]
449    pub fn is_11(&self) -> bool {
450        **self == FAULTM_A::_11
451    }
452}
453impl core::ops::Deref for FAULTM_R {
454    type Target = crate::FieldReader<u8, FAULTM_A>;
455    #[inline(always)]
456    fn deref(&self) -> &Self::Target {
457        &self.0
458    }
459}
460#[doc = "Field `FAULTM` writer - Fault Control Mode"]
461pub struct FAULTM_W<'a> {
462    w: &'a mut W,
463}
464impl<'a> FAULTM_W<'a> {
465    #[doc = r"Writes `variant` to the field"]
466    #[inline(always)]
467    pub fn variant(self, variant: FAULTM_A) -> &'a mut W {
468        self.bits(variant.into())
469    }
470    #[doc = "Fault control is disabled for all channels."]
471    #[inline(always)]
472    pub fn _00(self) -> &'a mut W {
473        self.variant(FAULTM_A::_00)
474    }
475    #[doc = "Fault control is enabled for even channels only (channels 0, 2, 4, and 6), and the selected mode is the manual fault clearing."]
476    #[inline(always)]
477    pub fn _01(self) -> &'a mut W {
478        self.variant(FAULTM_A::_01)
479    }
480    #[doc = "Fault control is enabled for all channels, and the selected mode is the manual fault clearing."]
481    #[inline(always)]
482    pub fn _10(self) -> &'a mut W {
483        self.variant(FAULTM_A::_10)
484    }
485    #[doc = "Fault control is enabled for all channels, and the selected mode is the automatic fault clearing."]
486    #[inline(always)]
487    pub fn _11(self) -> &'a mut W {
488        self.variant(FAULTM_A::_11)
489    }
490    #[doc = r"Writes raw bits to the field"]
491    #[inline(always)]
492    pub fn bits(self, value: u8) -> &'a mut W {
493        self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5);
494        self.w
495    }
496}
497#[doc = "Fault Interrupt Enable\n\nValue on reset: 0"]
498#[derive(Clone, Copy, Debug, PartialEq)]
499pub enum FAULTIE_A {
500    #[doc = "0: Fault control interrupt is disabled."]
501    _0 = 0,
502    #[doc = "1: Fault control interrupt is enabled."]
503    _1 = 1,
504}
505impl From<FAULTIE_A> for bool {
506    #[inline(always)]
507    fn from(variant: FAULTIE_A) -> Self {
508        variant as u8 != 0
509    }
510}
511#[doc = "Field `FAULTIE` reader - Fault Interrupt Enable"]
512pub struct FAULTIE_R(crate::FieldReader<bool, FAULTIE_A>);
513impl FAULTIE_R {
514    #[inline(always)]
515    pub(crate) fn new(bits: bool) -> Self {
516        FAULTIE_R(crate::FieldReader::new(bits))
517    }
518    #[doc = r"Get enumerated values variant"]
519    #[inline(always)]
520    pub fn variant(&self) -> FAULTIE_A {
521        match self.bits {
522            false => FAULTIE_A::_0,
523            true => FAULTIE_A::_1,
524        }
525    }
526    #[doc = "Checks if the value of the field is `_0`"]
527    #[inline(always)]
528    pub fn is_0(&self) -> bool {
529        **self == FAULTIE_A::_0
530    }
531    #[doc = "Checks if the value of the field is `_1`"]
532    #[inline(always)]
533    pub fn is_1(&self) -> bool {
534        **self == FAULTIE_A::_1
535    }
536}
537impl core::ops::Deref for FAULTIE_R {
538    type Target = crate::FieldReader<bool, FAULTIE_A>;
539    #[inline(always)]
540    fn deref(&self) -> &Self::Target {
541        &self.0
542    }
543}
544#[doc = "Field `FAULTIE` writer - Fault Interrupt Enable"]
545pub struct FAULTIE_W<'a> {
546    w: &'a mut W,
547}
548impl<'a> FAULTIE_W<'a> {
549    #[doc = r"Writes `variant` to the field"]
550    #[inline(always)]
551    pub fn variant(self, variant: FAULTIE_A) -> &'a mut W {
552        self.bit(variant.into())
553    }
554    #[doc = "Fault control interrupt is disabled."]
555    #[inline(always)]
556    pub fn _0(self) -> &'a mut W {
557        self.variant(FAULTIE_A::_0)
558    }
559    #[doc = "Fault control interrupt is enabled."]
560    #[inline(always)]
561    pub fn _1(self) -> &'a mut W {
562        self.variant(FAULTIE_A::_1)
563    }
564    #[doc = r"Sets the field bit"]
565    #[inline(always)]
566    pub fn set_bit(self) -> &'a mut W {
567        self.bit(true)
568    }
569    #[doc = r"Clears the field bit"]
570    #[inline(always)]
571    pub fn clear_bit(self) -> &'a mut W {
572        self.bit(false)
573    }
574    #[doc = r"Writes raw bits to the field"]
575    #[inline(always)]
576    pub fn bit(self, value: bool) -> &'a mut W {
577        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
578        self.w
579    }
580}
581impl R {
582    #[doc = "Bit 0 - FTM Enable"]
583    #[inline(always)]
584    pub fn ftmen(&self) -> FTMEN_R {
585        FTMEN_R::new((self.bits & 0x01) != 0)
586    }
587    #[doc = "Bit 2 - Write Protection Disable"]
588    #[inline(always)]
589    pub fn wpdis(&self) -> WPDIS_R {
590        WPDIS_R::new(((self.bits >> 2) & 0x01) != 0)
591    }
592    #[doc = "Bit 3 - PWM Synchronization Mode"]
593    #[inline(always)]
594    pub fn pwmsync(&self) -> PWMSYNC_R {
595        PWMSYNC_R::new(((self.bits >> 3) & 0x01) != 0)
596    }
597    #[doc = "Bit 4 - Capture Test Mode Enable"]
598    #[inline(always)]
599    pub fn captest(&self) -> CAPTEST_R {
600        CAPTEST_R::new(((self.bits >> 4) & 0x01) != 0)
601    }
602    #[doc = "Bits 5:6 - Fault Control Mode"]
603    #[inline(always)]
604    pub fn faultm(&self) -> FAULTM_R {
605        FAULTM_R::new(((self.bits >> 5) & 0x03) as u8)
606    }
607    #[doc = "Bit 7 - Fault Interrupt Enable"]
608    #[inline(always)]
609    pub fn faultie(&self) -> FAULTIE_R {
610        FAULTIE_R::new(((self.bits >> 7) & 0x01) != 0)
611    }
612}
613impl W {
614    #[doc = "Bit 0 - FTM Enable"]
615    #[inline(always)]
616    pub fn ftmen(&mut self) -> FTMEN_W {
617        FTMEN_W { w: self }
618    }
619    #[doc = "Bit 1 - Initialize The Channels Output"]
620    #[inline(always)]
621    pub fn init(&mut self) -> INIT_W {
622        INIT_W { w: self }
623    }
624    #[doc = "Bit 2 - Write Protection Disable"]
625    #[inline(always)]
626    pub fn wpdis(&mut self) -> WPDIS_W {
627        WPDIS_W { w: self }
628    }
629    #[doc = "Bit 3 - PWM Synchronization Mode"]
630    #[inline(always)]
631    pub fn pwmsync(&mut self) -> PWMSYNC_W {
632        PWMSYNC_W { w: self }
633    }
634    #[doc = "Bit 4 - Capture Test Mode Enable"]
635    #[inline(always)]
636    pub fn captest(&mut self) -> CAPTEST_W {
637        CAPTEST_W { w: self }
638    }
639    #[doc = "Bits 5:6 - Fault Control Mode"]
640    #[inline(always)]
641    pub fn faultm(&mut self) -> FAULTM_W {
642        FAULTM_W { w: self }
643    }
644    #[doc = "Bit 7 - Fault Interrupt Enable"]
645    #[inline(always)]
646    pub fn faultie(&mut self) -> FAULTIE_W {
647        FAULTIE_W { w: self }
648    }
649    #[doc = "Writes raw bits to the register."]
650    #[inline(always)]
651    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
652        self.0.bits(bits);
653        self
654    }
655}
656#[doc = "Features Mode Selection\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 [mode](index.html) module"]
657pub struct MODE_SPEC;
658impl crate::RegisterSpec for MODE_SPEC {
659    type Ux = u32;
660}
661#[doc = "`read()` method returns [mode::R](R) reader structure"]
662impl crate::Readable for MODE_SPEC {
663    type Reader = R;
664}
665#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"]
666impl crate::Writable for MODE_SPEC {
667    type Writer = W;
668}
669#[doc = "`reset()` method sets MODE to value 0x04"]
670impl crate::Resettable for MODE_SPEC {
671    #[inline(always)]
672    fn reset_value() -> Self::Ux {
673        0x04
674    }
675}