ambiq_apollo1_pac/ctimer/
ctrl1.rs

1#[doc = "Reader of register CTRL1"]
2pub type R = crate::R<u32, super::CTRL1>;
3#[doc = "Writer for register CTRL1"]
4pub type W = crate::W<u32, super::CTRL1>;
5#[doc = "Register CTRL1 `reset()`'s with value 0"]
6impl crate::ResetValue for super::CTRL1 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Counter/Timer A1/B1 Link bit.\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum CTLINK1_A {
16    #[doc = "0: Use A0/B0 timers as two independent 16-bit timers (default)."]
17    TWO_16BIT_TIMERS = 0,
18    #[doc = "1: Link A1/B1 timers into a single 32-bit timer."]
19    _32BIT_TIMER = 1,
20}
21impl From<CTLINK1_A> for bool {
22    #[inline(always)]
23    fn from(variant: CTLINK1_A) -> Self {
24        variant as u8 != 0
25    }
26}
27#[doc = "Reader of field `CTLINK1`"]
28pub type CTLINK1_R = crate::R<bool, CTLINK1_A>;
29impl CTLINK1_R {
30    #[doc = r"Get enumerated values variant"]
31    #[inline(always)]
32    pub fn variant(&self) -> CTLINK1_A {
33        match self.bits {
34            false => CTLINK1_A::TWO_16BIT_TIMERS,
35            true => CTLINK1_A::_32BIT_TIMER,
36        }
37    }
38    #[doc = "Checks if the value of the field is `TWO_16BIT_TIMERS`"]
39    #[inline(always)]
40    pub fn is_two_16bit_timers(&self) -> bool {
41        *self == CTLINK1_A::TWO_16BIT_TIMERS
42    }
43    #[doc = "Checks if the value of the field is `_32BIT_TIMER`"]
44    #[inline(always)]
45    pub fn is_32bit_timer(&self) -> bool {
46        *self == CTLINK1_A::_32BIT_TIMER
47    }
48}
49#[doc = "Write proxy for field `CTLINK1`"]
50pub struct CTLINK1_W<'a> {
51    w: &'a mut W,
52}
53impl<'a> CTLINK1_W<'a> {
54    #[doc = r"Writes `variant` to the field"]
55    #[inline(always)]
56    pub fn variant(self, variant: CTLINK1_A) -> &'a mut W {
57        {
58            self.bit(variant.into())
59        }
60    }
61    #[doc = "Use A0/B0 timers as two independent 16-bit timers (default)."]
62    #[inline(always)]
63    pub fn two_16bit_timers(self) -> &'a mut W {
64        self.variant(CTLINK1_A::TWO_16BIT_TIMERS)
65    }
66    #[doc = "Link A1/B1 timers into a single 32-bit timer."]
67    #[inline(always)]
68    pub fn _32bit_timer(self) -> &'a mut W {
69        self.variant(CTLINK1_A::_32BIT_TIMER)
70    }
71    #[doc = r"Sets the field bit"]
72    #[inline(always)]
73    pub fn set_bit(self) -> &'a mut W {
74        self.bit(true)
75    }
76    #[doc = r"Clears the field bit"]
77    #[inline(always)]
78    pub fn clear_bit(self) -> &'a mut W {
79        self.bit(false)
80    }
81    #[doc = r"Writes raw bits to the field"]
82    #[inline(always)]
83    pub fn bit(self, value: bool) -> &'a mut W {
84        self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
85        self.w
86    }
87}
88#[doc = "Counter/Timer B1 output polarity.\n\nValue on reset: 0"]
89#[derive(Clone, Copy, Debug, PartialEq)]
90pub enum TMRB1POL_A {
91    #[doc = "0: The polarity of the TMRPINB1 pin is the same as the timer output."]
92    NORMAL = 0,
93    #[doc = "1: The polarity of the TMRPINB1 pin is the inverse of the timer output."]
94    INVERTED = 1,
95}
96impl From<TMRB1POL_A> for bool {
97    #[inline(always)]
98    fn from(variant: TMRB1POL_A) -> Self {
99        variant as u8 != 0
100    }
101}
102#[doc = "Reader of field `TMRB1POL`"]
103pub type TMRB1POL_R = crate::R<bool, TMRB1POL_A>;
104impl TMRB1POL_R {
105    #[doc = r"Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> TMRB1POL_A {
108        match self.bits {
109            false => TMRB1POL_A::NORMAL,
110            true => TMRB1POL_A::INVERTED,
111        }
112    }
113    #[doc = "Checks if the value of the field is `NORMAL`"]
114    #[inline(always)]
115    pub fn is_normal(&self) -> bool {
116        *self == TMRB1POL_A::NORMAL
117    }
118    #[doc = "Checks if the value of the field is `INVERTED`"]
119    #[inline(always)]
120    pub fn is_inverted(&self) -> bool {
121        *self == TMRB1POL_A::INVERTED
122    }
123}
124#[doc = "Write proxy for field `TMRB1POL`"]
125pub struct TMRB1POL_W<'a> {
126    w: &'a mut W,
127}
128impl<'a> TMRB1POL_W<'a> {
129    #[doc = r"Writes `variant` to the field"]
130    #[inline(always)]
131    pub fn variant(self, variant: TMRB1POL_A) -> &'a mut W {
132        {
133            self.bit(variant.into())
134        }
135    }
136    #[doc = "The polarity of the TMRPINB1 pin is the same as the timer output."]
137    #[inline(always)]
138    pub fn normal(self) -> &'a mut W {
139        self.variant(TMRB1POL_A::NORMAL)
140    }
141    #[doc = "The polarity of the TMRPINB1 pin is the inverse of the timer output."]
142    #[inline(always)]
143    pub fn inverted(self) -> &'a mut W {
144        self.variant(TMRB1POL_A::INVERTED)
145    }
146    #[doc = r"Sets the field bit"]
147    #[inline(always)]
148    pub fn set_bit(self) -> &'a mut W {
149        self.bit(true)
150    }
151    #[doc = r"Clears the field bit"]
152    #[inline(always)]
153    pub fn clear_bit(self) -> &'a mut W {
154        self.bit(false)
155    }
156    #[doc = r"Writes raw bits to the field"]
157    #[inline(always)]
158    pub fn bit(self, value: bool) -> &'a mut W {
159        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
160        self.w
161    }
162}
163#[doc = "Counter/Timer B1 Clear bit.\n\nValue on reset: 0"]
164#[derive(Clone, Copy, Debug, PartialEq)]
165pub enum TMRB1CLR_A {
166    #[doc = "0: Allow counter/timer B1 to run"]
167    RUN = 0,
168    #[doc = "1: Holds counter/timer B1 at 0x0000."]
169    CLEAR = 1,
170}
171impl From<TMRB1CLR_A> for bool {
172    #[inline(always)]
173    fn from(variant: TMRB1CLR_A) -> Self {
174        variant as u8 != 0
175    }
176}
177#[doc = "Reader of field `TMRB1CLR`"]
178pub type TMRB1CLR_R = crate::R<bool, TMRB1CLR_A>;
179impl TMRB1CLR_R {
180    #[doc = r"Get enumerated values variant"]
181    #[inline(always)]
182    pub fn variant(&self) -> TMRB1CLR_A {
183        match self.bits {
184            false => TMRB1CLR_A::RUN,
185            true => TMRB1CLR_A::CLEAR,
186        }
187    }
188    #[doc = "Checks if the value of the field is `RUN`"]
189    #[inline(always)]
190    pub fn is_run(&self) -> bool {
191        *self == TMRB1CLR_A::RUN
192    }
193    #[doc = "Checks if the value of the field is `CLEAR`"]
194    #[inline(always)]
195    pub fn is_clear(&self) -> bool {
196        *self == TMRB1CLR_A::CLEAR
197    }
198}
199#[doc = "Write proxy for field `TMRB1CLR`"]
200pub struct TMRB1CLR_W<'a> {
201    w: &'a mut W,
202}
203impl<'a> TMRB1CLR_W<'a> {
204    #[doc = r"Writes `variant` to the field"]
205    #[inline(always)]
206    pub fn variant(self, variant: TMRB1CLR_A) -> &'a mut W {
207        {
208            self.bit(variant.into())
209        }
210    }
211    #[doc = "Allow counter/timer B1 to run"]
212    #[inline(always)]
213    pub fn run(self) -> &'a mut W {
214        self.variant(TMRB1CLR_A::RUN)
215    }
216    #[doc = "Holds counter/timer B1 at 0x0000."]
217    #[inline(always)]
218    pub fn clear(self) -> &'a mut W {
219        self.variant(TMRB1CLR_A::CLEAR)
220    }
221    #[doc = r"Sets the field bit"]
222    #[inline(always)]
223    pub fn set_bit(self) -> &'a mut W {
224        self.bit(true)
225    }
226    #[doc = r"Clears the field bit"]
227    #[inline(always)]
228    pub fn clear_bit(self) -> &'a mut W {
229        self.bit(false)
230    }
231    #[doc = r"Writes raw bits to the field"]
232    #[inline(always)]
233    pub fn bit(self, value: bool) -> &'a mut W {
234        self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
235        self.w
236    }
237}
238#[doc = "Counter/Timer B1 Output Enable bit.\n\nValue on reset: 0"]
239#[derive(Clone, Copy, Debug, PartialEq)]
240pub enum TMRB1PE_A {
241    #[doc = "0: Counter/Timer B holds the TMRPINB signal at the value TMRB1POL."]
242    DIS = 0,
243    #[doc = "1: Enable counter/timer B1 to generate a signal on TMRPINB."]
244    EN = 1,
245}
246impl From<TMRB1PE_A> for bool {
247    #[inline(always)]
248    fn from(variant: TMRB1PE_A) -> Self {
249        variant as u8 != 0
250    }
251}
252#[doc = "Reader of field `TMRB1PE`"]
253pub type TMRB1PE_R = crate::R<bool, TMRB1PE_A>;
254impl TMRB1PE_R {
255    #[doc = r"Get enumerated values variant"]
256    #[inline(always)]
257    pub fn variant(&self) -> TMRB1PE_A {
258        match self.bits {
259            false => TMRB1PE_A::DIS,
260            true => TMRB1PE_A::EN,
261        }
262    }
263    #[doc = "Checks if the value of the field is `DIS`"]
264    #[inline(always)]
265    pub fn is_dis(&self) -> bool {
266        *self == TMRB1PE_A::DIS
267    }
268    #[doc = "Checks if the value of the field is `EN`"]
269    #[inline(always)]
270    pub fn is_en(&self) -> bool {
271        *self == TMRB1PE_A::EN
272    }
273}
274#[doc = "Write proxy for field `TMRB1PE`"]
275pub struct TMRB1PE_W<'a> {
276    w: &'a mut W,
277}
278impl<'a> TMRB1PE_W<'a> {
279    #[doc = r"Writes `variant` to the field"]
280    #[inline(always)]
281    pub fn variant(self, variant: TMRB1PE_A) -> &'a mut W {
282        {
283            self.bit(variant.into())
284        }
285    }
286    #[doc = "Counter/Timer B holds the TMRPINB signal at the value TMRB1POL."]
287    #[inline(always)]
288    pub fn dis(self) -> &'a mut W {
289        self.variant(TMRB1PE_A::DIS)
290    }
291    #[doc = "Enable counter/timer B1 to generate a signal on TMRPINB."]
292    #[inline(always)]
293    pub fn en(self) -> &'a mut W {
294        self.variant(TMRB1PE_A::EN)
295    }
296    #[doc = r"Sets the field bit"]
297    #[inline(always)]
298    pub fn set_bit(self) -> &'a mut W {
299        self.bit(true)
300    }
301    #[doc = r"Clears the field bit"]
302    #[inline(always)]
303    pub fn clear_bit(self) -> &'a mut W {
304        self.bit(false)
305    }
306    #[doc = r"Writes raw bits to the field"]
307    #[inline(always)]
308    pub fn bit(self, value: bool) -> &'a mut W {
309        self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
310        self.w
311    }
312}
313#[doc = "Counter/Timer B1 Interrupt Enable bit.\n\nValue on reset: 0"]
314#[derive(Clone, Copy, Debug, PartialEq)]
315pub enum TMRB1IE_A {
316    #[doc = "0: Disable counter/timer B1 from generating an interrupt."]
317    DIS = 0,
318    #[doc = "1: Enable counter/timer B1 to generate an interrupt."]
319    EN = 1,
320}
321impl From<TMRB1IE_A> for bool {
322    #[inline(always)]
323    fn from(variant: TMRB1IE_A) -> Self {
324        variant as u8 != 0
325    }
326}
327#[doc = "Reader of field `TMRB1IE`"]
328pub type TMRB1IE_R = crate::R<bool, TMRB1IE_A>;
329impl TMRB1IE_R {
330    #[doc = r"Get enumerated values variant"]
331    #[inline(always)]
332    pub fn variant(&self) -> TMRB1IE_A {
333        match self.bits {
334            false => TMRB1IE_A::DIS,
335            true => TMRB1IE_A::EN,
336        }
337    }
338    #[doc = "Checks if the value of the field is `DIS`"]
339    #[inline(always)]
340    pub fn is_dis(&self) -> bool {
341        *self == TMRB1IE_A::DIS
342    }
343    #[doc = "Checks if the value of the field is `EN`"]
344    #[inline(always)]
345    pub fn is_en(&self) -> bool {
346        *self == TMRB1IE_A::EN
347    }
348}
349#[doc = "Write proxy for field `TMRB1IE`"]
350pub struct TMRB1IE_W<'a> {
351    w: &'a mut W,
352}
353impl<'a> TMRB1IE_W<'a> {
354    #[doc = r"Writes `variant` to the field"]
355    #[inline(always)]
356    pub fn variant(self, variant: TMRB1IE_A) -> &'a mut W {
357        {
358            self.bit(variant.into())
359        }
360    }
361    #[doc = "Disable counter/timer B1 from generating an interrupt."]
362    #[inline(always)]
363    pub fn dis(self) -> &'a mut W {
364        self.variant(TMRB1IE_A::DIS)
365    }
366    #[doc = "Enable counter/timer B1 to generate an interrupt."]
367    #[inline(always)]
368    pub fn en(self) -> &'a mut W {
369        self.variant(TMRB1IE_A::EN)
370    }
371    #[doc = r"Sets the field bit"]
372    #[inline(always)]
373    pub fn set_bit(self) -> &'a mut W {
374        self.bit(true)
375    }
376    #[doc = r"Clears the field bit"]
377    #[inline(always)]
378    pub fn clear_bit(self) -> &'a mut W {
379        self.bit(false)
380    }
381    #[doc = r"Writes raw bits to the field"]
382    #[inline(always)]
383    pub fn bit(self, value: bool) -> &'a mut W {
384        self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25);
385        self.w
386    }
387}
388#[doc = "Counter/Timer B1 Function Select.\n\nValue on reset: 0"]
389#[derive(Clone, Copy, Debug, PartialEq)]
390#[repr(u8)]
391pub enum TMRB1FN_A {
392    #[doc = "0: Single count (output toggles and sticks).  Count to CMPR0B1, stop."]
393    SINGLECOUNT = 0,
394    #[doc = "1: Repeated count (periodic 1-clock-cycle-wide pulses).  Count to CMPR0B1, restart."]
395    REPEATEDCOUNT = 1,
396    #[doc = "2: Pulse once (aka one-shot).  Count to CMPR0B1, assert, count to CMPR1B, deassert, stop."]
397    PULSE_ONCE = 2,
398    #[doc = "3: Pulse continously.  Count to CMPR0B1, assert, count to CMPR1B1, deassert, restart."]
399    PULSE_CONT = 3,
400    #[doc = "4: Continuous run (aka Free Run).  Count continuously."]
401    CONTINUOUS = 4,
402}
403impl From<TMRB1FN_A> for u8 {
404    #[inline(always)]
405    fn from(variant: TMRB1FN_A) -> Self {
406        variant as _
407    }
408}
409#[doc = "Reader of field `TMRB1FN`"]
410pub type TMRB1FN_R = crate::R<u8, TMRB1FN_A>;
411impl TMRB1FN_R {
412    #[doc = r"Get enumerated values variant"]
413    #[inline(always)]
414    pub fn variant(&self) -> crate::Variant<u8, TMRB1FN_A> {
415        use crate::Variant::*;
416        match self.bits {
417            0 => Val(TMRB1FN_A::SINGLECOUNT),
418            1 => Val(TMRB1FN_A::REPEATEDCOUNT),
419            2 => Val(TMRB1FN_A::PULSE_ONCE),
420            3 => Val(TMRB1FN_A::PULSE_CONT),
421            4 => Val(TMRB1FN_A::CONTINUOUS),
422            i => Res(i),
423        }
424    }
425    #[doc = "Checks if the value of the field is `SINGLECOUNT`"]
426    #[inline(always)]
427    pub fn is_singlecount(&self) -> bool {
428        *self == TMRB1FN_A::SINGLECOUNT
429    }
430    #[doc = "Checks if the value of the field is `REPEATEDCOUNT`"]
431    #[inline(always)]
432    pub fn is_repeatedcount(&self) -> bool {
433        *self == TMRB1FN_A::REPEATEDCOUNT
434    }
435    #[doc = "Checks if the value of the field is `PULSE_ONCE`"]
436    #[inline(always)]
437    pub fn is_pulse_once(&self) -> bool {
438        *self == TMRB1FN_A::PULSE_ONCE
439    }
440    #[doc = "Checks if the value of the field is `PULSE_CONT`"]
441    #[inline(always)]
442    pub fn is_pulse_cont(&self) -> bool {
443        *self == TMRB1FN_A::PULSE_CONT
444    }
445    #[doc = "Checks if the value of the field is `CONTINUOUS`"]
446    #[inline(always)]
447    pub fn is_continuous(&self) -> bool {
448        *self == TMRB1FN_A::CONTINUOUS
449    }
450}
451#[doc = "Write proxy for field `TMRB1FN`"]
452pub struct TMRB1FN_W<'a> {
453    w: &'a mut W,
454}
455impl<'a> TMRB1FN_W<'a> {
456    #[doc = r"Writes `variant` to the field"]
457    #[inline(always)]
458    pub fn variant(self, variant: TMRB1FN_A) -> &'a mut W {
459        unsafe { self.bits(variant.into()) }
460    }
461    #[doc = "Single count (output toggles and sticks). Count to CMPR0B1, stop."]
462    #[inline(always)]
463    pub fn singlecount(self) -> &'a mut W {
464        self.variant(TMRB1FN_A::SINGLECOUNT)
465    }
466    #[doc = "Repeated count (periodic 1-clock-cycle-wide pulses). Count to CMPR0B1, restart."]
467    #[inline(always)]
468    pub fn repeatedcount(self) -> &'a mut W {
469        self.variant(TMRB1FN_A::REPEATEDCOUNT)
470    }
471    #[doc = "Pulse once (aka one-shot). Count to CMPR0B1, assert, count to CMPR1B, deassert, stop."]
472    #[inline(always)]
473    pub fn pulse_once(self) -> &'a mut W {
474        self.variant(TMRB1FN_A::PULSE_ONCE)
475    }
476    #[doc = "Pulse continously. Count to CMPR0B1, assert, count to CMPR1B1, deassert, restart."]
477    #[inline(always)]
478    pub fn pulse_cont(self) -> &'a mut W {
479        self.variant(TMRB1FN_A::PULSE_CONT)
480    }
481    #[doc = "Continuous run (aka Free Run). Count continuously."]
482    #[inline(always)]
483    pub fn continuous(self) -> &'a mut W {
484        self.variant(TMRB1FN_A::CONTINUOUS)
485    }
486    #[doc = r"Writes raw bits to the field"]
487    #[inline(always)]
488    pub unsafe fn bits(self, value: u8) -> &'a mut W {
489        self.w.bits = (self.w.bits & !(0x07 << 22)) | (((value as u32) & 0x07) << 22);
490        self.w
491    }
492}
493#[doc = "Counter/Timer B1 Clock Select.\n\nValue on reset: 0"]
494#[derive(Clone, Copy, Debug, PartialEq)]
495#[repr(u8)]
496pub enum TMRB1CLK_A {
497    #[doc = "0: Clock source is TMRPINB."]
498    TMRPIN = 0,
499    #[doc = "1: Clock source is the HFRC"]
500    HFRC = 1,
501    #[doc = "2: Clock source is HFRC / 8"]
502    HFRC_DIV8 = 2,
503    #[doc = "3: Clock source is HFRC / 128"]
504    HFRC_DIV128 = 3,
505    #[doc = "4: Clock source is HFRC / 512"]
506    HFRC_DIV512 = 4,
507    #[doc = "5: Clock source is HFRC / 2048"]
508    HFRC_DIV2K = 5,
509    #[doc = "6: Clock source is the XT (uncalibrated)."]
510    XT = 6,
511    #[doc = "7: Clock source is XT / 2"]
512    XT_DIV2 = 7,
513    #[doc = "8: Clock source is XT / 16"]
514    XT_DIV16 = 8,
515    #[doc = "9: Clock source is XT / 256"]
516    XT_DIV256 = 9,
517    #[doc = "10: Clock source is LFRC / 2"]
518    LFRC_DIV2 = 10,
519    #[doc = "11: Clock source is LFRC / 32"]
520    LFRC_DIV32 = 11,
521    #[doc = "12: Clock source is LFRC / 1024"]
522    LFRC_DIV1K = 12,
523    #[doc = "13: Clock source is LFRC / 16K"]
524    LFRC = 13,
525    #[doc = "14: Clock source is 100 Hz from the current RTC oscillator."]
526    RTC_100HZ = 14,
527    #[doc = "15: Clock source is HCLK."]
528    HCLK = 15,
529    #[doc = "16: Clock source is buck converter stream B."]
530    BUCKB = 16,
531}
532impl From<TMRB1CLK_A> for u8 {
533    #[inline(always)]
534    fn from(variant: TMRB1CLK_A) -> Self {
535        variant as _
536    }
537}
538#[doc = "Reader of field `TMRB1CLK`"]
539pub type TMRB1CLK_R = crate::R<u8, TMRB1CLK_A>;
540impl TMRB1CLK_R {
541    #[doc = r"Get enumerated values variant"]
542    #[inline(always)]
543    pub fn variant(&self) -> crate::Variant<u8, TMRB1CLK_A> {
544        use crate::Variant::*;
545        match self.bits {
546            0 => Val(TMRB1CLK_A::TMRPIN),
547            1 => Val(TMRB1CLK_A::HFRC),
548            2 => Val(TMRB1CLK_A::HFRC_DIV8),
549            3 => Val(TMRB1CLK_A::HFRC_DIV128),
550            4 => Val(TMRB1CLK_A::HFRC_DIV512),
551            5 => Val(TMRB1CLK_A::HFRC_DIV2K),
552            6 => Val(TMRB1CLK_A::XT),
553            7 => Val(TMRB1CLK_A::XT_DIV2),
554            8 => Val(TMRB1CLK_A::XT_DIV16),
555            9 => Val(TMRB1CLK_A::XT_DIV256),
556            10 => Val(TMRB1CLK_A::LFRC_DIV2),
557            11 => Val(TMRB1CLK_A::LFRC_DIV32),
558            12 => Val(TMRB1CLK_A::LFRC_DIV1K),
559            13 => Val(TMRB1CLK_A::LFRC),
560            14 => Val(TMRB1CLK_A::RTC_100HZ),
561            15 => Val(TMRB1CLK_A::HCLK),
562            16 => Val(TMRB1CLK_A::BUCKB),
563            i => Res(i),
564        }
565    }
566    #[doc = "Checks if the value of the field is `TMRPIN`"]
567    #[inline(always)]
568    pub fn is_tmrpin(&self) -> bool {
569        *self == TMRB1CLK_A::TMRPIN
570    }
571    #[doc = "Checks if the value of the field is `HFRC`"]
572    #[inline(always)]
573    pub fn is_hfrc(&self) -> bool {
574        *self == TMRB1CLK_A::HFRC
575    }
576    #[doc = "Checks if the value of the field is `HFRC_DIV8`"]
577    #[inline(always)]
578    pub fn is_hfrc_div8(&self) -> bool {
579        *self == TMRB1CLK_A::HFRC_DIV8
580    }
581    #[doc = "Checks if the value of the field is `HFRC_DIV128`"]
582    #[inline(always)]
583    pub fn is_hfrc_div128(&self) -> bool {
584        *self == TMRB1CLK_A::HFRC_DIV128
585    }
586    #[doc = "Checks if the value of the field is `HFRC_DIV512`"]
587    #[inline(always)]
588    pub fn is_hfrc_div512(&self) -> bool {
589        *self == TMRB1CLK_A::HFRC_DIV512
590    }
591    #[doc = "Checks if the value of the field is `HFRC_DIV2K`"]
592    #[inline(always)]
593    pub fn is_hfrc_div2k(&self) -> bool {
594        *self == TMRB1CLK_A::HFRC_DIV2K
595    }
596    #[doc = "Checks if the value of the field is `XT`"]
597    #[inline(always)]
598    pub fn is_xt(&self) -> bool {
599        *self == TMRB1CLK_A::XT
600    }
601    #[doc = "Checks if the value of the field is `XT_DIV2`"]
602    #[inline(always)]
603    pub fn is_xt_div2(&self) -> bool {
604        *self == TMRB1CLK_A::XT_DIV2
605    }
606    #[doc = "Checks if the value of the field is `XT_DIV16`"]
607    #[inline(always)]
608    pub fn is_xt_div16(&self) -> bool {
609        *self == TMRB1CLK_A::XT_DIV16
610    }
611    #[doc = "Checks if the value of the field is `XT_DIV256`"]
612    #[inline(always)]
613    pub fn is_xt_div256(&self) -> bool {
614        *self == TMRB1CLK_A::XT_DIV256
615    }
616    #[doc = "Checks if the value of the field is `LFRC_DIV2`"]
617    #[inline(always)]
618    pub fn is_lfrc_div2(&self) -> bool {
619        *self == TMRB1CLK_A::LFRC_DIV2
620    }
621    #[doc = "Checks if the value of the field is `LFRC_DIV32`"]
622    #[inline(always)]
623    pub fn is_lfrc_div32(&self) -> bool {
624        *self == TMRB1CLK_A::LFRC_DIV32
625    }
626    #[doc = "Checks if the value of the field is `LFRC_DIV1K`"]
627    #[inline(always)]
628    pub fn is_lfrc_div1k(&self) -> bool {
629        *self == TMRB1CLK_A::LFRC_DIV1K
630    }
631    #[doc = "Checks if the value of the field is `LFRC`"]
632    #[inline(always)]
633    pub fn is_lfrc(&self) -> bool {
634        *self == TMRB1CLK_A::LFRC
635    }
636    #[doc = "Checks if the value of the field is `RTC_100HZ`"]
637    #[inline(always)]
638    pub fn is_rtc_100hz(&self) -> bool {
639        *self == TMRB1CLK_A::RTC_100HZ
640    }
641    #[doc = "Checks if the value of the field is `HCLK`"]
642    #[inline(always)]
643    pub fn is_hclk(&self) -> bool {
644        *self == TMRB1CLK_A::HCLK
645    }
646    #[doc = "Checks if the value of the field is `BUCKB`"]
647    #[inline(always)]
648    pub fn is_buckb(&self) -> bool {
649        *self == TMRB1CLK_A::BUCKB
650    }
651}
652#[doc = "Write proxy for field `TMRB1CLK`"]
653pub struct TMRB1CLK_W<'a> {
654    w: &'a mut W,
655}
656impl<'a> TMRB1CLK_W<'a> {
657    #[doc = r"Writes `variant` to the field"]
658    #[inline(always)]
659    pub fn variant(self, variant: TMRB1CLK_A) -> &'a mut W {
660        unsafe { self.bits(variant.into()) }
661    }
662    #[doc = "Clock source is TMRPINB."]
663    #[inline(always)]
664    pub fn tmrpin(self) -> &'a mut W {
665        self.variant(TMRB1CLK_A::TMRPIN)
666    }
667    #[doc = "Clock source is the HFRC"]
668    #[inline(always)]
669    pub fn hfrc(self) -> &'a mut W {
670        self.variant(TMRB1CLK_A::HFRC)
671    }
672    #[doc = "Clock source is HFRC / 8"]
673    #[inline(always)]
674    pub fn hfrc_div8(self) -> &'a mut W {
675        self.variant(TMRB1CLK_A::HFRC_DIV8)
676    }
677    #[doc = "Clock source is HFRC / 128"]
678    #[inline(always)]
679    pub fn hfrc_div128(self) -> &'a mut W {
680        self.variant(TMRB1CLK_A::HFRC_DIV128)
681    }
682    #[doc = "Clock source is HFRC / 512"]
683    #[inline(always)]
684    pub fn hfrc_div512(self) -> &'a mut W {
685        self.variant(TMRB1CLK_A::HFRC_DIV512)
686    }
687    #[doc = "Clock source is HFRC / 2048"]
688    #[inline(always)]
689    pub fn hfrc_div2k(self) -> &'a mut W {
690        self.variant(TMRB1CLK_A::HFRC_DIV2K)
691    }
692    #[doc = "Clock source is the XT (uncalibrated)."]
693    #[inline(always)]
694    pub fn xt(self) -> &'a mut W {
695        self.variant(TMRB1CLK_A::XT)
696    }
697    #[doc = "Clock source is XT / 2"]
698    #[inline(always)]
699    pub fn xt_div2(self) -> &'a mut W {
700        self.variant(TMRB1CLK_A::XT_DIV2)
701    }
702    #[doc = "Clock source is XT / 16"]
703    #[inline(always)]
704    pub fn xt_div16(self) -> &'a mut W {
705        self.variant(TMRB1CLK_A::XT_DIV16)
706    }
707    #[doc = "Clock source is XT / 256"]
708    #[inline(always)]
709    pub fn xt_div256(self) -> &'a mut W {
710        self.variant(TMRB1CLK_A::XT_DIV256)
711    }
712    #[doc = "Clock source is LFRC / 2"]
713    #[inline(always)]
714    pub fn lfrc_div2(self) -> &'a mut W {
715        self.variant(TMRB1CLK_A::LFRC_DIV2)
716    }
717    #[doc = "Clock source is LFRC / 32"]
718    #[inline(always)]
719    pub fn lfrc_div32(self) -> &'a mut W {
720        self.variant(TMRB1CLK_A::LFRC_DIV32)
721    }
722    #[doc = "Clock source is LFRC / 1024"]
723    #[inline(always)]
724    pub fn lfrc_div1k(self) -> &'a mut W {
725        self.variant(TMRB1CLK_A::LFRC_DIV1K)
726    }
727    #[doc = "Clock source is LFRC / 16K"]
728    #[inline(always)]
729    pub fn lfrc(self) -> &'a mut W {
730        self.variant(TMRB1CLK_A::LFRC)
731    }
732    #[doc = "Clock source is 100 Hz from the current RTC oscillator."]
733    #[inline(always)]
734    pub fn rtc_100hz(self) -> &'a mut W {
735        self.variant(TMRB1CLK_A::RTC_100HZ)
736    }
737    #[doc = "Clock source is HCLK."]
738    #[inline(always)]
739    pub fn hclk(self) -> &'a mut W {
740        self.variant(TMRB1CLK_A::HCLK)
741    }
742    #[doc = "Clock source is buck converter stream B."]
743    #[inline(always)]
744    pub fn buckb(self) -> &'a mut W {
745        self.variant(TMRB1CLK_A::BUCKB)
746    }
747    #[doc = r"Writes raw bits to the field"]
748    #[inline(always)]
749    pub unsafe fn bits(self, value: u8) -> &'a mut W {
750        self.w.bits = (self.w.bits & !(0x1f << 17)) | (((value as u32) & 0x1f) << 17);
751        self.w
752    }
753}
754#[doc = "Counter/Timer B1 Enable bit.\n\nValue on reset: 0"]
755#[derive(Clone, Copy, Debug, PartialEq)]
756pub enum TMRB1EN_A {
757    #[doc = "0: Counter/Timer B1 Disable."]
758    DIS = 0,
759    #[doc = "1: Counter/Timer B1 Enable."]
760    EN = 1,
761}
762impl From<TMRB1EN_A> for bool {
763    #[inline(always)]
764    fn from(variant: TMRB1EN_A) -> Self {
765        variant as u8 != 0
766    }
767}
768#[doc = "Reader of field `TMRB1EN`"]
769pub type TMRB1EN_R = crate::R<bool, TMRB1EN_A>;
770impl TMRB1EN_R {
771    #[doc = r"Get enumerated values variant"]
772    #[inline(always)]
773    pub fn variant(&self) -> TMRB1EN_A {
774        match self.bits {
775            false => TMRB1EN_A::DIS,
776            true => TMRB1EN_A::EN,
777        }
778    }
779    #[doc = "Checks if the value of the field is `DIS`"]
780    #[inline(always)]
781    pub fn is_dis(&self) -> bool {
782        *self == TMRB1EN_A::DIS
783    }
784    #[doc = "Checks if the value of the field is `EN`"]
785    #[inline(always)]
786    pub fn is_en(&self) -> bool {
787        *self == TMRB1EN_A::EN
788    }
789}
790#[doc = "Write proxy for field `TMRB1EN`"]
791pub struct TMRB1EN_W<'a> {
792    w: &'a mut W,
793}
794impl<'a> TMRB1EN_W<'a> {
795    #[doc = r"Writes `variant` to the field"]
796    #[inline(always)]
797    pub fn variant(self, variant: TMRB1EN_A) -> &'a mut W {
798        {
799            self.bit(variant.into())
800        }
801    }
802    #[doc = "Counter/Timer B1 Disable."]
803    #[inline(always)]
804    pub fn dis(self) -> &'a mut W {
805        self.variant(TMRB1EN_A::DIS)
806    }
807    #[doc = "Counter/Timer B1 Enable."]
808    #[inline(always)]
809    pub fn en(self) -> &'a mut W {
810        self.variant(TMRB1EN_A::EN)
811    }
812    #[doc = r"Sets the field bit"]
813    #[inline(always)]
814    pub fn set_bit(self) -> &'a mut W {
815        self.bit(true)
816    }
817    #[doc = r"Clears the field bit"]
818    #[inline(always)]
819    pub fn clear_bit(self) -> &'a mut W {
820        self.bit(false)
821    }
822    #[doc = r"Writes raw bits to the field"]
823    #[inline(always)]
824    pub fn bit(self, value: bool) -> &'a mut W {
825        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
826        self.w
827    }
828}
829#[doc = "Counter/Timer A1 output polarity.\n\nValue on reset: 0"]
830#[derive(Clone, Copy, Debug, PartialEq)]
831pub enum TMRA1POL_A {
832    #[doc = "0: The polarity of the TMRPINA1 pin is the same as the timer output."]
833    NORMAL = 0,
834    #[doc = "1: The polarity of the TMRPINA1 pin is the inverse of the timer output."]
835    INVERTED = 1,
836}
837impl From<TMRA1POL_A> for bool {
838    #[inline(always)]
839    fn from(variant: TMRA1POL_A) -> Self {
840        variant as u8 != 0
841    }
842}
843#[doc = "Reader of field `TMRA1POL`"]
844pub type TMRA1POL_R = crate::R<bool, TMRA1POL_A>;
845impl TMRA1POL_R {
846    #[doc = r"Get enumerated values variant"]
847    #[inline(always)]
848    pub fn variant(&self) -> TMRA1POL_A {
849        match self.bits {
850            false => TMRA1POL_A::NORMAL,
851            true => TMRA1POL_A::INVERTED,
852        }
853    }
854    #[doc = "Checks if the value of the field is `NORMAL`"]
855    #[inline(always)]
856    pub fn is_normal(&self) -> bool {
857        *self == TMRA1POL_A::NORMAL
858    }
859    #[doc = "Checks if the value of the field is `INVERTED`"]
860    #[inline(always)]
861    pub fn is_inverted(&self) -> bool {
862        *self == TMRA1POL_A::INVERTED
863    }
864}
865#[doc = "Write proxy for field `TMRA1POL`"]
866pub struct TMRA1POL_W<'a> {
867    w: &'a mut W,
868}
869impl<'a> TMRA1POL_W<'a> {
870    #[doc = r"Writes `variant` to the field"]
871    #[inline(always)]
872    pub fn variant(self, variant: TMRA1POL_A) -> &'a mut W {
873        {
874            self.bit(variant.into())
875        }
876    }
877    #[doc = "The polarity of the TMRPINA1 pin is the same as the timer output."]
878    #[inline(always)]
879    pub fn normal(self) -> &'a mut W {
880        self.variant(TMRA1POL_A::NORMAL)
881    }
882    #[doc = "The polarity of the TMRPINA1 pin is the inverse of the timer output."]
883    #[inline(always)]
884    pub fn inverted(self) -> &'a mut W {
885        self.variant(TMRA1POL_A::INVERTED)
886    }
887    #[doc = r"Sets the field bit"]
888    #[inline(always)]
889    pub fn set_bit(self) -> &'a mut W {
890        self.bit(true)
891    }
892    #[doc = r"Clears the field bit"]
893    #[inline(always)]
894    pub fn clear_bit(self) -> &'a mut W {
895        self.bit(false)
896    }
897    #[doc = r"Writes raw bits to the field"]
898    #[inline(always)]
899    pub fn bit(self, value: bool) -> &'a mut W {
900        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
901        self.w
902    }
903}
904#[doc = "Counter/Timer A1 Clear bit.\n\nValue on reset: 0"]
905#[derive(Clone, Copy, Debug, PartialEq)]
906pub enum TMRA1CLR_A {
907    #[doc = "0: Allow counter/timer A1 to run"]
908    RUN = 0,
909    #[doc = "1: Holds counter/timer A1 at 0x0000."]
910    CLEAR = 1,
911}
912impl From<TMRA1CLR_A> for bool {
913    #[inline(always)]
914    fn from(variant: TMRA1CLR_A) -> Self {
915        variant as u8 != 0
916    }
917}
918#[doc = "Reader of field `TMRA1CLR`"]
919pub type TMRA1CLR_R = crate::R<bool, TMRA1CLR_A>;
920impl TMRA1CLR_R {
921    #[doc = r"Get enumerated values variant"]
922    #[inline(always)]
923    pub fn variant(&self) -> TMRA1CLR_A {
924        match self.bits {
925            false => TMRA1CLR_A::RUN,
926            true => TMRA1CLR_A::CLEAR,
927        }
928    }
929    #[doc = "Checks if the value of the field is `RUN`"]
930    #[inline(always)]
931    pub fn is_run(&self) -> bool {
932        *self == TMRA1CLR_A::RUN
933    }
934    #[doc = "Checks if the value of the field is `CLEAR`"]
935    #[inline(always)]
936    pub fn is_clear(&self) -> bool {
937        *self == TMRA1CLR_A::CLEAR
938    }
939}
940#[doc = "Write proxy for field `TMRA1CLR`"]
941pub struct TMRA1CLR_W<'a> {
942    w: &'a mut W,
943}
944impl<'a> TMRA1CLR_W<'a> {
945    #[doc = r"Writes `variant` to the field"]
946    #[inline(always)]
947    pub fn variant(self, variant: TMRA1CLR_A) -> &'a mut W {
948        {
949            self.bit(variant.into())
950        }
951    }
952    #[doc = "Allow counter/timer A1 to run"]
953    #[inline(always)]
954    pub fn run(self) -> &'a mut W {
955        self.variant(TMRA1CLR_A::RUN)
956    }
957    #[doc = "Holds counter/timer A1 at 0x0000."]
958    #[inline(always)]
959    pub fn clear(self) -> &'a mut W {
960        self.variant(TMRA1CLR_A::CLEAR)
961    }
962    #[doc = r"Sets the field bit"]
963    #[inline(always)]
964    pub fn set_bit(self) -> &'a mut W {
965        self.bit(true)
966    }
967    #[doc = r"Clears the field bit"]
968    #[inline(always)]
969    pub fn clear_bit(self) -> &'a mut W {
970        self.bit(false)
971    }
972    #[doc = r"Writes raw bits to the field"]
973    #[inline(always)]
974    pub fn bit(self, value: bool) -> &'a mut W {
975        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
976        self.w
977    }
978}
979#[doc = "Counter/Timer A1 Output Enable bit.\n\nValue on reset: 0"]
980#[derive(Clone, Copy, Debug, PartialEq)]
981pub enum TMRA1PE_A {
982    #[doc = "0: Counter/Timer A holds the TMRPINA signal at the value TMRA1POL."]
983    DIS = 0,
984    #[doc = "1: Enable counter/timer A1 to generate a signal on TMRPINA."]
985    EN = 1,
986}
987impl From<TMRA1PE_A> for bool {
988    #[inline(always)]
989    fn from(variant: TMRA1PE_A) -> Self {
990        variant as u8 != 0
991    }
992}
993#[doc = "Reader of field `TMRA1PE`"]
994pub type TMRA1PE_R = crate::R<bool, TMRA1PE_A>;
995impl TMRA1PE_R {
996    #[doc = r"Get enumerated values variant"]
997    #[inline(always)]
998    pub fn variant(&self) -> TMRA1PE_A {
999        match self.bits {
1000            false => TMRA1PE_A::DIS,
1001            true => TMRA1PE_A::EN,
1002        }
1003    }
1004    #[doc = "Checks if the value of the field is `DIS`"]
1005    #[inline(always)]
1006    pub fn is_dis(&self) -> bool {
1007        *self == TMRA1PE_A::DIS
1008    }
1009    #[doc = "Checks if the value of the field is `EN`"]
1010    #[inline(always)]
1011    pub fn is_en(&self) -> bool {
1012        *self == TMRA1PE_A::EN
1013    }
1014}
1015#[doc = "Write proxy for field `TMRA1PE`"]
1016pub struct TMRA1PE_W<'a> {
1017    w: &'a mut W,
1018}
1019impl<'a> TMRA1PE_W<'a> {
1020    #[doc = r"Writes `variant` to the field"]
1021    #[inline(always)]
1022    pub fn variant(self, variant: TMRA1PE_A) -> &'a mut W {
1023        {
1024            self.bit(variant.into())
1025        }
1026    }
1027    #[doc = "Counter/Timer A holds the TMRPINA signal at the value TMRA1POL."]
1028    #[inline(always)]
1029    pub fn dis(self) -> &'a mut W {
1030        self.variant(TMRA1PE_A::DIS)
1031    }
1032    #[doc = "Enable counter/timer A1 to generate a signal on TMRPINA."]
1033    #[inline(always)]
1034    pub fn en(self) -> &'a mut W {
1035        self.variant(TMRA1PE_A::EN)
1036    }
1037    #[doc = r"Sets the field bit"]
1038    #[inline(always)]
1039    pub fn set_bit(self) -> &'a mut W {
1040        self.bit(true)
1041    }
1042    #[doc = r"Clears the field bit"]
1043    #[inline(always)]
1044    pub fn clear_bit(self) -> &'a mut W {
1045        self.bit(false)
1046    }
1047    #[doc = r"Writes raw bits to the field"]
1048    #[inline(always)]
1049    pub fn bit(self, value: bool) -> &'a mut W {
1050        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
1051        self.w
1052    }
1053}
1054#[doc = "Counter/Timer A1 Interrupt Enable bit.\n\nValue on reset: 0"]
1055#[derive(Clone, Copy, Debug, PartialEq)]
1056pub enum TMRA1IE_A {
1057    #[doc = "0: Disable counter/timer A1 from generating an interrupt."]
1058    DIS = 0,
1059    #[doc = "1: Enable counter/timer A1 to generate an interrupt."]
1060    EN = 1,
1061}
1062impl From<TMRA1IE_A> for bool {
1063    #[inline(always)]
1064    fn from(variant: TMRA1IE_A) -> Self {
1065        variant as u8 != 0
1066    }
1067}
1068#[doc = "Reader of field `TMRA1IE`"]
1069pub type TMRA1IE_R = crate::R<bool, TMRA1IE_A>;
1070impl TMRA1IE_R {
1071    #[doc = r"Get enumerated values variant"]
1072    #[inline(always)]
1073    pub fn variant(&self) -> TMRA1IE_A {
1074        match self.bits {
1075            false => TMRA1IE_A::DIS,
1076            true => TMRA1IE_A::EN,
1077        }
1078    }
1079    #[doc = "Checks if the value of the field is `DIS`"]
1080    #[inline(always)]
1081    pub fn is_dis(&self) -> bool {
1082        *self == TMRA1IE_A::DIS
1083    }
1084    #[doc = "Checks if the value of the field is `EN`"]
1085    #[inline(always)]
1086    pub fn is_en(&self) -> bool {
1087        *self == TMRA1IE_A::EN
1088    }
1089}
1090#[doc = "Write proxy for field `TMRA1IE`"]
1091pub struct TMRA1IE_W<'a> {
1092    w: &'a mut W,
1093}
1094impl<'a> TMRA1IE_W<'a> {
1095    #[doc = r"Writes `variant` to the field"]
1096    #[inline(always)]
1097    pub fn variant(self, variant: TMRA1IE_A) -> &'a mut W {
1098        {
1099            self.bit(variant.into())
1100        }
1101    }
1102    #[doc = "Disable counter/timer A1 from generating an interrupt."]
1103    #[inline(always)]
1104    pub fn dis(self) -> &'a mut W {
1105        self.variant(TMRA1IE_A::DIS)
1106    }
1107    #[doc = "Enable counter/timer A1 to generate an interrupt."]
1108    #[inline(always)]
1109    pub fn en(self) -> &'a mut W {
1110        self.variant(TMRA1IE_A::EN)
1111    }
1112    #[doc = r"Sets the field bit"]
1113    #[inline(always)]
1114    pub fn set_bit(self) -> &'a mut W {
1115        self.bit(true)
1116    }
1117    #[doc = r"Clears the field bit"]
1118    #[inline(always)]
1119    pub fn clear_bit(self) -> &'a mut W {
1120        self.bit(false)
1121    }
1122    #[doc = r"Writes raw bits to the field"]
1123    #[inline(always)]
1124    pub fn bit(self, value: bool) -> &'a mut W {
1125        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
1126        self.w
1127    }
1128}
1129#[doc = "Counter/Timer A1 Function Select.\n\nValue on reset: 0"]
1130#[derive(Clone, Copy, Debug, PartialEq)]
1131#[repr(u8)]
1132pub enum TMRA1FN_A {
1133    #[doc = "0: Single count (output toggles and sticks).  Count to CMPR0A1, stop."]
1134    SINGLECOUNT = 0,
1135    #[doc = "1: Repeated count (periodic 1-clock-cycle-wide pulses).  Count to CMPR0A1, restart."]
1136    REPEATEDCOUNT = 1,
1137    #[doc = "2: Pulse once (aka one-shot).  Count to CMPR0A1, assert, count to CMPR1B, deassert, stop."]
1138    PULSE_ONCE = 2,
1139    #[doc = "3: Pulse continously.  Count to CMPR0A1, assert, count to CMPR1A1, deassert, restart."]
1140    PULSE_CONT = 3,
1141    #[doc = "4: Continuous run (aka Free Run).  Count continuously."]
1142    CONTINUOUS = 4,
1143}
1144impl From<TMRA1FN_A> for u8 {
1145    #[inline(always)]
1146    fn from(variant: TMRA1FN_A) -> Self {
1147        variant as _
1148    }
1149}
1150#[doc = "Reader of field `TMRA1FN`"]
1151pub type TMRA1FN_R = crate::R<u8, TMRA1FN_A>;
1152impl TMRA1FN_R {
1153    #[doc = r"Get enumerated values variant"]
1154    #[inline(always)]
1155    pub fn variant(&self) -> crate::Variant<u8, TMRA1FN_A> {
1156        use crate::Variant::*;
1157        match self.bits {
1158            0 => Val(TMRA1FN_A::SINGLECOUNT),
1159            1 => Val(TMRA1FN_A::REPEATEDCOUNT),
1160            2 => Val(TMRA1FN_A::PULSE_ONCE),
1161            3 => Val(TMRA1FN_A::PULSE_CONT),
1162            4 => Val(TMRA1FN_A::CONTINUOUS),
1163            i => Res(i),
1164        }
1165    }
1166    #[doc = "Checks if the value of the field is `SINGLECOUNT`"]
1167    #[inline(always)]
1168    pub fn is_singlecount(&self) -> bool {
1169        *self == TMRA1FN_A::SINGLECOUNT
1170    }
1171    #[doc = "Checks if the value of the field is `REPEATEDCOUNT`"]
1172    #[inline(always)]
1173    pub fn is_repeatedcount(&self) -> bool {
1174        *self == TMRA1FN_A::REPEATEDCOUNT
1175    }
1176    #[doc = "Checks if the value of the field is `PULSE_ONCE`"]
1177    #[inline(always)]
1178    pub fn is_pulse_once(&self) -> bool {
1179        *self == TMRA1FN_A::PULSE_ONCE
1180    }
1181    #[doc = "Checks if the value of the field is `PULSE_CONT`"]
1182    #[inline(always)]
1183    pub fn is_pulse_cont(&self) -> bool {
1184        *self == TMRA1FN_A::PULSE_CONT
1185    }
1186    #[doc = "Checks if the value of the field is `CONTINUOUS`"]
1187    #[inline(always)]
1188    pub fn is_continuous(&self) -> bool {
1189        *self == TMRA1FN_A::CONTINUOUS
1190    }
1191}
1192#[doc = "Write proxy for field `TMRA1FN`"]
1193pub struct TMRA1FN_W<'a> {
1194    w: &'a mut W,
1195}
1196impl<'a> TMRA1FN_W<'a> {
1197    #[doc = r"Writes `variant` to the field"]
1198    #[inline(always)]
1199    pub fn variant(self, variant: TMRA1FN_A) -> &'a mut W {
1200        unsafe { self.bits(variant.into()) }
1201    }
1202    #[doc = "Single count (output toggles and sticks). Count to CMPR0A1, stop."]
1203    #[inline(always)]
1204    pub fn singlecount(self) -> &'a mut W {
1205        self.variant(TMRA1FN_A::SINGLECOUNT)
1206    }
1207    #[doc = "Repeated count (periodic 1-clock-cycle-wide pulses). Count to CMPR0A1, restart."]
1208    #[inline(always)]
1209    pub fn repeatedcount(self) -> &'a mut W {
1210        self.variant(TMRA1FN_A::REPEATEDCOUNT)
1211    }
1212    #[doc = "Pulse once (aka one-shot). Count to CMPR0A1, assert, count to CMPR1B, deassert, stop."]
1213    #[inline(always)]
1214    pub fn pulse_once(self) -> &'a mut W {
1215        self.variant(TMRA1FN_A::PULSE_ONCE)
1216    }
1217    #[doc = "Pulse continously. Count to CMPR0A1, assert, count to CMPR1A1, deassert, restart."]
1218    #[inline(always)]
1219    pub fn pulse_cont(self) -> &'a mut W {
1220        self.variant(TMRA1FN_A::PULSE_CONT)
1221    }
1222    #[doc = "Continuous run (aka Free Run). Count continuously."]
1223    #[inline(always)]
1224    pub fn continuous(self) -> &'a mut W {
1225        self.variant(TMRA1FN_A::CONTINUOUS)
1226    }
1227    #[doc = r"Writes raw bits to the field"]
1228    #[inline(always)]
1229    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1230        self.w.bits = (self.w.bits & !(0x07 << 6)) | (((value as u32) & 0x07) << 6);
1231        self.w
1232    }
1233}
1234#[doc = "Counter/Timer A1 Clock Select.\n\nValue on reset: 0"]
1235#[derive(Clone, Copy, Debug, PartialEq)]
1236#[repr(u8)]
1237pub enum TMRA1CLK_A {
1238    #[doc = "0: Clock source is TMRPINA."]
1239    TMRPIN = 0,
1240    #[doc = "1: Clock source is the HFRC"]
1241    HFRC = 1,
1242    #[doc = "2: Clock source is the HFRC / 8"]
1243    HFRC_DIV8 = 2,
1244    #[doc = "3: Clock source is HFRC / 128"]
1245    HFRC_DIV128 = 3,
1246    #[doc = "4: Clock source is HFRC / 512"]
1247    HFRC_DIV512 = 4,
1248    #[doc = "5: Clock source is HFRC / 2048"]
1249    HFRC_DIV2K = 5,
1250    #[doc = "6: Clock source is the XT (uncalibrated)."]
1251    XT = 6,
1252    #[doc = "7: Clock source is XT / 2"]
1253    XT_DIV2 = 7,
1254    #[doc = "8: Clock source is XT / 16"]
1255    XT_DIV16 = 8,
1256    #[doc = "9: Clock source is XT / 256"]
1257    XT_DIV256 = 9,
1258    #[doc = "10: Clock source is LFRC / 2"]
1259    LFRC_DIV2 = 10,
1260    #[doc = "11: Clock source is LFRC / 32"]
1261    LFRC_DIV32 = 11,
1262    #[doc = "12: Clock source is LFRC / 1024"]
1263    LFRC_DIV1K = 12,
1264    #[doc = "13: Clock source is LFRC / 16K"]
1265    LFRC = 13,
1266    #[doc = "14: Clock source is 100 Hz from the current RTC oscillator."]
1267    RTC_100HZ = 14,
1268    #[doc = "15: Clock source is HCLK."]
1269    HCLK = 15,
1270    #[doc = "16: Clock source is buck converter stream A."]
1271    BUCKA = 16,
1272}
1273impl From<TMRA1CLK_A> for u8 {
1274    #[inline(always)]
1275    fn from(variant: TMRA1CLK_A) -> Self {
1276        variant as _
1277    }
1278}
1279#[doc = "Reader of field `TMRA1CLK`"]
1280pub type TMRA1CLK_R = crate::R<u8, TMRA1CLK_A>;
1281impl TMRA1CLK_R {
1282    #[doc = r"Get enumerated values variant"]
1283    #[inline(always)]
1284    pub fn variant(&self) -> crate::Variant<u8, TMRA1CLK_A> {
1285        use crate::Variant::*;
1286        match self.bits {
1287            0 => Val(TMRA1CLK_A::TMRPIN),
1288            1 => Val(TMRA1CLK_A::HFRC),
1289            2 => Val(TMRA1CLK_A::HFRC_DIV8),
1290            3 => Val(TMRA1CLK_A::HFRC_DIV128),
1291            4 => Val(TMRA1CLK_A::HFRC_DIV512),
1292            5 => Val(TMRA1CLK_A::HFRC_DIV2K),
1293            6 => Val(TMRA1CLK_A::XT),
1294            7 => Val(TMRA1CLK_A::XT_DIV2),
1295            8 => Val(TMRA1CLK_A::XT_DIV16),
1296            9 => Val(TMRA1CLK_A::XT_DIV256),
1297            10 => Val(TMRA1CLK_A::LFRC_DIV2),
1298            11 => Val(TMRA1CLK_A::LFRC_DIV32),
1299            12 => Val(TMRA1CLK_A::LFRC_DIV1K),
1300            13 => Val(TMRA1CLK_A::LFRC),
1301            14 => Val(TMRA1CLK_A::RTC_100HZ),
1302            15 => Val(TMRA1CLK_A::HCLK),
1303            16 => Val(TMRA1CLK_A::BUCKA),
1304            i => Res(i),
1305        }
1306    }
1307    #[doc = "Checks if the value of the field is `TMRPIN`"]
1308    #[inline(always)]
1309    pub fn is_tmrpin(&self) -> bool {
1310        *self == TMRA1CLK_A::TMRPIN
1311    }
1312    #[doc = "Checks if the value of the field is `HFRC`"]
1313    #[inline(always)]
1314    pub fn is_hfrc(&self) -> bool {
1315        *self == TMRA1CLK_A::HFRC
1316    }
1317    #[doc = "Checks if the value of the field is `HFRC_DIV8`"]
1318    #[inline(always)]
1319    pub fn is_hfrc_div8(&self) -> bool {
1320        *self == TMRA1CLK_A::HFRC_DIV8
1321    }
1322    #[doc = "Checks if the value of the field is `HFRC_DIV128`"]
1323    #[inline(always)]
1324    pub fn is_hfrc_div128(&self) -> bool {
1325        *self == TMRA1CLK_A::HFRC_DIV128
1326    }
1327    #[doc = "Checks if the value of the field is `HFRC_DIV512`"]
1328    #[inline(always)]
1329    pub fn is_hfrc_div512(&self) -> bool {
1330        *self == TMRA1CLK_A::HFRC_DIV512
1331    }
1332    #[doc = "Checks if the value of the field is `HFRC_DIV2K`"]
1333    #[inline(always)]
1334    pub fn is_hfrc_div2k(&self) -> bool {
1335        *self == TMRA1CLK_A::HFRC_DIV2K
1336    }
1337    #[doc = "Checks if the value of the field is `XT`"]
1338    #[inline(always)]
1339    pub fn is_xt(&self) -> bool {
1340        *self == TMRA1CLK_A::XT
1341    }
1342    #[doc = "Checks if the value of the field is `XT_DIV2`"]
1343    #[inline(always)]
1344    pub fn is_xt_div2(&self) -> bool {
1345        *self == TMRA1CLK_A::XT_DIV2
1346    }
1347    #[doc = "Checks if the value of the field is `XT_DIV16`"]
1348    #[inline(always)]
1349    pub fn is_xt_div16(&self) -> bool {
1350        *self == TMRA1CLK_A::XT_DIV16
1351    }
1352    #[doc = "Checks if the value of the field is `XT_DIV256`"]
1353    #[inline(always)]
1354    pub fn is_xt_div256(&self) -> bool {
1355        *self == TMRA1CLK_A::XT_DIV256
1356    }
1357    #[doc = "Checks if the value of the field is `LFRC_DIV2`"]
1358    #[inline(always)]
1359    pub fn is_lfrc_div2(&self) -> bool {
1360        *self == TMRA1CLK_A::LFRC_DIV2
1361    }
1362    #[doc = "Checks if the value of the field is `LFRC_DIV32`"]
1363    #[inline(always)]
1364    pub fn is_lfrc_div32(&self) -> bool {
1365        *self == TMRA1CLK_A::LFRC_DIV32
1366    }
1367    #[doc = "Checks if the value of the field is `LFRC_DIV1K`"]
1368    #[inline(always)]
1369    pub fn is_lfrc_div1k(&self) -> bool {
1370        *self == TMRA1CLK_A::LFRC_DIV1K
1371    }
1372    #[doc = "Checks if the value of the field is `LFRC`"]
1373    #[inline(always)]
1374    pub fn is_lfrc(&self) -> bool {
1375        *self == TMRA1CLK_A::LFRC
1376    }
1377    #[doc = "Checks if the value of the field is `RTC_100HZ`"]
1378    #[inline(always)]
1379    pub fn is_rtc_100hz(&self) -> bool {
1380        *self == TMRA1CLK_A::RTC_100HZ
1381    }
1382    #[doc = "Checks if the value of the field is `HCLK`"]
1383    #[inline(always)]
1384    pub fn is_hclk(&self) -> bool {
1385        *self == TMRA1CLK_A::HCLK
1386    }
1387    #[doc = "Checks if the value of the field is `BUCKA`"]
1388    #[inline(always)]
1389    pub fn is_bucka(&self) -> bool {
1390        *self == TMRA1CLK_A::BUCKA
1391    }
1392}
1393#[doc = "Write proxy for field `TMRA1CLK`"]
1394pub struct TMRA1CLK_W<'a> {
1395    w: &'a mut W,
1396}
1397impl<'a> TMRA1CLK_W<'a> {
1398    #[doc = r"Writes `variant` to the field"]
1399    #[inline(always)]
1400    pub fn variant(self, variant: TMRA1CLK_A) -> &'a mut W {
1401        unsafe { self.bits(variant.into()) }
1402    }
1403    #[doc = "Clock source is TMRPINA."]
1404    #[inline(always)]
1405    pub fn tmrpin(self) -> &'a mut W {
1406        self.variant(TMRA1CLK_A::TMRPIN)
1407    }
1408    #[doc = "Clock source is the HFRC"]
1409    #[inline(always)]
1410    pub fn hfrc(self) -> &'a mut W {
1411        self.variant(TMRA1CLK_A::HFRC)
1412    }
1413    #[doc = "Clock source is the HFRC / 8"]
1414    #[inline(always)]
1415    pub fn hfrc_div8(self) -> &'a mut W {
1416        self.variant(TMRA1CLK_A::HFRC_DIV8)
1417    }
1418    #[doc = "Clock source is HFRC / 128"]
1419    #[inline(always)]
1420    pub fn hfrc_div128(self) -> &'a mut W {
1421        self.variant(TMRA1CLK_A::HFRC_DIV128)
1422    }
1423    #[doc = "Clock source is HFRC / 512"]
1424    #[inline(always)]
1425    pub fn hfrc_div512(self) -> &'a mut W {
1426        self.variant(TMRA1CLK_A::HFRC_DIV512)
1427    }
1428    #[doc = "Clock source is HFRC / 2048"]
1429    #[inline(always)]
1430    pub fn hfrc_div2k(self) -> &'a mut W {
1431        self.variant(TMRA1CLK_A::HFRC_DIV2K)
1432    }
1433    #[doc = "Clock source is the XT (uncalibrated)."]
1434    #[inline(always)]
1435    pub fn xt(self) -> &'a mut W {
1436        self.variant(TMRA1CLK_A::XT)
1437    }
1438    #[doc = "Clock source is XT / 2"]
1439    #[inline(always)]
1440    pub fn xt_div2(self) -> &'a mut W {
1441        self.variant(TMRA1CLK_A::XT_DIV2)
1442    }
1443    #[doc = "Clock source is XT / 16"]
1444    #[inline(always)]
1445    pub fn xt_div16(self) -> &'a mut W {
1446        self.variant(TMRA1CLK_A::XT_DIV16)
1447    }
1448    #[doc = "Clock source is XT / 256"]
1449    #[inline(always)]
1450    pub fn xt_div256(self) -> &'a mut W {
1451        self.variant(TMRA1CLK_A::XT_DIV256)
1452    }
1453    #[doc = "Clock source is LFRC / 2"]
1454    #[inline(always)]
1455    pub fn lfrc_div2(self) -> &'a mut W {
1456        self.variant(TMRA1CLK_A::LFRC_DIV2)
1457    }
1458    #[doc = "Clock source is LFRC / 32"]
1459    #[inline(always)]
1460    pub fn lfrc_div32(self) -> &'a mut W {
1461        self.variant(TMRA1CLK_A::LFRC_DIV32)
1462    }
1463    #[doc = "Clock source is LFRC / 1024"]
1464    #[inline(always)]
1465    pub fn lfrc_div1k(self) -> &'a mut W {
1466        self.variant(TMRA1CLK_A::LFRC_DIV1K)
1467    }
1468    #[doc = "Clock source is LFRC / 16K"]
1469    #[inline(always)]
1470    pub fn lfrc(self) -> &'a mut W {
1471        self.variant(TMRA1CLK_A::LFRC)
1472    }
1473    #[doc = "Clock source is 100 Hz from the current RTC oscillator."]
1474    #[inline(always)]
1475    pub fn rtc_100hz(self) -> &'a mut W {
1476        self.variant(TMRA1CLK_A::RTC_100HZ)
1477    }
1478    #[doc = "Clock source is HCLK."]
1479    #[inline(always)]
1480    pub fn hclk(self) -> &'a mut W {
1481        self.variant(TMRA1CLK_A::HCLK)
1482    }
1483    #[doc = "Clock source is buck converter stream A."]
1484    #[inline(always)]
1485    pub fn bucka(self) -> &'a mut W {
1486        self.variant(TMRA1CLK_A::BUCKA)
1487    }
1488    #[doc = r"Writes raw bits to the field"]
1489    #[inline(always)]
1490    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1491        self.w.bits = (self.w.bits & !(0x1f << 1)) | (((value as u32) & 0x1f) << 1);
1492        self.w
1493    }
1494}
1495#[doc = "Counter/Timer A1 Enable bit.\n\nValue on reset: 0"]
1496#[derive(Clone, Copy, Debug, PartialEq)]
1497pub enum TMRA1EN_A {
1498    #[doc = "0: Counter/Timer A1 Disable."]
1499    DIS = 0,
1500    #[doc = "1: Counter/Timer A1 Enable."]
1501    EN = 1,
1502}
1503impl From<TMRA1EN_A> for bool {
1504    #[inline(always)]
1505    fn from(variant: TMRA1EN_A) -> Self {
1506        variant as u8 != 0
1507    }
1508}
1509#[doc = "Reader of field `TMRA1EN`"]
1510pub type TMRA1EN_R = crate::R<bool, TMRA1EN_A>;
1511impl TMRA1EN_R {
1512    #[doc = r"Get enumerated values variant"]
1513    #[inline(always)]
1514    pub fn variant(&self) -> TMRA1EN_A {
1515        match self.bits {
1516            false => TMRA1EN_A::DIS,
1517            true => TMRA1EN_A::EN,
1518        }
1519    }
1520    #[doc = "Checks if the value of the field is `DIS`"]
1521    #[inline(always)]
1522    pub fn is_dis(&self) -> bool {
1523        *self == TMRA1EN_A::DIS
1524    }
1525    #[doc = "Checks if the value of the field is `EN`"]
1526    #[inline(always)]
1527    pub fn is_en(&self) -> bool {
1528        *self == TMRA1EN_A::EN
1529    }
1530}
1531#[doc = "Write proxy for field `TMRA1EN`"]
1532pub struct TMRA1EN_W<'a> {
1533    w: &'a mut W,
1534}
1535impl<'a> TMRA1EN_W<'a> {
1536    #[doc = r"Writes `variant` to the field"]
1537    #[inline(always)]
1538    pub fn variant(self, variant: TMRA1EN_A) -> &'a mut W {
1539        {
1540            self.bit(variant.into())
1541        }
1542    }
1543    #[doc = "Counter/Timer A1 Disable."]
1544    #[inline(always)]
1545    pub fn dis(self) -> &'a mut W {
1546        self.variant(TMRA1EN_A::DIS)
1547    }
1548    #[doc = "Counter/Timer A1 Enable."]
1549    #[inline(always)]
1550    pub fn en(self) -> &'a mut W {
1551        self.variant(TMRA1EN_A::EN)
1552    }
1553    #[doc = r"Sets the field bit"]
1554    #[inline(always)]
1555    pub fn set_bit(self) -> &'a mut W {
1556        self.bit(true)
1557    }
1558    #[doc = r"Clears the field bit"]
1559    #[inline(always)]
1560    pub fn clear_bit(self) -> &'a mut W {
1561        self.bit(false)
1562    }
1563    #[doc = r"Writes raw bits to the field"]
1564    #[inline(always)]
1565    pub fn bit(self, value: bool) -> &'a mut W {
1566        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
1567        self.w
1568    }
1569}
1570impl R {
1571    #[doc = "Bit 31 - Counter/Timer A1/B1 Link bit."]
1572    #[inline(always)]
1573    pub fn ctlink1(&self) -> CTLINK1_R {
1574        CTLINK1_R::new(((self.bits >> 31) & 0x01) != 0)
1575    }
1576    #[doc = "Bit 28 - Counter/Timer B1 output polarity."]
1577    #[inline(always)]
1578    pub fn tmrb1pol(&self) -> TMRB1POL_R {
1579        TMRB1POL_R::new(((self.bits >> 28) & 0x01) != 0)
1580    }
1581    #[doc = "Bit 27 - Counter/Timer B1 Clear bit."]
1582    #[inline(always)]
1583    pub fn tmrb1clr(&self) -> TMRB1CLR_R {
1584        TMRB1CLR_R::new(((self.bits >> 27) & 0x01) != 0)
1585    }
1586    #[doc = "Bit 26 - Counter/Timer B1 Output Enable bit."]
1587    #[inline(always)]
1588    pub fn tmrb1pe(&self) -> TMRB1PE_R {
1589        TMRB1PE_R::new(((self.bits >> 26) & 0x01) != 0)
1590    }
1591    #[doc = "Bit 25 - Counter/Timer B1 Interrupt Enable bit."]
1592    #[inline(always)]
1593    pub fn tmrb1ie(&self) -> TMRB1IE_R {
1594        TMRB1IE_R::new(((self.bits >> 25) & 0x01) != 0)
1595    }
1596    #[doc = "Bits 22:24 - Counter/Timer B1 Function Select."]
1597    #[inline(always)]
1598    pub fn tmrb1fn(&self) -> TMRB1FN_R {
1599        TMRB1FN_R::new(((self.bits >> 22) & 0x07) as u8)
1600    }
1601    #[doc = "Bits 17:21 - Counter/Timer B1 Clock Select."]
1602    #[inline(always)]
1603    pub fn tmrb1clk(&self) -> TMRB1CLK_R {
1604        TMRB1CLK_R::new(((self.bits >> 17) & 0x1f) as u8)
1605    }
1606    #[doc = "Bit 16 - Counter/Timer B1 Enable bit."]
1607    #[inline(always)]
1608    pub fn tmrb1en(&self) -> TMRB1EN_R {
1609        TMRB1EN_R::new(((self.bits >> 16) & 0x01) != 0)
1610    }
1611    #[doc = "Bit 12 - Counter/Timer A1 output polarity."]
1612    #[inline(always)]
1613    pub fn tmra1pol(&self) -> TMRA1POL_R {
1614        TMRA1POL_R::new(((self.bits >> 12) & 0x01) != 0)
1615    }
1616    #[doc = "Bit 11 - Counter/Timer A1 Clear bit."]
1617    #[inline(always)]
1618    pub fn tmra1clr(&self) -> TMRA1CLR_R {
1619        TMRA1CLR_R::new(((self.bits >> 11) & 0x01) != 0)
1620    }
1621    #[doc = "Bit 10 - Counter/Timer A1 Output Enable bit."]
1622    #[inline(always)]
1623    pub fn tmra1pe(&self) -> TMRA1PE_R {
1624        TMRA1PE_R::new(((self.bits >> 10) & 0x01) != 0)
1625    }
1626    #[doc = "Bit 9 - Counter/Timer A1 Interrupt Enable bit."]
1627    #[inline(always)]
1628    pub fn tmra1ie(&self) -> TMRA1IE_R {
1629        TMRA1IE_R::new(((self.bits >> 9) & 0x01) != 0)
1630    }
1631    #[doc = "Bits 6:8 - Counter/Timer A1 Function Select."]
1632    #[inline(always)]
1633    pub fn tmra1fn(&self) -> TMRA1FN_R {
1634        TMRA1FN_R::new(((self.bits >> 6) & 0x07) as u8)
1635    }
1636    #[doc = "Bits 1:5 - Counter/Timer A1 Clock Select."]
1637    #[inline(always)]
1638    pub fn tmra1clk(&self) -> TMRA1CLK_R {
1639        TMRA1CLK_R::new(((self.bits >> 1) & 0x1f) as u8)
1640    }
1641    #[doc = "Bit 0 - Counter/Timer A1 Enable bit."]
1642    #[inline(always)]
1643    pub fn tmra1en(&self) -> TMRA1EN_R {
1644        TMRA1EN_R::new((self.bits & 0x01) != 0)
1645    }
1646}
1647impl W {
1648    #[doc = "Bit 31 - Counter/Timer A1/B1 Link bit."]
1649    #[inline(always)]
1650    pub fn ctlink1(&mut self) -> CTLINK1_W {
1651        CTLINK1_W { w: self }
1652    }
1653    #[doc = "Bit 28 - Counter/Timer B1 output polarity."]
1654    #[inline(always)]
1655    pub fn tmrb1pol(&mut self) -> TMRB1POL_W {
1656        TMRB1POL_W { w: self }
1657    }
1658    #[doc = "Bit 27 - Counter/Timer B1 Clear bit."]
1659    #[inline(always)]
1660    pub fn tmrb1clr(&mut self) -> TMRB1CLR_W {
1661        TMRB1CLR_W { w: self }
1662    }
1663    #[doc = "Bit 26 - Counter/Timer B1 Output Enable bit."]
1664    #[inline(always)]
1665    pub fn tmrb1pe(&mut self) -> TMRB1PE_W {
1666        TMRB1PE_W { w: self }
1667    }
1668    #[doc = "Bit 25 - Counter/Timer B1 Interrupt Enable bit."]
1669    #[inline(always)]
1670    pub fn tmrb1ie(&mut self) -> TMRB1IE_W {
1671        TMRB1IE_W { w: self }
1672    }
1673    #[doc = "Bits 22:24 - Counter/Timer B1 Function Select."]
1674    #[inline(always)]
1675    pub fn tmrb1fn(&mut self) -> TMRB1FN_W {
1676        TMRB1FN_W { w: self }
1677    }
1678    #[doc = "Bits 17:21 - Counter/Timer B1 Clock Select."]
1679    #[inline(always)]
1680    pub fn tmrb1clk(&mut self) -> TMRB1CLK_W {
1681        TMRB1CLK_W { w: self }
1682    }
1683    #[doc = "Bit 16 - Counter/Timer B1 Enable bit."]
1684    #[inline(always)]
1685    pub fn tmrb1en(&mut self) -> TMRB1EN_W {
1686        TMRB1EN_W { w: self }
1687    }
1688    #[doc = "Bit 12 - Counter/Timer A1 output polarity."]
1689    #[inline(always)]
1690    pub fn tmra1pol(&mut self) -> TMRA1POL_W {
1691        TMRA1POL_W { w: self }
1692    }
1693    #[doc = "Bit 11 - Counter/Timer A1 Clear bit."]
1694    #[inline(always)]
1695    pub fn tmra1clr(&mut self) -> TMRA1CLR_W {
1696        TMRA1CLR_W { w: self }
1697    }
1698    #[doc = "Bit 10 - Counter/Timer A1 Output Enable bit."]
1699    #[inline(always)]
1700    pub fn tmra1pe(&mut self) -> TMRA1PE_W {
1701        TMRA1PE_W { w: self }
1702    }
1703    #[doc = "Bit 9 - Counter/Timer A1 Interrupt Enable bit."]
1704    #[inline(always)]
1705    pub fn tmra1ie(&mut self) -> TMRA1IE_W {
1706        TMRA1IE_W { w: self }
1707    }
1708    #[doc = "Bits 6:8 - Counter/Timer A1 Function Select."]
1709    #[inline(always)]
1710    pub fn tmra1fn(&mut self) -> TMRA1FN_W {
1711        TMRA1FN_W { w: self }
1712    }
1713    #[doc = "Bits 1:5 - Counter/Timer A1 Clock Select."]
1714    #[inline(always)]
1715    pub fn tmra1clk(&mut self) -> TMRA1CLK_W {
1716        TMRA1CLK_W { w: self }
1717    }
1718    #[doc = "Bit 0 - Counter/Timer A1 Enable bit."]
1719    #[inline(always)]
1720    pub fn tmra1en(&mut self) -> TMRA1EN_W {
1721        TMRA1EN_W { w: self }
1722    }
1723}