msp432p401r/cs/
csctl3.rs

1#[doc = "Register `CSCTL3` reader"]
2pub struct R(crate::R<CSCTL3_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CSCTL3_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CSCTL3_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CSCTL3_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CSCTL3` writer"]
17pub struct W(crate::W<CSCTL3_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CSCTL3_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<CSCTL3_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CSCTL3_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Start flag counter for LFXT\n\nValue on reset: 3"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum FCNTLF_A {
41    #[doc = "0: 4096 cycles"]
42    FCNTLF_0 = 0,
43    #[doc = "1: 8192 cycles"]
44    FCNTLF_1 = 1,
45    #[doc = "2: 16384 cycles"]
46    FCNTLF_2 = 2,
47    #[doc = "3: 32768 cycles"]
48    FCNTLF_3 = 3,
49}
50impl From<FCNTLF_A> for u8 {
51    #[inline(always)]
52    fn from(variant: FCNTLF_A) -> Self {
53        variant as _
54    }
55}
56#[doc = "Field `FCNTLF` reader - Start flag counter for LFXT"]
57pub type FCNTLF_R = crate::FieldReader<u8, FCNTLF_A>;
58impl FCNTLF_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> FCNTLF_A {
62        match self.bits {
63            0 => FCNTLF_A::FCNTLF_0,
64            1 => FCNTLF_A::FCNTLF_1,
65            2 => FCNTLF_A::FCNTLF_2,
66            3 => FCNTLF_A::FCNTLF_3,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `FCNTLF_0`"]
71    #[inline(always)]
72    pub fn is_fcntlf_0(&self) -> bool {
73        *self == FCNTLF_A::FCNTLF_0
74    }
75    #[doc = "Checks if the value of the field is `FCNTLF_1`"]
76    #[inline(always)]
77    pub fn is_fcntlf_1(&self) -> bool {
78        *self == FCNTLF_A::FCNTLF_1
79    }
80    #[doc = "Checks if the value of the field is `FCNTLF_2`"]
81    #[inline(always)]
82    pub fn is_fcntlf_2(&self) -> bool {
83        *self == FCNTLF_A::FCNTLF_2
84    }
85    #[doc = "Checks if the value of the field is `FCNTLF_3`"]
86    #[inline(always)]
87    pub fn is_fcntlf_3(&self) -> bool {
88        *self == FCNTLF_A::FCNTLF_3
89    }
90}
91#[doc = "Field `FCNTLF` writer - Start flag counter for LFXT"]
92pub type FCNTLF_W<'a, const O: u8> =
93    crate::FieldWriterSafe<'a, u32, CSCTL3_SPEC, u8, FCNTLF_A, 2, O>;
94impl<'a, const O: u8> FCNTLF_W<'a, O> {
95    #[doc = "4096 cycles"]
96    #[inline(always)]
97    pub fn fcntlf_0(self) -> &'a mut W {
98        self.variant(FCNTLF_A::FCNTLF_0)
99    }
100    #[doc = "8192 cycles"]
101    #[inline(always)]
102    pub fn fcntlf_1(self) -> &'a mut W {
103        self.variant(FCNTLF_A::FCNTLF_1)
104    }
105    #[doc = "16384 cycles"]
106    #[inline(always)]
107    pub fn fcntlf_2(self) -> &'a mut W {
108        self.variant(FCNTLF_A::FCNTLF_2)
109    }
110    #[doc = "32768 cycles"]
111    #[inline(always)]
112    pub fn fcntlf_3(self) -> &'a mut W {
113        self.variant(FCNTLF_A::FCNTLF_3)
114    }
115}
116#[doc = "Reset start fault counter for LFXT\n\nValue on reset: 0"]
117#[derive(Clone, Copy, Debug, PartialEq)]
118pub enum RFCNTLF_AW {
119    #[doc = "0: Not applicable. Always reads as zero due to self clearing."]
120    RFCNTLF_0 = 0,
121    #[doc = "1: Restarts the counter immediately."]
122    RFCNTLF_1 = 1,
123}
124impl From<RFCNTLF_AW> for bool {
125    #[inline(always)]
126    fn from(variant: RFCNTLF_AW) -> Self {
127        variant as u8 != 0
128    }
129}
130#[doc = "Field `RFCNTLF` writer - Reset start fault counter for LFXT"]
131pub type RFCNTLF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, RFCNTLF_AW, O>;
132impl<'a, const O: u8> RFCNTLF_W<'a, O> {
133    #[doc = "Not applicable. Always reads as zero due to self clearing."]
134    #[inline(always)]
135    pub fn rfcntlf_0(self) -> &'a mut W {
136        self.variant(RFCNTLF_AW::RFCNTLF_0)
137    }
138    #[doc = "Restarts the counter immediately."]
139    #[inline(always)]
140    pub fn rfcntlf_1(self) -> &'a mut W {
141        self.variant(RFCNTLF_AW::RFCNTLF_1)
142    }
143}
144#[doc = "Enable start fault counter for LFXT\n\nValue on reset: 1"]
145#[derive(Clone, Copy, Debug, PartialEq)]
146pub enum FCNTLF_EN_A {
147    #[doc = "0: Startup fault counter disabled. Counter is cleared."]
148    FCNTLF_EN_0 = 0,
149    #[doc = "1: Startup fault counter enabled."]
150    FCNTLF_EN_1 = 1,
151}
152impl From<FCNTLF_EN_A> for bool {
153    #[inline(always)]
154    fn from(variant: FCNTLF_EN_A) -> Self {
155        variant as u8 != 0
156    }
157}
158#[doc = "Field `FCNTLF_EN` reader - Enable start fault counter for LFXT"]
159pub type FCNTLF_EN_R = crate::BitReader<FCNTLF_EN_A>;
160impl FCNTLF_EN_R {
161    #[doc = "Get enumerated values variant"]
162    #[inline(always)]
163    pub fn variant(&self) -> FCNTLF_EN_A {
164        match self.bits {
165            false => FCNTLF_EN_A::FCNTLF_EN_0,
166            true => FCNTLF_EN_A::FCNTLF_EN_1,
167        }
168    }
169    #[doc = "Checks if the value of the field is `FCNTLF_EN_0`"]
170    #[inline(always)]
171    pub fn is_fcntlf_en_0(&self) -> bool {
172        *self == FCNTLF_EN_A::FCNTLF_EN_0
173    }
174    #[doc = "Checks if the value of the field is `FCNTLF_EN_1`"]
175    #[inline(always)]
176    pub fn is_fcntlf_en_1(&self) -> bool {
177        *self == FCNTLF_EN_A::FCNTLF_EN_1
178    }
179}
180#[doc = "Field `FCNTLF_EN` writer - Enable start fault counter for LFXT"]
181pub type FCNTLF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, FCNTLF_EN_A, O>;
182impl<'a, const O: u8> FCNTLF_EN_W<'a, O> {
183    #[doc = "Startup fault counter disabled. Counter is cleared."]
184    #[inline(always)]
185    pub fn fcntlf_en_0(self) -> &'a mut W {
186        self.variant(FCNTLF_EN_A::FCNTLF_EN_0)
187    }
188    #[doc = "Startup fault counter enabled."]
189    #[inline(always)]
190    pub fn fcntlf_en_1(self) -> &'a mut W {
191        self.variant(FCNTLF_EN_A::FCNTLF_EN_1)
192    }
193}
194#[doc = "Start flag counter for HFXT\n\nValue on reset: 3"]
195#[derive(Clone, Copy, Debug, PartialEq)]
196#[repr(u8)]
197pub enum FCNTHF_A {
198    #[doc = "0: 2048 cycles"]
199    FCNTHF_0 = 0,
200    #[doc = "1: 4096 cycles"]
201    FCNTHF_1 = 1,
202    #[doc = "2: 8192 cycles"]
203    FCNTHF_2 = 2,
204    #[doc = "3: 16384 cycles"]
205    FCNTHF_3 = 3,
206}
207impl From<FCNTHF_A> for u8 {
208    #[inline(always)]
209    fn from(variant: FCNTHF_A) -> Self {
210        variant as _
211    }
212}
213#[doc = "Field `FCNTHF` reader - Start flag counter for HFXT"]
214pub type FCNTHF_R = crate::FieldReader<u8, FCNTHF_A>;
215impl FCNTHF_R {
216    #[doc = "Get enumerated values variant"]
217    #[inline(always)]
218    pub fn variant(&self) -> FCNTHF_A {
219        match self.bits {
220            0 => FCNTHF_A::FCNTHF_0,
221            1 => FCNTHF_A::FCNTHF_1,
222            2 => FCNTHF_A::FCNTHF_2,
223            3 => FCNTHF_A::FCNTHF_3,
224            _ => unreachable!(),
225        }
226    }
227    #[doc = "Checks if the value of the field is `FCNTHF_0`"]
228    #[inline(always)]
229    pub fn is_fcnthf_0(&self) -> bool {
230        *self == FCNTHF_A::FCNTHF_0
231    }
232    #[doc = "Checks if the value of the field is `FCNTHF_1`"]
233    #[inline(always)]
234    pub fn is_fcnthf_1(&self) -> bool {
235        *self == FCNTHF_A::FCNTHF_1
236    }
237    #[doc = "Checks if the value of the field is `FCNTHF_2`"]
238    #[inline(always)]
239    pub fn is_fcnthf_2(&self) -> bool {
240        *self == FCNTHF_A::FCNTHF_2
241    }
242    #[doc = "Checks if the value of the field is `FCNTHF_3`"]
243    #[inline(always)]
244    pub fn is_fcnthf_3(&self) -> bool {
245        *self == FCNTHF_A::FCNTHF_3
246    }
247}
248#[doc = "Field `FCNTHF` writer - Start flag counter for HFXT"]
249pub type FCNTHF_W<'a, const O: u8> =
250    crate::FieldWriterSafe<'a, u32, CSCTL3_SPEC, u8, FCNTHF_A, 2, O>;
251impl<'a, const O: u8> FCNTHF_W<'a, O> {
252    #[doc = "2048 cycles"]
253    #[inline(always)]
254    pub fn fcnthf_0(self) -> &'a mut W {
255        self.variant(FCNTHF_A::FCNTHF_0)
256    }
257    #[doc = "4096 cycles"]
258    #[inline(always)]
259    pub fn fcnthf_1(self) -> &'a mut W {
260        self.variant(FCNTHF_A::FCNTHF_1)
261    }
262    #[doc = "8192 cycles"]
263    #[inline(always)]
264    pub fn fcnthf_2(self) -> &'a mut W {
265        self.variant(FCNTHF_A::FCNTHF_2)
266    }
267    #[doc = "16384 cycles"]
268    #[inline(always)]
269    pub fn fcnthf_3(self) -> &'a mut W {
270        self.variant(FCNTHF_A::FCNTHF_3)
271    }
272}
273#[doc = "Reset start fault counter for HFXT\n\nValue on reset: 0"]
274#[derive(Clone, Copy, Debug, PartialEq)]
275pub enum RFCNTHF_AW {
276    #[doc = "0: Not applicable. Always reads as zero due to self clearing."]
277    RFCNTHF_0 = 0,
278    #[doc = "1: Restarts the counter immediately."]
279    RFCNTHF_1 = 1,
280}
281impl From<RFCNTHF_AW> for bool {
282    #[inline(always)]
283    fn from(variant: RFCNTHF_AW) -> Self {
284        variant as u8 != 0
285    }
286}
287#[doc = "Field `RFCNTHF` writer - Reset start fault counter for HFXT"]
288pub type RFCNTHF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, RFCNTHF_AW, O>;
289impl<'a, const O: u8> RFCNTHF_W<'a, O> {
290    #[doc = "Not applicable. Always reads as zero due to self clearing."]
291    #[inline(always)]
292    pub fn rfcnthf_0(self) -> &'a mut W {
293        self.variant(RFCNTHF_AW::RFCNTHF_0)
294    }
295    #[doc = "Restarts the counter immediately."]
296    #[inline(always)]
297    pub fn rfcnthf_1(self) -> &'a mut W {
298        self.variant(RFCNTHF_AW::RFCNTHF_1)
299    }
300}
301#[doc = "Enable start fault counter for HFXT\n\nValue on reset: 1"]
302#[derive(Clone, Copy, Debug, PartialEq)]
303pub enum FCNTHF_EN_A {
304    #[doc = "0: Startup fault counter disabled. Counter is cleared."]
305    FCNTHF_EN_0 = 0,
306    #[doc = "1: Startup fault counter enabled."]
307    FCNTHF_EN_1 = 1,
308}
309impl From<FCNTHF_EN_A> for bool {
310    #[inline(always)]
311    fn from(variant: FCNTHF_EN_A) -> Self {
312        variant as u8 != 0
313    }
314}
315#[doc = "Field `FCNTHF_EN` reader - Enable start fault counter for HFXT"]
316pub type FCNTHF_EN_R = crate::BitReader<FCNTHF_EN_A>;
317impl FCNTHF_EN_R {
318    #[doc = "Get enumerated values variant"]
319    #[inline(always)]
320    pub fn variant(&self) -> FCNTHF_EN_A {
321        match self.bits {
322            false => FCNTHF_EN_A::FCNTHF_EN_0,
323            true => FCNTHF_EN_A::FCNTHF_EN_1,
324        }
325    }
326    #[doc = "Checks if the value of the field is `FCNTHF_EN_0`"]
327    #[inline(always)]
328    pub fn is_fcnthf_en_0(&self) -> bool {
329        *self == FCNTHF_EN_A::FCNTHF_EN_0
330    }
331    #[doc = "Checks if the value of the field is `FCNTHF_EN_1`"]
332    #[inline(always)]
333    pub fn is_fcnthf_en_1(&self) -> bool {
334        *self == FCNTHF_EN_A::FCNTHF_EN_1
335    }
336}
337#[doc = "Field `FCNTHF_EN` writer - Enable start fault counter for HFXT"]
338pub type FCNTHF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, FCNTHF_EN_A, O>;
339impl<'a, const O: u8> FCNTHF_EN_W<'a, O> {
340    #[doc = "Startup fault counter disabled. Counter is cleared."]
341    #[inline(always)]
342    pub fn fcnthf_en_0(self) -> &'a mut W {
343        self.variant(FCNTHF_EN_A::FCNTHF_EN_0)
344    }
345    #[doc = "Startup fault counter enabled."]
346    #[inline(always)]
347    pub fn fcnthf_en_1(self) -> &'a mut W {
348        self.variant(FCNTHF_EN_A::FCNTHF_EN_1)
349    }
350}
351#[doc = "Start flag counter for HFXT2\n\nValue on reset: 3"]
352#[derive(Clone, Copy, Debug, PartialEq)]
353#[repr(u8)]
354pub enum FCNTHF2_A {
355    #[doc = "0: 2048 cycles"]
356    FCNTHF2_0 = 0,
357    #[doc = "1: 4096 cycles"]
358    FCNTHF2_1 = 1,
359    #[doc = "2: 8192 cycles"]
360    FCNTHF2_2 = 2,
361    #[doc = "3: 16384 cycles"]
362    FCNTHF2_3 = 3,
363}
364impl From<FCNTHF2_A> for u8 {
365    #[inline(always)]
366    fn from(variant: FCNTHF2_A) -> Self {
367        variant as _
368    }
369}
370#[doc = "Field `FCNTHF2` reader - Start flag counter for HFXT2"]
371pub type FCNTHF2_R = crate::FieldReader<u8, FCNTHF2_A>;
372impl FCNTHF2_R {
373    #[doc = "Get enumerated values variant"]
374    #[inline(always)]
375    pub fn variant(&self) -> FCNTHF2_A {
376        match self.bits {
377            0 => FCNTHF2_A::FCNTHF2_0,
378            1 => FCNTHF2_A::FCNTHF2_1,
379            2 => FCNTHF2_A::FCNTHF2_2,
380            3 => FCNTHF2_A::FCNTHF2_3,
381            _ => unreachable!(),
382        }
383    }
384    #[doc = "Checks if the value of the field is `FCNTHF2_0`"]
385    #[inline(always)]
386    pub fn is_fcnthf2_0(&self) -> bool {
387        *self == FCNTHF2_A::FCNTHF2_0
388    }
389    #[doc = "Checks if the value of the field is `FCNTHF2_1`"]
390    #[inline(always)]
391    pub fn is_fcnthf2_1(&self) -> bool {
392        *self == FCNTHF2_A::FCNTHF2_1
393    }
394    #[doc = "Checks if the value of the field is `FCNTHF2_2`"]
395    #[inline(always)]
396    pub fn is_fcnthf2_2(&self) -> bool {
397        *self == FCNTHF2_A::FCNTHF2_2
398    }
399    #[doc = "Checks if the value of the field is `FCNTHF2_3`"]
400    #[inline(always)]
401    pub fn is_fcnthf2_3(&self) -> bool {
402        *self == FCNTHF2_A::FCNTHF2_3
403    }
404}
405#[doc = "Field `FCNTHF2` writer - Start flag counter for HFXT2"]
406pub type FCNTHF2_W<'a, const O: u8> =
407    crate::FieldWriterSafe<'a, u32, CSCTL3_SPEC, u8, FCNTHF2_A, 2, O>;
408impl<'a, const O: u8> FCNTHF2_W<'a, O> {
409    #[doc = "2048 cycles"]
410    #[inline(always)]
411    pub fn fcnthf2_0(self) -> &'a mut W {
412        self.variant(FCNTHF2_A::FCNTHF2_0)
413    }
414    #[doc = "4096 cycles"]
415    #[inline(always)]
416    pub fn fcnthf2_1(self) -> &'a mut W {
417        self.variant(FCNTHF2_A::FCNTHF2_1)
418    }
419    #[doc = "8192 cycles"]
420    #[inline(always)]
421    pub fn fcnthf2_2(self) -> &'a mut W {
422        self.variant(FCNTHF2_A::FCNTHF2_2)
423    }
424    #[doc = "16384 cycles"]
425    #[inline(always)]
426    pub fn fcnthf2_3(self) -> &'a mut W {
427        self.variant(FCNTHF2_A::FCNTHF2_3)
428    }
429}
430#[doc = "Reset start fault counter for HFXT2\n\nValue on reset: 0"]
431#[derive(Clone, Copy, Debug, PartialEq)]
432pub enum RFCNTHF2_AW {
433    #[doc = "0: Not applicable. Always reads as zero due to self clearing."]
434    RFCNTHF2_0 = 0,
435    #[doc = "1: Restarts the counter immediately."]
436    RFCNTHF2_1 = 1,
437}
438impl From<RFCNTHF2_AW> for bool {
439    #[inline(always)]
440    fn from(variant: RFCNTHF2_AW) -> Self {
441        variant as u8 != 0
442    }
443}
444#[doc = "Field `RFCNTHF2` writer - Reset start fault counter for HFXT2"]
445pub type RFCNTHF2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, RFCNTHF2_AW, O>;
446impl<'a, const O: u8> RFCNTHF2_W<'a, O> {
447    #[doc = "Not applicable. Always reads as zero due to self clearing."]
448    #[inline(always)]
449    pub fn rfcnthf2_0(self) -> &'a mut W {
450        self.variant(RFCNTHF2_AW::RFCNTHF2_0)
451    }
452    #[doc = "Restarts the counter immediately."]
453    #[inline(always)]
454    pub fn rfcnthf2_1(self) -> &'a mut W {
455        self.variant(RFCNTHF2_AW::RFCNTHF2_1)
456    }
457}
458#[doc = "Enable start fault counter for HFXT2\n\nValue on reset: 1"]
459#[derive(Clone, Copy, Debug, PartialEq)]
460pub enum FCNTHF2_EN_A {
461    #[doc = "0: Startup fault counter disabled. Counter is cleared."]
462    FCNTHF2_EN_0 = 0,
463    #[doc = "1: Startup fault counter enabled."]
464    FCNTHF2_EN_1 = 1,
465}
466impl From<FCNTHF2_EN_A> for bool {
467    #[inline(always)]
468    fn from(variant: FCNTHF2_EN_A) -> Self {
469        variant as u8 != 0
470    }
471}
472#[doc = "Field `FCNTHF2_EN` reader - Enable start fault counter for HFXT2"]
473pub type FCNTHF2_EN_R = crate::BitReader<FCNTHF2_EN_A>;
474impl FCNTHF2_EN_R {
475    #[doc = "Get enumerated values variant"]
476    #[inline(always)]
477    pub fn variant(&self) -> FCNTHF2_EN_A {
478        match self.bits {
479            false => FCNTHF2_EN_A::FCNTHF2_EN_0,
480            true => FCNTHF2_EN_A::FCNTHF2_EN_1,
481        }
482    }
483    #[doc = "Checks if the value of the field is `FCNTHF2_EN_0`"]
484    #[inline(always)]
485    pub fn is_fcnthf2_en_0(&self) -> bool {
486        *self == FCNTHF2_EN_A::FCNTHF2_EN_0
487    }
488    #[doc = "Checks if the value of the field is `FCNTHF2_EN_1`"]
489    #[inline(always)]
490    pub fn is_fcnthf2_en_1(&self) -> bool {
491        *self == FCNTHF2_EN_A::FCNTHF2_EN_1
492    }
493}
494#[doc = "Field `FCNTHF2_EN` writer - Enable start fault counter for HFXT2"]
495pub type FCNTHF2_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSCTL3_SPEC, FCNTHF2_EN_A, O>;
496impl<'a, const O: u8> FCNTHF2_EN_W<'a, O> {
497    #[doc = "Startup fault counter disabled. Counter is cleared."]
498    #[inline(always)]
499    pub fn fcnthf2_en_0(self) -> &'a mut W {
500        self.variant(FCNTHF2_EN_A::FCNTHF2_EN_0)
501    }
502    #[doc = "Startup fault counter enabled."]
503    #[inline(always)]
504    pub fn fcnthf2_en_1(self) -> &'a mut W {
505        self.variant(FCNTHF2_EN_A::FCNTHF2_EN_1)
506    }
507}
508impl R {
509    #[doc = "Bits 0:1 - Start flag counter for LFXT"]
510    #[inline(always)]
511    pub fn fcntlf(&self) -> FCNTLF_R {
512        FCNTLF_R::new((self.bits & 3) as u8)
513    }
514    #[doc = "Bit 3 - Enable start fault counter for LFXT"]
515    #[inline(always)]
516    pub fn fcntlf_en(&self) -> FCNTLF_EN_R {
517        FCNTLF_EN_R::new(((self.bits >> 3) & 1) != 0)
518    }
519    #[doc = "Bits 4:5 - Start flag counter for HFXT"]
520    #[inline(always)]
521    pub fn fcnthf(&self) -> FCNTHF_R {
522        FCNTHF_R::new(((self.bits >> 4) & 3) as u8)
523    }
524    #[doc = "Bit 7 - Enable start fault counter for HFXT"]
525    #[inline(always)]
526    pub fn fcnthf_en(&self) -> FCNTHF_EN_R {
527        FCNTHF_EN_R::new(((self.bits >> 7) & 1) != 0)
528    }
529    #[doc = "Bits 8:9 - Start flag counter for HFXT2"]
530    #[inline(always)]
531    pub fn fcnthf2(&self) -> FCNTHF2_R {
532        FCNTHF2_R::new(((self.bits >> 8) & 3) as u8)
533    }
534    #[doc = "Bit 11 - Enable start fault counter for HFXT2"]
535    #[inline(always)]
536    pub fn fcnthf2_en(&self) -> FCNTHF2_EN_R {
537        FCNTHF2_EN_R::new(((self.bits >> 11) & 1) != 0)
538    }
539}
540impl W {
541    #[doc = "Bits 0:1 - Start flag counter for LFXT"]
542    #[inline(always)]
543    pub fn fcntlf(&mut self) -> FCNTLF_W<0> {
544        FCNTLF_W::new(self)
545    }
546    #[doc = "Bit 2 - Reset start fault counter for LFXT"]
547    #[inline(always)]
548    pub fn rfcntlf(&mut self) -> RFCNTLF_W<2> {
549        RFCNTLF_W::new(self)
550    }
551    #[doc = "Bit 3 - Enable start fault counter for LFXT"]
552    #[inline(always)]
553    pub fn fcntlf_en(&mut self) -> FCNTLF_EN_W<3> {
554        FCNTLF_EN_W::new(self)
555    }
556    #[doc = "Bits 4:5 - Start flag counter for HFXT"]
557    #[inline(always)]
558    pub fn fcnthf(&mut self) -> FCNTHF_W<4> {
559        FCNTHF_W::new(self)
560    }
561    #[doc = "Bit 6 - Reset start fault counter for HFXT"]
562    #[inline(always)]
563    pub fn rfcnthf(&mut self) -> RFCNTHF_W<6> {
564        RFCNTHF_W::new(self)
565    }
566    #[doc = "Bit 7 - Enable start fault counter for HFXT"]
567    #[inline(always)]
568    pub fn fcnthf_en(&mut self) -> FCNTHF_EN_W<7> {
569        FCNTHF_EN_W::new(self)
570    }
571    #[doc = "Bits 8:9 - Start flag counter for HFXT2"]
572    #[inline(always)]
573    pub fn fcnthf2(&mut self) -> FCNTHF2_W<8> {
574        FCNTHF2_W::new(self)
575    }
576    #[doc = "Bit 10 - Reset start fault counter for HFXT2"]
577    #[inline(always)]
578    pub fn rfcnthf2(&mut self) -> RFCNTHF2_W<10> {
579        RFCNTHF2_W::new(self)
580    }
581    #[doc = "Bit 11 - Enable start fault counter for HFXT2"]
582    #[inline(always)]
583    pub fn fcnthf2_en(&mut self) -> FCNTHF2_EN_W<11> {
584        FCNTHF2_EN_W::new(self)
585    }
586    #[doc = "Writes raw bits to the register."]
587    #[inline(always)]
588    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
589        self.0.bits(bits);
590        self
591    }
592}
593#[doc = "Control 3 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csctl3](index.html) module"]
594pub struct CSCTL3_SPEC;
595impl crate::RegisterSpec for CSCTL3_SPEC {
596    type Ux = u32;
597}
598#[doc = "`read()` method returns [csctl3::R](R) reader structure"]
599impl crate::Readable for CSCTL3_SPEC {
600    type Reader = R;
601}
602#[doc = "`write(|w| ..)` method takes [csctl3::W](W) writer structure"]
603impl crate::Writable for CSCTL3_SPEC {
604    type Writer = W;
605}
606#[doc = "`reset()` method sets CSCTL3 to value 0x0bbb"]
607impl crate::Resettable for CSCTL3_SPEC {
608    #[inline(always)]
609    fn reset_value() -> Self::Ux {
610        0x0bbb
611    }
612}