efm32pg12_pac/pcnt0/
ctrl.rs

1#[doc = "Reader of register CTRL"]
2pub type R = crate::R<u32, super::CTRL>;
3#[doc = "Writer for register CTRL"]
4pub type W = crate::W<u32, super::CTRL>;
5#[doc = "Register CTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::CTRL {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Mode Select\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u8)]
16pub enum MODE_A {
17    #[doc = "0: The module is disabled."]
18    DISABLE = 0,
19    #[doc = "1: Single input LFACLK oversampling mode (available in EM0-EM3)."]
20    OVSSINGLE = 1,
21    #[doc = "2: Externally clocked single input counter mode (available in EM0-EM3)."]
22    EXTCLKSINGLE = 2,
23    #[doc = "3: Externally clocked quadrature decoder mode (available in EM0-EM3)."]
24    EXTCLKQUAD = 3,
25    #[doc = "4: LFACLK oversampling quadrature decoder 1X mode (available in EM0-EM3)."]
26    OVSQUAD1X = 4,
27    #[doc = "5: LFACLK oversampling quadrature decoder 2X mode (available in EM0-EM3)."]
28    OVSQUAD2X = 5,
29    #[doc = "6: LFACLK oversampling quadrature decoder 4X mode (available in EM0-EM3)."]
30    OVSQUAD4X = 6,
31}
32impl From<MODE_A> for u8 {
33    #[inline(always)]
34    fn from(variant: MODE_A) -> Self {
35        variant as _
36    }
37}
38#[doc = "Reader of field `MODE`"]
39pub type MODE_R = crate::R<u8, MODE_A>;
40impl MODE_R {
41    #[doc = r"Get enumerated values variant"]
42    #[inline(always)]
43    pub fn variant(&self) -> crate::Variant<u8, MODE_A> {
44        use crate::Variant::*;
45        match self.bits {
46            0 => Val(MODE_A::DISABLE),
47            1 => Val(MODE_A::OVSSINGLE),
48            2 => Val(MODE_A::EXTCLKSINGLE),
49            3 => Val(MODE_A::EXTCLKQUAD),
50            4 => Val(MODE_A::OVSQUAD1X),
51            5 => Val(MODE_A::OVSQUAD2X),
52            6 => Val(MODE_A::OVSQUAD4X),
53            i => Res(i),
54        }
55    }
56    #[doc = "Checks if the value of the field is `DISABLE`"]
57    #[inline(always)]
58    pub fn is_disable(&self) -> bool {
59        *self == MODE_A::DISABLE
60    }
61    #[doc = "Checks if the value of the field is `OVSSINGLE`"]
62    #[inline(always)]
63    pub fn is_ovssingle(&self) -> bool {
64        *self == MODE_A::OVSSINGLE
65    }
66    #[doc = "Checks if the value of the field is `EXTCLKSINGLE`"]
67    #[inline(always)]
68    pub fn is_extclksingle(&self) -> bool {
69        *self == MODE_A::EXTCLKSINGLE
70    }
71    #[doc = "Checks if the value of the field is `EXTCLKQUAD`"]
72    #[inline(always)]
73    pub fn is_extclkquad(&self) -> bool {
74        *self == MODE_A::EXTCLKQUAD
75    }
76    #[doc = "Checks if the value of the field is `OVSQUAD1X`"]
77    #[inline(always)]
78    pub fn is_ovsquad1x(&self) -> bool {
79        *self == MODE_A::OVSQUAD1X
80    }
81    #[doc = "Checks if the value of the field is `OVSQUAD2X`"]
82    #[inline(always)]
83    pub fn is_ovsquad2x(&self) -> bool {
84        *self == MODE_A::OVSQUAD2X
85    }
86    #[doc = "Checks if the value of the field is `OVSQUAD4X`"]
87    #[inline(always)]
88    pub fn is_ovsquad4x(&self) -> bool {
89        *self == MODE_A::OVSQUAD4X
90    }
91}
92#[doc = "Write proxy for field `MODE`"]
93pub struct MODE_W<'a> {
94    w: &'a mut W,
95}
96impl<'a> MODE_W<'a> {
97    #[doc = r"Writes `variant` to the field"]
98    #[inline(always)]
99    pub fn variant(self, variant: MODE_A) -> &'a mut W {
100        unsafe { self.bits(variant.into()) }
101    }
102    #[doc = "The module is disabled."]
103    #[inline(always)]
104    pub fn disable(self) -> &'a mut W {
105        self.variant(MODE_A::DISABLE)
106    }
107    #[doc = "Single input LFACLK oversampling mode (available in EM0-EM3)."]
108    #[inline(always)]
109    pub fn ovssingle(self) -> &'a mut W {
110        self.variant(MODE_A::OVSSINGLE)
111    }
112    #[doc = "Externally clocked single input counter mode (available in EM0-EM3)."]
113    #[inline(always)]
114    pub fn extclksingle(self) -> &'a mut W {
115        self.variant(MODE_A::EXTCLKSINGLE)
116    }
117    #[doc = "Externally clocked quadrature decoder mode (available in EM0-EM3)."]
118    #[inline(always)]
119    pub fn extclkquad(self) -> &'a mut W {
120        self.variant(MODE_A::EXTCLKQUAD)
121    }
122    #[doc = "LFACLK oversampling quadrature decoder 1X mode (available in EM0-EM3)."]
123    #[inline(always)]
124    pub fn ovsquad1x(self) -> &'a mut W {
125        self.variant(MODE_A::OVSQUAD1X)
126    }
127    #[doc = "LFACLK oversampling quadrature decoder 2X mode (available in EM0-EM3)."]
128    #[inline(always)]
129    pub fn ovsquad2x(self) -> &'a mut W {
130        self.variant(MODE_A::OVSQUAD2X)
131    }
132    #[doc = "LFACLK oversampling quadrature decoder 4X mode (available in EM0-EM3)."]
133    #[inline(always)]
134    pub fn ovsquad4x(self) -> &'a mut W {
135        self.variant(MODE_A::OVSQUAD4X)
136    }
137    #[doc = r"Writes raw bits to the field"]
138    #[inline(always)]
139    pub unsafe fn bits(self, value: u8) -> &'a mut W {
140        self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
141        self.w
142    }
143}
144#[doc = "Reader of field `FILT`"]
145pub type FILT_R = crate::R<bool, bool>;
146#[doc = "Write proxy for field `FILT`"]
147pub struct FILT_W<'a> {
148    w: &'a mut W,
149}
150impl<'a> FILT_W<'a> {
151    #[doc = r"Sets the field bit"]
152    #[inline(always)]
153    pub fn set_bit(self) -> &'a mut W {
154        self.bit(true)
155    }
156    #[doc = r"Clears the field bit"]
157    #[inline(always)]
158    pub fn clear_bit(self) -> &'a mut W {
159        self.bit(false)
160    }
161    #[doc = r"Writes raw bits to the field"]
162    #[inline(always)]
163    pub fn bit(self, value: bool) -> &'a mut W {
164        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
165        self.w
166    }
167}
168#[doc = "Reader of field `RSTEN`"]
169pub type RSTEN_R = crate::R<bool, bool>;
170#[doc = "Write proxy for field `RSTEN`"]
171pub struct RSTEN_W<'a> {
172    w: &'a mut W,
173}
174impl<'a> RSTEN_W<'a> {
175    #[doc = r"Sets the field bit"]
176    #[inline(always)]
177    pub fn set_bit(self) -> &'a mut W {
178        self.bit(true)
179    }
180    #[doc = r"Clears the field bit"]
181    #[inline(always)]
182    pub fn clear_bit(self) -> &'a mut W {
183        self.bit(false)
184    }
185    #[doc = r"Writes raw bits to the field"]
186    #[inline(always)]
187    pub fn bit(self, value: bool) -> &'a mut W {
188        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
189        self.w
190    }
191}
192#[doc = "Reader of field `CNTRSTEN`"]
193pub type CNTRSTEN_R = crate::R<bool, bool>;
194#[doc = "Write proxy for field `CNTRSTEN`"]
195pub struct CNTRSTEN_W<'a> {
196    w: &'a mut W,
197}
198impl<'a> CNTRSTEN_W<'a> {
199    #[doc = r"Sets the field bit"]
200    #[inline(always)]
201    pub fn set_bit(self) -> &'a mut W {
202        self.bit(true)
203    }
204    #[doc = r"Clears the field bit"]
205    #[inline(always)]
206    pub fn clear_bit(self) -> &'a mut W {
207        self.bit(false)
208    }
209    #[doc = r"Writes raw bits to the field"]
210    #[inline(always)]
211    pub fn bit(self, value: bool) -> &'a mut W {
212        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
213        self.w
214    }
215}
216#[doc = "Reader of field `AUXCNTRSTEN`"]
217pub type AUXCNTRSTEN_R = crate::R<bool, bool>;
218#[doc = "Write proxy for field `AUXCNTRSTEN`"]
219pub struct AUXCNTRSTEN_W<'a> {
220    w: &'a mut W,
221}
222impl<'a> AUXCNTRSTEN_W<'a> {
223    #[doc = r"Sets the field bit"]
224    #[inline(always)]
225    pub fn set_bit(self) -> &'a mut W {
226        self.bit(true)
227    }
228    #[doc = r"Clears the field bit"]
229    #[inline(always)]
230    pub fn clear_bit(self) -> &'a mut W {
231        self.bit(false)
232    }
233    #[doc = r"Writes raw bits to the field"]
234    #[inline(always)]
235    pub fn bit(self, value: bool) -> &'a mut W {
236        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
237        self.w
238    }
239}
240#[doc = "Reader of field `DEBUGHALT`"]
241pub type DEBUGHALT_R = crate::R<bool, bool>;
242#[doc = "Write proxy for field `DEBUGHALT`"]
243pub struct DEBUGHALT_W<'a> {
244    w: &'a mut W,
245}
246impl<'a> DEBUGHALT_W<'a> {
247    #[doc = r"Sets the field bit"]
248    #[inline(always)]
249    pub fn set_bit(self) -> &'a mut W {
250        self.bit(true)
251    }
252    #[doc = r"Clears the field bit"]
253    #[inline(always)]
254    pub fn clear_bit(self) -> &'a mut W {
255        self.bit(false)
256    }
257    #[doc = r"Writes raw bits to the field"]
258    #[inline(always)]
259    pub fn bit(self, value: bool) -> &'a mut W {
260        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
261        self.w
262    }
263}
264#[doc = "Reader of field `HYST`"]
265pub type HYST_R = crate::R<bool, bool>;
266#[doc = "Write proxy for field `HYST`"]
267pub struct HYST_W<'a> {
268    w: &'a mut W,
269}
270impl<'a> HYST_W<'a> {
271    #[doc = r"Sets the field bit"]
272    #[inline(always)]
273    pub fn set_bit(self) -> &'a mut W {
274        self.bit(true)
275    }
276    #[doc = r"Clears the field bit"]
277    #[inline(always)]
278    pub fn clear_bit(self) -> &'a mut W {
279        self.bit(false)
280    }
281    #[doc = r"Writes raw bits to the field"]
282    #[inline(always)]
283    pub fn bit(self, value: bool) -> &'a mut W {
284        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
285        self.w
286    }
287}
288#[doc = "Reader of field `S1CDIR`"]
289pub type S1CDIR_R = crate::R<bool, bool>;
290#[doc = "Write proxy for field `S1CDIR`"]
291pub struct S1CDIR_W<'a> {
292    w: &'a mut W,
293}
294impl<'a> S1CDIR_W<'a> {
295    #[doc = r"Sets the field bit"]
296    #[inline(always)]
297    pub fn set_bit(self) -> &'a mut W {
298        self.bit(true)
299    }
300    #[doc = r"Clears the field bit"]
301    #[inline(always)]
302    pub fn clear_bit(self) -> &'a mut W {
303        self.bit(false)
304    }
305    #[doc = r"Writes raw bits to the field"]
306    #[inline(always)]
307    pub fn bit(self, value: bool) -> &'a mut W {
308        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
309        self.w
310    }
311}
312#[doc = "Controls When the Counter Counts\n\nValue on reset: 0"]
313#[derive(Clone, Copy, Debug, PartialEq)]
314#[repr(u8)]
315pub enum CNTEV_A {
316    #[doc = "0: Counts up on up-count and down on down-count events."]
317    BOTH = 0,
318    #[doc = "1: Only counts up on up-count events."]
319    UP = 1,
320    #[doc = "2: Only counts down on down-count events."]
321    DOWN = 2,
322    #[doc = "3: Never counts."]
323    NONE = 3,
324}
325impl From<CNTEV_A> for u8 {
326    #[inline(always)]
327    fn from(variant: CNTEV_A) -> Self {
328        variant as _
329    }
330}
331#[doc = "Reader of field `CNTEV`"]
332pub type CNTEV_R = crate::R<u8, CNTEV_A>;
333impl CNTEV_R {
334    #[doc = r"Get enumerated values variant"]
335    #[inline(always)]
336    pub fn variant(&self) -> CNTEV_A {
337        match self.bits {
338            0 => CNTEV_A::BOTH,
339            1 => CNTEV_A::UP,
340            2 => CNTEV_A::DOWN,
341            3 => CNTEV_A::NONE,
342            _ => unreachable!(),
343        }
344    }
345    #[doc = "Checks if the value of the field is `BOTH`"]
346    #[inline(always)]
347    pub fn is_both(&self) -> bool {
348        *self == CNTEV_A::BOTH
349    }
350    #[doc = "Checks if the value of the field is `UP`"]
351    #[inline(always)]
352    pub fn is_up(&self) -> bool {
353        *self == CNTEV_A::UP
354    }
355    #[doc = "Checks if the value of the field is `DOWN`"]
356    #[inline(always)]
357    pub fn is_down(&self) -> bool {
358        *self == CNTEV_A::DOWN
359    }
360    #[doc = "Checks if the value of the field is `NONE`"]
361    #[inline(always)]
362    pub fn is_none(&self) -> bool {
363        *self == CNTEV_A::NONE
364    }
365}
366#[doc = "Write proxy for field `CNTEV`"]
367pub struct CNTEV_W<'a> {
368    w: &'a mut W,
369}
370impl<'a> CNTEV_W<'a> {
371    #[doc = r"Writes `variant` to the field"]
372    #[inline(always)]
373    pub fn variant(self, variant: CNTEV_A) -> &'a mut W {
374        {
375            self.bits(variant.into())
376        }
377    }
378    #[doc = "Counts up on up-count and down on down-count events."]
379    #[inline(always)]
380    pub fn both(self) -> &'a mut W {
381        self.variant(CNTEV_A::BOTH)
382    }
383    #[doc = "Only counts up on up-count events."]
384    #[inline(always)]
385    pub fn up(self) -> &'a mut W {
386        self.variant(CNTEV_A::UP)
387    }
388    #[doc = "Only counts down on down-count events."]
389    #[inline(always)]
390    pub fn down(self) -> &'a mut W {
391        self.variant(CNTEV_A::DOWN)
392    }
393    #[doc = "Never counts."]
394    #[inline(always)]
395    pub fn none(self) -> &'a mut W {
396        self.variant(CNTEV_A::NONE)
397    }
398    #[doc = r"Writes raw bits to the field"]
399    #[inline(always)]
400    pub fn bits(self, value: u8) -> &'a mut W {
401        self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10);
402        self.w
403    }
404}
405#[doc = "Controls When the Auxiliary Counter Counts\n\nValue on reset: 0"]
406#[derive(Clone, Copy, Debug, PartialEq)]
407#[repr(u8)]
408pub enum AUXCNTEV_A {
409    #[doc = "0: Never counts."]
410    NONE = 0,
411    #[doc = "1: Counts up on up-count events."]
412    UP = 1,
413    #[doc = "2: Counts up on down-count events."]
414    DOWN = 2,
415    #[doc = "3: Counts up on both up-count and down-count events."]
416    BOTH = 3,
417}
418impl From<AUXCNTEV_A> for u8 {
419    #[inline(always)]
420    fn from(variant: AUXCNTEV_A) -> Self {
421        variant as _
422    }
423}
424#[doc = "Reader of field `AUXCNTEV`"]
425pub type AUXCNTEV_R = crate::R<u8, AUXCNTEV_A>;
426impl AUXCNTEV_R {
427    #[doc = r"Get enumerated values variant"]
428    #[inline(always)]
429    pub fn variant(&self) -> AUXCNTEV_A {
430        match self.bits {
431            0 => AUXCNTEV_A::NONE,
432            1 => AUXCNTEV_A::UP,
433            2 => AUXCNTEV_A::DOWN,
434            3 => AUXCNTEV_A::BOTH,
435            _ => unreachable!(),
436        }
437    }
438    #[doc = "Checks if the value of the field is `NONE`"]
439    #[inline(always)]
440    pub fn is_none(&self) -> bool {
441        *self == AUXCNTEV_A::NONE
442    }
443    #[doc = "Checks if the value of the field is `UP`"]
444    #[inline(always)]
445    pub fn is_up(&self) -> bool {
446        *self == AUXCNTEV_A::UP
447    }
448    #[doc = "Checks if the value of the field is `DOWN`"]
449    #[inline(always)]
450    pub fn is_down(&self) -> bool {
451        *self == AUXCNTEV_A::DOWN
452    }
453    #[doc = "Checks if the value of the field is `BOTH`"]
454    #[inline(always)]
455    pub fn is_both(&self) -> bool {
456        *self == AUXCNTEV_A::BOTH
457    }
458}
459#[doc = "Write proxy for field `AUXCNTEV`"]
460pub struct AUXCNTEV_W<'a> {
461    w: &'a mut W,
462}
463impl<'a> AUXCNTEV_W<'a> {
464    #[doc = r"Writes `variant` to the field"]
465    #[inline(always)]
466    pub fn variant(self, variant: AUXCNTEV_A) -> &'a mut W {
467        {
468            self.bits(variant.into())
469        }
470    }
471    #[doc = "Never counts."]
472    #[inline(always)]
473    pub fn none(self) -> &'a mut W {
474        self.variant(AUXCNTEV_A::NONE)
475    }
476    #[doc = "Counts up on up-count events."]
477    #[inline(always)]
478    pub fn up(self) -> &'a mut W {
479        self.variant(AUXCNTEV_A::UP)
480    }
481    #[doc = "Counts up on down-count events."]
482    #[inline(always)]
483    pub fn down(self) -> &'a mut W {
484        self.variant(AUXCNTEV_A::DOWN)
485    }
486    #[doc = "Counts up on both up-count and down-count events."]
487    #[inline(always)]
488    pub fn both(self) -> &'a mut W {
489        self.variant(AUXCNTEV_A::BOTH)
490    }
491    #[doc = r"Writes raw bits to the field"]
492    #[inline(always)]
493    pub fn bits(self, value: u8) -> &'a mut W {
494        self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12);
495        self.w
496    }
497}
498#[doc = "Reader of field `CNTDIR`"]
499pub type CNTDIR_R = crate::R<bool, bool>;
500#[doc = "Write proxy for field `CNTDIR`"]
501pub struct CNTDIR_W<'a> {
502    w: &'a mut W,
503}
504impl<'a> CNTDIR_W<'a> {
505    #[doc = r"Sets the field bit"]
506    #[inline(always)]
507    pub fn set_bit(self) -> &'a mut W {
508        self.bit(true)
509    }
510    #[doc = r"Clears the field bit"]
511    #[inline(always)]
512    pub fn clear_bit(self) -> &'a mut W {
513        self.bit(false)
514    }
515    #[doc = r"Writes raw bits to the field"]
516    #[inline(always)]
517    pub fn bit(self, value: bool) -> &'a mut W {
518        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
519        self.w
520    }
521}
522#[doc = "Reader of field `EDGE`"]
523pub type EDGE_R = crate::R<bool, bool>;
524#[doc = "Write proxy for field `EDGE`"]
525pub struct EDGE_W<'a> {
526    w: &'a mut W,
527}
528impl<'a> EDGE_W<'a> {
529    #[doc = r"Sets the field bit"]
530    #[inline(always)]
531    pub fn set_bit(self) -> &'a mut W {
532        self.bit(true)
533    }
534    #[doc = r"Clears the field bit"]
535    #[inline(always)]
536    pub fn clear_bit(self) -> &'a mut W {
537        self.bit(false)
538    }
539    #[doc = r"Writes raw bits to the field"]
540    #[inline(always)]
541    pub fn bit(self, value: bool) -> &'a mut W {
542        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
543        self.w
544    }
545}
546#[doc = "Sets the Mode for Triggered Compare and Clear\n\nValue on reset: 0"]
547#[derive(Clone, Copy, Debug, PartialEq)]
548#[repr(u8)]
549pub enum TCCMODE_A {
550    #[doc = "0: Triggered compare and clear not enabled."]
551    DISABLED = 0,
552    #[doc = "1: Compare and clear performed on each (optionally prescaled) LFA clock cycle."]
553    LFA = 1,
554    #[doc = "2: Compare and clear performed on positive PRS edges."]
555    PRS = 2,
556}
557impl From<TCCMODE_A> for u8 {
558    #[inline(always)]
559    fn from(variant: TCCMODE_A) -> Self {
560        variant as _
561    }
562}
563#[doc = "Reader of field `TCCMODE`"]
564pub type TCCMODE_R = crate::R<u8, TCCMODE_A>;
565impl TCCMODE_R {
566    #[doc = r"Get enumerated values variant"]
567    #[inline(always)]
568    pub fn variant(&self) -> crate::Variant<u8, TCCMODE_A> {
569        use crate::Variant::*;
570        match self.bits {
571            0 => Val(TCCMODE_A::DISABLED),
572            1 => Val(TCCMODE_A::LFA),
573            2 => Val(TCCMODE_A::PRS),
574            i => Res(i),
575        }
576    }
577    #[doc = "Checks if the value of the field is `DISABLED`"]
578    #[inline(always)]
579    pub fn is_disabled(&self) -> bool {
580        *self == TCCMODE_A::DISABLED
581    }
582    #[doc = "Checks if the value of the field is `LFA`"]
583    #[inline(always)]
584    pub fn is_lfa(&self) -> bool {
585        *self == TCCMODE_A::LFA
586    }
587    #[doc = "Checks if the value of the field is `PRS`"]
588    #[inline(always)]
589    pub fn is_prs(&self) -> bool {
590        *self == TCCMODE_A::PRS
591    }
592}
593#[doc = "Write proxy for field `TCCMODE`"]
594pub struct TCCMODE_W<'a> {
595    w: &'a mut W,
596}
597impl<'a> TCCMODE_W<'a> {
598    #[doc = r"Writes `variant` to the field"]
599    #[inline(always)]
600    pub fn variant(self, variant: TCCMODE_A) -> &'a mut W {
601        unsafe { self.bits(variant.into()) }
602    }
603    #[doc = "Triggered compare and clear not enabled."]
604    #[inline(always)]
605    pub fn disabled(self) -> &'a mut W {
606        self.variant(TCCMODE_A::DISABLED)
607    }
608    #[doc = "Compare and clear performed on each (optionally prescaled) LFA clock cycle."]
609    #[inline(always)]
610    pub fn lfa(self) -> &'a mut W {
611        self.variant(TCCMODE_A::LFA)
612    }
613    #[doc = "Compare and clear performed on positive PRS edges."]
614    #[inline(always)]
615    pub fn prs(self) -> &'a mut W {
616        self.variant(TCCMODE_A::PRS)
617    }
618    #[doc = r"Writes raw bits to the field"]
619    #[inline(always)]
620    pub unsafe fn bits(self, value: u8) -> &'a mut W {
621        self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16);
622        self.w
623    }
624}
625#[doc = "Set the LFA Prescaler for Triggered Compare and Clear\n\nValue on reset: 0"]
626#[derive(Clone, Copy, Debug, PartialEq)]
627#[repr(u8)]
628pub enum TCCPRESC_A {
629    #[doc = "0: Compare and clear event each LFA cycle."]
630    DIV1 = 0,
631    #[doc = "1: Compare and clear performed on every other LFA cycle."]
632    DIV2 = 1,
633    #[doc = "2: Compare and clear performed on every 4th LFA cycle."]
634    DIV4 = 2,
635    #[doc = "3: Compare and clear performed on every 8th LFA cycle."]
636    DIV8 = 3,
637}
638impl From<TCCPRESC_A> for u8 {
639    #[inline(always)]
640    fn from(variant: TCCPRESC_A) -> Self {
641        variant as _
642    }
643}
644#[doc = "Reader of field `TCCPRESC`"]
645pub type TCCPRESC_R = crate::R<u8, TCCPRESC_A>;
646impl TCCPRESC_R {
647    #[doc = r"Get enumerated values variant"]
648    #[inline(always)]
649    pub fn variant(&self) -> TCCPRESC_A {
650        match self.bits {
651            0 => TCCPRESC_A::DIV1,
652            1 => TCCPRESC_A::DIV2,
653            2 => TCCPRESC_A::DIV4,
654            3 => TCCPRESC_A::DIV8,
655            _ => unreachable!(),
656        }
657    }
658    #[doc = "Checks if the value of the field is `DIV1`"]
659    #[inline(always)]
660    pub fn is_div1(&self) -> bool {
661        *self == TCCPRESC_A::DIV1
662    }
663    #[doc = "Checks if the value of the field is `DIV2`"]
664    #[inline(always)]
665    pub fn is_div2(&self) -> bool {
666        *self == TCCPRESC_A::DIV2
667    }
668    #[doc = "Checks if the value of the field is `DIV4`"]
669    #[inline(always)]
670    pub fn is_div4(&self) -> bool {
671        *self == TCCPRESC_A::DIV4
672    }
673    #[doc = "Checks if the value of the field is `DIV8`"]
674    #[inline(always)]
675    pub fn is_div8(&self) -> bool {
676        *self == TCCPRESC_A::DIV8
677    }
678}
679#[doc = "Write proxy for field `TCCPRESC`"]
680pub struct TCCPRESC_W<'a> {
681    w: &'a mut W,
682}
683impl<'a> TCCPRESC_W<'a> {
684    #[doc = r"Writes `variant` to the field"]
685    #[inline(always)]
686    pub fn variant(self, variant: TCCPRESC_A) -> &'a mut W {
687        {
688            self.bits(variant.into())
689        }
690    }
691    #[doc = "Compare and clear event each LFA cycle."]
692    #[inline(always)]
693    pub fn div1(self) -> &'a mut W {
694        self.variant(TCCPRESC_A::DIV1)
695    }
696    #[doc = "Compare and clear performed on every other LFA cycle."]
697    #[inline(always)]
698    pub fn div2(self) -> &'a mut W {
699        self.variant(TCCPRESC_A::DIV2)
700    }
701    #[doc = "Compare and clear performed on every 4th LFA cycle."]
702    #[inline(always)]
703    pub fn div4(self) -> &'a mut W {
704        self.variant(TCCPRESC_A::DIV4)
705    }
706    #[doc = "Compare and clear performed on every 8th LFA cycle."]
707    #[inline(always)]
708    pub fn div8(self) -> &'a mut W {
709        self.variant(TCCPRESC_A::DIV8)
710    }
711    #[doc = r"Writes raw bits to the field"]
712    #[inline(always)]
713    pub fn bits(self, value: u8) -> &'a mut W {
714        self.w.bits = (self.w.bits & !(0x03 << 19)) | (((value as u32) & 0x03) << 19);
715        self.w
716    }
717}
718#[doc = "Triggered Compare and Clear Compare Mode\n\nValue on reset: 0"]
719#[derive(Clone, Copy, Debug, PartialEq)]
720#[repr(u8)]
721pub enum TCCCOMP_A {
722    #[doc = "0: Compare match if PCNT_CNT is less than, or equal to PCNT_TOP."]
723    LTOE = 0,
724    #[doc = "1: Compare match if PCNT_CNT is greater than or equal to PCNT_TOP."]
725    GTOE = 1,
726    #[doc = "2: Compare match if PCNT_CNT is less than, or equal to PCNT_TOP\\[15:8\\]\\], and greater than, or equal to PCNT_TOP\\[7:0\\]."]
727    RANGE = 2,
728}
729impl From<TCCCOMP_A> for u8 {
730    #[inline(always)]
731    fn from(variant: TCCCOMP_A) -> Self {
732        variant as _
733    }
734}
735#[doc = "Reader of field `TCCCOMP`"]
736pub type TCCCOMP_R = crate::R<u8, TCCCOMP_A>;
737impl TCCCOMP_R {
738    #[doc = r"Get enumerated values variant"]
739    #[inline(always)]
740    pub fn variant(&self) -> crate::Variant<u8, TCCCOMP_A> {
741        use crate::Variant::*;
742        match self.bits {
743            0 => Val(TCCCOMP_A::LTOE),
744            1 => Val(TCCCOMP_A::GTOE),
745            2 => Val(TCCCOMP_A::RANGE),
746            i => Res(i),
747        }
748    }
749    #[doc = "Checks if the value of the field is `LTOE`"]
750    #[inline(always)]
751    pub fn is_ltoe(&self) -> bool {
752        *self == TCCCOMP_A::LTOE
753    }
754    #[doc = "Checks if the value of the field is `GTOE`"]
755    #[inline(always)]
756    pub fn is_gtoe(&self) -> bool {
757        *self == TCCCOMP_A::GTOE
758    }
759    #[doc = "Checks if the value of the field is `RANGE`"]
760    #[inline(always)]
761    pub fn is_range(&self) -> bool {
762        *self == TCCCOMP_A::RANGE
763    }
764}
765#[doc = "Write proxy for field `TCCCOMP`"]
766pub struct TCCCOMP_W<'a> {
767    w: &'a mut W,
768}
769impl<'a> TCCCOMP_W<'a> {
770    #[doc = r"Writes `variant` to the field"]
771    #[inline(always)]
772    pub fn variant(self, variant: TCCCOMP_A) -> &'a mut W {
773        unsafe { self.bits(variant.into()) }
774    }
775    #[doc = "Compare match if PCNT_CNT is less than, or equal to PCNT_TOP."]
776    #[inline(always)]
777    pub fn ltoe(self) -> &'a mut W {
778        self.variant(TCCCOMP_A::LTOE)
779    }
780    #[doc = "Compare match if PCNT_CNT is greater than or equal to PCNT_TOP."]
781    #[inline(always)]
782    pub fn gtoe(self) -> &'a mut W {
783        self.variant(TCCCOMP_A::GTOE)
784    }
785    #[doc = "Compare match if PCNT_CNT is less than, or equal to PCNT_TOP\\[15:8\\]\\], and greater than, or equal to PCNT_TOP\\[7:0\\]."]
786    #[inline(always)]
787    pub fn range(self) -> &'a mut W {
788        self.variant(TCCCOMP_A::RANGE)
789    }
790    #[doc = r"Writes raw bits to the field"]
791    #[inline(always)]
792    pub unsafe fn bits(self, value: u8) -> &'a mut W {
793        self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22);
794        self.w
795    }
796}
797#[doc = "Reader of field `PRSGATEEN`"]
798pub type PRSGATEEN_R = crate::R<bool, bool>;
799#[doc = "Write proxy for field `PRSGATEEN`"]
800pub struct PRSGATEEN_W<'a> {
801    w: &'a mut W,
802}
803impl<'a> PRSGATEEN_W<'a> {
804    #[doc = r"Sets the field bit"]
805    #[inline(always)]
806    pub fn set_bit(self) -> &'a mut W {
807        self.bit(true)
808    }
809    #[doc = r"Clears the field bit"]
810    #[inline(always)]
811    pub fn clear_bit(self) -> &'a mut W {
812        self.bit(false)
813    }
814    #[doc = r"Writes raw bits to the field"]
815    #[inline(always)]
816    pub fn bit(self, value: bool) -> &'a mut W {
817        self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
818        self.w
819    }
820}
821#[doc = "Reader of field `TCCPRSPOL`"]
822pub type TCCPRSPOL_R = crate::R<bool, bool>;
823#[doc = "Write proxy for field `TCCPRSPOL`"]
824pub struct TCCPRSPOL_W<'a> {
825    w: &'a mut W,
826}
827impl<'a> TCCPRSPOL_W<'a> {
828    #[doc = r"Sets the field bit"]
829    #[inline(always)]
830    pub fn set_bit(self) -> &'a mut W {
831        self.bit(true)
832    }
833    #[doc = r"Clears the field bit"]
834    #[inline(always)]
835    pub fn clear_bit(self) -> &'a mut W {
836        self.bit(false)
837    }
838    #[doc = r"Writes raw bits to the field"]
839    #[inline(always)]
840    pub fn bit(self, value: bool) -> &'a mut W {
841        self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25);
842        self.w
843    }
844}
845#[doc = "TCC PRS Channel Select\n\nValue on reset: 0"]
846#[derive(Clone, Copy, Debug, PartialEq)]
847#[repr(u8)]
848pub enum TCCPRSSEL_A {
849    #[doc = "0: PRS Channel 0 selected."]
850    PRSCH0 = 0,
851    #[doc = "1: PRS Channel 1 selected."]
852    PRSCH1 = 1,
853    #[doc = "2: PRS Channel 2 selected."]
854    PRSCH2 = 2,
855    #[doc = "3: PRS Channel 3 selected."]
856    PRSCH3 = 3,
857    #[doc = "4: PRS Channel 4 selected."]
858    PRSCH4 = 4,
859    #[doc = "5: PRS Channel 5 selected."]
860    PRSCH5 = 5,
861    #[doc = "6: PRS Channel 6 selected."]
862    PRSCH6 = 6,
863    #[doc = "7: PRS Channel 7 selected."]
864    PRSCH7 = 7,
865    #[doc = "8: PRS Channel 8 selected."]
866    PRSCH8 = 8,
867    #[doc = "9: PRS Channel 9 selected."]
868    PRSCH9 = 9,
869    #[doc = "10: PRS Channel 10 selected."]
870    PRSCH10 = 10,
871    #[doc = "11: PRS Channel 11 selected."]
872    PRSCH11 = 11,
873}
874impl From<TCCPRSSEL_A> for u8 {
875    #[inline(always)]
876    fn from(variant: TCCPRSSEL_A) -> Self {
877        variant as _
878    }
879}
880#[doc = "Reader of field `TCCPRSSEL`"]
881pub type TCCPRSSEL_R = crate::R<u8, TCCPRSSEL_A>;
882impl TCCPRSSEL_R {
883    #[doc = r"Get enumerated values variant"]
884    #[inline(always)]
885    pub fn variant(&self) -> crate::Variant<u8, TCCPRSSEL_A> {
886        use crate::Variant::*;
887        match self.bits {
888            0 => Val(TCCPRSSEL_A::PRSCH0),
889            1 => Val(TCCPRSSEL_A::PRSCH1),
890            2 => Val(TCCPRSSEL_A::PRSCH2),
891            3 => Val(TCCPRSSEL_A::PRSCH3),
892            4 => Val(TCCPRSSEL_A::PRSCH4),
893            5 => Val(TCCPRSSEL_A::PRSCH5),
894            6 => Val(TCCPRSSEL_A::PRSCH6),
895            7 => Val(TCCPRSSEL_A::PRSCH7),
896            8 => Val(TCCPRSSEL_A::PRSCH8),
897            9 => Val(TCCPRSSEL_A::PRSCH9),
898            10 => Val(TCCPRSSEL_A::PRSCH10),
899            11 => Val(TCCPRSSEL_A::PRSCH11),
900            i => Res(i),
901        }
902    }
903    #[doc = "Checks if the value of the field is `PRSCH0`"]
904    #[inline(always)]
905    pub fn is_prsch0(&self) -> bool {
906        *self == TCCPRSSEL_A::PRSCH0
907    }
908    #[doc = "Checks if the value of the field is `PRSCH1`"]
909    #[inline(always)]
910    pub fn is_prsch1(&self) -> bool {
911        *self == TCCPRSSEL_A::PRSCH1
912    }
913    #[doc = "Checks if the value of the field is `PRSCH2`"]
914    #[inline(always)]
915    pub fn is_prsch2(&self) -> bool {
916        *self == TCCPRSSEL_A::PRSCH2
917    }
918    #[doc = "Checks if the value of the field is `PRSCH3`"]
919    #[inline(always)]
920    pub fn is_prsch3(&self) -> bool {
921        *self == TCCPRSSEL_A::PRSCH3
922    }
923    #[doc = "Checks if the value of the field is `PRSCH4`"]
924    #[inline(always)]
925    pub fn is_prsch4(&self) -> bool {
926        *self == TCCPRSSEL_A::PRSCH4
927    }
928    #[doc = "Checks if the value of the field is `PRSCH5`"]
929    #[inline(always)]
930    pub fn is_prsch5(&self) -> bool {
931        *self == TCCPRSSEL_A::PRSCH5
932    }
933    #[doc = "Checks if the value of the field is `PRSCH6`"]
934    #[inline(always)]
935    pub fn is_prsch6(&self) -> bool {
936        *self == TCCPRSSEL_A::PRSCH6
937    }
938    #[doc = "Checks if the value of the field is `PRSCH7`"]
939    #[inline(always)]
940    pub fn is_prsch7(&self) -> bool {
941        *self == TCCPRSSEL_A::PRSCH7
942    }
943    #[doc = "Checks if the value of the field is `PRSCH8`"]
944    #[inline(always)]
945    pub fn is_prsch8(&self) -> bool {
946        *self == TCCPRSSEL_A::PRSCH8
947    }
948    #[doc = "Checks if the value of the field is `PRSCH9`"]
949    #[inline(always)]
950    pub fn is_prsch9(&self) -> bool {
951        *self == TCCPRSSEL_A::PRSCH9
952    }
953    #[doc = "Checks if the value of the field is `PRSCH10`"]
954    #[inline(always)]
955    pub fn is_prsch10(&self) -> bool {
956        *self == TCCPRSSEL_A::PRSCH10
957    }
958    #[doc = "Checks if the value of the field is `PRSCH11`"]
959    #[inline(always)]
960    pub fn is_prsch11(&self) -> bool {
961        *self == TCCPRSSEL_A::PRSCH11
962    }
963}
964#[doc = "Write proxy for field `TCCPRSSEL`"]
965pub struct TCCPRSSEL_W<'a> {
966    w: &'a mut W,
967}
968impl<'a> TCCPRSSEL_W<'a> {
969    #[doc = r"Writes `variant` to the field"]
970    #[inline(always)]
971    pub fn variant(self, variant: TCCPRSSEL_A) -> &'a mut W {
972        unsafe { self.bits(variant.into()) }
973    }
974    #[doc = "PRS Channel 0 selected."]
975    #[inline(always)]
976    pub fn prsch0(self) -> &'a mut W {
977        self.variant(TCCPRSSEL_A::PRSCH0)
978    }
979    #[doc = "PRS Channel 1 selected."]
980    #[inline(always)]
981    pub fn prsch1(self) -> &'a mut W {
982        self.variant(TCCPRSSEL_A::PRSCH1)
983    }
984    #[doc = "PRS Channel 2 selected."]
985    #[inline(always)]
986    pub fn prsch2(self) -> &'a mut W {
987        self.variant(TCCPRSSEL_A::PRSCH2)
988    }
989    #[doc = "PRS Channel 3 selected."]
990    #[inline(always)]
991    pub fn prsch3(self) -> &'a mut W {
992        self.variant(TCCPRSSEL_A::PRSCH3)
993    }
994    #[doc = "PRS Channel 4 selected."]
995    #[inline(always)]
996    pub fn prsch4(self) -> &'a mut W {
997        self.variant(TCCPRSSEL_A::PRSCH4)
998    }
999    #[doc = "PRS Channel 5 selected."]
1000    #[inline(always)]
1001    pub fn prsch5(self) -> &'a mut W {
1002        self.variant(TCCPRSSEL_A::PRSCH5)
1003    }
1004    #[doc = "PRS Channel 6 selected."]
1005    #[inline(always)]
1006    pub fn prsch6(self) -> &'a mut W {
1007        self.variant(TCCPRSSEL_A::PRSCH6)
1008    }
1009    #[doc = "PRS Channel 7 selected."]
1010    #[inline(always)]
1011    pub fn prsch7(self) -> &'a mut W {
1012        self.variant(TCCPRSSEL_A::PRSCH7)
1013    }
1014    #[doc = "PRS Channel 8 selected."]
1015    #[inline(always)]
1016    pub fn prsch8(self) -> &'a mut W {
1017        self.variant(TCCPRSSEL_A::PRSCH8)
1018    }
1019    #[doc = "PRS Channel 9 selected."]
1020    #[inline(always)]
1021    pub fn prsch9(self) -> &'a mut W {
1022        self.variant(TCCPRSSEL_A::PRSCH9)
1023    }
1024    #[doc = "PRS Channel 10 selected."]
1025    #[inline(always)]
1026    pub fn prsch10(self) -> &'a mut W {
1027        self.variant(TCCPRSSEL_A::PRSCH10)
1028    }
1029    #[doc = "PRS Channel 11 selected."]
1030    #[inline(always)]
1031    pub fn prsch11(self) -> &'a mut W {
1032        self.variant(TCCPRSSEL_A::PRSCH11)
1033    }
1034    #[doc = r"Writes raw bits to the field"]
1035    #[inline(always)]
1036    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1037        self.w.bits = (self.w.bits & !(0x0f << 26)) | (((value as u32) & 0x0f) << 26);
1038        self.w
1039    }
1040}
1041#[doc = "Reader of field `TOPBHFSEL`"]
1042pub type TOPBHFSEL_R = crate::R<bool, bool>;
1043#[doc = "Write proxy for field `TOPBHFSEL`"]
1044pub struct TOPBHFSEL_W<'a> {
1045    w: &'a mut W,
1046}
1047impl<'a> TOPBHFSEL_W<'a> {
1048    #[doc = r"Sets the field bit"]
1049    #[inline(always)]
1050    pub fn set_bit(self) -> &'a mut W {
1051        self.bit(true)
1052    }
1053    #[doc = r"Clears the field bit"]
1054    #[inline(always)]
1055    pub fn clear_bit(self) -> &'a mut W {
1056        self.bit(false)
1057    }
1058    #[doc = r"Writes raw bits to the field"]
1059    #[inline(always)]
1060    pub fn bit(self, value: bool) -> &'a mut W {
1061        self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
1062        self.w
1063    }
1064}
1065impl R {
1066    #[doc = "Bits 0:2 - Mode Select"]
1067    #[inline(always)]
1068    pub fn mode(&self) -> MODE_R {
1069        MODE_R::new((self.bits & 0x07) as u8)
1070    }
1071    #[doc = "Bit 3 - Enable Digital Pulse Width Filter"]
1072    #[inline(always)]
1073    pub fn filt(&self) -> FILT_R {
1074        FILT_R::new(((self.bits >> 3) & 0x01) != 0)
1075    }
1076    #[doc = "Bit 4 - Enable PCNT Clock Domain Reset"]
1077    #[inline(always)]
1078    pub fn rsten(&self) -> RSTEN_R {
1079        RSTEN_R::new(((self.bits >> 4) & 0x01) != 0)
1080    }
1081    #[doc = "Bit 5 - Enable CNT Reset"]
1082    #[inline(always)]
1083    pub fn cntrsten(&self) -> CNTRSTEN_R {
1084        CNTRSTEN_R::new(((self.bits >> 5) & 0x01) != 0)
1085    }
1086    #[doc = "Bit 6 - Enable AUXCNT Reset"]
1087    #[inline(always)]
1088    pub fn auxcntrsten(&self) -> AUXCNTRSTEN_R {
1089        AUXCNTRSTEN_R::new(((self.bits >> 6) & 0x01) != 0)
1090    }
1091    #[doc = "Bit 7 - Debug Mode Halt Enable"]
1092    #[inline(always)]
1093    pub fn debughalt(&self) -> DEBUGHALT_R {
1094        DEBUGHALT_R::new(((self.bits >> 7) & 0x01) != 0)
1095    }
1096    #[doc = "Bit 8 - Enable Hysteresis"]
1097    #[inline(always)]
1098    pub fn hyst(&self) -> HYST_R {
1099        HYST_R::new(((self.bits >> 8) & 0x01) != 0)
1100    }
1101    #[doc = "Bit 9 - Count Direction Determined By S1"]
1102    #[inline(always)]
1103    pub fn s1cdir(&self) -> S1CDIR_R {
1104        S1CDIR_R::new(((self.bits >> 9) & 0x01) != 0)
1105    }
1106    #[doc = "Bits 10:11 - Controls When the Counter Counts"]
1107    #[inline(always)]
1108    pub fn cntev(&self) -> CNTEV_R {
1109        CNTEV_R::new(((self.bits >> 10) & 0x03) as u8)
1110    }
1111    #[doc = "Bits 12:13 - Controls When the Auxiliary Counter Counts"]
1112    #[inline(always)]
1113    pub fn auxcntev(&self) -> AUXCNTEV_R {
1114        AUXCNTEV_R::new(((self.bits >> 12) & 0x03) as u8)
1115    }
1116    #[doc = "Bit 14 - Non-Quadrature Mode Counter Direction Control"]
1117    #[inline(always)]
1118    pub fn cntdir(&self) -> CNTDIR_R {
1119        CNTDIR_R::new(((self.bits >> 14) & 0x01) != 0)
1120    }
1121    #[doc = "Bit 15 - Edge Select"]
1122    #[inline(always)]
1123    pub fn edge(&self) -> EDGE_R {
1124        EDGE_R::new(((self.bits >> 15) & 0x01) != 0)
1125    }
1126    #[doc = "Bits 16:17 - Sets the Mode for Triggered Compare and Clear"]
1127    #[inline(always)]
1128    pub fn tccmode(&self) -> TCCMODE_R {
1129        TCCMODE_R::new(((self.bits >> 16) & 0x03) as u8)
1130    }
1131    #[doc = "Bits 19:20 - Set the LFA Prescaler for Triggered Compare and Clear"]
1132    #[inline(always)]
1133    pub fn tccpresc(&self) -> TCCPRESC_R {
1134        TCCPRESC_R::new(((self.bits >> 19) & 0x03) as u8)
1135    }
1136    #[doc = "Bits 22:23 - Triggered Compare and Clear Compare Mode"]
1137    #[inline(always)]
1138    pub fn tcccomp(&self) -> TCCCOMP_R {
1139        TCCCOMP_R::new(((self.bits >> 22) & 0x03) as u8)
1140    }
1141    #[doc = "Bit 24 - PRS Gate Enable"]
1142    #[inline(always)]
1143    pub fn prsgateen(&self) -> PRSGATEEN_R {
1144        PRSGATEEN_R::new(((self.bits >> 24) & 0x01) != 0)
1145    }
1146    #[doc = "Bit 25 - TCC PRS Polarity Select"]
1147    #[inline(always)]
1148    pub fn tccprspol(&self) -> TCCPRSPOL_R {
1149        TCCPRSPOL_R::new(((self.bits >> 25) & 0x01) != 0)
1150    }
1151    #[doc = "Bits 26:29 - TCC PRS Channel Select"]
1152    #[inline(always)]
1153    pub fn tccprssel(&self) -> TCCPRSSEL_R {
1154        TCCPRSSEL_R::new(((self.bits >> 26) & 0x0f) as u8)
1155    }
1156    #[doc = "Bit 31 - TOPB High Frequency Value Select"]
1157    #[inline(always)]
1158    pub fn topbhfsel(&self) -> TOPBHFSEL_R {
1159        TOPBHFSEL_R::new(((self.bits >> 31) & 0x01) != 0)
1160    }
1161}
1162impl W {
1163    #[doc = "Bits 0:2 - Mode Select"]
1164    #[inline(always)]
1165    pub fn mode(&mut self) -> MODE_W {
1166        MODE_W { w: self }
1167    }
1168    #[doc = "Bit 3 - Enable Digital Pulse Width Filter"]
1169    #[inline(always)]
1170    pub fn filt(&mut self) -> FILT_W {
1171        FILT_W { w: self }
1172    }
1173    #[doc = "Bit 4 - Enable PCNT Clock Domain Reset"]
1174    #[inline(always)]
1175    pub fn rsten(&mut self) -> RSTEN_W {
1176        RSTEN_W { w: self }
1177    }
1178    #[doc = "Bit 5 - Enable CNT Reset"]
1179    #[inline(always)]
1180    pub fn cntrsten(&mut self) -> CNTRSTEN_W {
1181        CNTRSTEN_W { w: self }
1182    }
1183    #[doc = "Bit 6 - Enable AUXCNT Reset"]
1184    #[inline(always)]
1185    pub fn auxcntrsten(&mut self) -> AUXCNTRSTEN_W {
1186        AUXCNTRSTEN_W { w: self }
1187    }
1188    #[doc = "Bit 7 - Debug Mode Halt Enable"]
1189    #[inline(always)]
1190    pub fn debughalt(&mut self) -> DEBUGHALT_W {
1191        DEBUGHALT_W { w: self }
1192    }
1193    #[doc = "Bit 8 - Enable Hysteresis"]
1194    #[inline(always)]
1195    pub fn hyst(&mut self) -> HYST_W {
1196        HYST_W { w: self }
1197    }
1198    #[doc = "Bit 9 - Count Direction Determined By S1"]
1199    #[inline(always)]
1200    pub fn s1cdir(&mut self) -> S1CDIR_W {
1201        S1CDIR_W { w: self }
1202    }
1203    #[doc = "Bits 10:11 - Controls When the Counter Counts"]
1204    #[inline(always)]
1205    pub fn cntev(&mut self) -> CNTEV_W {
1206        CNTEV_W { w: self }
1207    }
1208    #[doc = "Bits 12:13 - Controls When the Auxiliary Counter Counts"]
1209    #[inline(always)]
1210    pub fn auxcntev(&mut self) -> AUXCNTEV_W {
1211        AUXCNTEV_W { w: self }
1212    }
1213    #[doc = "Bit 14 - Non-Quadrature Mode Counter Direction Control"]
1214    #[inline(always)]
1215    pub fn cntdir(&mut self) -> CNTDIR_W {
1216        CNTDIR_W { w: self }
1217    }
1218    #[doc = "Bit 15 - Edge Select"]
1219    #[inline(always)]
1220    pub fn edge(&mut self) -> EDGE_W {
1221        EDGE_W { w: self }
1222    }
1223    #[doc = "Bits 16:17 - Sets the Mode for Triggered Compare and Clear"]
1224    #[inline(always)]
1225    pub fn tccmode(&mut self) -> TCCMODE_W {
1226        TCCMODE_W { w: self }
1227    }
1228    #[doc = "Bits 19:20 - Set the LFA Prescaler for Triggered Compare and Clear"]
1229    #[inline(always)]
1230    pub fn tccpresc(&mut self) -> TCCPRESC_W {
1231        TCCPRESC_W { w: self }
1232    }
1233    #[doc = "Bits 22:23 - Triggered Compare and Clear Compare Mode"]
1234    #[inline(always)]
1235    pub fn tcccomp(&mut self) -> TCCCOMP_W {
1236        TCCCOMP_W { w: self }
1237    }
1238    #[doc = "Bit 24 - PRS Gate Enable"]
1239    #[inline(always)]
1240    pub fn prsgateen(&mut self) -> PRSGATEEN_W {
1241        PRSGATEEN_W { w: self }
1242    }
1243    #[doc = "Bit 25 - TCC PRS Polarity Select"]
1244    #[inline(always)]
1245    pub fn tccprspol(&mut self) -> TCCPRSPOL_W {
1246        TCCPRSPOL_W { w: self }
1247    }
1248    #[doc = "Bits 26:29 - TCC PRS Channel Select"]
1249    #[inline(always)]
1250    pub fn tccprssel(&mut self) -> TCCPRSSEL_W {
1251        TCCPRSSEL_W { w: self }
1252    }
1253    #[doc = "Bit 31 - TOPB High Frequency Value Select"]
1254    #[inline(always)]
1255    pub fn topbhfsel(&mut self) -> TOPBHFSEL_W {
1256        TOPBHFSEL_W { w: self }
1257    }
1258}