efm32gg11b320_pac/rtcc/
cc2_ctrl.rs

1#[doc = "Register `CC2_CTRL` reader"]
2pub struct R(crate::R<CC2_CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CC2_CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CC2_CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CC2_CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CC2_CTRL` writer"]
17pub struct W(crate::W<CC2_CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CC2_CTRL_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<CC2_CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CC2_CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "CC Channel Mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum MODE_A {
41    #[doc = "0: Compare/Capture channel turned off"]
42    OFF = 0,
43    #[doc = "1: Input capture"]
44    INPUTCAPTURE = 1,
45    #[doc = "2: Output compare"]
46    OUTPUTCOMPARE = 2,
47}
48impl From<MODE_A> for u8 {
49    #[inline(always)]
50    fn from(variant: MODE_A) -> Self {
51        variant as _
52    }
53}
54#[doc = "Field `MODE` reader - CC Channel Mode"]
55pub type MODE_R = crate::FieldReader<u8, MODE_A>;
56impl MODE_R {
57    #[doc = "Get enumerated values variant"]
58    #[inline(always)]
59    pub fn variant(&self) -> Option<MODE_A> {
60        match self.bits {
61            0 => Some(MODE_A::OFF),
62            1 => Some(MODE_A::INPUTCAPTURE),
63            2 => Some(MODE_A::OUTPUTCOMPARE),
64            _ => None,
65        }
66    }
67    #[doc = "Checks if the value of the field is `OFF`"]
68    #[inline(always)]
69    pub fn is_off(&self) -> bool {
70        *self == MODE_A::OFF
71    }
72    #[doc = "Checks if the value of the field is `INPUTCAPTURE`"]
73    #[inline(always)]
74    pub fn is_inputcapture(&self) -> bool {
75        *self == MODE_A::INPUTCAPTURE
76    }
77    #[doc = "Checks if the value of the field is `OUTPUTCOMPARE`"]
78    #[inline(always)]
79    pub fn is_outputcompare(&self) -> bool {
80        *self == MODE_A::OUTPUTCOMPARE
81    }
82}
83#[doc = "Field `MODE` writer - CC Channel Mode"]
84pub type MODE_W<'a> = crate::FieldWriter<'a, u32, CC2_CTRL_SPEC, u8, MODE_A, 2, 0>;
85impl<'a> MODE_W<'a> {
86    #[doc = "Compare/Capture channel turned off"]
87    #[inline(always)]
88    pub fn off(self) -> &'a mut W {
89        self.variant(MODE_A::OFF)
90    }
91    #[doc = "Input capture"]
92    #[inline(always)]
93    pub fn inputcapture(self) -> &'a mut W {
94        self.variant(MODE_A::INPUTCAPTURE)
95    }
96    #[doc = "Output compare"]
97    #[inline(always)]
98    pub fn outputcompare(self) -> &'a mut W {
99        self.variant(MODE_A::OUTPUTCOMPARE)
100    }
101}
102#[doc = "Compare Match Output Action\n\nValue on reset: 0"]
103#[derive(Clone, Copy, Debug, PartialEq)]
104#[repr(u8)]
105pub enum CMOA_A {
106    #[doc = "0: A single clock cycle pulse is generated on output"]
107    PULSE = 0,
108    #[doc = "1: Toggle output on compare match"]
109    TOGGLE = 1,
110    #[doc = "2: Clear output on compare match"]
111    CLEAR = 2,
112    #[doc = "3: Set output on compare match"]
113    SET = 3,
114}
115impl From<CMOA_A> for u8 {
116    #[inline(always)]
117    fn from(variant: CMOA_A) -> Self {
118        variant as _
119    }
120}
121#[doc = "Field `CMOA` reader - Compare Match Output Action"]
122pub type CMOA_R = crate::FieldReader<u8, CMOA_A>;
123impl CMOA_R {
124    #[doc = "Get enumerated values variant"]
125    #[inline(always)]
126    pub fn variant(&self) -> CMOA_A {
127        match self.bits {
128            0 => CMOA_A::PULSE,
129            1 => CMOA_A::TOGGLE,
130            2 => CMOA_A::CLEAR,
131            3 => CMOA_A::SET,
132            _ => unreachable!(),
133        }
134    }
135    #[doc = "Checks if the value of the field is `PULSE`"]
136    #[inline(always)]
137    pub fn is_pulse(&self) -> bool {
138        *self == CMOA_A::PULSE
139    }
140    #[doc = "Checks if the value of the field is `TOGGLE`"]
141    #[inline(always)]
142    pub fn is_toggle(&self) -> bool {
143        *self == CMOA_A::TOGGLE
144    }
145    #[doc = "Checks if the value of the field is `CLEAR`"]
146    #[inline(always)]
147    pub fn is_clear(&self) -> bool {
148        *self == CMOA_A::CLEAR
149    }
150    #[doc = "Checks if the value of the field is `SET`"]
151    #[inline(always)]
152    pub fn is_set(&self) -> bool {
153        *self == CMOA_A::SET
154    }
155}
156#[doc = "Field `CMOA` writer - Compare Match Output Action"]
157pub type CMOA_W<'a> = crate::FieldWriterSafe<'a, u32, CC2_CTRL_SPEC, u8, CMOA_A, 2, 2>;
158impl<'a> CMOA_W<'a> {
159    #[doc = "A single clock cycle pulse is generated on output"]
160    #[inline(always)]
161    pub fn pulse(self) -> &'a mut W {
162        self.variant(CMOA_A::PULSE)
163    }
164    #[doc = "Toggle output on compare match"]
165    #[inline(always)]
166    pub fn toggle(self) -> &'a mut W {
167        self.variant(CMOA_A::TOGGLE)
168    }
169    #[doc = "Clear output on compare match"]
170    #[inline(always)]
171    pub fn clear(self) -> &'a mut W {
172        self.variant(CMOA_A::CLEAR)
173    }
174    #[doc = "Set output on compare match"]
175    #[inline(always)]
176    pub fn set(self) -> &'a mut W {
177        self.variant(CMOA_A::SET)
178    }
179}
180#[doc = "Input Capture Edge Select\n\nValue on reset: 0"]
181#[derive(Clone, Copy, Debug, PartialEq)]
182#[repr(u8)]
183pub enum ICEDGE_A {
184    #[doc = "0: Rising edges detected"]
185    RISING = 0,
186    #[doc = "1: Falling edges detected"]
187    FALLING = 1,
188    #[doc = "2: Both edges detected"]
189    BOTH = 2,
190    #[doc = "3: No edge detection, signal is left as it is"]
191    NONE = 3,
192}
193impl From<ICEDGE_A> for u8 {
194    #[inline(always)]
195    fn from(variant: ICEDGE_A) -> Self {
196        variant as _
197    }
198}
199#[doc = "Field `ICEDGE` reader - Input Capture Edge Select"]
200pub type ICEDGE_R = crate::FieldReader<u8, ICEDGE_A>;
201impl ICEDGE_R {
202    #[doc = "Get enumerated values variant"]
203    #[inline(always)]
204    pub fn variant(&self) -> ICEDGE_A {
205        match self.bits {
206            0 => ICEDGE_A::RISING,
207            1 => ICEDGE_A::FALLING,
208            2 => ICEDGE_A::BOTH,
209            3 => ICEDGE_A::NONE,
210            _ => unreachable!(),
211        }
212    }
213    #[doc = "Checks if the value of the field is `RISING`"]
214    #[inline(always)]
215    pub fn is_rising(&self) -> bool {
216        *self == ICEDGE_A::RISING
217    }
218    #[doc = "Checks if the value of the field is `FALLING`"]
219    #[inline(always)]
220    pub fn is_falling(&self) -> bool {
221        *self == ICEDGE_A::FALLING
222    }
223    #[doc = "Checks if the value of the field is `BOTH`"]
224    #[inline(always)]
225    pub fn is_both(&self) -> bool {
226        *self == ICEDGE_A::BOTH
227    }
228    #[doc = "Checks if the value of the field is `NONE`"]
229    #[inline(always)]
230    pub fn is_none(&self) -> bool {
231        *self == ICEDGE_A::NONE
232    }
233}
234#[doc = "Field `ICEDGE` writer - Input Capture Edge Select"]
235pub type ICEDGE_W<'a> = crate::FieldWriterSafe<'a, u32, CC2_CTRL_SPEC, u8, ICEDGE_A, 2, 4>;
236impl<'a> ICEDGE_W<'a> {
237    #[doc = "Rising edges detected"]
238    #[inline(always)]
239    pub fn rising(self) -> &'a mut W {
240        self.variant(ICEDGE_A::RISING)
241    }
242    #[doc = "Falling edges detected"]
243    #[inline(always)]
244    pub fn falling(self) -> &'a mut W {
245        self.variant(ICEDGE_A::FALLING)
246    }
247    #[doc = "Both edges detected"]
248    #[inline(always)]
249    pub fn both(self) -> &'a mut W {
250        self.variant(ICEDGE_A::BOTH)
251    }
252    #[doc = "No edge detection, signal is left as it is"]
253    #[inline(always)]
254    pub fn none(self) -> &'a mut W {
255        self.variant(ICEDGE_A::NONE)
256    }
257}
258#[doc = "Compare/Capture Channel PRS Input Channel Selection\n\nValue on reset: 0"]
259#[derive(Clone, Copy, Debug, PartialEq)]
260#[repr(u8)]
261pub enum PRSSEL_A {
262    #[doc = "0: PRS Channel 0 selected as input"]
263    PRSCH0 = 0,
264    #[doc = "1: PRS Channel 1 selected as input"]
265    PRSCH1 = 1,
266    #[doc = "2: PRS Channel 2 selected as input"]
267    PRSCH2 = 2,
268    #[doc = "3: PRS Channel 3 selected as input"]
269    PRSCH3 = 3,
270    #[doc = "4: PRS Channel 4 selected as input"]
271    PRSCH4 = 4,
272    #[doc = "5: PRS Channel 5 selected as input"]
273    PRSCH5 = 5,
274    #[doc = "6: PRS Channel 6 selected as input"]
275    PRSCH6 = 6,
276    #[doc = "7: PRS Channel 7 selected as input"]
277    PRSCH7 = 7,
278    #[doc = "8: PRS Channel 8 selected as input"]
279    PRSCH8 = 8,
280    #[doc = "9: PRS Channel 9 selected as input"]
281    PRSCH9 = 9,
282    #[doc = "10: PRS Channel 10 selected as input"]
283    PRSCH10 = 10,
284    #[doc = "11: PRS Channel 11 selected as input"]
285    PRSCH11 = 11,
286    #[doc = "12: PRS Channel 12 selected as input"]
287    PRSCH12 = 12,
288    #[doc = "13: PRS Channel 13 selected as input"]
289    PRSCH13 = 13,
290    #[doc = "14: PRS Channel 14 selected as input"]
291    PRSCH14 = 14,
292    #[doc = "15: PRS Channel 15 selected as input"]
293    PRSCH15 = 15,
294    #[doc = "16: PRS Channel 16 selected as input"]
295    PRSCH16 = 16,
296    #[doc = "17: PRS Channel 17 selected as input"]
297    PRSCH17 = 17,
298    #[doc = "18: PRS Channel 18 selected as input"]
299    PRSCH18 = 18,
300    #[doc = "19: PRS Channel 19 selected as input"]
301    PRSCH19 = 19,
302    #[doc = "20: PRS Channel 20 selected as input"]
303    PRSCH20 = 20,
304    #[doc = "21: PRS Channel 21 selected as input"]
305    PRSCH21 = 21,
306    #[doc = "22: PRS Channel 22 selected as input"]
307    PRSCH22 = 22,
308    #[doc = "23: PRS Channel 23 selected as input"]
309    PRSCH23 = 23,
310}
311impl From<PRSSEL_A> for u8 {
312    #[inline(always)]
313    fn from(variant: PRSSEL_A) -> Self {
314        variant as _
315    }
316}
317#[doc = "Field `PRSSEL` reader - Compare/Capture Channel PRS Input Channel Selection"]
318pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
319impl PRSSEL_R {
320    #[doc = "Get enumerated values variant"]
321    #[inline(always)]
322    pub fn variant(&self) -> Option<PRSSEL_A> {
323        match self.bits {
324            0 => Some(PRSSEL_A::PRSCH0),
325            1 => Some(PRSSEL_A::PRSCH1),
326            2 => Some(PRSSEL_A::PRSCH2),
327            3 => Some(PRSSEL_A::PRSCH3),
328            4 => Some(PRSSEL_A::PRSCH4),
329            5 => Some(PRSSEL_A::PRSCH5),
330            6 => Some(PRSSEL_A::PRSCH6),
331            7 => Some(PRSSEL_A::PRSCH7),
332            8 => Some(PRSSEL_A::PRSCH8),
333            9 => Some(PRSSEL_A::PRSCH9),
334            10 => Some(PRSSEL_A::PRSCH10),
335            11 => Some(PRSSEL_A::PRSCH11),
336            12 => Some(PRSSEL_A::PRSCH12),
337            13 => Some(PRSSEL_A::PRSCH13),
338            14 => Some(PRSSEL_A::PRSCH14),
339            15 => Some(PRSSEL_A::PRSCH15),
340            16 => Some(PRSSEL_A::PRSCH16),
341            17 => Some(PRSSEL_A::PRSCH17),
342            18 => Some(PRSSEL_A::PRSCH18),
343            19 => Some(PRSSEL_A::PRSCH19),
344            20 => Some(PRSSEL_A::PRSCH20),
345            21 => Some(PRSSEL_A::PRSCH21),
346            22 => Some(PRSSEL_A::PRSCH22),
347            23 => Some(PRSSEL_A::PRSCH23),
348            _ => None,
349        }
350    }
351    #[doc = "Checks if the value of the field is `PRSCH0`"]
352    #[inline(always)]
353    pub fn is_prsch0(&self) -> bool {
354        *self == PRSSEL_A::PRSCH0
355    }
356    #[doc = "Checks if the value of the field is `PRSCH1`"]
357    #[inline(always)]
358    pub fn is_prsch1(&self) -> bool {
359        *self == PRSSEL_A::PRSCH1
360    }
361    #[doc = "Checks if the value of the field is `PRSCH2`"]
362    #[inline(always)]
363    pub fn is_prsch2(&self) -> bool {
364        *self == PRSSEL_A::PRSCH2
365    }
366    #[doc = "Checks if the value of the field is `PRSCH3`"]
367    #[inline(always)]
368    pub fn is_prsch3(&self) -> bool {
369        *self == PRSSEL_A::PRSCH3
370    }
371    #[doc = "Checks if the value of the field is `PRSCH4`"]
372    #[inline(always)]
373    pub fn is_prsch4(&self) -> bool {
374        *self == PRSSEL_A::PRSCH4
375    }
376    #[doc = "Checks if the value of the field is `PRSCH5`"]
377    #[inline(always)]
378    pub fn is_prsch5(&self) -> bool {
379        *self == PRSSEL_A::PRSCH5
380    }
381    #[doc = "Checks if the value of the field is `PRSCH6`"]
382    #[inline(always)]
383    pub fn is_prsch6(&self) -> bool {
384        *self == PRSSEL_A::PRSCH6
385    }
386    #[doc = "Checks if the value of the field is `PRSCH7`"]
387    #[inline(always)]
388    pub fn is_prsch7(&self) -> bool {
389        *self == PRSSEL_A::PRSCH7
390    }
391    #[doc = "Checks if the value of the field is `PRSCH8`"]
392    #[inline(always)]
393    pub fn is_prsch8(&self) -> bool {
394        *self == PRSSEL_A::PRSCH8
395    }
396    #[doc = "Checks if the value of the field is `PRSCH9`"]
397    #[inline(always)]
398    pub fn is_prsch9(&self) -> bool {
399        *self == PRSSEL_A::PRSCH9
400    }
401    #[doc = "Checks if the value of the field is `PRSCH10`"]
402    #[inline(always)]
403    pub fn is_prsch10(&self) -> bool {
404        *self == PRSSEL_A::PRSCH10
405    }
406    #[doc = "Checks if the value of the field is `PRSCH11`"]
407    #[inline(always)]
408    pub fn is_prsch11(&self) -> bool {
409        *self == PRSSEL_A::PRSCH11
410    }
411    #[doc = "Checks if the value of the field is `PRSCH12`"]
412    #[inline(always)]
413    pub fn is_prsch12(&self) -> bool {
414        *self == PRSSEL_A::PRSCH12
415    }
416    #[doc = "Checks if the value of the field is `PRSCH13`"]
417    #[inline(always)]
418    pub fn is_prsch13(&self) -> bool {
419        *self == PRSSEL_A::PRSCH13
420    }
421    #[doc = "Checks if the value of the field is `PRSCH14`"]
422    #[inline(always)]
423    pub fn is_prsch14(&self) -> bool {
424        *self == PRSSEL_A::PRSCH14
425    }
426    #[doc = "Checks if the value of the field is `PRSCH15`"]
427    #[inline(always)]
428    pub fn is_prsch15(&self) -> bool {
429        *self == PRSSEL_A::PRSCH15
430    }
431    #[doc = "Checks if the value of the field is `PRSCH16`"]
432    #[inline(always)]
433    pub fn is_prsch16(&self) -> bool {
434        *self == PRSSEL_A::PRSCH16
435    }
436    #[doc = "Checks if the value of the field is `PRSCH17`"]
437    #[inline(always)]
438    pub fn is_prsch17(&self) -> bool {
439        *self == PRSSEL_A::PRSCH17
440    }
441    #[doc = "Checks if the value of the field is `PRSCH18`"]
442    #[inline(always)]
443    pub fn is_prsch18(&self) -> bool {
444        *self == PRSSEL_A::PRSCH18
445    }
446    #[doc = "Checks if the value of the field is `PRSCH19`"]
447    #[inline(always)]
448    pub fn is_prsch19(&self) -> bool {
449        *self == PRSSEL_A::PRSCH19
450    }
451    #[doc = "Checks if the value of the field is `PRSCH20`"]
452    #[inline(always)]
453    pub fn is_prsch20(&self) -> bool {
454        *self == PRSSEL_A::PRSCH20
455    }
456    #[doc = "Checks if the value of the field is `PRSCH21`"]
457    #[inline(always)]
458    pub fn is_prsch21(&self) -> bool {
459        *self == PRSSEL_A::PRSCH21
460    }
461    #[doc = "Checks if the value of the field is `PRSCH22`"]
462    #[inline(always)]
463    pub fn is_prsch22(&self) -> bool {
464        *self == PRSSEL_A::PRSCH22
465    }
466    #[doc = "Checks if the value of the field is `PRSCH23`"]
467    #[inline(always)]
468    pub fn is_prsch23(&self) -> bool {
469        *self == PRSSEL_A::PRSCH23
470    }
471}
472#[doc = "Field `PRSSEL` writer - Compare/Capture Channel PRS Input Channel Selection"]
473pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, CC2_CTRL_SPEC, u8, PRSSEL_A, 5, 6>;
474impl<'a> PRSSEL_W<'a> {
475    #[doc = "PRS Channel 0 selected as input"]
476    #[inline(always)]
477    pub fn prsch0(self) -> &'a mut W {
478        self.variant(PRSSEL_A::PRSCH0)
479    }
480    #[doc = "PRS Channel 1 selected as input"]
481    #[inline(always)]
482    pub fn prsch1(self) -> &'a mut W {
483        self.variant(PRSSEL_A::PRSCH1)
484    }
485    #[doc = "PRS Channel 2 selected as input"]
486    #[inline(always)]
487    pub fn prsch2(self) -> &'a mut W {
488        self.variant(PRSSEL_A::PRSCH2)
489    }
490    #[doc = "PRS Channel 3 selected as input"]
491    #[inline(always)]
492    pub fn prsch3(self) -> &'a mut W {
493        self.variant(PRSSEL_A::PRSCH3)
494    }
495    #[doc = "PRS Channel 4 selected as input"]
496    #[inline(always)]
497    pub fn prsch4(self) -> &'a mut W {
498        self.variant(PRSSEL_A::PRSCH4)
499    }
500    #[doc = "PRS Channel 5 selected as input"]
501    #[inline(always)]
502    pub fn prsch5(self) -> &'a mut W {
503        self.variant(PRSSEL_A::PRSCH5)
504    }
505    #[doc = "PRS Channel 6 selected as input"]
506    #[inline(always)]
507    pub fn prsch6(self) -> &'a mut W {
508        self.variant(PRSSEL_A::PRSCH6)
509    }
510    #[doc = "PRS Channel 7 selected as input"]
511    #[inline(always)]
512    pub fn prsch7(self) -> &'a mut W {
513        self.variant(PRSSEL_A::PRSCH7)
514    }
515    #[doc = "PRS Channel 8 selected as input"]
516    #[inline(always)]
517    pub fn prsch8(self) -> &'a mut W {
518        self.variant(PRSSEL_A::PRSCH8)
519    }
520    #[doc = "PRS Channel 9 selected as input"]
521    #[inline(always)]
522    pub fn prsch9(self) -> &'a mut W {
523        self.variant(PRSSEL_A::PRSCH9)
524    }
525    #[doc = "PRS Channel 10 selected as input"]
526    #[inline(always)]
527    pub fn prsch10(self) -> &'a mut W {
528        self.variant(PRSSEL_A::PRSCH10)
529    }
530    #[doc = "PRS Channel 11 selected as input"]
531    #[inline(always)]
532    pub fn prsch11(self) -> &'a mut W {
533        self.variant(PRSSEL_A::PRSCH11)
534    }
535    #[doc = "PRS Channel 12 selected as input"]
536    #[inline(always)]
537    pub fn prsch12(self) -> &'a mut W {
538        self.variant(PRSSEL_A::PRSCH12)
539    }
540    #[doc = "PRS Channel 13 selected as input"]
541    #[inline(always)]
542    pub fn prsch13(self) -> &'a mut W {
543        self.variant(PRSSEL_A::PRSCH13)
544    }
545    #[doc = "PRS Channel 14 selected as input"]
546    #[inline(always)]
547    pub fn prsch14(self) -> &'a mut W {
548        self.variant(PRSSEL_A::PRSCH14)
549    }
550    #[doc = "PRS Channel 15 selected as input"]
551    #[inline(always)]
552    pub fn prsch15(self) -> &'a mut W {
553        self.variant(PRSSEL_A::PRSCH15)
554    }
555    #[doc = "PRS Channel 16 selected as input"]
556    #[inline(always)]
557    pub fn prsch16(self) -> &'a mut W {
558        self.variant(PRSSEL_A::PRSCH16)
559    }
560    #[doc = "PRS Channel 17 selected as input"]
561    #[inline(always)]
562    pub fn prsch17(self) -> &'a mut W {
563        self.variant(PRSSEL_A::PRSCH17)
564    }
565    #[doc = "PRS Channel 18 selected as input"]
566    #[inline(always)]
567    pub fn prsch18(self) -> &'a mut W {
568        self.variant(PRSSEL_A::PRSCH18)
569    }
570    #[doc = "PRS Channel 19 selected as input"]
571    #[inline(always)]
572    pub fn prsch19(self) -> &'a mut W {
573        self.variant(PRSSEL_A::PRSCH19)
574    }
575    #[doc = "PRS Channel 20 selected as input"]
576    #[inline(always)]
577    pub fn prsch20(self) -> &'a mut W {
578        self.variant(PRSSEL_A::PRSCH20)
579    }
580    #[doc = "PRS Channel 21 selected as input"]
581    #[inline(always)]
582    pub fn prsch21(self) -> &'a mut W {
583        self.variant(PRSSEL_A::PRSCH21)
584    }
585    #[doc = "PRS Channel 22 selected as input"]
586    #[inline(always)]
587    pub fn prsch22(self) -> &'a mut W {
588        self.variant(PRSSEL_A::PRSCH22)
589    }
590    #[doc = "PRS Channel 23 selected as input"]
591    #[inline(always)]
592    pub fn prsch23(self) -> &'a mut W {
593        self.variant(PRSSEL_A::PRSCH23)
594    }
595}
596#[doc = "Field `COMPBASE` reader - Capture Compare Channel Comparison Base"]
597pub type COMPBASE_R = crate::BitReader<bool>;
598#[doc = "Field `COMPBASE` writer - Capture Compare Channel Comparison Base"]
599pub type COMPBASE_W<'a> = crate::BitWriter<'a, u32, CC2_CTRL_SPEC, bool, 11>;
600#[doc = "Field `COMPMASK` reader - Capture Compare Channel Comparison Mask"]
601pub type COMPMASK_R = crate::FieldReader<u8, u8>;
602#[doc = "Field `COMPMASK` writer - Capture Compare Channel Comparison Mask"]
603pub type COMPMASK_W<'a> = crate::FieldWriter<'a, u32, CC2_CTRL_SPEC, u8, u8, 5, 12>;
604#[doc = "Field `DAYCC` reader - Day Capture/Compare Selection"]
605pub type DAYCC_R = crate::BitReader<bool>;
606#[doc = "Field `DAYCC` writer - Day Capture/Compare Selection"]
607pub type DAYCC_W<'a> = crate::BitWriter<'a, u32, CC2_CTRL_SPEC, bool, 17>;
608impl R {
609    #[doc = "Bits 0:1 - CC Channel Mode"]
610    #[inline(always)]
611    pub fn mode(&self) -> MODE_R {
612        MODE_R::new((self.bits & 3) as u8)
613    }
614    #[doc = "Bits 2:3 - Compare Match Output Action"]
615    #[inline(always)]
616    pub fn cmoa(&self) -> CMOA_R {
617        CMOA_R::new(((self.bits >> 2) & 3) as u8)
618    }
619    #[doc = "Bits 4:5 - Input Capture Edge Select"]
620    #[inline(always)]
621    pub fn icedge(&self) -> ICEDGE_R {
622        ICEDGE_R::new(((self.bits >> 4) & 3) as u8)
623    }
624    #[doc = "Bits 6:10 - Compare/Capture Channel PRS Input Channel Selection"]
625    #[inline(always)]
626    pub fn prssel(&self) -> PRSSEL_R {
627        PRSSEL_R::new(((self.bits >> 6) & 0x1f) as u8)
628    }
629    #[doc = "Bit 11 - Capture Compare Channel Comparison Base"]
630    #[inline(always)]
631    pub fn compbase(&self) -> COMPBASE_R {
632        COMPBASE_R::new(((self.bits >> 11) & 1) != 0)
633    }
634    #[doc = "Bits 12:16 - Capture Compare Channel Comparison Mask"]
635    #[inline(always)]
636    pub fn compmask(&self) -> COMPMASK_R {
637        COMPMASK_R::new(((self.bits >> 12) & 0x1f) as u8)
638    }
639    #[doc = "Bit 17 - Day Capture/Compare Selection"]
640    #[inline(always)]
641    pub fn daycc(&self) -> DAYCC_R {
642        DAYCC_R::new(((self.bits >> 17) & 1) != 0)
643    }
644}
645impl W {
646    #[doc = "Bits 0:1 - CC Channel Mode"]
647    #[inline(always)]
648    pub fn mode(&mut self) -> MODE_W {
649        MODE_W::new(self)
650    }
651    #[doc = "Bits 2:3 - Compare Match Output Action"]
652    #[inline(always)]
653    pub fn cmoa(&mut self) -> CMOA_W {
654        CMOA_W::new(self)
655    }
656    #[doc = "Bits 4:5 - Input Capture Edge Select"]
657    #[inline(always)]
658    pub fn icedge(&mut self) -> ICEDGE_W {
659        ICEDGE_W::new(self)
660    }
661    #[doc = "Bits 6:10 - Compare/Capture Channel PRS Input Channel Selection"]
662    #[inline(always)]
663    pub fn prssel(&mut self) -> PRSSEL_W {
664        PRSSEL_W::new(self)
665    }
666    #[doc = "Bit 11 - Capture Compare Channel Comparison Base"]
667    #[inline(always)]
668    pub fn compbase(&mut self) -> COMPBASE_W {
669        COMPBASE_W::new(self)
670    }
671    #[doc = "Bits 12:16 - Capture Compare Channel Comparison Mask"]
672    #[inline(always)]
673    pub fn compmask(&mut self) -> COMPMASK_W {
674        COMPMASK_W::new(self)
675    }
676    #[doc = "Bit 17 - Day Capture/Compare Selection"]
677    #[inline(always)]
678    pub fn daycc(&mut self) -> DAYCC_W {
679        DAYCC_W::new(self)
680    }
681    #[doc = "Writes raw bits to the register."]
682    #[inline(always)]
683    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
684        self.0.bits(bits);
685        self
686    }
687}
688#[doc = "CC Channel Control 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 [cc2_ctrl](index.html) module"]
689pub struct CC2_CTRL_SPEC;
690impl crate::RegisterSpec for CC2_CTRL_SPEC {
691    type Ux = u32;
692}
693#[doc = "`read()` method returns [cc2_ctrl::R](R) reader structure"]
694impl crate::Readable for CC2_CTRL_SPEC {
695    type Reader = R;
696}
697#[doc = "`write(|w| ..)` method takes [cc2_ctrl::W](W) writer structure"]
698impl crate::Writable for CC2_CTRL_SPEC {
699    type Writer = W;
700}
701#[doc = "`reset()` method sets CC2_CTRL to value 0"]
702impl crate::Resettable for CC2_CTRL_SPEC {
703    #[inline(always)]
704    fn reset_value() -> Self::Ux {
705        0
706    }
707}