1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EN1 {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<EN1> for bool {
17 #[inline(always)]
18 fn from(variant: EN1) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type EN_R = crate::BitReader<EN1>;
24impl EN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> EN1 {
28 match self.bits {
29 false => EN1::Disabled,
30 true => EN1::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == EN1::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == EN1::Enabled
42 }
43}
44pub type EN_W<'a, REG> = crate::BitWriter<'a, REG, EN1>;
46impl<'a, REG> EN_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(EN1::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(EN1::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum BOFF1 {
67 Enabled = 0,
69 Disabled = 1,
71}
72impl From<BOFF1> for bool {
73 #[inline(always)]
74 fn from(variant: BOFF1) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type BOFF_R = crate::BitReader<BOFF1>;
80impl BOFF_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> BOFF1 {
84 match self.bits {
85 false => BOFF1::Enabled,
86 true => BOFF1::Disabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_enabled(&self) -> bool {
92 *self == BOFF1::Enabled
93 }
94 #[inline(always)]
96 pub fn is_disabled(&self) -> bool {
97 *self == BOFF1::Disabled
98 }
99}
100pub type BOFF_W<'a, REG> = crate::BitWriter<'a, REG, BOFF1>;
102impl<'a, REG> BOFF_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn enabled(self) -> &'a mut crate::W<REG> {
109 self.variant(BOFF1::Enabled)
110 }
111 #[inline(always)]
113 pub fn disabled(self) -> &'a mut crate::W<REG> {
114 self.variant(BOFF1::Disabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum TEN1 {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<TEN1> for bool {
129 #[inline(always)]
130 fn from(variant: TEN1) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type TEN_R = crate::BitReader<TEN1>;
136impl TEN_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> TEN1 {
140 match self.bits {
141 false => TEN1::Disabled,
142 true => TEN1::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == TEN1::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == TEN1::Enabled
154 }
155}
156pub type TEN_W<'a, REG> = crate::BitWriter<'a, REG, TEN1>;
158impl<'a, REG> TEN_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn disabled(self) -> &'a mut crate::W<REG> {
165 self.variant(TEN1::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(TEN1::Enabled)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178#[repr(u8)]
179pub enum TSEL1 {
180 Tim6trgo = 0,
182 Tim8trgo = 1,
184 Tim7trgo = 2,
186 Tim5trgo = 3,
188 Tim2trgo = 4,
190 Tim4trgo = 5,
192 Exti9 = 6,
194 Swtrig = 7,
196}
197impl From<TSEL1> for u8 {
198 #[inline(always)]
199 fn from(variant: TSEL1) -> Self {
200 variant as _
201 }
202}
203impl crate::FieldSpec for TSEL1 {
204 type Ux = u8;
205}
206impl crate::IsEnum for TSEL1 {}
207pub type TSEL1_R = crate::FieldReader<TSEL1>;
209impl TSEL1_R {
210 #[inline(always)]
212 pub const fn variant(&self) -> TSEL1 {
213 match self.bits {
214 0 => TSEL1::Tim6trgo,
215 1 => TSEL1::Tim8trgo,
216 2 => TSEL1::Tim7trgo,
217 3 => TSEL1::Tim5trgo,
218 4 => TSEL1::Tim2trgo,
219 5 => TSEL1::Tim4trgo,
220 6 => TSEL1::Exti9,
221 7 => TSEL1::Swtrig,
222 _ => unreachable!(),
223 }
224 }
225 #[inline(always)]
227 pub fn is_tim6trgo(&self) -> bool {
228 *self == TSEL1::Tim6trgo
229 }
230 #[inline(always)]
232 pub fn is_tim8trgo(&self) -> bool {
233 *self == TSEL1::Tim8trgo
234 }
235 #[inline(always)]
237 pub fn is_tim7trgo(&self) -> bool {
238 *self == TSEL1::Tim7trgo
239 }
240 #[inline(always)]
242 pub fn is_tim5trgo(&self) -> bool {
243 *self == TSEL1::Tim5trgo
244 }
245 #[inline(always)]
247 pub fn is_tim2trgo(&self) -> bool {
248 *self == TSEL1::Tim2trgo
249 }
250 #[inline(always)]
252 pub fn is_tim4trgo(&self) -> bool {
253 *self == TSEL1::Tim4trgo
254 }
255 #[inline(always)]
257 pub fn is_exti9(&self) -> bool {
258 *self == TSEL1::Exti9
259 }
260 #[inline(always)]
262 pub fn is_swtrig(&self) -> bool {
263 *self == TSEL1::Swtrig
264 }
265}
266pub type TSEL1_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TSEL1, crate::Safe>;
268impl<'a, REG> TSEL1_W<'a, REG>
269where
270 REG: crate::Writable + crate::RegisterSpec,
271 REG::Ux: From<u8>,
272{
273 #[inline(always)]
275 pub fn tim6trgo(self) -> &'a mut crate::W<REG> {
276 self.variant(TSEL1::Tim6trgo)
277 }
278 #[inline(always)]
280 pub fn tim8trgo(self) -> &'a mut crate::W<REG> {
281 self.variant(TSEL1::Tim8trgo)
282 }
283 #[inline(always)]
285 pub fn tim7trgo(self) -> &'a mut crate::W<REG> {
286 self.variant(TSEL1::Tim7trgo)
287 }
288 #[inline(always)]
290 pub fn tim5trgo(self) -> &'a mut crate::W<REG> {
291 self.variant(TSEL1::Tim5trgo)
292 }
293 #[inline(always)]
295 pub fn tim2trgo(self) -> &'a mut crate::W<REG> {
296 self.variant(TSEL1::Tim2trgo)
297 }
298 #[inline(always)]
300 pub fn tim4trgo(self) -> &'a mut crate::W<REG> {
301 self.variant(TSEL1::Tim4trgo)
302 }
303 #[inline(always)]
305 pub fn exti9(self) -> &'a mut crate::W<REG> {
306 self.variant(TSEL1::Exti9)
307 }
308 #[inline(always)]
310 pub fn swtrig(self) -> &'a mut crate::W<REG> {
311 self.variant(TSEL1::Swtrig)
312 }
313}
314#[cfg_attr(feature = "defmt", derive(defmt::Format))]
318#[derive(Clone, Copy, Debug, PartialEq, Eq)]
319#[repr(u8)]
320pub enum WAVE1 {
321 Disabled = 0,
323 Noise = 1,
325 Triangle = 2,
327}
328impl From<WAVE1> for u8 {
329 #[inline(always)]
330 fn from(variant: WAVE1) -> Self {
331 variant as _
332 }
333}
334impl crate::FieldSpec for WAVE1 {
335 type Ux = u8;
336}
337impl crate::IsEnum for WAVE1 {}
338pub type WAVE_R = crate::FieldReader<WAVE1>;
340impl WAVE_R {
341 #[inline(always)]
343 pub const fn variant(&self) -> WAVE1 {
344 match self.bits {
345 0 => WAVE1::Disabled,
346 1 => WAVE1::Noise,
347 _ => WAVE1::Triangle,
348 }
349 }
350 #[inline(always)]
352 pub fn is_disabled(&self) -> bool {
353 *self == WAVE1::Disabled
354 }
355 #[inline(always)]
357 pub fn is_noise(&self) -> bool {
358 *self == WAVE1::Noise
359 }
360 #[inline(always)]
362 pub fn is_triangle(&self) -> bool {
363 matches!(self.variant(), WAVE1::Triangle)
364 }
365}
366pub type WAVE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, WAVE1, crate::Safe>;
368impl<'a, REG> WAVE_W<'a, REG>
369where
370 REG: crate::Writable + crate::RegisterSpec,
371 REG::Ux: From<u8>,
372{
373 #[inline(always)]
375 pub fn disabled(self) -> &'a mut crate::W<REG> {
376 self.variant(WAVE1::Disabled)
377 }
378 #[inline(always)]
380 pub fn noise(self) -> &'a mut crate::W<REG> {
381 self.variant(WAVE1::Noise)
382 }
383 #[inline(always)]
385 pub fn triangle(self) -> &'a mut crate::W<REG> {
386 self.variant(WAVE1::Triangle)
387 }
388}
389#[cfg_attr(feature = "defmt", derive(defmt::Format))]
393#[derive(Clone, Copy, Debug, PartialEq, Eq)]
394#[repr(u8)]
395pub enum MAMP1 {
396 Amp1 = 0,
398 Amp3 = 1,
400 Amp7 = 2,
402 Amp15 = 3,
404 Amp31 = 4,
406 Amp63 = 5,
408 Amp127 = 6,
410 Amp255 = 7,
412 Amp511 = 8,
414 Amp1023 = 9,
416 Amp2047 = 10,
418 Amp4095 = 11,
420}
421impl From<MAMP1> for u8 {
422 #[inline(always)]
423 fn from(variant: MAMP1) -> Self {
424 variant as _
425 }
426}
427impl crate::FieldSpec for MAMP1 {
428 type Ux = u8;
429}
430impl crate::IsEnum for MAMP1 {}
431pub type MAMP_R = crate::FieldReader<MAMP1>;
433impl MAMP_R {
434 #[inline(always)]
436 pub const fn variant(&self) -> MAMP1 {
437 match self.bits {
438 0 => MAMP1::Amp1,
439 1 => MAMP1::Amp3,
440 2 => MAMP1::Amp7,
441 3 => MAMP1::Amp15,
442 4 => MAMP1::Amp31,
443 5 => MAMP1::Amp63,
444 6 => MAMP1::Amp127,
445 7 => MAMP1::Amp255,
446 8 => MAMP1::Amp511,
447 9 => MAMP1::Amp1023,
448 10 => MAMP1::Amp2047,
449 _ => MAMP1::Amp4095,
450 }
451 }
452 #[inline(always)]
454 pub fn is_amp1(&self) -> bool {
455 *self == MAMP1::Amp1
456 }
457 #[inline(always)]
459 pub fn is_amp3(&self) -> bool {
460 *self == MAMP1::Amp3
461 }
462 #[inline(always)]
464 pub fn is_amp7(&self) -> bool {
465 *self == MAMP1::Amp7
466 }
467 #[inline(always)]
469 pub fn is_amp15(&self) -> bool {
470 *self == MAMP1::Amp15
471 }
472 #[inline(always)]
474 pub fn is_amp31(&self) -> bool {
475 *self == MAMP1::Amp31
476 }
477 #[inline(always)]
479 pub fn is_amp63(&self) -> bool {
480 *self == MAMP1::Amp63
481 }
482 #[inline(always)]
484 pub fn is_amp127(&self) -> bool {
485 *self == MAMP1::Amp127
486 }
487 #[inline(always)]
489 pub fn is_amp255(&self) -> bool {
490 *self == MAMP1::Amp255
491 }
492 #[inline(always)]
494 pub fn is_amp511(&self) -> bool {
495 *self == MAMP1::Amp511
496 }
497 #[inline(always)]
499 pub fn is_amp1023(&self) -> bool {
500 *self == MAMP1::Amp1023
501 }
502 #[inline(always)]
504 pub fn is_amp2047(&self) -> bool {
505 *self == MAMP1::Amp2047
506 }
507 #[inline(always)]
509 pub fn is_amp4095(&self) -> bool {
510 matches!(self.variant(), MAMP1::Amp4095)
511 }
512}
513pub type MAMP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, MAMP1, crate::Safe>;
515impl<'a, REG> MAMP_W<'a, REG>
516where
517 REG: crate::Writable + crate::RegisterSpec,
518 REG::Ux: From<u8>,
519{
520 #[inline(always)]
522 pub fn amp1(self) -> &'a mut crate::W<REG> {
523 self.variant(MAMP1::Amp1)
524 }
525 #[inline(always)]
527 pub fn amp3(self) -> &'a mut crate::W<REG> {
528 self.variant(MAMP1::Amp3)
529 }
530 #[inline(always)]
532 pub fn amp7(self) -> &'a mut crate::W<REG> {
533 self.variant(MAMP1::Amp7)
534 }
535 #[inline(always)]
537 pub fn amp15(self) -> &'a mut crate::W<REG> {
538 self.variant(MAMP1::Amp15)
539 }
540 #[inline(always)]
542 pub fn amp31(self) -> &'a mut crate::W<REG> {
543 self.variant(MAMP1::Amp31)
544 }
545 #[inline(always)]
547 pub fn amp63(self) -> &'a mut crate::W<REG> {
548 self.variant(MAMP1::Amp63)
549 }
550 #[inline(always)]
552 pub fn amp127(self) -> &'a mut crate::W<REG> {
553 self.variant(MAMP1::Amp127)
554 }
555 #[inline(always)]
557 pub fn amp255(self) -> &'a mut crate::W<REG> {
558 self.variant(MAMP1::Amp255)
559 }
560 #[inline(always)]
562 pub fn amp511(self) -> &'a mut crate::W<REG> {
563 self.variant(MAMP1::Amp511)
564 }
565 #[inline(always)]
567 pub fn amp1023(self) -> &'a mut crate::W<REG> {
568 self.variant(MAMP1::Amp1023)
569 }
570 #[inline(always)]
572 pub fn amp2047(self) -> &'a mut crate::W<REG> {
573 self.variant(MAMP1::Amp2047)
574 }
575 #[inline(always)]
577 pub fn amp4095(self) -> &'a mut crate::W<REG> {
578 self.variant(MAMP1::Amp4095)
579 }
580}
581#[cfg_attr(feature = "defmt", derive(defmt::Format))]
585#[derive(Clone, Copy, Debug, PartialEq, Eq)]
586pub enum DMAEN1 {
587 Disabled = 0,
589 Enabled = 1,
591}
592impl From<DMAEN1> for bool {
593 #[inline(always)]
594 fn from(variant: DMAEN1) -> Self {
595 variant as u8 != 0
596 }
597}
598pub type DMAEN_R = crate::BitReader<DMAEN1>;
600impl DMAEN_R {
601 #[inline(always)]
603 pub const fn variant(&self) -> DMAEN1 {
604 match self.bits {
605 false => DMAEN1::Disabled,
606 true => DMAEN1::Enabled,
607 }
608 }
609 #[inline(always)]
611 pub fn is_disabled(&self) -> bool {
612 *self == DMAEN1::Disabled
613 }
614 #[inline(always)]
616 pub fn is_enabled(&self) -> bool {
617 *self == DMAEN1::Enabled
618 }
619}
620pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG, DMAEN1>;
622impl<'a, REG> DMAEN_W<'a, REG>
623where
624 REG: crate::Writable + crate::RegisterSpec,
625{
626 #[inline(always)]
628 pub fn disabled(self) -> &'a mut crate::W<REG> {
629 self.variant(DMAEN1::Disabled)
630 }
631 #[inline(always)]
633 pub fn enabled(self) -> &'a mut crate::W<REG> {
634 self.variant(DMAEN1::Enabled)
635 }
636}
637#[cfg_attr(feature = "defmt", derive(defmt::Format))]
641#[derive(Clone, Copy, Debug, PartialEq, Eq)]
642pub enum DMAUDRIE1 {
643 Disabled = 0,
645 Enabled = 1,
647}
648impl From<DMAUDRIE1> for bool {
649 #[inline(always)]
650 fn from(variant: DMAUDRIE1) -> Self {
651 variant as u8 != 0
652 }
653}
654pub type DMAUDRIE_R = crate::BitReader<DMAUDRIE1>;
656impl DMAUDRIE_R {
657 #[inline(always)]
659 pub const fn variant(&self) -> DMAUDRIE1 {
660 match self.bits {
661 false => DMAUDRIE1::Disabled,
662 true => DMAUDRIE1::Enabled,
663 }
664 }
665 #[inline(always)]
667 pub fn is_disabled(&self) -> bool {
668 *self == DMAUDRIE1::Disabled
669 }
670 #[inline(always)]
672 pub fn is_enabled(&self) -> bool {
673 *self == DMAUDRIE1::Enabled
674 }
675}
676pub type DMAUDRIE_W<'a, REG> = crate::BitWriter<'a, REG, DMAUDRIE1>;
678impl<'a, REG> DMAUDRIE_W<'a, REG>
679where
680 REG: crate::Writable + crate::RegisterSpec,
681{
682 #[inline(always)]
684 pub fn disabled(self) -> &'a mut crate::W<REG> {
685 self.variant(DMAUDRIE1::Disabled)
686 }
687 #[inline(always)]
689 pub fn enabled(self) -> &'a mut crate::W<REG> {
690 self.variant(DMAUDRIE1::Enabled)
691 }
692}
693pub use TSEL1_R as TSEL2_R;
695pub use TSEL1_W as TSEL2_W;
697impl R {
698 #[inline(always)]
702 pub fn en(&self, n: u8) -> EN_R {
703 #[allow(clippy::no_effect)]
704 [(); 2][n as usize];
705 EN_R::new(((self.bits >> (n * 16)) & 1) != 0)
706 }
707 #[inline(always)]
710 pub fn en_iter(&self) -> impl Iterator<Item = EN_R> + '_ {
711 (0..2).map(move |n| EN_R::new(((self.bits >> (n * 16)) & 1) != 0))
712 }
713 #[inline(always)]
715 pub fn en1(&self) -> EN_R {
716 EN_R::new((self.bits & 1) != 0)
717 }
718 #[inline(always)]
720 pub fn en2(&self) -> EN_R {
721 EN_R::new(((self.bits >> 16) & 1) != 0)
722 }
723 #[inline(always)]
727 pub fn boff(&self, n: u8) -> BOFF_R {
728 #[allow(clippy::no_effect)]
729 [(); 2][n as usize];
730 BOFF_R::new(((self.bits >> (n * 16 + 1)) & 1) != 0)
731 }
732 #[inline(always)]
735 pub fn boff_iter(&self) -> impl Iterator<Item = BOFF_R> + '_ {
736 (0..2).map(move |n| BOFF_R::new(((self.bits >> (n * 16 + 1)) & 1) != 0))
737 }
738 #[inline(always)]
740 pub fn boff1(&self) -> BOFF_R {
741 BOFF_R::new(((self.bits >> 1) & 1) != 0)
742 }
743 #[inline(always)]
745 pub fn boff2(&self) -> BOFF_R {
746 BOFF_R::new(((self.bits >> 17) & 1) != 0)
747 }
748 #[inline(always)]
752 pub fn ten(&self, n: u8) -> TEN_R {
753 #[allow(clippy::no_effect)]
754 [(); 2][n as usize];
755 TEN_R::new(((self.bits >> (n * 16 + 2)) & 1) != 0)
756 }
757 #[inline(always)]
760 pub fn ten_iter(&self) -> impl Iterator<Item = TEN_R> + '_ {
761 (0..2).map(move |n| TEN_R::new(((self.bits >> (n * 16 + 2)) & 1) != 0))
762 }
763 #[inline(always)]
765 pub fn ten1(&self) -> TEN_R {
766 TEN_R::new(((self.bits >> 2) & 1) != 0)
767 }
768 #[inline(always)]
770 pub fn ten2(&self) -> TEN_R {
771 TEN_R::new(((self.bits >> 18) & 1) != 0)
772 }
773 #[inline(always)]
775 pub fn tsel1(&self) -> TSEL1_R {
776 TSEL1_R::new(((self.bits >> 3) & 7) as u8)
777 }
778 #[inline(always)]
782 pub fn wave(&self, n: u8) -> WAVE_R {
783 #[allow(clippy::no_effect)]
784 [(); 2][n as usize];
785 WAVE_R::new(((self.bits >> (n * 16 + 6)) & 3) as u8)
786 }
787 #[inline(always)]
790 pub fn wave_iter(&self) -> impl Iterator<Item = WAVE_R> + '_ {
791 (0..2).map(move |n| WAVE_R::new(((self.bits >> (n * 16 + 6)) & 3) as u8))
792 }
793 #[inline(always)]
795 pub fn wave1(&self) -> WAVE_R {
796 WAVE_R::new(((self.bits >> 6) & 3) as u8)
797 }
798 #[inline(always)]
800 pub fn wave2(&self) -> WAVE_R {
801 WAVE_R::new(((self.bits >> 22) & 3) as u8)
802 }
803 #[inline(always)]
807 pub fn mamp(&self, n: u8) -> MAMP_R {
808 #[allow(clippy::no_effect)]
809 [(); 2][n as usize];
810 MAMP_R::new(((self.bits >> (n * 16 + 8)) & 0x0f) as u8)
811 }
812 #[inline(always)]
815 pub fn mamp_iter(&self) -> impl Iterator<Item = MAMP_R> + '_ {
816 (0..2).map(move |n| MAMP_R::new(((self.bits >> (n * 16 + 8)) & 0x0f) as u8))
817 }
818 #[inline(always)]
820 pub fn mamp1(&self) -> MAMP_R {
821 MAMP_R::new(((self.bits >> 8) & 0x0f) as u8)
822 }
823 #[inline(always)]
825 pub fn mamp2(&self) -> MAMP_R {
826 MAMP_R::new(((self.bits >> 24) & 0x0f) as u8)
827 }
828 #[inline(always)]
832 pub fn dmaen(&self, n: u8) -> DMAEN_R {
833 #[allow(clippy::no_effect)]
834 [(); 2][n as usize];
835 DMAEN_R::new(((self.bits >> (n * 16 + 12)) & 1) != 0)
836 }
837 #[inline(always)]
840 pub fn dmaen_iter(&self) -> impl Iterator<Item = DMAEN_R> + '_ {
841 (0..2).map(move |n| DMAEN_R::new(((self.bits >> (n * 16 + 12)) & 1) != 0))
842 }
843 #[inline(always)]
845 pub fn dmaen1(&self) -> DMAEN_R {
846 DMAEN_R::new(((self.bits >> 12) & 1) != 0)
847 }
848 #[inline(always)]
850 pub fn dmaen2(&self) -> DMAEN_R {
851 DMAEN_R::new(((self.bits >> 28) & 1) != 0)
852 }
853 #[inline(always)]
857 pub fn dmaudrie(&self, n: u8) -> DMAUDRIE_R {
858 #[allow(clippy::no_effect)]
859 [(); 2][n as usize];
860 DMAUDRIE_R::new(((self.bits >> (n * 16 + 13)) & 1) != 0)
861 }
862 #[inline(always)]
865 pub fn dmaudrie_iter(&self) -> impl Iterator<Item = DMAUDRIE_R> + '_ {
866 (0..2).map(move |n| DMAUDRIE_R::new(((self.bits >> (n * 16 + 13)) & 1) != 0))
867 }
868 #[inline(always)]
870 pub fn dmaudrie1(&self) -> DMAUDRIE_R {
871 DMAUDRIE_R::new(((self.bits >> 13) & 1) != 0)
872 }
873 #[inline(always)]
875 pub fn dmaudrie2(&self) -> DMAUDRIE_R {
876 DMAUDRIE_R::new(((self.bits >> 29) & 1) != 0)
877 }
878 #[inline(always)]
880 pub fn tsel2(&self) -> TSEL2_R {
881 TSEL2_R::new(((self.bits >> 19) & 7) as u8)
882 }
883}
884impl core::fmt::Debug for R {
885 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
886 f.debug_struct("CR")
887 .field("dmaudrie1", &self.dmaudrie1())
888 .field("dmaudrie2", &self.dmaudrie2())
889 .field("dmaen1", &self.dmaen1())
890 .field("dmaen2", &self.dmaen2())
891 .field("mamp1", &self.mamp1())
892 .field("mamp2", &self.mamp2())
893 .field("wave1", &self.wave1())
894 .field("wave2", &self.wave2())
895 .field("tsel1", &self.tsel1())
896 .field("tsel2", &self.tsel2())
897 .field("ten1", &self.ten1())
898 .field("ten2", &self.ten2())
899 .field("boff1", &self.boff1())
900 .field("boff2", &self.boff2())
901 .field("en1", &self.en1())
902 .field("en2", &self.en2())
903 .finish()
904 }
905}
906impl W {
907 #[inline(always)]
911 pub fn en(&mut self, n: u8) -> EN_W<CRrs> {
912 #[allow(clippy::no_effect)]
913 [(); 2][n as usize];
914 EN_W::new(self, n * 16)
915 }
916 #[inline(always)]
918 pub fn en1(&mut self) -> EN_W<CRrs> {
919 EN_W::new(self, 0)
920 }
921 #[inline(always)]
923 pub fn en2(&mut self) -> EN_W<CRrs> {
924 EN_W::new(self, 16)
925 }
926 #[inline(always)]
930 pub fn boff(&mut self, n: u8) -> BOFF_W<CRrs> {
931 #[allow(clippy::no_effect)]
932 [(); 2][n as usize];
933 BOFF_W::new(self, n * 16 + 1)
934 }
935 #[inline(always)]
937 pub fn boff1(&mut self) -> BOFF_W<CRrs> {
938 BOFF_W::new(self, 1)
939 }
940 #[inline(always)]
942 pub fn boff2(&mut self) -> BOFF_W<CRrs> {
943 BOFF_W::new(self, 17)
944 }
945 #[inline(always)]
949 pub fn ten(&mut self, n: u8) -> TEN_W<CRrs> {
950 #[allow(clippy::no_effect)]
951 [(); 2][n as usize];
952 TEN_W::new(self, n * 16 + 2)
953 }
954 #[inline(always)]
956 pub fn ten1(&mut self) -> TEN_W<CRrs> {
957 TEN_W::new(self, 2)
958 }
959 #[inline(always)]
961 pub fn ten2(&mut self) -> TEN_W<CRrs> {
962 TEN_W::new(self, 18)
963 }
964 #[inline(always)]
966 pub fn tsel1(&mut self) -> TSEL1_W<CRrs> {
967 TSEL1_W::new(self, 3)
968 }
969 #[inline(always)]
973 pub fn wave(&mut self, n: u8) -> WAVE_W<CRrs> {
974 #[allow(clippy::no_effect)]
975 [(); 2][n as usize];
976 WAVE_W::new(self, n * 16 + 6)
977 }
978 #[inline(always)]
980 pub fn wave1(&mut self) -> WAVE_W<CRrs> {
981 WAVE_W::new(self, 6)
982 }
983 #[inline(always)]
985 pub fn wave2(&mut self) -> WAVE_W<CRrs> {
986 WAVE_W::new(self, 22)
987 }
988 #[inline(always)]
992 pub fn mamp(&mut self, n: u8) -> MAMP_W<CRrs> {
993 #[allow(clippy::no_effect)]
994 [(); 2][n as usize];
995 MAMP_W::new(self, n * 16 + 8)
996 }
997 #[inline(always)]
999 pub fn mamp1(&mut self) -> MAMP_W<CRrs> {
1000 MAMP_W::new(self, 8)
1001 }
1002 #[inline(always)]
1004 pub fn mamp2(&mut self) -> MAMP_W<CRrs> {
1005 MAMP_W::new(self, 24)
1006 }
1007 #[inline(always)]
1011 pub fn dmaen(&mut self, n: u8) -> DMAEN_W<CRrs> {
1012 #[allow(clippy::no_effect)]
1013 [(); 2][n as usize];
1014 DMAEN_W::new(self, n * 16 + 12)
1015 }
1016 #[inline(always)]
1018 pub fn dmaen1(&mut self) -> DMAEN_W<CRrs> {
1019 DMAEN_W::new(self, 12)
1020 }
1021 #[inline(always)]
1023 pub fn dmaen2(&mut self) -> DMAEN_W<CRrs> {
1024 DMAEN_W::new(self, 28)
1025 }
1026 #[inline(always)]
1030 pub fn dmaudrie(&mut self, n: u8) -> DMAUDRIE_W<CRrs> {
1031 #[allow(clippy::no_effect)]
1032 [(); 2][n as usize];
1033 DMAUDRIE_W::new(self, n * 16 + 13)
1034 }
1035 #[inline(always)]
1037 pub fn dmaudrie1(&mut self) -> DMAUDRIE_W<CRrs> {
1038 DMAUDRIE_W::new(self, 13)
1039 }
1040 #[inline(always)]
1042 pub fn dmaudrie2(&mut self) -> DMAUDRIE_W<CRrs> {
1043 DMAUDRIE_W::new(self, 29)
1044 }
1045 #[inline(always)]
1047 pub fn tsel2(&mut self) -> TSEL2_W<CRrs> {
1048 TSEL2_W::new(self, 19)
1049 }
1050}
1051pub struct CRrs;
1057impl crate::RegisterSpec for CRrs {
1058 type Ux = u32;
1059}
1060impl crate::Readable for CRrs {}
1062impl crate::Writable for CRrs {
1064 type Safety = crate::Unsafe;
1065}
1066impl crate::Resettable for CRrs {}