atsam4ls2b_pac/tc0/
waveform_cmr_alt.rs

1#[doc = "Register `CMR%s_ALT` reader"]
2pub struct R(crate::R<WAVEFORM_CMR_ALT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<WAVEFORM_CMR_ALT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<WAVEFORM_CMR_ALT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<WAVEFORM_CMR_ALT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CMR%s_ALT` writer"]
17pub struct W(crate::W<WAVEFORM_CMR_ALT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<WAVEFORM_CMR_ALT_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<WAVEFORM_CMR_ALT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<WAVEFORM_CMR_ALT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TCCLKS` reader - Clock Selection"]
38pub type TCCLKS_R = crate::FieldReader<u8, TCCLKSSELECT_A>;
39#[doc = "Clock Selection\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum TCCLKSSELECT_A {
43    #[doc = "0: TIMER_DIV1_CLOCK"]
44    TIMER_DIV1_CLOCK = 0,
45    #[doc = "1: TIMER_DIV2_CLOCK"]
46    TIMER_DIV2_CLOCK = 1,
47    #[doc = "2: TIMER_DIV3_CLOCK"]
48    TIMER_DIV3_CLOCK = 2,
49    #[doc = "3: TIMER_DIV4_CLOCK"]
50    TIMER_DIV4_CLOCK = 3,
51    #[doc = "4: TIMER_DIV5_CLOCK"]
52    TIMER_DIV5_CLOCK = 4,
53    #[doc = "5: XC0"]
54    XC0 = 5,
55    #[doc = "6: XC1"]
56    XC1 = 6,
57    #[doc = "7: XC2"]
58    XC2 = 7,
59}
60impl From<TCCLKSSELECT_A> for u8 {
61    #[inline(always)]
62    fn from(variant: TCCLKSSELECT_A) -> Self {
63        variant as _
64    }
65}
66impl TCCLKS_R {
67    #[doc = "Get enumerated values variant"]
68    #[inline(always)]
69    pub fn variant(&self) -> TCCLKSSELECT_A {
70        match self.bits {
71            0 => TCCLKSSELECT_A::TIMER_DIV1_CLOCK,
72            1 => TCCLKSSELECT_A::TIMER_DIV2_CLOCK,
73            2 => TCCLKSSELECT_A::TIMER_DIV3_CLOCK,
74            3 => TCCLKSSELECT_A::TIMER_DIV4_CLOCK,
75            4 => TCCLKSSELECT_A::TIMER_DIV5_CLOCK,
76            5 => TCCLKSSELECT_A::XC0,
77            6 => TCCLKSSELECT_A::XC1,
78            7 => TCCLKSSELECT_A::XC2,
79            _ => unreachable!(),
80        }
81    }
82    #[doc = "Checks if the value of the field is `TIMER_DIV1_CLOCK`"]
83    #[inline(always)]
84    pub fn is_timer_div1_clock(&self) -> bool {
85        *self == TCCLKSSELECT_A::TIMER_DIV1_CLOCK
86    }
87    #[doc = "Checks if the value of the field is `TIMER_DIV2_CLOCK`"]
88    #[inline(always)]
89    pub fn is_timer_div2_clock(&self) -> bool {
90        *self == TCCLKSSELECT_A::TIMER_DIV2_CLOCK
91    }
92    #[doc = "Checks if the value of the field is `TIMER_DIV3_CLOCK`"]
93    #[inline(always)]
94    pub fn is_timer_div3_clock(&self) -> bool {
95        *self == TCCLKSSELECT_A::TIMER_DIV3_CLOCK
96    }
97    #[doc = "Checks if the value of the field is `TIMER_DIV4_CLOCK`"]
98    #[inline(always)]
99    pub fn is_timer_div4_clock(&self) -> bool {
100        *self == TCCLKSSELECT_A::TIMER_DIV4_CLOCK
101    }
102    #[doc = "Checks if the value of the field is `TIMER_DIV5_CLOCK`"]
103    #[inline(always)]
104    pub fn is_timer_div5_clock(&self) -> bool {
105        *self == TCCLKSSELECT_A::TIMER_DIV5_CLOCK
106    }
107    #[doc = "Checks if the value of the field is `XC0`"]
108    #[inline(always)]
109    pub fn is_xc0(&self) -> bool {
110        *self == TCCLKSSELECT_A::XC0
111    }
112    #[doc = "Checks if the value of the field is `XC1`"]
113    #[inline(always)]
114    pub fn is_xc1(&self) -> bool {
115        *self == TCCLKSSELECT_A::XC1
116    }
117    #[doc = "Checks if the value of the field is `XC2`"]
118    #[inline(always)]
119    pub fn is_xc2(&self) -> bool {
120        *self == TCCLKSSELECT_A::XC2
121    }
122}
123#[doc = "Field `TCCLKS` writer - Clock Selection"]
124pub type TCCLKS_W<'a, const O: u8> =
125    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, TCCLKSSELECT_A, 3, O>;
126impl<'a, const O: u8> TCCLKS_W<'a, O> {
127    #[doc = "TIMER_DIV1_CLOCK"]
128    #[inline(always)]
129    pub fn timer_div1_clock(self) -> &'a mut W {
130        self.variant(TCCLKSSELECT_A::TIMER_DIV1_CLOCK)
131    }
132    #[doc = "TIMER_DIV2_CLOCK"]
133    #[inline(always)]
134    pub fn timer_div2_clock(self) -> &'a mut W {
135        self.variant(TCCLKSSELECT_A::TIMER_DIV2_CLOCK)
136    }
137    #[doc = "TIMER_DIV3_CLOCK"]
138    #[inline(always)]
139    pub fn timer_div3_clock(self) -> &'a mut W {
140        self.variant(TCCLKSSELECT_A::TIMER_DIV3_CLOCK)
141    }
142    #[doc = "TIMER_DIV4_CLOCK"]
143    #[inline(always)]
144    pub fn timer_div4_clock(self) -> &'a mut W {
145        self.variant(TCCLKSSELECT_A::TIMER_DIV4_CLOCK)
146    }
147    #[doc = "TIMER_DIV5_CLOCK"]
148    #[inline(always)]
149    pub fn timer_div5_clock(self) -> &'a mut W {
150        self.variant(TCCLKSSELECT_A::TIMER_DIV5_CLOCK)
151    }
152    #[doc = "XC0"]
153    #[inline(always)]
154    pub fn xc0(self) -> &'a mut W {
155        self.variant(TCCLKSSELECT_A::XC0)
156    }
157    #[doc = "XC1"]
158    #[inline(always)]
159    pub fn xc1(self) -> &'a mut W {
160        self.variant(TCCLKSSELECT_A::XC1)
161    }
162    #[doc = "XC2"]
163    #[inline(always)]
164    pub fn xc2(self) -> &'a mut W {
165        self.variant(TCCLKSSELECT_A::XC2)
166    }
167}
168#[doc = "Field `CLKI` reader - Clock Invert"]
169pub type CLKI_R = crate::BitReader<CLKISELECT_A>;
170#[doc = "Clock Invert\n\nValue on reset: 0"]
171#[derive(Clone, Copy, Debug, PartialEq, Eq)]
172pub enum CLKISELECT_A {
173    #[doc = "0: Counter is incremented on rising edge of the clock."]
174    _0 = 0,
175    #[doc = "1: Counter is incremented on falling edge of the clock."]
176    _1 = 1,
177}
178impl From<CLKISELECT_A> for bool {
179    #[inline(always)]
180    fn from(variant: CLKISELECT_A) -> Self {
181        variant as u8 != 0
182    }
183}
184impl CLKI_R {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub fn variant(&self) -> CLKISELECT_A {
188        match self.bits {
189            false => CLKISELECT_A::_0,
190            true => CLKISELECT_A::_1,
191        }
192    }
193    #[doc = "Checks if the value of the field is `_0`"]
194    #[inline(always)]
195    pub fn is_0(&self) -> bool {
196        *self == CLKISELECT_A::_0
197    }
198    #[doc = "Checks if the value of the field is `_1`"]
199    #[inline(always)]
200    pub fn is_1(&self) -> bool {
201        *self == CLKISELECT_A::_1
202    }
203}
204#[doc = "Field `CLKI` writer - Clock Invert"]
205pub type CLKI_W<'a, const O: u8> =
206    crate::BitWriter<'a, u32, WAVEFORM_CMR_ALT_SPEC, CLKISELECT_A, O>;
207impl<'a, const O: u8> CLKI_W<'a, O> {
208    #[doc = "Counter is incremented on rising edge of the clock."]
209    #[inline(always)]
210    pub fn _0(self) -> &'a mut W {
211        self.variant(CLKISELECT_A::_0)
212    }
213    #[doc = "Counter is incremented on falling edge of the clock."]
214    #[inline(always)]
215    pub fn _1(self) -> &'a mut W {
216        self.variant(CLKISELECT_A::_1)
217    }
218}
219#[doc = "Field `BURST` reader - Burst Signal Selection"]
220pub type BURST_R = crate::FieldReader<u8, BURSTSELECT_A>;
221#[doc = "Burst Signal Selection\n\nValue on reset: 0"]
222#[derive(Clone, Copy, Debug, PartialEq, Eq)]
223#[repr(u8)]
224pub enum BURSTSELECT_A {
225    #[doc = "0: The clock is not gated by an external signal."]
226    NOT_GATED = 0,
227    #[doc = "1: XC0 is ANDed with the selected clock."]
228    CLK_AND_XC0 = 1,
229    #[doc = "2: XC1 is ANDed with the selected clock."]
230    CLK_AND_XC1 = 2,
231    #[doc = "3: XC2 is ANDed with the selected clock."]
232    CLK_AND_XC2 = 3,
233}
234impl From<BURSTSELECT_A> for u8 {
235    #[inline(always)]
236    fn from(variant: BURSTSELECT_A) -> Self {
237        variant as _
238    }
239}
240impl BURST_R {
241    #[doc = "Get enumerated values variant"]
242    #[inline(always)]
243    pub fn variant(&self) -> BURSTSELECT_A {
244        match self.bits {
245            0 => BURSTSELECT_A::NOT_GATED,
246            1 => BURSTSELECT_A::CLK_AND_XC0,
247            2 => BURSTSELECT_A::CLK_AND_XC1,
248            3 => BURSTSELECT_A::CLK_AND_XC2,
249            _ => unreachable!(),
250        }
251    }
252    #[doc = "Checks if the value of the field is `NOT_GATED`"]
253    #[inline(always)]
254    pub fn is_not_gated(&self) -> bool {
255        *self == BURSTSELECT_A::NOT_GATED
256    }
257    #[doc = "Checks if the value of the field is `CLK_AND_XC0`"]
258    #[inline(always)]
259    pub fn is_clk_and_xc0(&self) -> bool {
260        *self == BURSTSELECT_A::CLK_AND_XC0
261    }
262    #[doc = "Checks if the value of the field is `CLK_AND_XC1`"]
263    #[inline(always)]
264    pub fn is_clk_and_xc1(&self) -> bool {
265        *self == BURSTSELECT_A::CLK_AND_XC1
266    }
267    #[doc = "Checks if the value of the field is `CLK_AND_XC2`"]
268    #[inline(always)]
269    pub fn is_clk_and_xc2(&self) -> bool {
270        *self == BURSTSELECT_A::CLK_AND_XC2
271    }
272}
273#[doc = "Field `BURST` writer - Burst Signal Selection"]
274pub type BURST_W<'a, const O: u8> =
275    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, BURSTSELECT_A, 2, O>;
276impl<'a, const O: u8> BURST_W<'a, O> {
277    #[doc = "The clock is not gated by an external signal."]
278    #[inline(always)]
279    pub fn not_gated(self) -> &'a mut W {
280        self.variant(BURSTSELECT_A::NOT_GATED)
281    }
282    #[doc = "XC0 is ANDed with the selected clock."]
283    #[inline(always)]
284    pub fn clk_and_xc0(self) -> &'a mut W {
285        self.variant(BURSTSELECT_A::CLK_AND_XC0)
286    }
287    #[doc = "XC1 is ANDed with the selected clock."]
288    #[inline(always)]
289    pub fn clk_and_xc1(self) -> &'a mut W {
290        self.variant(BURSTSELECT_A::CLK_AND_XC1)
291    }
292    #[doc = "XC2 is ANDed with the selected clock."]
293    #[inline(always)]
294    pub fn clk_and_xc2(self) -> &'a mut W {
295        self.variant(BURSTSELECT_A::CLK_AND_XC2)
296    }
297}
298#[doc = "Field `CPCSTOP` reader - Counter Clock Stopped with RC Compare"]
299pub type CPCSTOP_R = crate::BitReader<CPCSTOPSELECT_A>;
300#[doc = "Counter Clock Stopped with RC Compare\n\nValue on reset: 0"]
301#[derive(Clone, Copy, Debug, PartialEq, Eq)]
302pub enum CPCSTOPSELECT_A {
303    #[doc = "0: Counter clock is not stopped when counter reaches RC."]
304    _0 = 0,
305    #[doc = "1: Counter clock is stopped when counter reaches RC."]
306    _1 = 1,
307}
308impl From<CPCSTOPSELECT_A> for bool {
309    #[inline(always)]
310    fn from(variant: CPCSTOPSELECT_A) -> Self {
311        variant as u8 != 0
312    }
313}
314impl CPCSTOP_R {
315    #[doc = "Get enumerated values variant"]
316    #[inline(always)]
317    pub fn variant(&self) -> CPCSTOPSELECT_A {
318        match self.bits {
319            false => CPCSTOPSELECT_A::_0,
320            true => CPCSTOPSELECT_A::_1,
321        }
322    }
323    #[doc = "Checks if the value of the field is `_0`"]
324    #[inline(always)]
325    pub fn is_0(&self) -> bool {
326        *self == CPCSTOPSELECT_A::_0
327    }
328    #[doc = "Checks if the value of the field is `_1`"]
329    #[inline(always)]
330    pub fn is_1(&self) -> bool {
331        *self == CPCSTOPSELECT_A::_1
332    }
333}
334#[doc = "Field `CPCSTOP` writer - Counter Clock Stopped with RC Compare"]
335pub type CPCSTOP_W<'a, const O: u8> =
336    crate::BitWriter<'a, u32, WAVEFORM_CMR_ALT_SPEC, CPCSTOPSELECT_A, O>;
337impl<'a, const O: u8> CPCSTOP_W<'a, O> {
338    #[doc = "Counter clock is not stopped when counter reaches RC."]
339    #[inline(always)]
340    pub fn _0(self) -> &'a mut W {
341        self.variant(CPCSTOPSELECT_A::_0)
342    }
343    #[doc = "Counter clock is stopped when counter reaches RC."]
344    #[inline(always)]
345    pub fn _1(self) -> &'a mut W {
346        self.variant(CPCSTOPSELECT_A::_1)
347    }
348}
349#[doc = "Field `CPCDIS` reader - Counter Clock Disable with RC Compare"]
350pub type CPCDIS_R = crate::BitReader<CPCDISSELECT_A>;
351#[doc = "Counter Clock Disable with RC Compare\n\nValue on reset: 0"]
352#[derive(Clone, Copy, Debug, PartialEq, Eq)]
353pub enum CPCDISSELECT_A {
354    #[doc = "0: Counter clock is not disabled when counter reaches RC."]
355    _0 = 0,
356    #[doc = "1: Counter clock is disabled when counter reaches RC."]
357    _1 = 1,
358}
359impl From<CPCDISSELECT_A> for bool {
360    #[inline(always)]
361    fn from(variant: CPCDISSELECT_A) -> Self {
362        variant as u8 != 0
363    }
364}
365impl CPCDIS_R {
366    #[doc = "Get enumerated values variant"]
367    #[inline(always)]
368    pub fn variant(&self) -> CPCDISSELECT_A {
369        match self.bits {
370            false => CPCDISSELECT_A::_0,
371            true => CPCDISSELECT_A::_1,
372        }
373    }
374    #[doc = "Checks if the value of the field is `_0`"]
375    #[inline(always)]
376    pub fn is_0(&self) -> bool {
377        *self == CPCDISSELECT_A::_0
378    }
379    #[doc = "Checks if the value of the field is `_1`"]
380    #[inline(always)]
381    pub fn is_1(&self) -> bool {
382        *self == CPCDISSELECT_A::_1
383    }
384}
385#[doc = "Field `CPCDIS` writer - Counter Clock Disable with RC Compare"]
386pub type CPCDIS_W<'a, const O: u8> =
387    crate::BitWriter<'a, u32, WAVEFORM_CMR_ALT_SPEC, CPCDISSELECT_A, O>;
388impl<'a, const O: u8> CPCDIS_W<'a, O> {
389    #[doc = "Counter clock is not disabled when counter reaches RC."]
390    #[inline(always)]
391    pub fn _0(self) -> &'a mut W {
392        self.variant(CPCDISSELECT_A::_0)
393    }
394    #[doc = "Counter clock is disabled when counter reaches RC."]
395    #[inline(always)]
396    pub fn _1(self) -> &'a mut W {
397        self.variant(CPCDISSELECT_A::_1)
398    }
399}
400#[doc = "Field `EEVTEDG` reader - External Event Edge Selection"]
401pub type EEVTEDG_R = crate::FieldReader<u8, EEVTEDGSELECT_A>;
402#[doc = "External Event Edge Selection\n\nValue on reset: 0"]
403#[derive(Clone, Copy, Debug, PartialEq, Eq)]
404#[repr(u8)]
405pub enum EEVTEDGSELECT_A {
406    #[doc = "0: none"]
407    NO_EDGE = 0,
408    #[doc = "1: rising edge"]
409    POS_EDGE = 1,
410    #[doc = "2: falling edge"]
411    NEG_EDGE = 2,
412    #[doc = "3: each edge"]
413    BOTH_EDGES = 3,
414}
415impl From<EEVTEDGSELECT_A> for u8 {
416    #[inline(always)]
417    fn from(variant: EEVTEDGSELECT_A) -> Self {
418        variant as _
419    }
420}
421impl EEVTEDG_R {
422    #[doc = "Get enumerated values variant"]
423    #[inline(always)]
424    pub fn variant(&self) -> EEVTEDGSELECT_A {
425        match self.bits {
426            0 => EEVTEDGSELECT_A::NO_EDGE,
427            1 => EEVTEDGSELECT_A::POS_EDGE,
428            2 => EEVTEDGSELECT_A::NEG_EDGE,
429            3 => EEVTEDGSELECT_A::BOTH_EDGES,
430            _ => unreachable!(),
431        }
432    }
433    #[doc = "Checks if the value of the field is `NO_EDGE`"]
434    #[inline(always)]
435    pub fn is_no_edge(&self) -> bool {
436        *self == EEVTEDGSELECT_A::NO_EDGE
437    }
438    #[doc = "Checks if the value of the field is `POS_EDGE`"]
439    #[inline(always)]
440    pub fn is_pos_edge(&self) -> bool {
441        *self == EEVTEDGSELECT_A::POS_EDGE
442    }
443    #[doc = "Checks if the value of the field is `NEG_EDGE`"]
444    #[inline(always)]
445    pub fn is_neg_edge(&self) -> bool {
446        *self == EEVTEDGSELECT_A::NEG_EDGE
447    }
448    #[doc = "Checks if the value of the field is `BOTH_EDGES`"]
449    #[inline(always)]
450    pub fn is_both_edges(&self) -> bool {
451        *self == EEVTEDGSELECT_A::BOTH_EDGES
452    }
453}
454#[doc = "Field `EEVTEDG` writer - External Event Edge Selection"]
455pub type EEVTEDG_W<'a, const O: u8> =
456    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, EEVTEDGSELECT_A, 2, O>;
457impl<'a, const O: u8> EEVTEDG_W<'a, O> {
458    #[doc = "none"]
459    #[inline(always)]
460    pub fn no_edge(self) -> &'a mut W {
461        self.variant(EEVTEDGSELECT_A::NO_EDGE)
462    }
463    #[doc = "rising edge"]
464    #[inline(always)]
465    pub fn pos_edge(self) -> &'a mut W {
466        self.variant(EEVTEDGSELECT_A::POS_EDGE)
467    }
468    #[doc = "falling edge"]
469    #[inline(always)]
470    pub fn neg_edge(self) -> &'a mut W {
471        self.variant(EEVTEDGSELECT_A::NEG_EDGE)
472    }
473    #[doc = "each edge"]
474    #[inline(always)]
475    pub fn both_edges(self) -> &'a mut W {
476        self.variant(EEVTEDGSELECT_A::BOTH_EDGES)
477    }
478}
479#[doc = "Field `EEVT` reader - External Event Selection"]
480pub type EEVT_R = crate::FieldReader<u8, EEVTSELECT_A>;
481#[doc = "External Event Selection\n\nValue on reset: 0"]
482#[derive(Clone, Copy, Debug, PartialEq, Eq)]
483#[repr(u8)]
484pub enum EEVTSELECT_A {
485    #[doc = "0: TIOB input. If TIOB is chosen as the external event signal, it is configured as an input and no longer generates waveforms."]
486    TIOB_INPUT = 0,
487    #[doc = "1: XC0 output"]
488    XC0_OUTPUT = 1,
489    #[doc = "2: XC1 output"]
490    XC1_OUTPUT = 2,
491    #[doc = "3: XC2 output"]
492    XC2_OUTPUT = 3,
493}
494impl From<EEVTSELECT_A> for u8 {
495    #[inline(always)]
496    fn from(variant: EEVTSELECT_A) -> Self {
497        variant as _
498    }
499}
500impl EEVT_R {
501    #[doc = "Get enumerated values variant"]
502    #[inline(always)]
503    pub fn variant(&self) -> EEVTSELECT_A {
504        match self.bits {
505            0 => EEVTSELECT_A::TIOB_INPUT,
506            1 => EEVTSELECT_A::XC0_OUTPUT,
507            2 => EEVTSELECT_A::XC1_OUTPUT,
508            3 => EEVTSELECT_A::XC2_OUTPUT,
509            _ => unreachable!(),
510        }
511    }
512    #[doc = "Checks if the value of the field is `TIOB_INPUT`"]
513    #[inline(always)]
514    pub fn is_tiob_input(&self) -> bool {
515        *self == EEVTSELECT_A::TIOB_INPUT
516    }
517    #[doc = "Checks if the value of the field is `XC0_OUTPUT`"]
518    #[inline(always)]
519    pub fn is_xc0_output(&self) -> bool {
520        *self == EEVTSELECT_A::XC0_OUTPUT
521    }
522    #[doc = "Checks if the value of the field is `XC1_OUTPUT`"]
523    #[inline(always)]
524    pub fn is_xc1_output(&self) -> bool {
525        *self == EEVTSELECT_A::XC1_OUTPUT
526    }
527    #[doc = "Checks if the value of the field is `XC2_OUTPUT`"]
528    #[inline(always)]
529    pub fn is_xc2_output(&self) -> bool {
530        *self == EEVTSELECT_A::XC2_OUTPUT
531    }
532}
533#[doc = "Field `EEVT` writer - External Event Selection"]
534pub type EEVT_W<'a, const O: u8> =
535    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, EEVTSELECT_A, 2, O>;
536impl<'a, const O: u8> EEVT_W<'a, O> {
537    #[doc = "TIOB input. If TIOB is chosen as the external event signal, it is configured as an input and no longer generates waveforms."]
538    #[inline(always)]
539    pub fn tiob_input(self) -> &'a mut W {
540        self.variant(EEVTSELECT_A::TIOB_INPUT)
541    }
542    #[doc = "XC0 output"]
543    #[inline(always)]
544    pub fn xc0_output(self) -> &'a mut W {
545        self.variant(EEVTSELECT_A::XC0_OUTPUT)
546    }
547    #[doc = "XC1 output"]
548    #[inline(always)]
549    pub fn xc1_output(self) -> &'a mut W {
550        self.variant(EEVTSELECT_A::XC1_OUTPUT)
551    }
552    #[doc = "XC2 output"]
553    #[inline(always)]
554    pub fn xc2_output(self) -> &'a mut W {
555        self.variant(EEVTSELECT_A::XC2_OUTPUT)
556    }
557}
558#[doc = "Field `ENETRG` reader - External Event Trigger Enable"]
559pub type ENETRG_R = crate::BitReader<ENETRGSELECT_A>;
560#[doc = "External Event Trigger Enable\n\nValue on reset: 0"]
561#[derive(Clone, Copy, Debug, PartialEq, Eq)]
562pub enum ENETRGSELECT_A {
563    #[doc = "0: The external event has no effect on the counter and its clock. In this case, the selected external event only controls the TIOA output."]
564    _0 = 0,
565    #[doc = "1: The external event resets the counter and starts the counter clock."]
566    _1 = 1,
567}
568impl From<ENETRGSELECT_A> for bool {
569    #[inline(always)]
570    fn from(variant: ENETRGSELECT_A) -> Self {
571        variant as u8 != 0
572    }
573}
574impl ENETRG_R {
575    #[doc = "Get enumerated values variant"]
576    #[inline(always)]
577    pub fn variant(&self) -> ENETRGSELECT_A {
578        match self.bits {
579            false => ENETRGSELECT_A::_0,
580            true => ENETRGSELECT_A::_1,
581        }
582    }
583    #[doc = "Checks if the value of the field is `_0`"]
584    #[inline(always)]
585    pub fn is_0(&self) -> bool {
586        *self == ENETRGSELECT_A::_0
587    }
588    #[doc = "Checks if the value of the field is `_1`"]
589    #[inline(always)]
590    pub fn is_1(&self) -> bool {
591        *self == ENETRGSELECT_A::_1
592    }
593}
594#[doc = "Field `ENETRG` writer - External Event Trigger Enable"]
595pub type ENETRG_W<'a, const O: u8> =
596    crate::BitWriter<'a, u32, WAVEFORM_CMR_ALT_SPEC, ENETRGSELECT_A, O>;
597impl<'a, const O: u8> ENETRG_W<'a, O> {
598    #[doc = "The external event has no effect on the counter and its clock. In this case, the selected external event only controls the TIOA output."]
599    #[inline(always)]
600    pub fn _0(self) -> &'a mut W {
601        self.variant(ENETRGSELECT_A::_0)
602    }
603    #[doc = "The external event resets the counter and starts the counter clock."]
604    #[inline(always)]
605    pub fn _1(self) -> &'a mut W {
606        self.variant(ENETRGSELECT_A::_1)
607    }
608}
609#[doc = "Field `WAVSEL` reader - Waveform Selection"]
610pub type WAVSEL_R = crate::FieldReader<u8, WAVSELSELECT_A>;
611#[doc = "Waveform Selection\n\nValue on reset: 0"]
612#[derive(Clone, Copy, Debug, PartialEq, Eq)]
613#[repr(u8)]
614pub enum WAVSELSELECT_A {
615    #[doc = "0: UP mode without automatic trigger on RC Compare"]
616    UP_NO_AUTO = 0,
617    #[doc = "1: UPDOWN mode without automatic trigger on RC Compare"]
618    UPDOWN_NO_AUTO = 1,
619    #[doc = "2: UP mode with automatic trigger on RC Compare"]
620    UP_AUTO = 2,
621    #[doc = "3: UPDOWN mode with automatic trigger on RC Compare"]
622    UPDOWN_AUTO = 3,
623}
624impl From<WAVSELSELECT_A> for u8 {
625    #[inline(always)]
626    fn from(variant: WAVSELSELECT_A) -> Self {
627        variant as _
628    }
629}
630impl WAVSEL_R {
631    #[doc = "Get enumerated values variant"]
632    #[inline(always)]
633    pub fn variant(&self) -> WAVSELSELECT_A {
634        match self.bits {
635            0 => WAVSELSELECT_A::UP_NO_AUTO,
636            1 => WAVSELSELECT_A::UPDOWN_NO_AUTO,
637            2 => WAVSELSELECT_A::UP_AUTO,
638            3 => WAVSELSELECT_A::UPDOWN_AUTO,
639            _ => unreachable!(),
640        }
641    }
642    #[doc = "Checks if the value of the field is `UP_NO_AUTO`"]
643    #[inline(always)]
644    pub fn is_up_no_auto(&self) -> bool {
645        *self == WAVSELSELECT_A::UP_NO_AUTO
646    }
647    #[doc = "Checks if the value of the field is `UPDOWN_NO_AUTO`"]
648    #[inline(always)]
649    pub fn is_updown_no_auto(&self) -> bool {
650        *self == WAVSELSELECT_A::UPDOWN_NO_AUTO
651    }
652    #[doc = "Checks if the value of the field is `UP_AUTO`"]
653    #[inline(always)]
654    pub fn is_up_auto(&self) -> bool {
655        *self == WAVSELSELECT_A::UP_AUTO
656    }
657    #[doc = "Checks if the value of the field is `UPDOWN_AUTO`"]
658    #[inline(always)]
659    pub fn is_updown_auto(&self) -> bool {
660        *self == WAVSELSELECT_A::UPDOWN_AUTO
661    }
662}
663#[doc = "Field `WAVSEL` writer - Waveform Selection"]
664pub type WAVSEL_W<'a, const O: u8> =
665    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, WAVSELSELECT_A, 2, O>;
666impl<'a, const O: u8> WAVSEL_W<'a, O> {
667    #[doc = "UP mode without automatic trigger on RC Compare"]
668    #[inline(always)]
669    pub fn up_no_auto(self) -> &'a mut W {
670        self.variant(WAVSELSELECT_A::UP_NO_AUTO)
671    }
672    #[doc = "UPDOWN mode without automatic trigger on RC Compare"]
673    #[inline(always)]
674    pub fn updown_no_auto(self) -> &'a mut W {
675        self.variant(WAVSELSELECT_A::UPDOWN_NO_AUTO)
676    }
677    #[doc = "UP mode with automatic trigger on RC Compare"]
678    #[inline(always)]
679    pub fn up_auto(self) -> &'a mut W {
680        self.variant(WAVSELSELECT_A::UP_AUTO)
681    }
682    #[doc = "UPDOWN mode with automatic trigger on RC Compare"]
683    #[inline(always)]
684    pub fn updown_auto(self) -> &'a mut W {
685        self.variant(WAVSELSELECT_A::UPDOWN_AUTO)
686    }
687}
688#[doc = "Field `WAVE` reader - WAVE"]
689pub type WAVE_R = crate::BitReader<WAVESELECT_A>;
690#[doc = "WAVE\n\nValue on reset: 0"]
691#[derive(Clone, Copy, Debug, PartialEq, Eq)]
692pub enum WAVESELECT_A {
693    #[doc = "0: Waveform Mode is disabled (Capture Mode is enabled)."]
694    _0 = 0,
695    #[doc = "1: Waveform Mode is enabled."]
696    _1 = 1,
697}
698impl From<WAVESELECT_A> for bool {
699    #[inline(always)]
700    fn from(variant: WAVESELECT_A) -> Self {
701        variant as u8 != 0
702    }
703}
704impl WAVE_R {
705    #[doc = "Get enumerated values variant"]
706    #[inline(always)]
707    pub fn variant(&self) -> WAVESELECT_A {
708        match self.bits {
709            false => WAVESELECT_A::_0,
710            true => WAVESELECT_A::_1,
711        }
712    }
713    #[doc = "Checks if the value of the field is `_0`"]
714    #[inline(always)]
715    pub fn is_0(&self) -> bool {
716        *self == WAVESELECT_A::_0
717    }
718    #[doc = "Checks if the value of the field is `_1`"]
719    #[inline(always)]
720    pub fn is_1(&self) -> bool {
721        *self == WAVESELECT_A::_1
722    }
723}
724#[doc = "Field `WAVE` writer - WAVE"]
725pub type WAVE_W<'a, const O: u8> =
726    crate::BitWriter<'a, u32, WAVEFORM_CMR_ALT_SPEC, WAVESELECT_A, O>;
727impl<'a, const O: u8> WAVE_W<'a, O> {
728    #[doc = "Waveform Mode is disabled (Capture Mode is enabled)."]
729    #[inline(always)]
730    pub fn _0(self) -> &'a mut W {
731        self.variant(WAVESELECT_A::_0)
732    }
733    #[doc = "Waveform Mode is enabled."]
734    #[inline(always)]
735    pub fn _1(self) -> &'a mut W {
736        self.variant(WAVESELECT_A::_1)
737    }
738}
739#[doc = "Field `ACPA` reader - RA Compare Effect on TIOA"]
740pub type ACPA_R = crate::FieldReader<u8, ACPASELECT_A>;
741#[doc = "RA Compare Effect on TIOA\n\nValue on reset: 0"]
742#[derive(Clone, Copy, Debug, PartialEq, Eq)]
743#[repr(u8)]
744pub enum ACPASELECT_A {
745    #[doc = "0: none"]
746    NONE = 0,
747    #[doc = "1: set"]
748    SET = 1,
749    #[doc = "2: clear"]
750    CLEAR = 2,
751    #[doc = "3: toggle"]
752    TOGGLE = 3,
753}
754impl From<ACPASELECT_A> for u8 {
755    #[inline(always)]
756    fn from(variant: ACPASELECT_A) -> Self {
757        variant as _
758    }
759}
760impl ACPA_R {
761    #[doc = "Get enumerated values variant"]
762    #[inline(always)]
763    pub fn variant(&self) -> ACPASELECT_A {
764        match self.bits {
765            0 => ACPASELECT_A::NONE,
766            1 => ACPASELECT_A::SET,
767            2 => ACPASELECT_A::CLEAR,
768            3 => ACPASELECT_A::TOGGLE,
769            _ => unreachable!(),
770        }
771    }
772    #[doc = "Checks if the value of the field is `NONE`"]
773    #[inline(always)]
774    pub fn is_none(&self) -> bool {
775        *self == ACPASELECT_A::NONE
776    }
777    #[doc = "Checks if the value of the field is `SET`"]
778    #[inline(always)]
779    pub fn is_set(&self) -> bool {
780        *self == ACPASELECT_A::SET
781    }
782    #[doc = "Checks if the value of the field is `CLEAR`"]
783    #[inline(always)]
784    pub fn is_clear(&self) -> bool {
785        *self == ACPASELECT_A::CLEAR
786    }
787    #[doc = "Checks if the value of the field is `TOGGLE`"]
788    #[inline(always)]
789    pub fn is_toggle(&self) -> bool {
790        *self == ACPASELECT_A::TOGGLE
791    }
792}
793#[doc = "Field `ACPA` writer - RA Compare Effect on TIOA"]
794pub type ACPA_W<'a, const O: u8> =
795    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, ACPASELECT_A, 2, O>;
796impl<'a, const O: u8> ACPA_W<'a, O> {
797    #[doc = "none"]
798    #[inline(always)]
799    pub fn none(self) -> &'a mut W {
800        self.variant(ACPASELECT_A::NONE)
801    }
802    #[doc = "set"]
803    #[inline(always)]
804    pub fn set(self) -> &'a mut W {
805        self.variant(ACPASELECT_A::SET)
806    }
807    #[doc = "clear"]
808    #[inline(always)]
809    pub fn clear(self) -> &'a mut W {
810        self.variant(ACPASELECT_A::CLEAR)
811    }
812    #[doc = "toggle"]
813    #[inline(always)]
814    pub fn toggle(self) -> &'a mut W {
815        self.variant(ACPASELECT_A::TOGGLE)
816    }
817}
818#[doc = "Field `ACPC` reader - RC Compare Effect on TIOA"]
819pub type ACPC_R = crate::FieldReader<u8, ACPCSELECT_A>;
820#[doc = "RC Compare Effect on TIOA\n\nValue on reset: 0"]
821#[derive(Clone, Copy, Debug, PartialEq, Eq)]
822#[repr(u8)]
823pub enum ACPCSELECT_A {
824    #[doc = "0: none"]
825    NONE = 0,
826    #[doc = "1: set"]
827    SET = 1,
828    #[doc = "2: clear"]
829    CLEAR = 2,
830    #[doc = "3: toggle"]
831    TOGGLE = 3,
832}
833impl From<ACPCSELECT_A> for u8 {
834    #[inline(always)]
835    fn from(variant: ACPCSELECT_A) -> Self {
836        variant as _
837    }
838}
839impl ACPC_R {
840    #[doc = "Get enumerated values variant"]
841    #[inline(always)]
842    pub fn variant(&self) -> ACPCSELECT_A {
843        match self.bits {
844            0 => ACPCSELECT_A::NONE,
845            1 => ACPCSELECT_A::SET,
846            2 => ACPCSELECT_A::CLEAR,
847            3 => ACPCSELECT_A::TOGGLE,
848            _ => unreachable!(),
849        }
850    }
851    #[doc = "Checks if the value of the field is `NONE`"]
852    #[inline(always)]
853    pub fn is_none(&self) -> bool {
854        *self == ACPCSELECT_A::NONE
855    }
856    #[doc = "Checks if the value of the field is `SET`"]
857    #[inline(always)]
858    pub fn is_set(&self) -> bool {
859        *self == ACPCSELECT_A::SET
860    }
861    #[doc = "Checks if the value of the field is `CLEAR`"]
862    #[inline(always)]
863    pub fn is_clear(&self) -> bool {
864        *self == ACPCSELECT_A::CLEAR
865    }
866    #[doc = "Checks if the value of the field is `TOGGLE`"]
867    #[inline(always)]
868    pub fn is_toggle(&self) -> bool {
869        *self == ACPCSELECT_A::TOGGLE
870    }
871}
872#[doc = "Field `ACPC` writer - RC Compare Effect on TIOA"]
873pub type ACPC_W<'a, const O: u8> =
874    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, ACPCSELECT_A, 2, O>;
875impl<'a, const O: u8> ACPC_W<'a, O> {
876    #[doc = "none"]
877    #[inline(always)]
878    pub fn none(self) -> &'a mut W {
879        self.variant(ACPCSELECT_A::NONE)
880    }
881    #[doc = "set"]
882    #[inline(always)]
883    pub fn set(self) -> &'a mut W {
884        self.variant(ACPCSELECT_A::SET)
885    }
886    #[doc = "clear"]
887    #[inline(always)]
888    pub fn clear(self) -> &'a mut W {
889        self.variant(ACPCSELECT_A::CLEAR)
890    }
891    #[doc = "toggle"]
892    #[inline(always)]
893    pub fn toggle(self) -> &'a mut W {
894        self.variant(ACPCSELECT_A::TOGGLE)
895    }
896}
897#[doc = "Field `AEEVT` reader - External Event Effect on TIOA"]
898pub type AEEVT_R = crate::FieldReader<u8, AEEVTSELECT_A>;
899#[doc = "External Event Effect on TIOA\n\nValue on reset: 0"]
900#[derive(Clone, Copy, Debug, PartialEq, Eq)]
901#[repr(u8)]
902pub enum AEEVTSELECT_A {
903    #[doc = "0: none"]
904    NONE = 0,
905    #[doc = "1: set"]
906    SET = 1,
907    #[doc = "2: clear"]
908    CLEAR = 2,
909    #[doc = "3: toggle"]
910    TOGGLE = 3,
911}
912impl From<AEEVTSELECT_A> for u8 {
913    #[inline(always)]
914    fn from(variant: AEEVTSELECT_A) -> Self {
915        variant as _
916    }
917}
918impl AEEVT_R {
919    #[doc = "Get enumerated values variant"]
920    #[inline(always)]
921    pub fn variant(&self) -> AEEVTSELECT_A {
922        match self.bits {
923            0 => AEEVTSELECT_A::NONE,
924            1 => AEEVTSELECT_A::SET,
925            2 => AEEVTSELECT_A::CLEAR,
926            3 => AEEVTSELECT_A::TOGGLE,
927            _ => unreachable!(),
928        }
929    }
930    #[doc = "Checks if the value of the field is `NONE`"]
931    #[inline(always)]
932    pub fn is_none(&self) -> bool {
933        *self == AEEVTSELECT_A::NONE
934    }
935    #[doc = "Checks if the value of the field is `SET`"]
936    #[inline(always)]
937    pub fn is_set(&self) -> bool {
938        *self == AEEVTSELECT_A::SET
939    }
940    #[doc = "Checks if the value of the field is `CLEAR`"]
941    #[inline(always)]
942    pub fn is_clear(&self) -> bool {
943        *self == AEEVTSELECT_A::CLEAR
944    }
945    #[doc = "Checks if the value of the field is `TOGGLE`"]
946    #[inline(always)]
947    pub fn is_toggle(&self) -> bool {
948        *self == AEEVTSELECT_A::TOGGLE
949    }
950}
951#[doc = "Field `AEEVT` writer - External Event Effect on TIOA"]
952pub type AEEVT_W<'a, const O: u8> =
953    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, AEEVTSELECT_A, 2, O>;
954impl<'a, const O: u8> AEEVT_W<'a, O> {
955    #[doc = "none"]
956    #[inline(always)]
957    pub fn none(self) -> &'a mut W {
958        self.variant(AEEVTSELECT_A::NONE)
959    }
960    #[doc = "set"]
961    #[inline(always)]
962    pub fn set(self) -> &'a mut W {
963        self.variant(AEEVTSELECT_A::SET)
964    }
965    #[doc = "clear"]
966    #[inline(always)]
967    pub fn clear(self) -> &'a mut W {
968        self.variant(AEEVTSELECT_A::CLEAR)
969    }
970    #[doc = "toggle"]
971    #[inline(always)]
972    pub fn toggle(self) -> &'a mut W {
973        self.variant(AEEVTSELECT_A::TOGGLE)
974    }
975}
976#[doc = "Field `ASWTRG` reader - Software Trigger Effect on TIOA"]
977pub type ASWTRG_R = crate::FieldReader<u8, ASWTRGSELECT_A>;
978#[doc = "Software Trigger Effect on TIOA\n\nValue on reset: 0"]
979#[derive(Clone, Copy, Debug, PartialEq, Eq)]
980#[repr(u8)]
981pub enum ASWTRGSELECT_A {
982    #[doc = "0: none"]
983    NONE = 0,
984    #[doc = "1: set"]
985    SET = 1,
986    #[doc = "2: clear"]
987    CLEAR = 2,
988    #[doc = "3: toggle"]
989    TOGGLE = 3,
990}
991impl From<ASWTRGSELECT_A> for u8 {
992    #[inline(always)]
993    fn from(variant: ASWTRGSELECT_A) -> Self {
994        variant as _
995    }
996}
997impl ASWTRG_R {
998    #[doc = "Get enumerated values variant"]
999    #[inline(always)]
1000    pub fn variant(&self) -> ASWTRGSELECT_A {
1001        match self.bits {
1002            0 => ASWTRGSELECT_A::NONE,
1003            1 => ASWTRGSELECT_A::SET,
1004            2 => ASWTRGSELECT_A::CLEAR,
1005            3 => ASWTRGSELECT_A::TOGGLE,
1006            _ => unreachable!(),
1007        }
1008    }
1009    #[doc = "Checks if the value of the field is `NONE`"]
1010    #[inline(always)]
1011    pub fn is_none(&self) -> bool {
1012        *self == ASWTRGSELECT_A::NONE
1013    }
1014    #[doc = "Checks if the value of the field is `SET`"]
1015    #[inline(always)]
1016    pub fn is_set(&self) -> bool {
1017        *self == ASWTRGSELECT_A::SET
1018    }
1019    #[doc = "Checks if the value of the field is `CLEAR`"]
1020    #[inline(always)]
1021    pub fn is_clear(&self) -> bool {
1022        *self == ASWTRGSELECT_A::CLEAR
1023    }
1024    #[doc = "Checks if the value of the field is `TOGGLE`"]
1025    #[inline(always)]
1026    pub fn is_toggle(&self) -> bool {
1027        *self == ASWTRGSELECT_A::TOGGLE
1028    }
1029}
1030#[doc = "Field `ASWTRG` writer - Software Trigger Effect on TIOA"]
1031pub type ASWTRG_W<'a, const O: u8> =
1032    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, ASWTRGSELECT_A, 2, O>;
1033impl<'a, const O: u8> ASWTRG_W<'a, O> {
1034    #[doc = "none"]
1035    #[inline(always)]
1036    pub fn none(self) -> &'a mut W {
1037        self.variant(ASWTRGSELECT_A::NONE)
1038    }
1039    #[doc = "set"]
1040    #[inline(always)]
1041    pub fn set(self) -> &'a mut W {
1042        self.variant(ASWTRGSELECT_A::SET)
1043    }
1044    #[doc = "clear"]
1045    #[inline(always)]
1046    pub fn clear(self) -> &'a mut W {
1047        self.variant(ASWTRGSELECT_A::CLEAR)
1048    }
1049    #[doc = "toggle"]
1050    #[inline(always)]
1051    pub fn toggle(self) -> &'a mut W {
1052        self.variant(ASWTRGSELECT_A::TOGGLE)
1053    }
1054}
1055#[doc = "Field `BCPB` reader - RB Compare Effect on TIOB"]
1056pub type BCPB_R = crate::FieldReader<u8, BCPBSELECT_A>;
1057#[doc = "RB Compare Effect on TIOB\n\nValue on reset: 0"]
1058#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1059#[repr(u8)]
1060pub enum BCPBSELECT_A {
1061    #[doc = "0: none"]
1062    NONE = 0,
1063    #[doc = "1: set"]
1064    SET = 1,
1065    #[doc = "2: clear"]
1066    CLEAR = 2,
1067    #[doc = "3: toggle"]
1068    TOGGLE = 3,
1069}
1070impl From<BCPBSELECT_A> for u8 {
1071    #[inline(always)]
1072    fn from(variant: BCPBSELECT_A) -> Self {
1073        variant as _
1074    }
1075}
1076impl BCPB_R {
1077    #[doc = "Get enumerated values variant"]
1078    #[inline(always)]
1079    pub fn variant(&self) -> BCPBSELECT_A {
1080        match self.bits {
1081            0 => BCPBSELECT_A::NONE,
1082            1 => BCPBSELECT_A::SET,
1083            2 => BCPBSELECT_A::CLEAR,
1084            3 => BCPBSELECT_A::TOGGLE,
1085            _ => unreachable!(),
1086        }
1087    }
1088    #[doc = "Checks if the value of the field is `NONE`"]
1089    #[inline(always)]
1090    pub fn is_none(&self) -> bool {
1091        *self == BCPBSELECT_A::NONE
1092    }
1093    #[doc = "Checks if the value of the field is `SET`"]
1094    #[inline(always)]
1095    pub fn is_set(&self) -> bool {
1096        *self == BCPBSELECT_A::SET
1097    }
1098    #[doc = "Checks if the value of the field is `CLEAR`"]
1099    #[inline(always)]
1100    pub fn is_clear(&self) -> bool {
1101        *self == BCPBSELECT_A::CLEAR
1102    }
1103    #[doc = "Checks if the value of the field is `TOGGLE`"]
1104    #[inline(always)]
1105    pub fn is_toggle(&self) -> bool {
1106        *self == BCPBSELECT_A::TOGGLE
1107    }
1108}
1109#[doc = "Field `BCPB` writer - RB Compare Effect on TIOB"]
1110pub type BCPB_W<'a, const O: u8> =
1111    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, BCPBSELECT_A, 2, O>;
1112impl<'a, const O: u8> BCPB_W<'a, O> {
1113    #[doc = "none"]
1114    #[inline(always)]
1115    pub fn none(self) -> &'a mut W {
1116        self.variant(BCPBSELECT_A::NONE)
1117    }
1118    #[doc = "set"]
1119    #[inline(always)]
1120    pub fn set(self) -> &'a mut W {
1121        self.variant(BCPBSELECT_A::SET)
1122    }
1123    #[doc = "clear"]
1124    #[inline(always)]
1125    pub fn clear(self) -> &'a mut W {
1126        self.variant(BCPBSELECT_A::CLEAR)
1127    }
1128    #[doc = "toggle"]
1129    #[inline(always)]
1130    pub fn toggle(self) -> &'a mut W {
1131        self.variant(BCPBSELECT_A::TOGGLE)
1132    }
1133}
1134#[doc = "Field `BCPC` reader - RC Compare Effect on TIOB"]
1135pub type BCPC_R = crate::FieldReader<u8, BCPCSELECT_A>;
1136#[doc = "RC Compare Effect on TIOB\n\nValue on reset: 0"]
1137#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1138#[repr(u8)]
1139pub enum BCPCSELECT_A {
1140    #[doc = "0: none"]
1141    NONE = 0,
1142    #[doc = "1: set"]
1143    SET = 1,
1144    #[doc = "2: clear"]
1145    CLEAR = 2,
1146    #[doc = "3: toggle"]
1147    TOGGLE = 3,
1148}
1149impl From<BCPCSELECT_A> for u8 {
1150    #[inline(always)]
1151    fn from(variant: BCPCSELECT_A) -> Self {
1152        variant as _
1153    }
1154}
1155impl BCPC_R {
1156    #[doc = "Get enumerated values variant"]
1157    #[inline(always)]
1158    pub fn variant(&self) -> BCPCSELECT_A {
1159        match self.bits {
1160            0 => BCPCSELECT_A::NONE,
1161            1 => BCPCSELECT_A::SET,
1162            2 => BCPCSELECT_A::CLEAR,
1163            3 => BCPCSELECT_A::TOGGLE,
1164            _ => unreachable!(),
1165        }
1166    }
1167    #[doc = "Checks if the value of the field is `NONE`"]
1168    #[inline(always)]
1169    pub fn is_none(&self) -> bool {
1170        *self == BCPCSELECT_A::NONE
1171    }
1172    #[doc = "Checks if the value of the field is `SET`"]
1173    #[inline(always)]
1174    pub fn is_set(&self) -> bool {
1175        *self == BCPCSELECT_A::SET
1176    }
1177    #[doc = "Checks if the value of the field is `CLEAR`"]
1178    #[inline(always)]
1179    pub fn is_clear(&self) -> bool {
1180        *self == BCPCSELECT_A::CLEAR
1181    }
1182    #[doc = "Checks if the value of the field is `TOGGLE`"]
1183    #[inline(always)]
1184    pub fn is_toggle(&self) -> bool {
1185        *self == BCPCSELECT_A::TOGGLE
1186    }
1187}
1188#[doc = "Field `BCPC` writer - RC Compare Effect on TIOB"]
1189pub type BCPC_W<'a, const O: u8> =
1190    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, BCPCSELECT_A, 2, O>;
1191impl<'a, const O: u8> BCPC_W<'a, O> {
1192    #[doc = "none"]
1193    #[inline(always)]
1194    pub fn none(self) -> &'a mut W {
1195        self.variant(BCPCSELECT_A::NONE)
1196    }
1197    #[doc = "set"]
1198    #[inline(always)]
1199    pub fn set(self) -> &'a mut W {
1200        self.variant(BCPCSELECT_A::SET)
1201    }
1202    #[doc = "clear"]
1203    #[inline(always)]
1204    pub fn clear(self) -> &'a mut W {
1205        self.variant(BCPCSELECT_A::CLEAR)
1206    }
1207    #[doc = "toggle"]
1208    #[inline(always)]
1209    pub fn toggle(self) -> &'a mut W {
1210        self.variant(BCPCSELECT_A::TOGGLE)
1211    }
1212}
1213#[doc = "Field `BEEVT` reader - External Event Effect on TIOB"]
1214pub type BEEVT_R = crate::FieldReader<u8, BEEVTSELECT_A>;
1215#[doc = "External Event Effect on TIOB\n\nValue on reset: 0"]
1216#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1217#[repr(u8)]
1218pub enum BEEVTSELECT_A {
1219    #[doc = "0: none"]
1220    NONE = 0,
1221    #[doc = "1: set"]
1222    SET = 1,
1223    #[doc = "2: clear"]
1224    CLEAR = 2,
1225    #[doc = "3: toggle"]
1226    TOGGLE = 3,
1227}
1228impl From<BEEVTSELECT_A> for u8 {
1229    #[inline(always)]
1230    fn from(variant: BEEVTSELECT_A) -> Self {
1231        variant as _
1232    }
1233}
1234impl BEEVT_R {
1235    #[doc = "Get enumerated values variant"]
1236    #[inline(always)]
1237    pub fn variant(&self) -> BEEVTSELECT_A {
1238        match self.bits {
1239            0 => BEEVTSELECT_A::NONE,
1240            1 => BEEVTSELECT_A::SET,
1241            2 => BEEVTSELECT_A::CLEAR,
1242            3 => BEEVTSELECT_A::TOGGLE,
1243            _ => unreachable!(),
1244        }
1245    }
1246    #[doc = "Checks if the value of the field is `NONE`"]
1247    #[inline(always)]
1248    pub fn is_none(&self) -> bool {
1249        *self == BEEVTSELECT_A::NONE
1250    }
1251    #[doc = "Checks if the value of the field is `SET`"]
1252    #[inline(always)]
1253    pub fn is_set(&self) -> bool {
1254        *self == BEEVTSELECT_A::SET
1255    }
1256    #[doc = "Checks if the value of the field is `CLEAR`"]
1257    #[inline(always)]
1258    pub fn is_clear(&self) -> bool {
1259        *self == BEEVTSELECT_A::CLEAR
1260    }
1261    #[doc = "Checks if the value of the field is `TOGGLE`"]
1262    #[inline(always)]
1263    pub fn is_toggle(&self) -> bool {
1264        *self == BEEVTSELECT_A::TOGGLE
1265    }
1266}
1267#[doc = "Field `BEEVT` writer - External Event Effect on TIOB"]
1268pub type BEEVT_W<'a, const O: u8> =
1269    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, BEEVTSELECT_A, 2, O>;
1270impl<'a, const O: u8> BEEVT_W<'a, O> {
1271    #[doc = "none"]
1272    #[inline(always)]
1273    pub fn none(self) -> &'a mut W {
1274        self.variant(BEEVTSELECT_A::NONE)
1275    }
1276    #[doc = "set"]
1277    #[inline(always)]
1278    pub fn set(self) -> &'a mut W {
1279        self.variant(BEEVTSELECT_A::SET)
1280    }
1281    #[doc = "clear"]
1282    #[inline(always)]
1283    pub fn clear(self) -> &'a mut W {
1284        self.variant(BEEVTSELECT_A::CLEAR)
1285    }
1286    #[doc = "toggle"]
1287    #[inline(always)]
1288    pub fn toggle(self) -> &'a mut W {
1289        self.variant(BEEVTSELECT_A::TOGGLE)
1290    }
1291}
1292#[doc = "Field `BSWTRG` reader - Software Trigger Effect on TIOB"]
1293pub type BSWTRG_R = crate::FieldReader<u8, BSWTRGSELECT_A>;
1294#[doc = "Software Trigger Effect on TIOB\n\nValue on reset: 0"]
1295#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1296#[repr(u8)]
1297pub enum BSWTRGSELECT_A {
1298    #[doc = "0: none"]
1299    NONE = 0,
1300    #[doc = "1: set"]
1301    SET = 1,
1302    #[doc = "2: clear"]
1303    CLEAR = 2,
1304    #[doc = "3: toggle"]
1305    TOGGLE = 3,
1306}
1307impl From<BSWTRGSELECT_A> for u8 {
1308    #[inline(always)]
1309    fn from(variant: BSWTRGSELECT_A) -> Self {
1310        variant as _
1311    }
1312}
1313impl BSWTRG_R {
1314    #[doc = "Get enumerated values variant"]
1315    #[inline(always)]
1316    pub fn variant(&self) -> BSWTRGSELECT_A {
1317        match self.bits {
1318            0 => BSWTRGSELECT_A::NONE,
1319            1 => BSWTRGSELECT_A::SET,
1320            2 => BSWTRGSELECT_A::CLEAR,
1321            3 => BSWTRGSELECT_A::TOGGLE,
1322            _ => unreachable!(),
1323        }
1324    }
1325    #[doc = "Checks if the value of the field is `NONE`"]
1326    #[inline(always)]
1327    pub fn is_none(&self) -> bool {
1328        *self == BSWTRGSELECT_A::NONE
1329    }
1330    #[doc = "Checks if the value of the field is `SET`"]
1331    #[inline(always)]
1332    pub fn is_set(&self) -> bool {
1333        *self == BSWTRGSELECT_A::SET
1334    }
1335    #[doc = "Checks if the value of the field is `CLEAR`"]
1336    #[inline(always)]
1337    pub fn is_clear(&self) -> bool {
1338        *self == BSWTRGSELECT_A::CLEAR
1339    }
1340    #[doc = "Checks if the value of the field is `TOGGLE`"]
1341    #[inline(always)]
1342    pub fn is_toggle(&self) -> bool {
1343        *self == BSWTRGSELECT_A::TOGGLE
1344    }
1345}
1346#[doc = "Field `BSWTRG` writer - Software Trigger Effect on TIOB"]
1347pub type BSWTRG_W<'a, const O: u8> =
1348    crate::FieldWriterSafe<'a, u32, WAVEFORM_CMR_ALT_SPEC, u8, BSWTRGSELECT_A, 2, O>;
1349impl<'a, const O: u8> BSWTRG_W<'a, O> {
1350    #[doc = "none"]
1351    #[inline(always)]
1352    pub fn none(self) -> &'a mut W {
1353        self.variant(BSWTRGSELECT_A::NONE)
1354    }
1355    #[doc = "set"]
1356    #[inline(always)]
1357    pub fn set(self) -> &'a mut W {
1358        self.variant(BSWTRGSELECT_A::SET)
1359    }
1360    #[doc = "clear"]
1361    #[inline(always)]
1362    pub fn clear(self) -> &'a mut W {
1363        self.variant(BSWTRGSELECT_A::CLEAR)
1364    }
1365    #[doc = "toggle"]
1366    #[inline(always)]
1367    pub fn toggle(self) -> &'a mut W {
1368        self.variant(BSWTRGSELECT_A::TOGGLE)
1369    }
1370}
1371impl R {
1372    #[doc = "Bits 0:2 - Clock Selection"]
1373    #[inline(always)]
1374    pub fn tcclks(&self) -> TCCLKS_R {
1375        TCCLKS_R::new((self.bits & 7) as u8)
1376    }
1377    #[doc = "Bit 3 - Clock Invert"]
1378    #[inline(always)]
1379    pub fn clki(&self) -> CLKI_R {
1380        CLKI_R::new(((self.bits >> 3) & 1) != 0)
1381    }
1382    #[doc = "Bits 4:5 - Burst Signal Selection"]
1383    #[inline(always)]
1384    pub fn burst(&self) -> BURST_R {
1385        BURST_R::new(((self.bits >> 4) & 3) as u8)
1386    }
1387    #[doc = "Bit 6 - Counter Clock Stopped with RC Compare"]
1388    #[inline(always)]
1389    pub fn cpcstop(&self) -> CPCSTOP_R {
1390        CPCSTOP_R::new(((self.bits >> 6) & 1) != 0)
1391    }
1392    #[doc = "Bit 7 - Counter Clock Disable with RC Compare"]
1393    #[inline(always)]
1394    pub fn cpcdis(&self) -> CPCDIS_R {
1395        CPCDIS_R::new(((self.bits >> 7) & 1) != 0)
1396    }
1397    #[doc = "Bits 8:9 - External Event Edge Selection"]
1398    #[inline(always)]
1399    pub fn eevtedg(&self) -> EEVTEDG_R {
1400        EEVTEDG_R::new(((self.bits >> 8) & 3) as u8)
1401    }
1402    #[doc = "Bits 10:11 - External Event Selection"]
1403    #[inline(always)]
1404    pub fn eevt(&self) -> EEVT_R {
1405        EEVT_R::new(((self.bits >> 10) & 3) as u8)
1406    }
1407    #[doc = "Bit 12 - External Event Trigger Enable"]
1408    #[inline(always)]
1409    pub fn enetrg(&self) -> ENETRG_R {
1410        ENETRG_R::new(((self.bits >> 12) & 1) != 0)
1411    }
1412    #[doc = "Bits 13:14 - Waveform Selection"]
1413    #[inline(always)]
1414    pub fn wavsel(&self) -> WAVSEL_R {
1415        WAVSEL_R::new(((self.bits >> 13) & 3) as u8)
1416    }
1417    #[doc = "Bit 15 - WAVE"]
1418    #[inline(always)]
1419    pub fn wave(&self) -> WAVE_R {
1420        WAVE_R::new(((self.bits >> 15) & 1) != 0)
1421    }
1422    #[doc = "Bits 16:17 - RA Compare Effect on TIOA"]
1423    #[inline(always)]
1424    pub fn acpa(&self) -> ACPA_R {
1425        ACPA_R::new(((self.bits >> 16) & 3) as u8)
1426    }
1427    #[doc = "Bits 18:19 - RC Compare Effect on TIOA"]
1428    #[inline(always)]
1429    pub fn acpc(&self) -> ACPC_R {
1430        ACPC_R::new(((self.bits >> 18) & 3) as u8)
1431    }
1432    #[doc = "Bits 20:21 - External Event Effect on TIOA"]
1433    #[inline(always)]
1434    pub fn aeevt(&self) -> AEEVT_R {
1435        AEEVT_R::new(((self.bits >> 20) & 3) as u8)
1436    }
1437    #[doc = "Bits 22:23 - Software Trigger Effect on TIOA"]
1438    #[inline(always)]
1439    pub fn aswtrg(&self) -> ASWTRG_R {
1440        ASWTRG_R::new(((self.bits >> 22) & 3) as u8)
1441    }
1442    #[doc = "Bits 24:25 - RB Compare Effect on TIOB"]
1443    #[inline(always)]
1444    pub fn bcpb(&self) -> BCPB_R {
1445        BCPB_R::new(((self.bits >> 24) & 3) as u8)
1446    }
1447    #[doc = "Bits 26:27 - RC Compare Effect on TIOB"]
1448    #[inline(always)]
1449    pub fn bcpc(&self) -> BCPC_R {
1450        BCPC_R::new(((self.bits >> 26) & 3) as u8)
1451    }
1452    #[doc = "Bits 28:29 - External Event Effect on TIOB"]
1453    #[inline(always)]
1454    pub fn beevt(&self) -> BEEVT_R {
1455        BEEVT_R::new(((self.bits >> 28) & 3) as u8)
1456    }
1457    #[doc = "Bits 30:31 - Software Trigger Effect on TIOB"]
1458    #[inline(always)]
1459    pub fn bswtrg(&self) -> BSWTRG_R {
1460        BSWTRG_R::new(((self.bits >> 30) & 3) as u8)
1461    }
1462}
1463impl W {
1464    #[doc = "Bits 0:2 - Clock Selection"]
1465    #[inline(always)]
1466    #[must_use]
1467    pub fn tcclks(&mut self) -> TCCLKS_W<0> {
1468        TCCLKS_W::new(self)
1469    }
1470    #[doc = "Bit 3 - Clock Invert"]
1471    #[inline(always)]
1472    #[must_use]
1473    pub fn clki(&mut self) -> CLKI_W<3> {
1474        CLKI_W::new(self)
1475    }
1476    #[doc = "Bits 4:5 - Burst Signal Selection"]
1477    #[inline(always)]
1478    #[must_use]
1479    pub fn burst(&mut self) -> BURST_W<4> {
1480        BURST_W::new(self)
1481    }
1482    #[doc = "Bit 6 - Counter Clock Stopped with RC Compare"]
1483    #[inline(always)]
1484    #[must_use]
1485    pub fn cpcstop(&mut self) -> CPCSTOP_W<6> {
1486        CPCSTOP_W::new(self)
1487    }
1488    #[doc = "Bit 7 - Counter Clock Disable with RC Compare"]
1489    #[inline(always)]
1490    #[must_use]
1491    pub fn cpcdis(&mut self) -> CPCDIS_W<7> {
1492        CPCDIS_W::new(self)
1493    }
1494    #[doc = "Bits 8:9 - External Event Edge Selection"]
1495    #[inline(always)]
1496    #[must_use]
1497    pub fn eevtedg(&mut self) -> EEVTEDG_W<8> {
1498        EEVTEDG_W::new(self)
1499    }
1500    #[doc = "Bits 10:11 - External Event Selection"]
1501    #[inline(always)]
1502    #[must_use]
1503    pub fn eevt(&mut self) -> EEVT_W<10> {
1504        EEVT_W::new(self)
1505    }
1506    #[doc = "Bit 12 - External Event Trigger Enable"]
1507    #[inline(always)]
1508    #[must_use]
1509    pub fn enetrg(&mut self) -> ENETRG_W<12> {
1510        ENETRG_W::new(self)
1511    }
1512    #[doc = "Bits 13:14 - Waveform Selection"]
1513    #[inline(always)]
1514    #[must_use]
1515    pub fn wavsel(&mut self) -> WAVSEL_W<13> {
1516        WAVSEL_W::new(self)
1517    }
1518    #[doc = "Bit 15 - WAVE"]
1519    #[inline(always)]
1520    #[must_use]
1521    pub fn wave(&mut self) -> WAVE_W<15> {
1522        WAVE_W::new(self)
1523    }
1524    #[doc = "Bits 16:17 - RA Compare Effect on TIOA"]
1525    #[inline(always)]
1526    #[must_use]
1527    pub fn acpa(&mut self) -> ACPA_W<16> {
1528        ACPA_W::new(self)
1529    }
1530    #[doc = "Bits 18:19 - RC Compare Effect on TIOA"]
1531    #[inline(always)]
1532    #[must_use]
1533    pub fn acpc(&mut self) -> ACPC_W<18> {
1534        ACPC_W::new(self)
1535    }
1536    #[doc = "Bits 20:21 - External Event Effect on TIOA"]
1537    #[inline(always)]
1538    #[must_use]
1539    pub fn aeevt(&mut self) -> AEEVT_W<20> {
1540        AEEVT_W::new(self)
1541    }
1542    #[doc = "Bits 22:23 - Software Trigger Effect on TIOA"]
1543    #[inline(always)]
1544    #[must_use]
1545    pub fn aswtrg(&mut self) -> ASWTRG_W<22> {
1546        ASWTRG_W::new(self)
1547    }
1548    #[doc = "Bits 24:25 - RB Compare Effect on TIOB"]
1549    #[inline(always)]
1550    #[must_use]
1551    pub fn bcpb(&mut self) -> BCPB_W<24> {
1552        BCPB_W::new(self)
1553    }
1554    #[doc = "Bits 26:27 - RC Compare Effect on TIOB"]
1555    #[inline(always)]
1556    #[must_use]
1557    pub fn bcpc(&mut self) -> BCPC_W<26> {
1558        BCPC_W::new(self)
1559    }
1560    #[doc = "Bits 28:29 - External Event Effect on TIOB"]
1561    #[inline(always)]
1562    #[must_use]
1563    pub fn beevt(&mut self) -> BEEVT_W<28> {
1564        BEEVT_W::new(self)
1565    }
1566    #[doc = "Bits 30:31 - Software Trigger Effect on TIOB"]
1567    #[inline(always)]
1568    #[must_use]
1569    pub fn bswtrg(&mut self) -> BSWTRG_W<30> {
1570        BSWTRG_W::new(self)
1571    }
1572    #[doc = "Writes raw bits to the register."]
1573    #[inline(always)]
1574    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1575        self.0.bits(bits);
1576        self
1577    }
1578}
1579#[doc = "Channel Mode Register Channel\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 [waveform_cmr_alt](index.html) module"]
1580pub struct WAVEFORM_CMR_ALT_SPEC;
1581impl crate::RegisterSpec for WAVEFORM_CMR_ALT_SPEC {
1582    type Ux = u32;
1583}
1584#[doc = "`read()` method returns [waveform_cmr_alt::R](R) reader structure"]
1585impl crate::Readable for WAVEFORM_CMR_ALT_SPEC {
1586    type Reader = R;
1587}
1588#[doc = "`write(|w| ..)` method takes [waveform_cmr_alt::W](W) writer structure"]
1589impl crate::Writable for WAVEFORM_CMR_ALT_SPEC {
1590    type Writer = W;
1591    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1592    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1593}
1594#[doc = "`reset()` method sets CMR%s_ALT to value 0"]
1595impl crate::Resettable for WAVEFORM_CMR_ALT_SPEC {
1596    const RESET_VALUE: Self::Ux = 0;
1597}