1#[doc = "Reader of register CTRL"]
2pub type R = crate::R<u32, super::CTRL>;
3#[doc = "Writer for register CTRL"]
4pub type W = crate::W<u32, super::CTRL>;
5#[doc = "Register CTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::CTRL {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Timer Mode\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u8)]
16pub enum MODE_A {
17 #[doc = "0: Up-count mode"]
18 UP = 0,
19 #[doc = "1: Down-count mode"]
20 DOWN = 1,
21 #[doc = "2: Up/down-count mode"]
22 UPDOWN = 2,
23 #[doc = "3: Quadrature decoder mode"]
24 QDEC = 3,
25}
26impl From<MODE_A> for u8 {
27 #[inline(always)]
28 fn from(variant: MODE_A) -> Self {
29 variant as _
30 }
31}
32#[doc = "Reader of field `MODE`"]
33pub type MODE_R = crate::R<u8, MODE_A>;
34impl MODE_R {
35 #[doc = r"Get enumerated values variant"]
36 #[inline(always)]
37 pub fn variant(&self) -> MODE_A {
38 match self.bits {
39 0 => MODE_A::UP,
40 1 => MODE_A::DOWN,
41 2 => MODE_A::UPDOWN,
42 3 => MODE_A::QDEC,
43 _ => unreachable!(),
44 }
45 }
46 #[doc = "Checks if the value of the field is `UP`"]
47 #[inline(always)]
48 pub fn is_up(&self) -> bool {
49 *self == MODE_A::UP
50 }
51 #[doc = "Checks if the value of the field is `DOWN`"]
52 #[inline(always)]
53 pub fn is_down(&self) -> bool {
54 *self == MODE_A::DOWN
55 }
56 #[doc = "Checks if the value of the field is `UPDOWN`"]
57 #[inline(always)]
58 pub fn is_updown(&self) -> bool {
59 *self == MODE_A::UPDOWN
60 }
61 #[doc = "Checks if the value of the field is `QDEC`"]
62 #[inline(always)]
63 pub fn is_qdec(&self) -> bool {
64 *self == MODE_A::QDEC
65 }
66}
67#[doc = "Write proxy for field `MODE`"]
68pub struct MODE_W<'a> {
69 w: &'a mut W,
70}
71impl<'a> MODE_W<'a> {
72 #[doc = r"Writes `variant` to the field"]
73 #[inline(always)]
74 pub fn variant(self, variant: MODE_A) -> &'a mut W {
75 {
76 self.bits(variant.into())
77 }
78 }
79 #[doc = "Up-count mode"]
80 #[inline(always)]
81 pub fn up(self) -> &'a mut W {
82 self.variant(MODE_A::UP)
83 }
84 #[doc = "Down-count mode"]
85 #[inline(always)]
86 pub fn down(self) -> &'a mut W {
87 self.variant(MODE_A::DOWN)
88 }
89 #[doc = "Up/down-count mode"]
90 #[inline(always)]
91 pub fn updown(self) -> &'a mut W {
92 self.variant(MODE_A::UPDOWN)
93 }
94 #[doc = "Quadrature decoder mode"]
95 #[inline(always)]
96 pub fn qdec(self) -> &'a mut W {
97 self.variant(MODE_A::QDEC)
98 }
99 #[doc = r"Writes raw bits to the field"]
100 #[inline(always)]
101 pub fn bits(self, value: u8) -> &'a mut W {
102 self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
103 self.w
104 }
105}
106#[doc = "Reader of field `SYNC`"]
107pub type SYNC_R = crate::R<bool, bool>;
108#[doc = "Write proxy for field `SYNC`"]
109pub struct SYNC_W<'a> {
110 w: &'a mut W,
111}
112impl<'a> SYNC_W<'a> {
113 #[doc = r"Sets the field bit"]
114 #[inline(always)]
115 pub fn set_bit(self) -> &'a mut W {
116 self.bit(true)
117 }
118 #[doc = r"Clears the field bit"]
119 #[inline(always)]
120 pub fn clear_bit(self) -> &'a mut W {
121 self.bit(false)
122 }
123 #[doc = r"Writes raw bits to the field"]
124 #[inline(always)]
125 pub fn bit(self, value: bool) -> &'a mut W {
126 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
127 self.w
128 }
129}
130#[doc = "Reader of field `OSMEN`"]
131pub type OSMEN_R = crate::R<bool, bool>;
132#[doc = "Write proxy for field `OSMEN`"]
133pub struct OSMEN_W<'a> {
134 w: &'a mut W,
135}
136impl<'a> OSMEN_W<'a> {
137 #[doc = r"Sets the field bit"]
138 #[inline(always)]
139 pub fn set_bit(self) -> &'a mut W {
140 self.bit(true)
141 }
142 #[doc = r"Clears the field bit"]
143 #[inline(always)]
144 pub fn clear_bit(self) -> &'a mut W {
145 self.bit(false)
146 }
147 #[doc = r"Writes raw bits to the field"]
148 #[inline(always)]
149 pub fn bit(self, value: bool) -> &'a mut W {
150 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
151 self.w
152 }
153}
154#[doc = "Reader of field `QDM`"]
155pub type QDM_R = crate::R<bool, bool>;
156#[doc = "Write proxy for field `QDM`"]
157pub struct QDM_W<'a> {
158 w: &'a mut W,
159}
160impl<'a> QDM_W<'a> {
161 #[doc = r"Sets the field bit"]
162 #[inline(always)]
163 pub fn set_bit(self) -> &'a mut W {
164 self.bit(true)
165 }
166 #[doc = r"Clears the field bit"]
167 #[inline(always)]
168 pub fn clear_bit(self) -> &'a mut W {
169 self.bit(false)
170 }
171 #[doc = r"Writes raw bits to the field"]
172 #[inline(always)]
173 pub fn bit(self, value: bool) -> &'a mut W {
174 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
175 self.w
176 }
177}
178#[doc = "Reader of field `DEBUGRUN`"]
179pub type DEBUGRUN_R = crate::R<bool, bool>;
180#[doc = "Write proxy for field `DEBUGRUN`"]
181pub struct DEBUGRUN_W<'a> {
182 w: &'a mut W,
183}
184impl<'a> DEBUGRUN_W<'a> {
185 #[doc = r"Sets the field bit"]
186 #[inline(always)]
187 pub fn set_bit(self) -> &'a mut W {
188 self.bit(true)
189 }
190 #[doc = r"Clears the field bit"]
191 #[inline(always)]
192 pub fn clear_bit(self) -> &'a mut W {
193 self.bit(false)
194 }
195 #[doc = r"Writes raw bits to the field"]
196 #[inline(always)]
197 pub fn bit(self, value: bool) -> &'a mut W {
198 self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
199 self.w
200 }
201}
202#[doc = "Reader of field `DMACLRACT`"]
203pub type DMACLRACT_R = crate::R<bool, bool>;
204#[doc = "Write proxy for field `DMACLRACT`"]
205pub struct DMACLRACT_W<'a> {
206 w: &'a mut W,
207}
208impl<'a> DMACLRACT_W<'a> {
209 #[doc = r"Sets the field bit"]
210 #[inline(always)]
211 pub fn set_bit(self) -> &'a mut W {
212 self.bit(true)
213 }
214 #[doc = r"Clears the field bit"]
215 #[inline(always)]
216 pub fn clear_bit(self) -> &'a mut W {
217 self.bit(false)
218 }
219 #[doc = r"Writes raw bits to the field"]
220 #[inline(always)]
221 pub fn bit(self, value: bool) -> &'a mut W {
222 self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
223 self.w
224 }
225}
226#[doc = "Timer Rising Input Edge Action\n\nValue on reset: 0"]
227#[derive(Clone, Copy, Debug, PartialEq)]
228#[repr(u8)]
229pub enum RISEA_A {
230 #[doc = "0: No action"]
231 NONE = 0,
232 #[doc = "1: Start counter without reload"]
233 START = 1,
234 #[doc = "2: Stop counter without reload"]
235 STOP = 2,
236 #[doc = "3: Reload and start counter"]
237 RELOADSTART = 3,
238}
239impl From<RISEA_A> for u8 {
240 #[inline(always)]
241 fn from(variant: RISEA_A) -> Self {
242 variant as _
243 }
244}
245#[doc = "Reader of field `RISEA`"]
246pub type RISEA_R = crate::R<u8, RISEA_A>;
247impl RISEA_R {
248 #[doc = r"Get enumerated values variant"]
249 #[inline(always)]
250 pub fn variant(&self) -> RISEA_A {
251 match self.bits {
252 0 => RISEA_A::NONE,
253 1 => RISEA_A::START,
254 2 => RISEA_A::STOP,
255 3 => RISEA_A::RELOADSTART,
256 _ => unreachable!(),
257 }
258 }
259 #[doc = "Checks if the value of the field is `NONE`"]
260 #[inline(always)]
261 pub fn is_none(&self) -> bool {
262 *self == RISEA_A::NONE
263 }
264 #[doc = "Checks if the value of the field is `START`"]
265 #[inline(always)]
266 pub fn is_start(&self) -> bool {
267 *self == RISEA_A::START
268 }
269 #[doc = "Checks if the value of the field is `STOP`"]
270 #[inline(always)]
271 pub fn is_stop(&self) -> bool {
272 *self == RISEA_A::STOP
273 }
274 #[doc = "Checks if the value of the field is `RELOADSTART`"]
275 #[inline(always)]
276 pub fn is_reloadstart(&self) -> bool {
277 *self == RISEA_A::RELOADSTART
278 }
279}
280#[doc = "Write proxy for field `RISEA`"]
281pub struct RISEA_W<'a> {
282 w: &'a mut W,
283}
284impl<'a> RISEA_W<'a> {
285 #[doc = r"Writes `variant` to the field"]
286 #[inline(always)]
287 pub fn variant(self, variant: RISEA_A) -> &'a mut W {
288 {
289 self.bits(variant.into())
290 }
291 }
292 #[doc = "No action"]
293 #[inline(always)]
294 pub fn none(self) -> &'a mut W {
295 self.variant(RISEA_A::NONE)
296 }
297 #[doc = "Start counter without reload"]
298 #[inline(always)]
299 pub fn start(self) -> &'a mut W {
300 self.variant(RISEA_A::START)
301 }
302 #[doc = "Stop counter without reload"]
303 #[inline(always)]
304 pub fn stop(self) -> &'a mut W {
305 self.variant(RISEA_A::STOP)
306 }
307 #[doc = "Reload and start counter"]
308 #[inline(always)]
309 pub fn reloadstart(self) -> &'a mut W {
310 self.variant(RISEA_A::RELOADSTART)
311 }
312 #[doc = r"Writes raw bits to the field"]
313 #[inline(always)]
314 pub fn bits(self, value: u8) -> &'a mut W {
315 self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
316 self.w
317 }
318}
319#[doc = "Timer Falling Input Edge Action\n\nValue on reset: 0"]
320#[derive(Clone, Copy, Debug, PartialEq)]
321#[repr(u8)]
322pub enum FALLA_A {
323 #[doc = "0: No action"]
324 NONE = 0,
325 #[doc = "1: Start counter without reload"]
326 START = 1,
327 #[doc = "2: Stop counter without reload"]
328 STOP = 2,
329 #[doc = "3: Reload and start counter"]
330 RELOADSTART = 3,
331}
332impl From<FALLA_A> for u8 {
333 #[inline(always)]
334 fn from(variant: FALLA_A) -> Self {
335 variant as _
336 }
337}
338#[doc = "Reader of field `FALLA`"]
339pub type FALLA_R = crate::R<u8, FALLA_A>;
340impl FALLA_R {
341 #[doc = r"Get enumerated values variant"]
342 #[inline(always)]
343 pub fn variant(&self) -> FALLA_A {
344 match self.bits {
345 0 => FALLA_A::NONE,
346 1 => FALLA_A::START,
347 2 => FALLA_A::STOP,
348 3 => FALLA_A::RELOADSTART,
349 _ => unreachable!(),
350 }
351 }
352 #[doc = "Checks if the value of the field is `NONE`"]
353 #[inline(always)]
354 pub fn is_none(&self) -> bool {
355 *self == FALLA_A::NONE
356 }
357 #[doc = "Checks if the value of the field is `START`"]
358 #[inline(always)]
359 pub fn is_start(&self) -> bool {
360 *self == FALLA_A::START
361 }
362 #[doc = "Checks if the value of the field is `STOP`"]
363 #[inline(always)]
364 pub fn is_stop(&self) -> bool {
365 *self == FALLA_A::STOP
366 }
367 #[doc = "Checks if the value of the field is `RELOADSTART`"]
368 #[inline(always)]
369 pub fn is_reloadstart(&self) -> bool {
370 *self == FALLA_A::RELOADSTART
371 }
372}
373#[doc = "Write proxy for field `FALLA`"]
374pub struct FALLA_W<'a> {
375 w: &'a mut W,
376}
377impl<'a> FALLA_W<'a> {
378 #[doc = r"Writes `variant` to the field"]
379 #[inline(always)]
380 pub fn variant(self, variant: FALLA_A) -> &'a mut W {
381 {
382 self.bits(variant.into())
383 }
384 }
385 #[doc = "No action"]
386 #[inline(always)]
387 pub fn none(self) -> &'a mut W {
388 self.variant(FALLA_A::NONE)
389 }
390 #[doc = "Start counter without reload"]
391 #[inline(always)]
392 pub fn start(self) -> &'a mut W {
393 self.variant(FALLA_A::START)
394 }
395 #[doc = "Stop counter without reload"]
396 #[inline(always)]
397 pub fn stop(self) -> &'a mut W {
398 self.variant(FALLA_A::STOP)
399 }
400 #[doc = "Reload and start counter"]
401 #[inline(always)]
402 pub fn reloadstart(self) -> &'a mut W {
403 self.variant(FALLA_A::RELOADSTART)
404 }
405 #[doc = r"Writes raw bits to the field"]
406 #[inline(always)]
407 pub fn bits(self, value: u8) -> &'a mut W {
408 self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10);
409 self.w
410 }
411}
412#[doc = "Reader of field `X2CNT`"]
413pub type X2CNT_R = crate::R<bool, bool>;
414#[doc = "Write proxy for field `X2CNT`"]
415pub struct X2CNT_W<'a> {
416 w: &'a mut W,
417}
418impl<'a> X2CNT_W<'a> {
419 #[doc = r"Sets the field bit"]
420 #[inline(always)]
421 pub fn set_bit(self) -> &'a mut W {
422 self.bit(true)
423 }
424 #[doc = r"Clears the field bit"]
425 #[inline(always)]
426 pub fn clear_bit(self) -> &'a mut W {
427 self.bit(false)
428 }
429 #[doc = r"Writes raw bits to the field"]
430 #[inline(always)]
431 pub fn bit(self, value: bool) -> &'a mut W {
432 self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
433 self.w
434 }
435}
436#[doc = "Reader of field `DISSYNCOUT`"]
437pub type DISSYNCOUT_R = crate::R<bool, bool>;
438#[doc = "Write proxy for field `DISSYNCOUT`"]
439pub struct DISSYNCOUT_W<'a> {
440 w: &'a mut W,
441}
442impl<'a> DISSYNCOUT_W<'a> {
443 #[doc = r"Sets the field bit"]
444 #[inline(always)]
445 pub fn set_bit(self) -> &'a mut W {
446 self.bit(true)
447 }
448 #[doc = r"Clears the field bit"]
449 #[inline(always)]
450 pub fn clear_bit(self) -> &'a mut W {
451 self.bit(false)
452 }
453 #[doc = r"Writes raw bits to the field"]
454 #[inline(always)]
455 pub fn bit(self, value: bool) -> &'a mut W {
456 self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
457 self.w
458 }
459}
460#[doc = "Clock Source Select\n\nValue on reset: 0"]
461#[derive(Clone, Copy, Debug, PartialEq)]
462#[repr(u8)]
463pub enum CLKSEL_A {
464 #[doc = "0: Prescaled HFPERCLK"]
465 PRESCHFPERCLK = 0,
466 #[doc = "1: Compare/Capture Channel 1 Input"]
467 CC1 = 1,
468 #[doc = "2: Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
469 TIMEROUF = 2,
470}
471impl From<CLKSEL_A> for u8 {
472 #[inline(always)]
473 fn from(variant: CLKSEL_A) -> Self {
474 variant as _
475 }
476}
477#[doc = "Reader of field `CLKSEL`"]
478pub type CLKSEL_R = crate::R<u8, CLKSEL_A>;
479impl CLKSEL_R {
480 #[doc = r"Get enumerated values variant"]
481 #[inline(always)]
482 pub fn variant(&self) -> crate::Variant<u8, CLKSEL_A> {
483 use crate::Variant::*;
484 match self.bits {
485 0 => Val(CLKSEL_A::PRESCHFPERCLK),
486 1 => Val(CLKSEL_A::CC1),
487 2 => Val(CLKSEL_A::TIMEROUF),
488 i => Res(i),
489 }
490 }
491 #[doc = "Checks if the value of the field is `PRESCHFPERCLK`"]
492 #[inline(always)]
493 pub fn is_preschfperclk(&self) -> bool {
494 *self == CLKSEL_A::PRESCHFPERCLK
495 }
496 #[doc = "Checks if the value of the field is `CC1`"]
497 #[inline(always)]
498 pub fn is_cc1(&self) -> bool {
499 *self == CLKSEL_A::CC1
500 }
501 #[doc = "Checks if the value of the field is `TIMEROUF`"]
502 #[inline(always)]
503 pub fn is_timerouf(&self) -> bool {
504 *self == CLKSEL_A::TIMEROUF
505 }
506}
507#[doc = "Write proxy for field `CLKSEL`"]
508pub struct CLKSEL_W<'a> {
509 w: &'a mut W,
510}
511impl<'a> CLKSEL_W<'a> {
512 #[doc = r"Writes `variant` to the field"]
513 #[inline(always)]
514 pub fn variant(self, variant: CLKSEL_A) -> &'a mut W {
515 unsafe { self.bits(variant.into()) }
516 }
517 #[doc = "Prescaled HFPERCLK"]
518 #[inline(always)]
519 pub fn preschfperclk(self) -> &'a mut W {
520 self.variant(CLKSEL_A::PRESCHFPERCLK)
521 }
522 #[doc = "Compare/Capture Channel 1 Input"]
523 #[inline(always)]
524 pub fn cc1(self) -> &'a mut W {
525 self.variant(CLKSEL_A::CC1)
526 }
527 #[doc = "Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
528 #[inline(always)]
529 pub fn timerouf(self) -> &'a mut W {
530 self.variant(CLKSEL_A::TIMEROUF)
531 }
532 #[doc = r"Writes raw bits to the field"]
533 #[inline(always)]
534 pub unsafe fn bits(self, value: u8) -> &'a mut W {
535 self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16);
536 self.w
537 }
538}
539#[doc = "Prescaler Setting\n\nValue on reset: 0"]
540#[derive(Clone, Copy, Debug, PartialEq)]
541#[repr(u8)]
542pub enum PRESC_A {
543 #[doc = "0: The HFPERCLK is undivided"]
544 DIV1 = 0,
545 #[doc = "1: The HFPERCLK is divided by 2"]
546 DIV2 = 1,
547 #[doc = "2: The HFPERCLK is divided by 4"]
548 DIV4 = 2,
549 #[doc = "3: The HFPERCLK is divided by 8"]
550 DIV8 = 3,
551 #[doc = "4: The HFPERCLK is divided by 16"]
552 DIV16 = 4,
553 #[doc = "5: The HFPERCLK is divided by 32"]
554 DIV32 = 5,
555 #[doc = "6: The HFPERCLK is divided by 64"]
556 DIV64 = 6,
557 #[doc = "7: The HFPERCLK is divided by 128"]
558 DIV128 = 7,
559 #[doc = "8: The HFPERCLK is divided by 256"]
560 DIV256 = 8,
561 #[doc = "9: The HFPERCLK is divided by 512"]
562 DIV512 = 9,
563 #[doc = "10: The HFPERCLK is divided by 1024"]
564 DIV1024 = 10,
565}
566impl From<PRESC_A> for u8 {
567 #[inline(always)]
568 fn from(variant: PRESC_A) -> Self {
569 variant as _
570 }
571}
572#[doc = "Reader of field `PRESC`"]
573pub type PRESC_R = crate::R<u8, PRESC_A>;
574impl PRESC_R {
575 #[doc = r"Get enumerated values variant"]
576 #[inline(always)]
577 pub fn variant(&self) -> crate::Variant<u8, PRESC_A> {
578 use crate::Variant::*;
579 match self.bits {
580 0 => Val(PRESC_A::DIV1),
581 1 => Val(PRESC_A::DIV2),
582 2 => Val(PRESC_A::DIV4),
583 3 => Val(PRESC_A::DIV8),
584 4 => Val(PRESC_A::DIV16),
585 5 => Val(PRESC_A::DIV32),
586 6 => Val(PRESC_A::DIV64),
587 7 => Val(PRESC_A::DIV128),
588 8 => Val(PRESC_A::DIV256),
589 9 => Val(PRESC_A::DIV512),
590 10 => Val(PRESC_A::DIV1024),
591 i => Res(i),
592 }
593 }
594 #[doc = "Checks if the value of the field is `DIV1`"]
595 #[inline(always)]
596 pub fn is_div1(&self) -> bool {
597 *self == PRESC_A::DIV1
598 }
599 #[doc = "Checks if the value of the field is `DIV2`"]
600 #[inline(always)]
601 pub fn is_div2(&self) -> bool {
602 *self == PRESC_A::DIV2
603 }
604 #[doc = "Checks if the value of the field is `DIV4`"]
605 #[inline(always)]
606 pub fn is_div4(&self) -> bool {
607 *self == PRESC_A::DIV4
608 }
609 #[doc = "Checks if the value of the field is `DIV8`"]
610 #[inline(always)]
611 pub fn is_div8(&self) -> bool {
612 *self == PRESC_A::DIV8
613 }
614 #[doc = "Checks if the value of the field is `DIV16`"]
615 #[inline(always)]
616 pub fn is_div16(&self) -> bool {
617 *self == PRESC_A::DIV16
618 }
619 #[doc = "Checks if the value of the field is `DIV32`"]
620 #[inline(always)]
621 pub fn is_div32(&self) -> bool {
622 *self == PRESC_A::DIV32
623 }
624 #[doc = "Checks if the value of the field is `DIV64`"]
625 #[inline(always)]
626 pub fn is_div64(&self) -> bool {
627 *self == PRESC_A::DIV64
628 }
629 #[doc = "Checks if the value of the field is `DIV128`"]
630 #[inline(always)]
631 pub fn is_div128(&self) -> bool {
632 *self == PRESC_A::DIV128
633 }
634 #[doc = "Checks if the value of the field is `DIV256`"]
635 #[inline(always)]
636 pub fn is_div256(&self) -> bool {
637 *self == PRESC_A::DIV256
638 }
639 #[doc = "Checks if the value of the field is `DIV512`"]
640 #[inline(always)]
641 pub fn is_div512(&self) -> bool {
642 *self == PRESC_A::DIV512
643 }
644 #[doc = "Checks if the value of the field is `DIV1024`"]
645 #[inline(always)]
646 pub fn is_div1024(&self) -> bool {
647 *self == PRESC_A::DIV1024
648 }
649}
650#[doc = "Write proxy for field `PRESC`"]
651pub struct PRESC_W<'a> {
652 w: &'a mut W,
653}
654impl<'a> PRESC_W<'a> {
655 #[doc = r"Writes `variant` to the field"]
656 #[inline(always)]
657 pub fn variant(self, variant: PRESC_A) -> &'a mut W {
658 unsafe { self.bits(variant.into()) }
659 }
660 #[doc = "The HFPERCLK is undivided"]
661 #[inline(always)]
662 pub fn div1(self) -> &'a mut W {
663 self.variant(PRESC_A::DIV1)
664 }
665 #[doc = "The HFPERCLK is divided by 2"]
666 #[inline(always)]
667 pub fn div2(self) -> &'a mut W {
668 self.variant(PRESC_A::DIV2)
669 }
670 #[doc = "The HFPERCLK is divided by 4"]
671 #[inline(always)]
672 pub fn div4(self) -> &'a mut W {
673 self.variant(PRESC_A::DIV4)
674 }
675 #[doc = "The HFPERCLK is divided by 8"]
676 #[inline(always)]
677 pub fn div8(self) -> &'a mut W {
678 self.variant(PRESC_A::DIV8)
679 }
680 #[doc = "The HFPERCLK is divided by 16"]
681 #[inline(always)]
682 pub fn div16(self) -> &'a mut W {
683 self.variant(PRESC_A::DIV16)
684 }
685 #[doc = "The HFPERCLK is divided by 32"]
686 #[inline(always)]
687 pub fn div32(self) -> &'a mut W {
688 self.variant(PRESC_A::DIV32)
689 }
690 #[doc = "The HFPERCLK is divided by 64"]
691 #[inline(always)]
692 pub fn div64(self) -> &'a mut W {
693 self.variant(PRESC_A::DIV64)
694 }
695 #[doc = "The HFPERCLK is divided by 128"]
696 #[inline(always)]
697 pub fn div128(self) -> &'a mut W {
698 self.variant(PRESC_A::DIV128)
699 }
700 #[doc = "The HFPERCLK is divided by 256"]
701 #[inline(always)]
702 pub fn div256(self) -> &'a mut W {
703 self.variant(PRESC_A::DIV256)
704 }
705 #[doc = "The HFPERCLK is divided by 512"]
706 #[inline(always)]
707 pub fn div512(self) -> &'a mut W {
708 self.variant(PRESC_A::DIV512)
709 }
710 #[doc = "The HFPERCLK is divided by 1024"]
711 #[inline(always)]
712 pub fn div1024(self) -> &'a mut W {
713 self.variant(PRESC_A::DIV1024)
714 }
715 #[doc = r"Writes raw bits to the field"]
716 #[inline(always)]
717 pub unsafe fn bits(self, value: u8) -> &'a mut W {
718 self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24);
719 self.w
720 }
721}
722#[doc = "Reader of field `ATI`"]
723pub type ATI_R = crate::R<bool, bool>;
724#[doc = "Write proxy for field `ATI`"]
725pub struct ATI_W<'a> {
726 w: &'a mut W,
727}
728impl<'a> ATI_W<'a> {
729 #[doc = r"Sets the field bit"]
730 #[inline(always)]
731 pub fn set_bit(self) -> &'a mut W {
732 self.bit(true)
733 }
734 #[doc = r"Clears the field bit"]
735 #[inline(always)]
736 pub fn clear_bit(self) -> &'a mut W {
737 self.bit(false)
738 }
739 #[doc = r"Writes raw bits to the field"]
740 #[inline(always)]
741 pub fn bit(self, value: bool) -> &'a mut W {
742 self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
743 self.w
744 }
745}
746#[doc = "Reader of field `RSSCOIST`"]
747pub type RSSCOIST_R = crate::R<bool, bool>;
748#[doc = "Write proxy for field `RSSCOIST`"]
749pub struct RSSCOIST_W<'a> {
750 w: &'a mut W,
751}
752impl<'a> RSSCOIST_W<'a> {
753 #[doc = r"Sets the field bit"]
754 #[inline(always)]
755 pub fn set_bit(self) -> &'a mut W {
756 self.bit(true)
757 }
758 #[doc = r"Clears the field bit"]
759 #[inline(always)]
760 pub fn clear_bit(self) -> &'a mut W {
761 self.bit(false)
762 }
763 #[doc = r"Writes raw bits to the field"]
764 #[inline(always)]
765 pub fn bit(self, value: bool) -> &'a mut W {
766 self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
767 self.w
768 }
769}
770impl R {
771 #[doc = "Bits 0:1 - Timer Mode"]
772 #[inline(always)]
773 pub fn mode(&self) -> MODE_R {
774 MODE_R::new((self.bits & 0x03) as u8)
775 }
776 #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
777 #[inline(always)]
778 pub fn sync(&self) -> SYNC_R {
779 SYNC_R::new(((self.bits >> 3) & 0x01) != 0)
780 }
781 #[doc = "Bit 4 - One-shot Mode Enable"]
782 #[inline(always)]
783 pub fn osmen(&self) -> OSMEN_R {
784 OSMEN_R::new(((self.bits >> 4) & 0x01) != 0)
785 }
786 #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
787 #[inline(always)]
788 pub fn qdm(&self) -> QDM_R {
789 QDM_R::new(((self.bits >> 5) & 0x01) != 0)
790 }
791 #[doc = "Bit 6 - Debug Mode Run Enable"]
792 #[inline(always)]
793 pub fn debugrun(&self) -> DEBUGRUN_R {
794 DEBUGRUN_R::new(((self.bits >> 6) & 0x01) != 0)
795 }
796 #[doc = "Bit 7 - DMA Request Clear on Active"]
797 #[inline(always)]
798 pub fn dmaclract(&self) -> DMACLRACT_R {
799 DMACLRACT_R::new(((self.bits >> 7) & 0x01) != 0)
800 }
801 #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
802 #[inline(always)]
803 pub fn risea(&self) -> RISEA_R {
804 RISEA_R::new(((self.bits >> 8) & 0x03) as u8)
805 }
806 #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
807 #[inline(always)]
808 pub fn falla(&self) -> FALLA_R {
809 FALLA_R::new(((self.bits >> 10) & 0x03) as u8)
810 }
811 #[doc = "Bit 13 - 2x Count Mode"]
812 #[inline(always)]
813 pub fn x2cnt(&self) -> X2CNT_R {
814 X2CNT_R::new(((self.bits >> 13) & 0x01) != 0)
815 }
816 #[doc = "Bit 14 - Disable Timer From Start/Stop/Reload Other Synchronized Timers"]
817 #[inline(always)]
818 pub fn dissyncout(&self) -> DISSYNCOUT_R {
819 DISSYNCOUT_R::new(((self.bits >> 14) & 0x01) != 0)
820 }
821 #[doc = "Bits 16:17 - Clock Source Select"]
822 #[inline(always)]
823 pub fn clksel(&self) -> CLKSEL_R {
824 CLKSEL_R::new(((self.bits >> 16) & 0x03) as u8)
825 }
826 #[doc = "Bits 24:27 - Prescaler Setting"]
827 #[inline(always)]
828 pub fn presc(&self) -> PRESC_R {
829 PRESC_R::new(((self.bits >> 24) & 0x0f) as u8)
830 }
831 #[doc = "Bit 28 - Always Track Inputs"]
832 #[inline(always)]
833 pub fn ati(&self) -> ATI_R {
834 ATI_R::new(((self.bits >> 28) & 0x01) != 0)
835 }
836 #[doc = "Bit 29 - Reload-Start Sets Compare Output Initial State"]
837 #[inline(always)]
838 pub fn rsscoist(&self) -> RSSCOIST_R {
839 RSSCOIST_R::new(((self.bits >> 29) & 0x01) != 0)
840 }
841}
842impl W {
843 #[doc = "Bits 0:1 - Timer Mode"]
844 #[inline(always)]
845 pub fn mode(&mut self) -> MODE_W {
846 MODE_W { w: self }
847 }
848 #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
849 #[inline(always)]
850 pub fn sync(&mut self) -> SYNC_W {
851 SYNC_W { w: self }
852 }
853 #[doc = "Bit 4 - One-shot Mode Enable"]
854 #[inline(always)]
855 pub fn osmen(&mut self) -> OSMEN_W {
856 OSMEN_W { w: self }
857 }
858 #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
859 #[inline(always)]
860 pub fn qdm(&mut self) -> QDM_W {
861 QDM_W { w: self }
862 }
863 #[doc = "Bit 6 - Debug Mode Run Enable"]
864 #[inline(always)]
865 pub fn debugrun(&mut self) -> DEBUGRUN_W {
866 DEBUGRUN_W { w: self }
867 }
868 #[doc = "Bit 7 - DMA Request Clear on Active"]
869 #[inline(always)]
870 pub fn dmaclract(&mut self) -> DMACLRACT_W {
871 DMACLRACT_W { w: self }
872 }
873 #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
874 #[inline(always)]
875 pub fn risea(&mut self) -> RISEA_W {
876 RISEA_W { w: self }
877 }
878 #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
879 #[inline(always)]
880 pub fn falla(&mut self) -> FALLA_W {
881 FALLA_W { w: self }
882 }
883 #[doc = "Bit 13 - 2x Count Mode"]
884 #[inline(always)]
885 pub fn x2cnt(&mut self) -> X2CNT_W {
886 X2CNT_W { w: self }
887 }
888 #[doc = "Bit 14 - Disable Timer From Start/Stop/Reload Other Synchronized Timers"]
889 #[inline(always)]
890 pub fn dissyncout(&mut self) -> DISSYNCOUT_W {
891 DISSYNCOUT_W { w: self }
892 }
893 #[doc = "Bits 16:17 - Clock Source Select"]
894 #[inline(always)]
895 pub fn clksel(&mut self) -> CLKSEL_W {
896 CLKSEL_W { w: self }
897 }
898 #[doc = "Bits 24:27 - Prescaler Setting"]
899 #[inline(always)]
900 pub fn presc(&mut self) -> PRESC_W {
901 PRESC_W { w: self }
902 }
903 #[doc = "Bit 28 - Always Track Inputs"]
904 #[inline(always)]
905 pub fn ati(&mut self) -> ATI_W {
906 ATI_W { w: self }
907 }
908 #[doc = "Bit 29 - Reload-Start Sets Compare Output Initial State"]
909 #[inline(always)]
910 pub fn rsscoist(&mut self) -> RSSCOIST_W {
911 RSSCOIST_W { w: self }
912 }
913}