1#[doc = "Register `INTCTRL` reader"]
2pub type R = crate::R<IntctrlSpec>;
3#[doc = "Register `INTCTRL` writer"]
4pub type W = crate::W<IntctrlSpec>;
5#[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Enable\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Sabie {
9 #[doc = "0: Disabled"]
10 Sabie0 = 0,
11 #[doc = "1: Enabled"]
12 Sabie1 = 1,
13}
14impl From<Sabie> for bool {
15 #[inline(always)]
16 fn from(variant: Sabie) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `SABIE` reader - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
21pub type SabieR = crate::BitReader<Sabie>;
22impl SabieR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> Sabie {
26 match self.bits {
27 false => Sabie::Sabie0,
28 true => Sabie::Sabie1,
29 }
30 }
31 #[doc = "Disabled"]
32 #[inline(always)]
33 pub fn is_sabie0(&self) -> bool {
34 *self == Sabie::Sabie0
35 }
36 #[doc = "Enabled"]
37 #[inline(always)]
38 pub fn is_sabie1(&self) -> bool {
39 *self == Sabie::Sabie1
40 }
41}
42#[doc = "Field `SABIE` writer - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
43pub type SabieW<'a, REG> = crate::BitWriter<'a, REG, Sabie>;
44impl<'a, REG> SabieW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "Disabled"]
49 #[inline(always)]
50 pub fn sabie0(self) -> &'a mut crate::W<REG> {
51 self.variant(Sabie::Sabie0)
52 }
53 #[doc = "Enabled"]
54 #[inline(always)]
55 pub fn sabie1(self) -> &'a mut crate::W<REG> {
56 self.variant(Sabie::Sabie1)
57 }
58}
59#[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Request\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Sabirq {
63 #[doc = "0: No simultaneous change of PHASEA and PHASEB has occurred"]
64 Sabirq0 = 0,
65 #[doc = "1: A simultaneous change of PHASEA and PHASEB has occurred"]
66 Sabirq1 = 1,
67}
68impl From<Sabirq> for bool {
69 #[inline(always)]
70 fn from(variant: Sabirq) -> Self {
71 variant as u8 != 0
72 }
73}
74#[doc = "Field `SABIRQ` reader - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
75pub type SabirqR = crate::BitReader<Sabirq>;
76impl SabirqR {
77 #[doc = "Get enumerated values variant"]
78 #[inline(always)]
79 pub const fn variant(&self) -> Sabirq {
80 match self.bits {
81 false => Sabirq::Sabirq0,
82 true => Sabirq::Sabirq1,
83 }
84 }
85 #[doc = "No simultaneous change of PHASEA and PHASEB has occurred"]
86 #[inline(always)]
87 pub fn is_sabirq0(&self) -> bool {
88 *self == Sabirq::Sabirq0
89 }
90 #[doc = "A simultaneous change of PHASEA and PHASEB has occurred"]
91 #[inline(always)]
92 pub fn is_sabirq1(&self) -> bool {
93 *self == Sabirq::Sabirq1
94 }
95}
96#[doc = "Field `SABIRQ` writer - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
97pub type SabirqW<'a, REG> = crate::BitWriter1C<'a, REG, Sabirq>;
98impl<'a, REG> SabirqW<'a, REG>
99where
100 REG: crate::Writable + crate::RegisterSpec,
101{
102 #[doc = "No simultaneous change of PHASEA and PHASEB has occurred"]
103 #[inline(always)]
104 pub fn sabirq0(self) -> &'a mut crate::W<REG> {
105 self.variant(Sabirq::Sabirq0)
106 }
107 #[doc = "A simultaneous change of PHASEA and PHASEB has occurred"]
108 #[inline(always)]
109 pub fn sabirq1(self) -> &'a mut crate::W<REG> {
110 self.variant(Sabirq::Sabirq1)
111 }
112}
113#[doc = "Count direction change interrupt enable\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Dirie {
117 #[doc = "0: Disabled"]
118 Dirie0 = 0,
119 #[doc = "1: Enabled"]
120 Dirie1 = 1,
121}
122impl From<Dirie> for bool {
123 #[inline(always)]
124 fn from(variant: Dirie) -> Self {
125 variant as u8 != 0
126 }
127}
128#[doc = "Field `DIRIE` reader - Count direction change interrupt enable"]
129pub type DirieR = crate::BitReader<Dirie>;
130impl DirieR {
131 #[doc = "Get enumerated values variant"]
132 #[inline(always)]
133 pub const fn variant(&self) -> Dirie {
134 match self.bits {
135 false => Dirie::Dirie0,
136 true => Dirie::Dirie1,
137 }
138 }
139 #[doc = "Disabled"]
140 #[inline(always)]
141 pub fn is_dirie0(&self) -> bool {
142 *self == Dirie::Dirie0
143 }
144 #[doc = "Enabled"]
145 #[inline(always)]
146 pub fn is_dirie1(&self) -> bool {
147 *self == Dirie::Dirie1
148 }
149}
150#[doc = "Field `DIRIE` writer - Count direction change interrupt enable"]
151pub type DirieW<'a, REG> = crate::BitWriter<'a, REG, Dirie>;
152impl<'a, REG> DirieW<'a, REG>
153where
154 REG: crate::Writable + crate::RegisterSpec,
155{
156 #[doc = "Disabled"]
157 #[inline(always)]
158 pub fn dirie0(self) -> &'a mut crate::W<REG> {
159 self.variant(Dirie::Dirie0)
160 }
161 #[doc = "Enabled"]
162 #[inline(always)]
163 pub fn dirie1(self) -> &'a mut crate::W<REG> {
164 self.variant(Dirie::Dirie1)
165 }
166}
167#[doc = "Count direction change interrupt\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Dirirq {
171 #[doc = "0: Count direction unchanged"]
172 Dirirq0 = 0,
173 #[doc = "1: Count direction changed"]
174 Dirirq1 = 1,
175}
176impl From<Dirirq> for bool {
177 #[inline(always)]
178 fn from(variant: Dirirq) -> Self {
179 variant as u8 != 0
180 }
181}
182#[doc = "Field `DIRIRQ` reader - Count direction change interrupt"]
183pub type DirirqR = crate::BitReader<Dirirq>;
184impl DirirqR {
185 #[doc = "Get enumerated values variant"]
186 #[inline(always)]
187 pub const fn variant(&self) -> Dirirq {
188 match self.bits {
189 false => Dirirq::Dirirq0,
190 true => Dirirq::Dirirq1,
191 }
192 }
193 #[doc = "Count direction unchanged"]
194 #[inline(always)]
195 pub fn is_dirirq0(&self) -> bool {
196 *self == Dirirq::Dirirq0
197 }
198 #[doc = "Count direction changed"]
199 #[inline(always)]
200 pub fn is_dirirq1(&self) -> bool {
201 *self == Dirirq::Dirirq1
202 }
203}
204#[doc = "Field `DIRIRQ` writer - Count direction change interrupt"]
205pub type DirirqW<'a, REG> = crate::BitWriter1C<'a, REG, Dirirq>;
206impl<'a, REG> DirirqW<'a, REG>
207where
208 REG: crate::Writable + crate::RegisterSpec,
209{
210 #[doc = "Count direction unchanged"]
211 #[inline(always)]
212 pub fn dirirq0(self) -> &'a mut crate::W<REG> {
213 self.variant(Dirirq::Dirirq0)
214 }
215 #[doc = "Count direction changed"]
216 #[inline(always)]
217 pub fn dirirq1(self) -> &'a mut crate::W<REG> {
218 self.variant(Dirirq::Dirirq1)
219 }
220}
221#[doc = "Roll-under Interrupt Enable\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Ruie {
225 #[doc = "0: Disabled"]
226 Ruie0 = 0,
227 #[doc = "1: Enabled"]
228 Ruie1 = 1,
229}
230impl From<Ruie> for bool {
231 #[inline(always)]
232 fn from(variant: Ruie) -> Self {
233 variant as u8 != 0
234 }
235}
236#[doc = "Field `RUIE` reader - Roll-under Interrupt Enable"]
237pub type RuieR = crate::BitReader<Ruie>;
238impl RuieR {
239 #[doc = "Get enumerated values variant"]
240 #[inline(always)]
241 pub const fn variant(&self) -> Ruie {
242 match self.bits {
243 false => Ruie::Ruie0,
244 true => Ruie::Ruie1,
245 }
246 }
247 #[doc = "Disabled"]
248 #[inline(always)]
249 pub fn is_ruie0(&self) -> bool {
250 *self == Ruie::Ruie0
251 }
252 #[doc = "Enabled"]
253 #[inline(always)]
254 pub fn is_ruie1(&self) -> bool {
255 *self == Ruie::Ruie1
256 }
257}
258#[doc = "Field `RUIE` writer - Roll-under Interrupt Enable"]
259pub type RuieW<'a, REG> = crate::BitWriter<'a, REG, Ruie>;
260impl<'a, REG> RuieW<'a, REG>
261where
262 REG: crate::Writable + crate::RegisterSpec,
263{
264 #[doc = "Disabled"]
265 #[inline(always)]
266 pub fn ruie0(self) -> &'a mut crate::W<REG> {
267 self.variant(Ruie::Ruie0)
268 }
269 #[doc = "Enabled"]
270 #[inline(always)]
271 pub fn ruie1(self) -> &'a mut crate::W<REG> {
272 self.variant(Ruie::Ruie1)
273 }
274}
275#[doc = "Roll-under Interrupt Request\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Ruirq {
279 #[doc = "0: No roll-under has occurred"]
280 Ruirq0 = 0,
281 #[doc = "1: Roll-under has occurred"]
282 Ruirq1 = 1,
283}
284impl From<Ruirq> for bool {
285 #[inline(always)]
286 fn from(variant: Ruirq) -> Self {
287 variant as u8 != 0
288 }
289}
290#[doc = "Field `RUIRQ` reader - Roll-under Interrupt Request"]
291pub type RuirqR = crate::BitReader<Ruirq>;
292impl RuirqR {
293 #[doc = "Get enumerated values variant"]
294 #[inline(always)]
295 pub const fn variant(&self) -> Ruirq {
296 match self.bits {
297 false => Ruirq::Ruirq0,
298 true => Ruirq::Ruirq1,
299 }
300 }
301 #[doc = "No roll-under has occurred"]
302 #[inline(always)]
303 pub fn is_ruirq0(&self) -> bool {
304 *self == Ruirq::Ruirq0
305 }
306 #[doc = "Roll-under has occurred"]
307 #[inline(always)]
308 pub fn is_ruirq1(&self) -> bool {
309 *self == Ruirq::Ruirq1
310 }
311}
312#[doc = "Field `RUIRQ` writer - Roll-under Interrupt Request"]
313pub type RuirqW<'a, REG> = crate::BitWriter1C<'a, REG, Ruirq>;
314impl<'a, REG> RuirqW<'a, REG>
315where
316 REG: crate::Writable + crate::RegisterSpec,
317{
318 #[doc = "No roll-under has occurred"]
319 #[inline(always)]
320 pub fn ruirq0(self) -> &'a mut crate::W<REG> {
321 self.variant(Ruirq::Ruirq0)
322 }
323 #[doc = "Roll-under has occurred"]
324 #[inline(always)]
325 pub fn ruirq1(self) -> &'a mut crate::W<REG> {
326 self.variant(Ruirq::Ruirq1)
327 }
328}
329#[doc = "Roll-over Interrupt Enable\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Roie {
333 #[doc = "0: Disabled"]
334 Roie = 0,
335 #[doc = "1: Enabled"]
336 Roie1 = 1,
337}
338impl From<Roie> for bool {
339 #[inline(always)]
340 fn from(variant: Roie) -> Self {
341 variant as u8 != 0
342 }
343}
344#[doc = "Field `ROIE` reader - Roll-over Interrupt Enable"]
345pub type RoieR = crate::BitReader<Roie>;
346impl RoieR {
347 #[doc = "Get enumerated values variant"]
348 #[inline(always)]
349 pub const fn variant(&self) -> Roie {
350 match self.bits {
351 false => Roie::Roie,
352 true => Roie::Roie1,
353 }
354 }
355 #[doc = "Disabled"]
356 #[inline(always)]
357 pub fn is_roie(&self) -> bool {
358 *self == Roie::Roie
359 }
360 #[doc = "Enabled"]
361 #[inline(always)]
362 pub fn is_roie1(&self) -> bool {
363 *self == Roie::Roie1
364 }
365}
366#[doc = "Field `ROIE` writer - Roll-over Interrupt Enable"]
367pub type RoieW<'a, REG> = crate::BitWriter<'a, REG, Roie>;
368impl<'a, REG> RoieW<'a, REG>
369where
370 REG: crate::Writable + crate::RegisterSpec,
371{
372 #[doc = "Disabled"]
373 #[inline(always)]
374 pub fn roie(self) -> &'a mut crate::W<REG> {
375 self.variant(Roie::Roie)
376 }
377 #[doc = "Enabled"]
378 #[inline(always)]
379 pub fn roie1(self) -> &'a mut crate::W<REG> {
380 self.variant(Roie::Roie1)
381 }
382}
383#[doc = "Roll-over Interrupt Request\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Roirq {
387 #[doc = "0: No roll-over has occurred"]
388 Roirq0 = 0,
389 #[doc = "1: Roll-over has occurred"]
390 Roirq1 = 1,
391}
392impl From<Roirq> for bool {
393 #[inline(always)]
394 fn from(variant: Roirq) -> Self {
395 variant as u8 != 0
396 }
397}
398#[doc = "Field `ROIRQ` reader - Roll-over Interrupt Request"]
399pub type RoirqR = crate::BitReader<Roirq>;
400impl RoirqR {
401 #[doc = "Get enumerated values variant"]
402 #[inline(always)]
403 pub const fn variant(&self) -> Roirq {
404 match self.bits {
405 false => Roirq::Roirq0,
406 true => Roirq::Roirq1,
407 }
408 }
409 #[doc = "No roll-over has occurred"]
410 #[inline(always)]
411 pub fn is_roirq0(&self) -> bool {
412 *self == Roirq::Roirq0
413 }
414 #[doc = "Roll-over has occurred"]
415 #[inline(always)]
416 pub fn is_roirq1(&self) -> bool {
417 *self == Roirq::Roirq1
418 }
419}
420#[doc = "Field `ROIRQ` writer - Roll-over Interrupt Request"]
421pub type RoirqW<'a, REG> = crate::BitWriter1C<'a, REG, Roirq>;
422impl<'a, REG> RoirqW<'a, REG>
423where
424 REG: crate::Writable + crate::RegisterSpec,
425{
426 #[doc = "No roll-over has occurred"]
427 #[inline(always)]
428 pub fn roirq0(self) -> &'a mut crate::W<REG> {
429 self.variant(Roirq::Roirq0)
430 }
431 #[doc = "Roll-over has occurred"]
432 #[inline(always)]
433 pub fn roirq1(self) -> &'a mut crate::W<REG> {
434 self.variant(Roirq::Roirq1)
435 }
436}
437#[doc = "Compare 0 Interrupt Enable\n\nValue on reset: 0"]
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum Cmp0ie {
441 #[doc = "0: Disabled"]
442 Cmp0ie0 = 0,
443 #[doc = "1: Enabled"]
444 Cmp0ie1 = 1,
445}
446impl From<Cmp0ie> for bool {
447 #[inline(always)]
448 fn from(variant: Cmp0ie) -> Self {
449 variant as u8 != 0
450 }
451}
452#[doc = "Field `CMP0IE` reader - Compare 0 Interrupt Enable"]
453pub type Cmp0ieR = crate::BitReader<Cmp0ie>;
454impl Cmp0ieR {
455 #[doc = "Get enumerated values variant"]
456 #[inline(always)]
457 pub const fn variant(&self) -> Cmp0ie {
458 match self.bits {
459 false => Cmp0ie::Cmp0ie0,
460 true => Cmp0ie::Cmp0ie1,
461 }
462 }
463 #[doc = "Disabled"]
464 #[inline(always)]
465 pub fn is_cmp0ie0(&self) -> bool {
466 *self == Cmp0ie::Cmp0ie0
467 }
468 #[doc = "Enabled"]
469 #[inline(always)]
470 pub fn is_cmp0ie1(&self) -> bool {
471 *self == Cmp0ie::Cmp0ie1
472 }
473}
474#[doc = "Field `CMP0IE` writer - Compare 0 Interrupt Enable"]
475pub type Cmp0ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp0ie>;
476impl<'a, REG> Cmp0ieW<'a, REG>
477where
478 REG: crate::Writable + crate::RegisterSpec,
479{
480 #[doc = "Disabled"]
481 #[inline(always)]
482 pub fn cmp0ie0(self) -> &'a mut crate::W<REG> {
483 self.variant(Cmp0ie::Cmp0ie0)
484 }
485 #[doc = "Enabled"]
486 #[inline(always)]
487 pub fn cmp0ie1(self) -> &'a mut crate::W<REG> {
488 self.variant(Cmp0ie::Cmp0ie1)
489 }
490}
491#[doc = "Compare 0 Interrupt Request\n\nValue on reset: 0"]
492#[cfg_attr(feature = "defmt", derive(defmt::Format))]
493#[derive(Clone, Copy, Debug, PartialEq, Eq)]
494pub enum Cmp0irq {
495 #[doc = "0: No match has occurred (the position counter does not match the COMP0 value)"]
496 Cmp0irq0 = 0,
497 #[doc = "1: COMP match has occurred (the position counter matches the COMP0 value)"]
498 Cmp0irq1 = 1,
499}
500impl From<Cmp0irq> for bool {
501 #[inline(always)]
502 fn from(variant: Cmp0irq) -> Self {
503 variant as u8 != 0
504 }
505}
506#[doc = "Field `CMP0IRQ` reader - Compare 0 Interrupt Request"]
507pub type Cmp0irqR = crate::BitReader<Cmp0irq>;
508impl Cmp0irqR {
509 #[doc = "Get enumerated values variant"]
510 #[inline(always)]
511 pub const fn variant(&self) -> Cmp0irq {
512 match self.bits {
513 false => Cmp0irq::Cmp0irq0,
514 true => Cmp0irq::Cmp0irq1,
515 }
516 }
517 #[doc = "No match has occurred (the position counter does not match the COMP0 value)"]
518 #[inline(always)]
519 pub fn is_cmp0irq0(&self) -> bool {
520 *self == Cmp0irq::Cmp0irq0
521 }
522 #[doc = "COMP match has occurred (the position counter matches the COMP0 value)"]
523 #[inline(always)]
524 pub fn is_cmp0irq1(&self) -> bool {
525 *self == Cmp0irq::Cmp0irq1
526 }
527}
528#[doc = "Field `CMP0IRQ` writer - Compare 0 Interrupt Request"]
529pub type Cmp0irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp0irq>;
530impl<'a, REG> Cmp0irqW<'a, REG>
531where
532 REG: crate::Writable + crate::RegisterSpec,
533{
534 #[doc = "No match has occurred (the position counter does not match the COMP0 value)"]
535 #[inline(always)]
536 pub fn cmp0irq0(self) -> &'a mut crate::W<REG> {
537 self.variant(Cmp0irq::Cmp0irq0)
538 }
539 #[doc = "COMP match has occurred (the position counter matches the COMP0 value)"]
540 #[inline(always)]
541 pub fn cmp0irq1(self) -> &'a mut crate::W<REG> {
542 self.variant(Cmp0irq::Cmp0irq1)
543 }
544}
545#[doc = "Compare1 Interrupt Enable\n\nValue on reset: 0"]
546#[cfg_attr(feature = "defmt", derive(defmt::Format))]
547#[derive(Clone, Copy, Debug, PartialEq, Eq)]
548pub enum Cmp1ie {
549 #[doc = "0: Disabled"]
550 Cmp1ie0 = 0,
551 #[doc = "1: Enabled"]
552 Cmp1ie1 = 1,
553}
554impl From<Cmp1ie> for bool {
555 #[inline(always)]
556 fn from(variant: Cmp1ie) -> Self {
557 variant as u8 != 0
558 }
559}
560#[doc = "Field `CMP1IE` reader - Compare1 Interrupt Enable"]
561pub type Cmp1ieR = crate::BitReader<Cmp1ie>;
562impl Cmp1ieR {
563 #[doc = "Get enumerated values variant"]
564 #[inline(always)]
565 pub const fn variant(&self) -> Cmp1ie {
566 match self.bits {
567 false => Cmp1ie::Cmp1ie0,
568 true => Cmp1ie::Cmp1ie1,
569 }
570 }
571 #[doc = "Disabled"]
572 #[inline(always)]
573 pub fn is_cmp1ie0(&self) -> bool {
574 *self == Cmp1ie::Cmp1ie0
575 }
576 #[doc = "Enabled"]
577 #[inline(always)]
578 pub fn is_cmp1ie1(&self) -> bool {
579 *self == Cmp1ie::Cmp1ie1
580 }
581}
582#[doc = "Field `CMP1IE` writer - Compare1 Interrupt Enable"]
583pub type Cmp1ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp1ie>;
584impl<'a, REG> Cmp1ieW<'a, REG>
585where
586 REG: crate::Writable + crate::RegisterSpec,
587{
588 #[doc = "Disabled"]
589 #[inline(always)]
590 pub fn cmp1ie0(self) -> &'a mut crate::W<REG> {
591 self.variant(Cmp1ie::Cmp1ie0)
592 }
593 #[doc = "Enabled"]
594 #[inline(always)]
595 pub fn cmp1ie1(self) -> &'a mut crate::W<REG> {
596 self.variant(Cmp1ie::Cmp1ie1)
597 }
598}
599#[doc = "Compare1 Interrupt Request\n\nValue on reset: 0"]
600#[cfg_attr(feature = "defmt", derive(defmt::Format))]
601#[derive(Clone, Copy, Debug, PartialEq, Eq)]
602pub enum Cmp1irq {
603 #[doc = "0: No match has occurred (the position counter does not match the COMP1 value)"]
604 Cmp1irq0 = 0,
605 #[doc = "1: COMP1 match has occurred (the position counter matches the COMP1 value)"]
606 Cmp1irq1 = 1,
607}
608impl From<Cmp1irq> for bool {
609 #[inline(always)]
610 fn from(variant: Cmp1irq) -> Self {
611 variant as u8 != 0
612 }
613}
614#[doc = "Field `CMP1IRQ` reader - Compare1 Interrupt Request"]
615pub type Cmp1irqR = crate::BitReader<Cmp1irq>;
616impl Cmp1irqR {
617 #[doc = "Get enumerated values variant"]
618 #[inline(always)]
619 pub const fn variant(&self) -> Cmp1irq {
620 match self.bits {
621 false => Cmp1irq::Cmp1irq0,
622 true => Cmp1irq::Cmp1irq1,
623 }
624 }
625 #[doc = "No match has occurred (the position counter does not match the COMP1 value)"]
626 #[inline(always)]
627 pub fn is_cmp1irq0(&self) -> bool {
628 *self == Cmp1irq::Cmp1irq0
629 }
630 #[doc = "COMP1 match has occurred (the position counter matches the COMP1 value)"]
631 #[inline(always)]
632 pub fn is_cmp1irq1(&self) -> bool {
633 *self == Cmp1irq::Cmp1irq1
634 }
635}
636#[doc = "Field `CMP1IRQ` writer - Compare1 Interrupt Request"]
637pub type Cmp1irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp1irq>;
638impl<'a, REG> Cmp1irqW<'a, REG>
639where
640 REG: crate::Writable + crate::RegisterSpec,
641{
642 #[doc = "No match has occurred (the position counter does not match the COMP1 value)"]
643 #[inline(always)]
644 pub fn cmp1irq0(self) -> &'a mut crate::W<REG> {
645 self.variant(Cmp1irq::Cmp1irq0)
646 }
647 #[doc = "COMP1 match has occurred (the position counter matches the COMP1 value)"]
648 #[inline(always)]
649 pub fn cmp1irq1(self) -> &'a mut crate::W<REG> {
650 self.variant(Cmp1irq::Cmp1irq1)
651 }
652}
653#[doc = "Compare2 Interrupt Enable\n\nValue on reset: 0"]
654#[cfg_attr(feature = "defmt", derive(defmt::Format))]
655#[derive(Clone, Copy, Debug, PartialEq, Eq)]
656pub enum Cmp2ie {
657 #[doc = "0: Disabled"]
658 Cmp2ie0 = 0,
659 #[doc = "1: Enabled"]
660 Cmp2ie1 = 1,
661}
662impl From<Cmp2ie> for bool {
663 #[inline(always)]
664 fn from(variant: Cmp2ie) -> Self {
665 variant as u8 != 0
666 }
667}
668#[doc = "Field `CMP2IE` reader - Compare2 Interrupt Enable"]
669pub type Cmp2ieR = crate::BitReader<Cmp2ie>;
670impl Cmp2ieR {
671 #[doc = "Get enumerated values variant"]
672 #[inline(always)]
673 pub const fn variant(&self) -> Cmp2ie {
674 match self.bits {
675 false => Cmp2ie::Cmp2ie0,
676 true => Cmp2ie::Cmp2ie1,
677 }
678 }
679 #[doc = "Disabled"]
680 #[inline(always)]
681 pub fn is_cmp2ie0(&self) -> bool {
682 *self == Cmp2ie::Cmp2ie0
683 }
684 #[doc = "Enabled"]
685 #[inline(always)]
686 pub fn is_cmp2ie1(&self) -> bool {
687 *self == Cmp2ie::Cmp2ie1
688 }
689}
690#[doc = "Field `CMP2IE` writer - Compare2 Interrupt Enable"]
691pub type Cmp2ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp2ie>;
692impl<'a, REG> Cmp2ieW<'a, REG>
693where
694 REG: crate::Writable + crate::RegisterSpec,
695{
696 #[doc = "Disabled"]
697 #[inline(always)]
698 pub fn cmp2ie0(self) -> &'a mut crate::W<REG> {
699 self.variant(Cmp2ie::Cmp2ie0)
700 }
701 #[doc = "Enabled"]
702 #[inline(always)]
703 pub fn cmp2ie1(self) -> &'a mut crate::W<REG> {
704 self.variant(Cmp2ie::Cmp2ie1)
705 }
706}
707#[doc = "Compare2 Interrupt Request\n\nValue on reset: 0"]
708#[cfg_attr(feature = "defmt", derive(defmt::Format))]
709#[derive(Clone, Copy, Debug, PartialEq, Eq)]
710pub enum Cmp2irq {
711 #[doc = "0: No match has occurred (the position counter does not match the COMP2 value)"]
712 Cmp2irq0 = 0,
713 #[doc = "1: COMP2 match has occurred (the position counter matches the COMP2 value)"]
714 Cmp2irq1 = 1,
715}
716impl From<Cmp2irq> for bool {
717 #[inline(always)]
718 fn from(variant: Cmp2irq) -> Self {
719 variant as u8 != 0
720 }
721}
722#[doc = "Field `CMP2IRQ` reader - Compare2 Interrupt Request"]
723pub type Cmp2irqR = crate::BitReader<Cmp2irq>;
724impl Cmp2irqR {
725 #[doc = "Get enumerated values variant"]
726 #[inline(always)]
727 pub const fn variant(&self) -> Cmp2irq {
728 match self.bits {
729 false => Cmp2irq::Cmp2irq0,
730 true => Cmp2irq::Cmp2irq1,
731 }
732 }
733 #[doc = "No match has occurred (the position counter does not match the COMP2 value)"]
734 #[inline(always)]
735 pub fn is_cmp2irq0(&self) -> bool {
736 *self == Cmp2irq::Cmp2irq0
737 }
738 #[doc = "COMP2 match has occurred (the position counter matches the COMP2 value)"]
739 #[inline(always)]
740 pub fn is_cmp2irq1(&self) -> bool {
741 *self == Cmp2irq::Cmp2irq1
742 }
743}
744#[doc = "Field `CMP2IRQ` writer - Compare2 Interrupt Request"]
745pub type Cmp2irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp2irq>;
746impl<'a, REG> Cmp2irqW<'a, REG>
747where
748 REG: crate::Writable + crate::RegisterSpec,
749{
750 #[doc = "No match has occurred (the position counter does not match the COMP2 value)"]
751 #[inline(always)]
752 pub fn cmp2irq0(self) -> &'a mut crate::W<REG> {
753 self.variant(Cmp2irq::Cmp2irq0)
754 }
755 #[doc = "COMP2 match has occurred (the position counter matches the COMP2 value)"]
756 #[inline(always)]
757 pub fn cmp2irq1(self) -> &'a mut crate::W<REG> {
758 self.variant(Cmp2irq::Cmp2irq1)
759 }
760}
761#[doc = "Compare3 Interrupt Enable\n\nValue on reset: 0"]
762#[cfg_attr(feature = "defmt", derive(defmt::Format))]
763#[derive(Clone, Copy, Debug, PartialEq, Eq)]
764pub enum Cmp3ie {
765 #[doc = "0: Disabled"]
766 Cmp3ie0 = 0,
767 #[doc = "1: Enabled"]
768 Cmp3ie1 = 1,
769}
770impl From<Cmp3ie> for bool {
771 #[inline(always)]
772 fn from(variant: Cmp3ie) -> Self {
773 variant as u8 != 0
774 }
775}
776#[doc = "Field `CMP3IE` reader - Compare3 Interrupt Enable"]
777pub type Cmp3ieR = crate::BitReader<Cmp3ie>;
778impl Cmp3ieR {
779 #[doc = "Get enumerated values variant"]
780 #[inline(always)]
781 pub const fn variant(&self) -> Cmp3ie {
782 match self.bits {
783 false => Cmp3ie::Cmp3ie0,
784 true => Cmp3ie::Cmp3ie1,
785 }
786 }
787 #[doc = "Disabled"]
788 #[inline(always)]
789 pub fn is_cmp3ie0(&self) -> bool {
790 *self == Cmp3ie::Cmp3ie0
791 }
792 #[doc = "Enabled"]
793 #[inline(always)]
794 pub fn is_cmp3ie1(&self) -> bool {
795 *self == Cmp3ie::Cmp3ie1
796 }
797}
798#[doc = "Field `CMP3IE` writer - Compare3 Interrupt Enable"]
799pub type Cmp3ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp3ie>;
800impl<'a, REG> Cmp3ieW<'a, REG>
801where
802 REG: crate::Writable + crate::RegisterSpec,
803{
804 #[doc = "Disabled"]
805 #[inline(always)]
806 pub fn cmp3ie0(self) -> &'a mut crate::W<REG> {
807 self.variant(Cmp3ie::Cmp3ie0)
808 }
809 #[doc = "Enabled"]
810 #[inline(always)]
811 pub fn cmp3ie1(self) -> &'a mut crate::W<REG> {
812 self.variant(Cmp3ie::Cmp3ie1)
813 }
814}
815#[doc = "Compare3 Interrupt Request\n\nValue on reset: 0"]
816#[cfg_attr(feature = "defmt", derive(defmt::Format))]
817#[derive(Clone, Copy, Debug, PartialEq, Eq)]
818pub enum Cmp3irq {
819 #[doc = "0: No match has occurred (the position counter does not match the COMP3 value)"]
820 Cmp3irq0 = 0,
821 #[doc = "1: COMP3 match has occurred (the position counter matches the COMP3 value)"]
822 Cmp3irq1 = 1,
823}
824impl From<Cmp3irq> for bool {
825 #[inline(always)]
826 fn from(variant: Cmp3irq) -> Self {
827 variant as u8 != 0
828 }
829}
830#[doc = "Field `CMP3IRQ` reader - Compare3 Interrupt Request"]
831pub type Cmp3irqR = crate::BitReader<Cmp3irq>;
832impl Cmp3irqR {
833 #[doc = "Get enumerated values variant"]
834 #[inline(always)]
835 pub const fn variant(&self) -> Cmp3irq {
836 match self.bits {
837 false => Cmp3irq::Cmp3irq0,
838 true => Cmp3irq::Cmp3irq1,
839 }
840 }
841 #[doc = "No match has occurred (the position counter does not match the COMP3 value)"]
842 #[inline(always)]
843 pub fn is_cmp3irq0(&self) -> bool {
844 *self == Cmp3irq::Cmp3irq0
845 }
846 #[doc = "COMP3 match has occurred (the position counter matches the COMP3 value)"]
847 #[inline(always)]
848 pub fn is_cmp3irq1(&self) -> bool {
849 *self == Cmp3irq::Cmp3irq1
850 }
851}
852#[doc = "Field `CMP3IRQ` writer - Compare3 Interrupt Request"]
853pub type Cmp3irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp3irq>;
854impl<'a, REG> Cmp3irqW<'a, REG>
855where
856 REG: crate::Writable + crate::RegisterSpec,
857{
858 #[doc = "No match has occurred (the position counter does not match the COMP3 value)"]
859 #[inline(always)]
860 pub fn cmp3irq0(self) -> &'a mut crate::W<REG> {
861 self.variant(Cmp3irq::Cmp3irq0)
862 }
863 #[doc = "COMP3 match has occurred (the position counter matches the COMP3 value)"]
864 #[inline(always)]
865 pub fn cmp3irq1(self) -> &'a mut crate::W<REG> {
866 self.variant(Cmp3irq::Cmp3irq1)
867 }
868}
869impl R {
870 #[doc = "Bit 0 - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
871 #[inline(always)]
872 pub fn sabie(&self) -> SabieR {
873 SabieR::new((self.bits & 1) != 0)
874 }
875 #[doc = "Bit 1 - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
876 #[inline(always)]
877 pub fn sabirq(&self) -> SabirqR {
878 SabirqR::new(((self.bits >> 1) & 1) != 0)
879 }
880 #[doc = "Bit 2 - Count direction change interrupt enable"]
881 #[inline(always)]
882 pub fn dirie(&self) -> DirieR {
883 DirieR::new(((self.bits >> 2) & 1) != 0)
884 }
885 #[doc = "Bit 3 - Count direction change interrupt"]
886 #[inline(always)]
887 pub fn dirirq(&self) -> DirirqR {
888 DirirqR::new(((self.bits >> 3) & 1) != 0)
889 }
890 #[doc = "Bit 4 - Roll-under Interrupt Enable"]
891 #[inline(always)]
892 pub fn ruie(&self) -> RuieR {
893 RuieR::new(((self.bits >> 4) & 1) != 0)
894 }
895 #[doc = "Bit 5 - Roll-under Interrupt Request"]
896 #[inline(always)]
897 pub fn ruirq(&self) -> RuirqR {
898 RuirqR::new(((self.bits >> 5) & 1) != 0)
899 }
900 #[doc = "Bit 6 - Roll-over Interrupt Enable"]
901 #[inline(always)]
902 pub fn roie(&self) -> RoieR {
903 RoieR::new(((self.bits >> 6) & 1) != 0)
904 }
905 #[doc = "Bit 7 - Roll-over Interrupt Request"]
906 #[inline(always)]
907 pub fn roirq(&self) -> RoirqR {
908 RoirqR::new(((self.bits >> 7) & 1) != 0)
909 }
910 #[doc = "Bit 8 - Compare 0 Interrupt Enable"]
911 #[inline(always)]
912 pub fn cmp0ie(&self) -> Cmp0ieR {
913 Cmp0ieR::new(((self.bits >> 8) & 1) != 0)
914 }
915 #[doc = "Bit 9 - Compare 0 Interrupt Request"]
916 #[inline(always)]
917 pub fn cmp0irq(&self) -> Cmp0irqR {
918 Cmp0irqR::new(((self.bits >> 9) & 1) != 0)
919 }
920 #[doc = "Bit 10 - Compare1 Interrupt Enable"]
921 #[inline(always)]
922 pub fn cmp1ie(&self) -> Cmp1ieR {
923 Cmp1ieR::new(((self.bits >> 10) & 1) != 0)
924 }
925 #[doc = "Bit 11 - Compare1 Interrupt Request"]
926 #[inline(always)]
927 pub fn cmp1irq(&self) -> Cmp1irqR {
928 Cmp1irqR::new(((self.bits >> 11) & 1) != 0)
929 }
930 #[doc = "Bit 12 - Compare2 Interrupt Enable"]
931 #[inline(always)]
932 pub fn cmp2ie(&self) -> Cmp2ieR {
933 Cmp2ieR::new(((self.bits >> 12) & 1) != 0)
934 }
935 #[doc = "Bit 13 - Compare2 Interrupt Request"]
936 #[inline(always)]
937 pub fn cmp2irq(&self) -> Cmp2irqR {
938 Cmp2irqR::new(((self.bits >> 13) & 1) != 0)
939 }
940 #[doc = "Bit 14 - Compare3 Interrupt Enable"]
941 #[inline(always)]
942 pub fn cmp3ie(&self) -> Cmp3ieR {
943 Cmp3ieR::new(((self.bits >> 14) & 1) != 0)
944 }
945 #[doc = "Bit 15 - Compare3 Interrupt Request"]
946 #[inline(always)]
947 pub fn cmp3irq(&self) -> Cmp3irqR {
948 Cmp3irqR::new(((self.bits >> 15) & 1) != 0)
949 }
950}
951#[cfg(feature = "debug")]
952impl core::fmt::Debug for R {
953 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
954 f.debug_struct("INTCTRL")
955 .field("sabie", &self.sabie())
956 .field("sabirq", &self.sabirq())
957 .field("dirie", &self.dirie())
958 .field("dirirq", &self.dirirq())
959 .field("ruie", &self.ruie())
960 .field("ruirq", &self.ruirq())
961 .field("roie", &self.roie())
962 .field("roirq", &self.roirq())
963 .field("cmp0ie", &self.cmp0ie())
964 .field("cmp0irq", &self.cmp0irq())
965 .field("cmp1ie", &self.cmp1ie())
966 .field("cmp1irq", &self.cmp1irq())
967 .field("cmp2ie", &self.cmp2ie())
968 .field("cmp2irq", &self.cmp2irq())
969 .field("cmp3ie", &self.cmp3ie())
970 .field("cmp3irq", &self.cmp3irq())
971 .finish()
972 }
973}
974impl W {
975 #[doc = "Bit 0 - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
976 #[inline(always)]
977 pub fn sabie(&mut self) -> SabieW<'_, IntctrlSpec> {
978 SabieW::new(self, 0)
979 }
980 #[doc = "Bit 1 - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
981 #[inline(always)]
982 pub fn sabirq(&mut self) -> SabirqW<'_, IntctrlSpec> {
983 SabirqW::new(self, 1)
984 }
985 #[doc = "Bit 2 - Count direction change interrupt enable"]
986 #[inline(always)]
987 pub fn dirie(&mut self) -> DirieW<'_, IntctrlSpec> {
988 DirieW::new(self, 2)
989 }
990 #[doc = "Bit 3 - Count direction change interrupt"]
991 #[inline(always)]
992 pub fn dirirq(&mut self) -> DirirqW<'_, IntctrlSpec> {
993 DirirqW::new(self, 3)
994 }
995 #[doc = "Bit 4 - Roll-under Interrupt Enable"]
996 #[inline(always)]
997 pub fn ruie(&mut self) -> RuieW<'_, IntctrlSpec> {
998 RuieW::new(self, 4)
999 }
1000 #[doc = "Bit 5 - Roll-under Interrupt Request"]
1001 #[inline(always)]
1002 pub fn ruirq(&mut self) -> RuirqW<'_, IntctrlSpec> {
1003 RuirqW::new(self, 5)
1004 }
1005 #[doc = "Bit 6 - Roll-over Interrupt Enable"]
1006 #[inline(always)]
1007 pub fn roie(&mut self) -> RoieW<'_, IntctrlSpec> {
1008 RoieW::new(self, 6)
1009 }
1010 #[doc = "Bit 7 - Roll-over Interrupt Request"]
1011 #[inline(always)]
1012 pub fn roirq(&mut self) -> RoirqW<'_, IntctrlSpec> {
1013 RoirqW::new(self, 7)
1014 }
1015 #[doc = "Bit 8 - Compare 0 Interrupt Enable"]
1016 #[inline(always)]
1017 pub fn cmp0ie(&mut self) -> Cmp0ieW<'_, IntctrlSpec> {
1018 Cmp0ieW::new(self, 8)
1019 }
1020 #[doc = "Bit 9 - Compare 0 Interrupt Request"]
1021 #[inline(always)]
1022 pub fn cmp0irq(&mut self) -> Cmp0irqW<'_, IntctrlSpec> {
1023 Cmp0irqW::new(self, 9)
1024 }
1025 #[doc = "Bit 10 - Compare1 Interrupt Enable"]
1026 #[inline(always)]
1027 pub fn cmp1ie(&mut self) -> Cmp1ieW<'_, IntctrlSpec> {
1028 Cmp1ieW::new(self, 10)
1029 }
1030 #[doc = "Bit 11 - Compare1 Interrupt Request"]
1031 #[inline(always)]
1032 pub fn cmp1irq(&mut self) -> Cmp1irqW<'_, IntctrlSpec> {
1033 Cmp1irqW::new(self, 11)
1034 }
1035 #[doc = "Bit 12 - Compare2 Interrupt Enable"]
1036 #[inline(always)]
1037 pub fn cmp2ie(&mut self) -> Cmp2ieW<'_, IntctrlSpec> {
1038 Cmp2ieW::new(self, 12)
1039 }
1040 #[doc = "Bit 13 - Compare2 Interrupt Request"]
1041 #[inline(always)]
1042 pub fn cmp2irq(&mut self) -> Cmp2irqW<'_, IntctrlSpec> {
1043 Cmp2irqW::new(self, 13)
1044 }
1045 #[doc = "Bit 14 - Compare3 Interrupt Enable"]
1046 #[inline(always)]
1047 pub fn cmp3ie(&mut self) -> Cmp3ieW<'_, IntctrlSpec> {
1048 Cmp3ieW::new(self, 14)
1049 }
1050 #[doc = "Bit 15 - Compare3 Interrupt Request"]
1051 #[inline(always)]
1052 pub fn cmp3irq(&mut self) -> Cmp3irqW<'_, IntctrlSpec> {
1053 Cmp3irqW::new(self, 15)
1054 }
1055}
1056#[doc = "Interrupt Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`intctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1057pub struct IntctrlSpec;
1058impl crate::RegisterSpec for IntctrlSpec {
1059 type Ux = u16;
1060}
1061#[doc = "`read()` method returns [`intctrl::R`](R) reader structure"]
1062impl crate::Readable for IntctrlSpec {}
1063#[doc = "`write(|w| ..)` method takes [`intctrl::W`](W) writer structure"]
1064impl crate::Writable for IntctrlSpec {
1065 type Safety = crate::Unsafe;
1066 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0xaaaa;
1067}
1068#[doc = "`reset()` method sets INTCTRL to value 0"]
1069impl crate::Resettable for IntctrlSpec {}