1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
#[doc = "Register `CH_AL2_CTRL` reader"]
pub type R = crate::R<CH_AL2_CTRL_SPEC>;
#[doc = "Register `CH_AL2_CTRL` writer"]
pub type W = crate::W<CH_AL2_CTRL_SPEC>;
#[doc = "Field `EN` reader - DMA Channel Enable.  
 When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)"]
pub type EN_R = crate::BitReader;
#[doc = "Field `EN` writer - DMA Channel Enable.  
 When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)"]
pub type EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `HIGH_PRIORITY` reader - HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels.  

 This only affects the order in which the DMA schedules channels. The DMA's bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput."]
pub type HIGH_PRIORITY_R = crate::BitReader;
#[doc = "Field `HIGH_PRIORITY` writer - HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels.  

 This only affects the order in which the DMA schedules channels. The DMA's bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput."]
pub type HIGH_PRIORITY_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `DATA_SIZE` reader - Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer."]
pub type DATA_SIZE_R = crate::FieldReader<DATA_SIZE_A>;
#[doc = "Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer.  

Value on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DATA_SIZE_A {
    #[doc = "0: `0`"]
    SIZE_BYTE = 0,
    #[doc = "1: `1`"]
    SIZE_HALFWORD = 1,
    #[doc = "2: `10`"]
    SIZE_WORD = 2,
}
impl From<DATA_SIZE_A> for u8 {
    #[inline(always)]
    fn from(variant: DATA_SIZE_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for DATA_SIZE_A {
    type Ux = u8;
}
impl DATA_SIZE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<DATA_SIZE_A> {
        match self.bits {
            0 => Some(DATA_SIZE_A::SIZE_BYTE),
            1 => Some(DATA_SIZE_A::SIZE_HALFWORD),
            2 => Some(DATA_SIZE_A::SIZE_WORD),
            _ => None,
        }
    }
    #[doc = "`0`"]
    #[inline(always)]
    pub fn is_size_byte(&self) -> bool {
        *self == DATA_SIZE_A::SIZE_BYTE
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn is_size_halfword(&self) -> bool {
        *self == DATA_SIZE_A::SIZE_HALFWORD
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn is_size_word(&self) -> bool {
        *self == DATA_SIZE_A::SIZE_WORD
    }
}
#[doc = "Field `DATA_SIZE` writer - Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer."]
pub type DATA_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DATA_SIZE_A>;
impl<'a, REG> DATA_SIZE_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "`0`"]
    #[inline(always)]
    pub fn size_byte(self) -> &'a mut crate::W<REG> {
        self.variant(DATA_SIZE_A::SIZE_BYTE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn size_halfword(self) -> &'a mut crate::W<REG> {
        self.variant(DATA_SIZE_A::SIZE_HALFWORD)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn size_word(self) -> &'a mut crate::W<REG> {
        self.variant(DATA_SIZE_A::SIZE_WORD)
    }
}
#[doc = "Field `INCR_READ` reader - If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address.  

 Generally this should be disabled for peripheral-to-memory transfers."]
pub type INCR_READ_R = crate::BitReader;
#[doc = "Field `INCR_READ` writer - If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address.  

 Generally this should be disabled for peripheral-to-memory transfers."]
pub type INCR_READ_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `INCR_WRITE` reader - If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address.  

 Generally this should be disabled for memory-to-peripheral transfers."]
pub type INCR_WRITE_R = crate::BitReader;
#[doc = "Field `INCR_WRITE` writer - If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address.  

 Generally this should be disabled for memory-to-peripheral transfers."]
pub type INCR_WRITE_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `RING_SIZE` reader - Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 &lt;&lt; n) byte boundary, facilitating access to naturally-aligned ring buffers.  

 Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL."]
pub type RING_SIZE_R = crate::FieldReader<RING_SIZE_A>;
#[doc = "Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 &lt;&lt; n) byte boundary, facilitating access to naturally-aligned ring buffers.  

 Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL.  

Value on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RING_SIZE_A {
    #[doc = "0: `0`"]
    RING_NONE = 0,
}
impl From<RING_SIZE_A> for u8 {
    #[inline(always)]
    fn from(variant: RING_SIZE_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for RING_SIZE_A {
    type Ux = u8;
}
impl RING_SIZE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<RING_SIZE_A> {
        match self.bits {
            0 => Some(RING_SIZE_A::RING_NONE),
            _ => None,
        }
    }
    #[doc = "`0`"]
    #[inline(always)]
    pub fn is_ring_none(&self) -> bool {
        *self == RING_SIZE_A::RING_NONE
    }
}
#[doc = "Field `RING_SIZE` writer - Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 &lt;&lt; n) byte boundary, facilitating access to naturally-aligned ring buffers.  

 Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL."]
pub type RING_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 4, RING_SIZE_A>;
impl<'a, REG> RING_SIZE_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "`0`"]
    #[inline(always)]
    pub fn ring_none(self) -> &'a mut crate::W<REG> {
        self.variant(RING_SIZE_A::RING_NONE)
    }
}
#[doc = "Field `RING_SEL` reader - Select whether RING_SIZE applies to read or write addresses.  
 If 0, read addresses are wrapped on a (1 &lt;&lt; RING_SIZE) boundary. If 1, write addresses are wrapped."]
pub type RING_SEL_R = crate::BitReader;
#[doc = "Field `RING_SEL` writer - Select whether RING_SIZE applies to read or write addresses.  
 If 0, read addresses are wrapped on a (1 &lt;&lt; RING_SIZE) boundary. If 1, write addresses are wrapped."]
pub type RING_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHAIN_TO` reader - When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_.   
 Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."]
pub type CHAIN_TO_R = crate::FieldReader;
#[doc = "Field `CHAIN_TO` writer - When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_.   
 Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."]
pub type CHAIN_TO_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `TREQ_SEL` reader - Select a Transfer Request signal.  
 The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).  
 0x0 to 0x3a -> select DREQ n as TREQ"]
pub type TREQ_SEL_R = crate::FieldReader<TREQ_SEL_A>;
#[doc = "Select a Transfer Request signal.  
 The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).  
 0x0 to 0x3a -> select DREQ n as TREQ  

Value on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TREQ_SEL_A {
    #[doc = "0: Select PIO0's TX FIFO 0 as TREQ"]
    PIO0_TX0 = 0,
    #[doc = "1: Select PIO0's TX FIFO 1 as TREQ"]
    PIO0_TX1 = 1,
    #[doc = "2: Select PIO0's TX FIFO 2 as TREQ"]
    PIO0_TX2 = 2,
    #[doc = "3: Select PIO0's TX FIFO 3 as TREQ"]
    PIO0_TX3 = 3,
    #[doc = "4: Select PIO0's RX FIFO 0 as TREQ"]
    PIO0_RX0 = 4,
    #[doc = "5: Select PIO0's RX FIFO 1 as TREQ"]
    PIO0_RX1 = 5,
    #[doc = "6: Select PIO0's RX FIFO 2 as TREQ"]
    PIO0_RX2 = 6,
    #[doc = "7: Select PIO0's RX FIFO 3 as TREQ"]
    PIO0_RX3 = 7,
    #[doc = "8: Select PIO1's TX FIFO 0 as TREQ"]
    PIO1_TX0 = 8,
    #[doc = "9: Select PIO1's TX FIFO 1 as TREQ"]
    PIO1_TX1 = 9,
    #[doc = "10: Select PIO1's TX FIFO 2 as TREQ"]
    PIO1_TX2 = 10,
    #[doc = "11: Select PIO1's TX FIFO 3 as TREQ"]
    PIO1_TX3 = 11,
    #[doc = "12: Select PIO1's RX FIFO 0 as TREQ"]
    PIO1_RX0 = 12,
    #[doc = "13: Select PIO1's RX FIFO 1 as TREQ"]
    PIO1_RX1 = 13,
    #[doc = "14: Select PIO1's RX FIFO 2 as TREQ"]
    PIO1_RX2 = 14,
    #[doc = "15: Select PIO1's RX FIFO 3 as TREQ"]
    PIO1_RX3 = 15,
    #[doc = "16: Select SPI0's TX FIFO as TREQ"]
    SPI0_TX = 16,
    #[doc = "17: Select SPI0's RX FIFO as TREQ"]
    SPI0_RX = 17,
    #[doc = "18: Select SPI1's TX FIFO as TREQ"]
    SPI1_TX = 18,
    #[doc = "19: Select SPI1's RX FIFO as TREQ"]
    SPI1_RX = 19,
    #[doc = "20: Select UART0's TX FIFO as TREQ"]
    UART0_TX = 20,
    #[doc = "21: Select UART0's RX FIFO as TREQ"]
    UART0_RX = 21,
    #[doc = "22: Select UART1's TX FIFO as TREQ"]
    UART1_TX = 22,
    #[doc = "23: Select UART1's RX FIFO as TREQ"]
    UART1_RX = 23,
    #[doc = "24: Select PWM Counter 0's Wrap Value as TREQ"]
    PWM_WRAP0 = 24,
    #[doc = "25: Select PWM Counter 1's Wrap Value as TREQ"]
    PWM_WRAP1 = 25,
    #[doc = "26: Select PWM Counter 2's Wrap Value as TREQ"]
    PWM_WRAP2 = 26,
    #[doc = "27: Select PWM Counter 3's Wrap Value as TREQ"]
    PWM_WRAP3 = 27,
    #[doc = "28: Select PWM Counter 4's Wrap Value as TREQ"]
    PWM_WRAP4 = 28,
    #[doc = "29: Select PWM Counter 5's Wrap Value as TREQ"]
    PWM_WRAP5 = 29,
    #[doc = "30: Select PWM Counter 6's Wrap Value as TREQ"]
    PWM_WRAP6 = 30,
    #[doc = "31: Select PWM Counter 7's Wrap Value as TREQ"]
    PWM_WRAP7 = 31,
    #[doc = "32: Select I2C0's TX FIFO as TREQ"]
    I2C0_TX = 32,
    #[doc = "33: Select I2C0's RX FIFO as TREQ"]
    I2C0_RX = 33,
    #[doc = "34: Select I2C1's TX FIFO as TREQ"]
    I2C1_TX = 34,
    #[doc = "35: Select I2C1's RX FIFO as TREQ"]
    I2C1_RX = 35,
    #[doc = "36: Select the ADC as TREQ"]
    ADC = 36,
    #[doc = "37: Select the XIP Streaming FIFO as TREQ"]
    XIP_STREAM = 37,
    #[doc = "38: Select the XIP SSI TX FIFO as TREQ"]
    XIP_SSITX = 38,
    #[doc = "39: Select the XIP SSI RX FIFO as TREQ"]
    XIP_SSIRX = 39,
    #[doc = "59: Select Timer 0 as TREQ"]
    TIMER0 = 59,
    #[doc = "60: Select Timer 1 as TREQ"]
    TIMER1 = 60,
    #[doc = "61: Select Timer 2 as TREQ (Optional)"]
    TIMER2 = 61,
    #[doc = "62: Select Timer 3 as TREQ (Optional)"]
    TIMER3 = 62,
    #[doc = "63: Permanent request, for unpaced transfers."]
    PERMANENT = 63,
}
impl From<TREQ_SEL_A> for u8 {
    #[inline(always)]
    fn from(variant: TREQ_SEL_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TREQ_SEL_A {
    type Ux = u8;
}
impl TREQ_SEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TREQ_SEL_A> {
        match self.bits {
            0 => Some(TREQ_SEL_A::PIO0_TX0),
            1 => Some(TREQ_SEL_A::PIO0_TX1),
            2 => Some(TREQ_SEL_A::PIO0_TX2),
            3 => Some(TREQ_SEL_A::PIO0_TX3),
            4 => Some(TREQ_SEL_A::PIO0_RX0),
            5 => Some(TREQ_SEL_A::PIO0_RX1),
            6 => Some(TREQ_SEL_A::PIO0_RX2),
            7 => Some(TREQ_SEL_A::PIO0_RX3),
            8 => Some(TREQ_SEL_A::PIO1_TX0),
            9 => Some(TREQ_SEL_A::PIO1_TX1),
            10 => Some(TREQ_SEL_A::PIO1_TX2),
            11 => Some(TREQ_SEL_A::PIO1_TX3),
            12 => Some(TREQ_SEL_A::PIO1_RX0),
            13 => Some(TREQ_SEL_A::PIO1_RX1),
            14 => Some(TREQ_SEL_A::PIO1_RX2),
            15 => Some(TREQ_SEL_A::PIO1_RX3),
            16 => Some(TREQ_SEL_A::SPI0_TX),
            17 => Some(TREQ_SEL_A::SPI0_RX),
            18 => Some(TREQ_SEL_A::SPI1_TX),
            19 => Some(TREQ_SEL_A::SPI1_RX),
            20 => Some(TREQ_SEL_A::UART0_TX),
            21 => Some(TREQ_SEL_A::UART0_RX),
            22 => Some(TREQ_SEL_A::UART1_TX),
            23 => Some(TREQ_SEL_A::UART1_RX),
            24 => Some(TREQ_SEL_A::PWM_WRAP0),
            25 => Some(TREQ_SEL_A::PWM_WRAP1),
            26 => Some(TREQ_SEL_A::PWM_WRAP2),
            27 => Some(TREQ_SEL_A::PWM_WRAP3),
            28 => Some(TREQ_SEL_A::PWM_WRAP4),
            29 => Some(TREQ_SEL_A::PWM_WRAP5),
            30 => Some(TREQ_SEL_A::PWM_WRAP6),
            31 => Some(TREQ_SEL_A::PWM_WRAP7),
            32 => Some(TREQ_SEL_A::I2C0_TX),
            33 => Some(TREQ_SEL_A::I2C0_RX),
            34 => Some(TREQ_SEL_A::I2C1_TX),
            35 => Some(TREQ_SEL_A::I2C1_RX),
            36 => Some(TREQ_SEL_A::ADC),
            37 => Some(TREQ_SEL_A::XIP_STREAM),
            38 => Some(TREQ_SEL_A::XIP_SSITX),
            39 => Some(TREQ_SEL_A::XIP_SSIRX),
            59 => Some(TREQ_SEL_A::TIMER0),
            60 => Some(TREQ_SEL_A::TIMER1),
            61 => Some(TREQ_SEL_A::TIMER2),
            62 => Some(TREQ_SEL_A::TIMER3),
            63 => Some(TREQ_SEL_A::PERMANENT),
            _ => None,
        }
    }
    #[doc = "Select PIO0's TX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_tx0(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_TX0
    }
    #[doc = "Select PIO0's TX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_tx1(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_TX1
    }
    #[doc = "Select PIO0's TX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_tx2(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_TX2
    }
    #[doc = "Select PIO0's TX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_tx3(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_TX3
    }
    #[doc = "Select PIO0's RX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_rx0(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_RX0
    }
    #[doc = "Select PIO0's RX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_rx1(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_RX1
    }
    #[doc = "Select PIO0's RX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_rx2(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_RX2
    }
    #[doc = "Select PIO0's RX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn is_pio0_rx3(&self) -> bool {
        *self == TREQ_SEL_A::PIO0_RX3
    }
    #[doc = "Select PIO1's TX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_tx0(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_TX0
    }
    #[doc = "Select PIO1's TX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_tx1(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_TX1
    }
    #[doc = "Select PIO1's TX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_tx2(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_TX2
    }
    #[doc = "Select PIO1's TX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_tx3(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_TX3
    }
    #[doc = "Select PIO1's RX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_rx0(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_RX0
    }
    #[doc = "Select PIO1's RX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_rx1(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_RX1
    }
    #[doc = "Select PIO1's RX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_rx2(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_RX2
    }
    #[doc = "Select PIO1's RX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn is_pio1_rx3(&self) -> bool {
        *self == TREQ_SEL_A::PIO1_RX3
    }
    #[doc = "Select SPI0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_spi0_tx(&self) -> bool {
        *self == TREQ_SEL_A::SPI0_TX
    }
    #[doc = "Select SPI0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_spi0_rx(&self) -> bool {
        *self == TREQ_SEL_A::SPI0_RX
    }
    #[doc = "Select SPI1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_spi1_tx(&self) -> bool {
        *self == TREQ_SEL_A::SPI1_TX
    }
    #[doc = "Select SPI1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_spi1_rx(&self) -> bool {
        *self == TREQ_SEL_A::SPI1_RX
    }
    #[doc = "Select UART0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_uart0_tx(&self) -> bool {
        *self == TREQ_SEL_A::UART0_TX
    }
    #[doc = "Select UART0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_uart0_rx(&self) -> bool {
        *self == TREQ_SEL_A::UART0_RX
    }
    #[doc = "Select UART1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_uart1_tx(&self) -> bool {
        *self == TREQ_SEL_A::UART1_TX
    }
    #[doc = "Select UART1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_uart1_rx(&self) -> bool {
        *self == TREQ_SEL_A::UART1_RX
    }
    #[doc = "Select PWM Counter 0's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap0(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP0
    }
    #[doc = "Select PWM Counter 1's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap1(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP1
    }
    #[doc = "Select PWM Counter 2's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap2(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP2
    }
    #[doc = "Select PWM Counter 3's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap3(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP3
    }
    #[doc = "Select PWM Counter 4's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap4(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP4
    }
    #[doc = "Select PWM Counter 5's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap5(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP5
    }
    #[doc = "Select PWM Counter 6's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap6(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP6
    }
    #[doc = "Select PWM Counter 7's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn is_pwm_wrap7(&self) -> bool {
        *self == TREQ_SEL_A::PWM_WRAP7
    }
    #[doc = "Select I2C0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_i2c0_tx(&self) -> bool {
        *self == TREQ_SEL_A::I2C0_TX
    }
    #[doc = "Select I2C0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_i2c0_rx(&self) -> bool {
        *self == TREQ_SEL_A::I2C0_RX
    }
    #[doc = "Select I2C1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_i2c1_tx(&self) -> bool {
        *self == TREQ_SEL_A::I2C1_TX
    }
    #[doc = "Select I2C1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_i2c1_rx(&self) -> bool {
        *self == TREQ_SEL_A::I2C1_RX
    }
    #[doc = "Select the ADC as TREQ"]
    #[inline(always)]
    pub fn is_adc(&self) -> bool {
        *self == TREQ_SEL_A::ADC
    }
    #[doc = "Select the XIP Streaming FIFO as TREQ"]
    #[inline(always)]
    pub fn is_xip_stream(&self) -> bool {
        *self == TREQ_SEL_A::XIP_STREAM
    }
    #[doc = "Select the XIP SSI TX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_xip_ssitx(&self) -> bool {
        *self == TREQ_SEL_A::XIP_SSITX
    }
    #[doc = "Select the XIP SSI RX FIFO as TREQ"]
    #[inline(always)]
    pub fn is_xip_ssirx(&self) -> bool {
        *self == TREQ_SEL_A::XIP_SSIRX
    }
    #[doc = "Select Timer 0 as TREQ"]
    #[inline(always)]
    pub fn is_timer0(&self) -> bool {
        *self == TREQ_SEL_A::TIMER0
    }
    #[doc = "Select Timer 1 as TREQ"]
    #[inline(always)]
    pub fn is_timer1(&self) -> bool {
        *self == TREQ_SEL_A::TIMER1
    }
    #[doc = "Select Timer 2 as TREQ (Optional)"]
    #[inline(always)]
    pub fn is_timer2(&self) -> bool {
        *self == TREQ_SEL_A::TIMER2
    }
    #[doc = "Select Timer 3 as TREQ (Optional)"]
    #[inline(always)]
    pub fn is_timer3(&self) -> bool {
        *self == TREQ_SEL_A::TIMER3
    }
    #[doc = "Permanent request, for unpaced transfers."]
    #[inline(always)]
    pub fn is_permanent(&self) -> bool {
        *self == TREQ_SEL_A::PERMANENT
    }
}
#[doc = "Field `TREQ_SEL` writer - Select a Transfer Request signal.  
 The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).  
 0x0 to 0x3a -> select DREQ n as TREQ"]
pub type TREQ_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 6, TREQ_SEL_A>;
impl<'a, REG> TREQ_SEL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Select PIO0's TX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn pio0_tx0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_TX0)
    }
    #[doc = "Select PIO0's TX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn pio0_tx1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_TX1)
    }
    #[doc = "Select PIO0's TX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn pio0_tx2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_TX2)
    }
    #[doc = "Select PIO0's TX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn pio0_tx3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_TX3)
    }
    #[doc = "Select PIO0's RX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn pio0_rx0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_RX0)
    }
    #[doc = "Select PIO0's RX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn pio0_rx1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_RX1)
    }
    #[doc = "Select PIO0's RX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn pio0_rx2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_RX2)
    }
    #[doc = "Select PIO0's RX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn pio0_rx3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO0_RX3)
    }
    #[doc = "Select PIO1's TX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn pio1_tx0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_TX0)
    }
    #[doc = "Select PIO1's TX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn pio1_tx1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_TX1)
    }
    #[doc = "Select PIO1's TX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn pio1_tx2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_TX2)
    }
    #[doc = "Select PIO1's TX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn pio1_tx3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_TX3)
    }
    #[doc = "Select PIO1's RX FIFO 0 as TREQ"]
    #[inline(always)]
    pub fn pio1_rx0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_RX0)
    }
    #[doc = "Select PIO1's RX FIFO 1 as TREQ"]
    #[inline(always)]
    pub fn pio1_rx1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_RX1)
    }
    #[doc = "Select PIO1's RX FIFO 2 as TREQ"]
    #[inline(always)]
    pub fn pio1_rx2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_RX2)
    }
    #[doc = "Select PIO1's RX FIFO 3 as TREQ"]
    #[inline(always)]
    pub fn pio1_rx3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PIO1_RX3)
    }
    #[doc = "Select SPI0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn spi0_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::SPI0_TX)
    }
    #[doc = "Select SPI0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn spi0_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::SPI0_RX)
    }
    #[doc = "Select SPI1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn spi1_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::SPI1_TX)
    }
    #[doc = "Select SPI1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn spi1_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::SPI1_RX)
    }
    #[doc = "Select UART0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn uart0_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::UART0_TX)
    }
    #[doc = "Select UART0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn uart0_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::UART0_RX)
    }
    #[doc = "Select UART1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn uart1_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::UART1_TX)
    }
    #[doc = "Select UART1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn uart1_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::UART1_RX)
    }
    #[doc = "Select PWM Counter 0's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP0)
    }
    #[doc = "Select PWM Counter 1's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP1)
    }
    #[doc = "Select PWM Counter 2's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP2)
    }
    #[doc = "Select PWM Counter 3's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP3)
    }
    #[doc = "Select PWM Counter 4's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap4(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP4)
    }
    #[doc = "Select PWM Counter 5's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap5(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP5)
    }
    #[doc = "Select PWM Counter 6's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap6(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP6)
    }
    #[doc = "Select PWM Counter 7's Wrap Value as TREQ"]
    #[inline(always)]
    pub fn pwm_wrap7(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PWM_WRAP7)
    }
    #[doc = "Select I2C0's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn i2c0_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::I2C0_TX)
    }
    #[doc = "Select I2C0's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn i2c0_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::I2C0_RX)
    }
    #[doc = "Select I2C1's TX FIFO as TREQ"]
    #[inline(always)]
    pub fn i2c1_tx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::I2C1_TX)
    }
    #[doc = "Select I2C1's RX FIFO as TREQ"]
    #[inline(always)]
    pub fn i2c1_rx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::I2C1_RX)
    }
    #[doc = "Select the ADC as TREQ"]
    #[inline(always)]
    pub fn adc(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::ADC)
    }
    #[doc = "Select the XIP Streaming FIFO as TREQ"]
    #[inline(always)]
    pub fn xip_stream(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::XIP_STREAM)
    }
    #[doc = "Select the XIP SSI TX FIFO as TREQ"]
    #[inline(always)]
    pub fn xip_ssitx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::XIP_SSITX)
    }
    #[doc = "Select the XIP SSI RX FIFO as TREQ"]
    #[inline(always)]
    pub fn xip_ssirx(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::XIP_SSIRX)
    }
    #[doc = "Select Timer 0 as TREQ"]
    #[inline(always)]
    pub fn timer0(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::TIMER0)
    }
    #[doc = "Select Timer 1 as TREQ"]
    #[inline(always)]
    pub fn timer1(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::TIMER1)
    }
    #[doc = "Select Timer 2 as TREQ (Optional)"]
    #[inline(always)]
    pub fn timer2(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::TIMER2)
    }
    #[doc = "Select Timer 3 as TREQ (Optional)"]
    #[inline(always)]
    pub fn timer3(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::TIMER3)
    }
    #[doc = "Permanent request, for unpaced transfers."]
    #[inline(always)]
    pub fn permanent(self) -> &'a mut crate::W<REG> {
        self.variant(TREQ_SEL_A::PERMANENT)
    }
}
#[doc = "Field `IRQ_QUIET` reader - In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain.  

 This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks."]
pub type IRQ_QUIET_R = crate::BitReader;
#[doc = "Field `IRQ_QUIET` writer - In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain.  

 This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks."]
pub type IRQ_QUIET_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `BSWAP` reader - Apply byte-swap transformation to DMA data.  
 For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order."]
pub type BSWAP_R = crate::BitReader;
#[doc = "Field `BSWAP` writer - Apply byte-swap transformation to DMA data.  
 For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order."]
pub type BSWAP_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SNIFF_EN` reader - If 1, this channel's data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected.  

 This allows checksum to be enabled or disabled on a per-control- block basis."]
pub type SNIFF_EN_R = crate::BitReader;
#[doc = "Field `SNIFF_EN` writer - If 1, this channel's data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected.  

 This allows checksum to be enabled or disabled on a per-control- block basis."]
pub type SNIFF_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `BUSY` reader - This flag goes high when the channel starts a new transfer sequence, and low when the last transfer of that sequence completes. Clearing EN while BUSY is high pauses the channel, and BUSY will stay high while paused.  

 To terminate a sequence early (and clear the BUSY flag), see CHAN_ABORT."]
pub type BUSY_R = crate::BitReader;
#[doc = "Field `WRITE_ERROR` reader - If 1, the channel received a write bus error. Write one to clear.  
 WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)"]
pub type WRITE_ERROR_R = crate::BitReader;
#[doc = "Field `WRITE_ERROR` writer - If 1, the channel received a write bus error. Write one to clear.  
 WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)"]
pub type WRITE_ERROR_W<'a, REG> = crate::BitWriter1C<'a, REG>;
#[doc = "Field `READ_ERROR` reader - If 1, the channel received a read bus error. Write one to clear.  
 READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)"]
pub type READ_ERROR_R = crate::BitReader;
#[doc = "Field `READ_ERROR` writer - If 1, the channel received a read bus error. Write one to clear.  
 READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)"]
pub type READ_ERROR_W<'a, REG> = crate::BitWriter1C<'a, REG>;
#[doc = "Field `AHB_ERROR` reader - Logical OR of the READ_ERROR and WRITE_ERROR flags. The channel halts when it encounters any bus error, and always raises its channel IRQ flag."]
pub type AHB_ERROR_R = crate::BitReader;
impl R {
    #[doc = "Bit 0 - DMA Channel Enable.  
 When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)"]
    #[inline(always)]
    pub fn en(&self) -> EN_R {
        EN_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels.  

 This only affects the order in which the DMA schedules channels. The DMA's bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput."]
    #[inline(always)]
    pub fn high_priority(&self) -> HIGH_PRIORITY_R {
        HIGH_PRIORITY_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bits 2:3 - Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer."]
    #[inline(always)]
    pub fn data_size(&self) -> DATA_SIZE_R {
        DATA_SIZE_R::new(((self.bits >> 2) & 3) as u8)
    }
    #[doc = "Bit 4 - If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address.  

 Generally this should be disabled for peripheral-to-memory transfers."]
    #[inline(always)]
    pub fn incr_read(&self) -> INCR_READ_R {
        INCR_READ_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address.  

 Generally this should be disabled for memory-to-peripheral transfers."]
    #[inline(always)]
    pub fn incr_write(&self) -> INCR_WRITE_R {
        INCR_WRITE_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:9 - Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 &lt;&lt; n) byte boundary, facilitating access to naturally-aligned ring buffers.  

 Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL."]
    #[inline(always)]
    pub fn ring_size(&self) -> RING_SIZE_R {
        RING_SIZE_R::new(((self.bits >> 6) & 0x0f) as u8)
    }
    #[doc = "Bit 10 - Select whether RING_SIZE applies to read or write addresses.  
 If 0, read addresses are wrapped on a (1 &lt;&lt; RING_SIZE) boundary. If 1, write addresses are wrapped."]
    #[inline(always)]
    pub fn ring_sel(&self) -> RING_SEL_R {
        RING_SEL_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bits 11:14 - When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_.   
 Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."]
    #[inline(always)]
    pub fn chain_to(&self) -> CHAIN_TO_R {
        CHAIN_TO_R::new(((self.bits >> 11) & 0x0f) as u8)
    }
    #[doc = "Bits 15:20 - Select a Transfer Request signal.  
 The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).  
 0x0 to 0x3a -> select DREQ n as TREQ"]
    #[inline(always)]
    pub fn treq_sel(&self) -> TREQ_SEL_R {
        TREQ_SEL_R::new(((self.bits >> 15) & 0x3f) as u8)
    }
    #[doc = "Bit 21 - In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain.  

 This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks."]
    #[inline(always)]
    pub fn irq_quiet(&self) -> IRQ_QUIET_R {
        IRQ_QUIET_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - Apply byte-swap transformation to DMA data.  
 For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order."]
    #[inline(always)]
    pub fn bswap(&self) -> BSWAP_R {
        BSWAP_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - If 1, this channel's data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected.  

 This allows checksum to be enabled or disabled on a per-control- block basis."]
    #[inline(always)]
    pub fn sniff_en(&self) -> SNIFF_EN_R {
        SNIFF_EN_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - This flag goes high when the channel starts a new transfer sequence, and low when the last transfer of that sequence completes. Clearing EN while BUSY is high pauses the channel, and BUSY will stay high while paused.  

 To terminate a sequence early (and clear the BUSY flag), see CHAN_ABORT."]
    #[inline(always)]
    pub fn busy(&self) -> BUSY_R {
        BUSY_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 29 - If 1, the channel received a write bus error. Write one to clear.  
 WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)"]
    #[inline(always)]
    pub fn write_error(&self) -> WRITE_ERROR_R {
        WRITE_ERROR_R::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 30 - If 1, the channel received a read bus error. Write one to clear.  
 READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)"]
    #[inline(always)]
    pub fn read_error(&self) -> READ_ERROR_R {
        READ_ERROR_R::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - Logical OR of the READ_ERROR and WRITE_ERROR flags. The channel halts when it encounters any bus error, and always raises its channel IRQ flag."]
    #[inline(always)]
    pub fn ahb_error(&self) -> AHB_ERROR_R {
        AHB_ERROR_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - DMA Channel Enable.  
 When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)"]
    #[inline(always)]
    #[must_use]
    pub fn en(&mut self) -> EN_W<CH_AL2_CTRL_SPEC> {
        EN_W::new(self, 0)
    }
    #[doc = "Bit 1 - HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels.  

 This only affects the order in which the DMA schedules channels. The DMA's bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput."]
    #[inline(always)]
    #[must_use]
    pub fn high_priority(&mut self) -> HIGH_PRIORITY_W<CH_AL2_CTRL_SPEC> {
        HIGH_PRIORITY_W::new(self, 1)
    }
    #[doc = "Bits 2:3 - Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer."]
    #[inline(always)]
    #[must_use]
    pub fn data_size(&mut self) -> DATA_SIZE_W<CH_AL2_CTRL_SPEC> {
        DATA_SIZE_W::new(self, 2)
    }
    #[doc = "Bit 4 - If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address.  

 Generally this should be disabled for peripheral-to-memory transfers."]
    #[inline(always)]
    #[must_use]
    pub fn incr_read(&mut self) -> INCR_READ_W<CH_AL2_CTRL_SPEC> {
        INCR_READ_W::new(self, 4)
    }
    #[doc = "Bit 5 - If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address.  

 Generally this should be disabled for memory-to-peripheral transfers."]
    #[inline(always)]
    #[must_use]
    pub fn incr_write(&mut self) -> INCR_WRITE_W<CH_AL2_CTRL_SPEC> {
        INCR_WRITE_W::new(self, 5)
    }
    #[doc = "Bits 6:9 - Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 &lt;&lt; n) byte boundary, facilitating access to naturally-aligned ring buffers.  

 Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL."]
    #[inline(always)]
    #[must_use]
    pub fn ring_size(&mut self) -> RING_SIZE_W<CH_AL2_CTRL_SPEC> {
        RING_SIZE_W::new(self, 6)
    }
    #[doc = "Bit 10 - Select whether RING_SIZE applies to read or write addresses.  
 If 0, read addresses are wrapped on a (1 &lt;&lt; RING_SIZE) boundary. If 1, write addresses are wrapped."]
    #[inline(always)]
    #[must_use]
    pub fn ring_sel(&mut self) -> RING_SEL_W<CH_AL2_CTRL_SPEC> {
        RING_SEL_W::new(self, 10)
    }
    #[doc = "Bits 11:14 - When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_.   
 Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."]
    #[inline(always)]
    #[must_use]
    pub fn chain_to(&mut self) -> CHAIN_TO_W<CH_AL2_CTRL_SPEC> {
        CHAIN_TO_W::new(self, 11)
    }
    #[doc = "Bits 15:20 - Select a Transfer Request signal.  
 The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).  
 0x0 to 0x3a -> select DREQ n as TREQ"]
    #[inline(always)]
    #[must_use]
    pub fn treq_sel(&mut self) -> TREQ_SEL_W<CH_AL2_CTRL_SPEC> {
        TREQ_SEL_W::new(self, 15)
    }
    #[doc = "Bit 21 - In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain.  

 This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks."]
    #[inline(always)]
    #[must_use]
    pub fn irq_quiet(&mut self) -> IRQ_QUIET_W<CH_AL2_CTRL_SPEC> {
        IRQ_QUIET_W::new(self, 21)
    }
    #[doc = "Bit 22 - Apply byte-swap transformation to DMA data.  
 For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order."]
    #[inline(always)]
    #[must_use]
    pub fn bswap(&mut self) -> BSWAP_W<CH_AL2_CTRL_SPEC> {
        BSWAP_W::new(self, 22)
    }
    #[doc = "Bit 23 - If 1, this channel's data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected.  

 This allows checksum to be enabled or disabled on a per-control- block basis."]
    #[inline(always)]
    #[must_use]
    pub fn sniff_en(&mut self) -> SNIFF_EN_W<CH_AL2_CTRL_SPEC> {
        SNIFF_EN_W::new(self, 23)
    }
    #[doc = "Bit 29 - If 1, the channel received a write bus error. Write one to clear.  
 WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)"]
    #[inline(always)]
    #[must_use]
    pub fn write_error(&mut self) -> WRITE_ERROR_W<CH_AL2_CTRL_SPEC> {
        WRITE_ERROR_W::new(self, 29)
    }
    #[doc = "Bit 30 - If 1, the channel received a read bus error. Write one to clear.  
 READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)"]
    #[inline(always)]
    #[must_use]
    pub fn read_error(&mut self) -> READ_ERROR_W<CH_AL2_CTRL_SPEC> {
        READ_ERROR_W::new(self, 30)
    }
    #[doc = r" Writes raw bits to the register."]
    #[doc = r""]
    #[doc = r" # Safety"]
    #[doc = r""]
    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
}
#[doc = "DMA Channel 0 Control and Status  

You can [`read`](crate::generic::Reg::read) this register and get [`ch_al2_ctrl::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ch_al2_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CH_AL2_CTRL_SPEC;
impl crate::RegisterSpec for CH_AL2_CTRL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ch_al2_ctrl::R`](R) reader structure"]
impl crate::Readable for CH_AL2_CTRL_SPEC {}
#[doc = "`write(|w| ..)` method takes [`ch_al2_ctrl::W`](W) writer structure"]
impl crate::Writable for CH_AL2_CTRL_SPEC {
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x6000_0000;
}
#[doc = "`reset()` method sets CH_AL2_CTRL to value 0"]
impl crate::Resettable for CH_AL2_CTRL_SPEC {
    const RESET_VALUE: u32 = 0;
}