1#[doc = "Reader of register CH0_CTRL"]
2pub type R = crate::R<u32, super::CH0_CTRL>;
3#[doc = "Writer for register CH0_CTRL"]
4pub type W = crate::W<u32, super::CH0_CTRL>;
5#[doc = "Register CH0_CTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::CH0_CTRL {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "DMA Structure Type\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u8)]
16pub enum STRUCTTYPE_A {
17 #[doc = "0: DMA transfer structure type selected."]
18 TRANSFER = 0,
19 #[doc = "1: Synchronization structure type selected."]
20 SYNCHRONIZE = 1,
21 #[doc = "2: Write immediate value structure type selected."]
22 WRITE = 2,
23}
24impl From<STRUCTTYPE_A> for u8 {
25 #[inline(always)]
26 fn from(variant: STRUCTTYPE_A) -> Self {
27 variant as _
28 }
29}
30#[doc = "Reader of field `STRUCTTYPE`"]
31pub type STRUCTTYPE_R = crate::R<u8, STRUCTTYPE_A>;
32impl STRUCTTYPE_R {
33 #[doc = r"Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> crate::Variant<u8, STRUCTTYPE_A> {
36 use crate::Variant::*;
37 match self.bits {
38 0 => Val(STRUCTTYPE_A::TRANSFER),
39 1 => Val(STRUCTTYPE_A::SYNCHRONIZE),
40 2 => Val(STRUCTTYPE_A::WRITE),
41 i => Res(i),
42 }
43 }
44 #[doc = "Checks if the value of the field is `TRANSFER`"]
45 #[inline(always)]
46 pub fn is_transfer(&self) -> bool {
47 *self == STRUCTTYPE_A::TRANSFER
48 }
49 #[doc = "Checks if the value of the field is `SYNCHRONIZE`"]
50 #[inline(always)]
51 pub fn is_synchronize(&self) -> bool {
52 *self == STRUCTTYPE_A::SYNCHRONIZE
53 }
54 #[doc = "Checks if the value of the field is `WRITE`"]
55 #[inline(always)]
56 pub fn is_write(&self) -> bool {
57 *self == STRUCTTYPE_A::WRITE
58 }
59}
60#[doc = "Write proxy for field `STRUCTREQ`"]
61pub struct STRUCTREQ_W<'a> {
62 w: &'a mut W,
63}
64impl<'a> STRUCTREQ_W<'a> {
65 #[doc = r"Sets the field bit"]
66 #[inline(always)]
67 pub fn set_bit(self) -> &'a mut W {
68 self.bit(true)
69 }
70 #[doc = r"Clears the field bit"]
71 #[inline(always)]
72 pub fn clear_bit(self) -> &'a mut W {
73 self.bit(false)
74 }
75 #[doc = r"Writes raw bits to the field"]
76 #[inline(always)]
77 pub fn bit(self, value: bool) -> &'a mut W {
78 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
79 self.w
80 }
81}
82#[doc = "Reader of field `XFERCNT`"]
83pub type XFERCNT_R = crate::R<u16, u16>;
84#[doc = "Write proxy for field `XFERCNT`"]
85pub struct XFERCNT_W<'a> {
86 w: &'a mut W,
87}
88impl<'a> XFERCNT_W<'a> {
89 #[doc = r"Writes raw bits to the field"]
90 #[inline(always)]
91 pub unsafe fn bits(self, value: u16) -> &'a mut W {
92 self.w.bits = (self.w.bits & !(0x07ff << 4)) | (((value as u32) & 0x07ff) << 4);
93 self.w
94 }
95}
96#[doc = "Reader of field `BYTESWAP`"]
97pub type BYTESWAP_R = crate::R<bool, bool>;
98#[doc = "Write proxy for field `BYTESWAP`"]
99pub struct BYTESWAP_W<'a> {
100 w: &'a mut W,
101}
102impl<'a> BYTESWAP_W<'a> {
103 #[doc = r"Sets the field bit"]
104 #[inline(always)]
105 pub fn set_bit(self) -> &'a mut W {
106 self.bit(true)
107 }
108 #[doc = r"Clears the field bit"]
109 #[inline(always)]
110 pub fn clear_bit(self) -> &'a mut W {
111 self.bit(false)
112 }
113 #[doc = r"Writes raw bits to the field"]
114 #[inline(always)]
115 pub fn bit(self, value: bool) -> &'a mut W {
116 self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
117 self.w
118 }
119}
120#[doc = "Block Transfer Size\n\nValue on reset: 0"]
121#[derive(Clone, Copy, Debug, PartialEq)]
122#[repr(u8)]
123pub enum BLOCKSIZE_A {
124 #[doc = "0: One unit transfer per arbitration"]
125 UNIT1 = 0,
126 #[doc = "1: Two unit transfers per arbitration"]
127 UNIT2 = 1,
128 #[doc = "2: Three unit transfers per arbitration"]
129 UNIT3 = 2,
130 #[doc = "3: Four unit transfers per arbitration"]
131 UNIT4 = 3,
132 #[doc = "4: Six unit transfers per arbitration"]
133 UNIT6 = 4,
134 #[doc = "5: Eight unit transfers per arbitration"]
135 UNIT8 = 5,
136 #[doc = "7: Sixteen unit transfers per arbitration"]
137 UNIT16 = 7,
138 #[doc = "9: 32 unit transfers per arbitration"]
139 UNIT32 = 9,
140 #[doc = "10: 64 unit transfers per arbitration"]
141 UNIT64 = 10,
142 #[doc = "11: 128 unit transfers per arbitration"]
143 UNIT128 = 11,
144 #[doc = "12: 256 unit transfers per arbitration"]
145 UNIT256 = 12,
146 #[doc = "13: 512 unit transfers per arbitration"]
147 UNIT512 = 13,
148 #[doc = "14: 1024 unit transfers per arbitration"]
149 UNIT1024 = 14,
150 #[doc = "15: Transfer all units as specified by the XFRCNT field"]
151 ALL = 15,
152}
153impl From<BLOCKSIZE_A> for u8 {
154 #[inline(always)]
155 fn from(variant: BLOCKSIZE_A) -> Self {
156 variant as _
157 }
158}
159#[doc = "Reader of field `BLOCKSIZE`"]
160pub type BLOCKSIZE_R = crate::R<u8, BLOCKSIZE_A>;
161impl BLOCKSIZE_R {
162 #[doc = r"Get enumerated values variant"]
163 #[inline(always)]
164 pub fn variant(&self) -> crate::Variant<u8, BLOCKSIZE_A> {
165 use crate::Variant::*;
166 match self.bits {
167 0 => Val(BLOCKSIZE_A::UNIT1),
168 1 => Val(BLOCKSIZE_A::UNIT2),
169 2 => Val(BLOCKSIZE_A::UNIT3),
170 3 => Val(BLOCKSIZE_A::UNIT4),
171 4 => Val(BLOCKSIZE_A::UNIT6),
172 5 => Val(BLOCKSIZE_A::UNIT8),
173 7 => Val(BLOCKSIZE_A::UNIT16),
174 9 => Val(BLOCKSIZE_A::UNIT32),
175 10 => Val(BLOCKSIZE_A::UNIT64),
176 11 => Val(BLOCKSIZE_A::UNIT128),
177 12 => Val(BLOCKSIZE_A::UNIT256),
178 13 => Val(BLOCKSIZE_A::UNIT512),
179 14 => Val(BLOCKSIZE_A::UNIT1024),
180 15 => Val(BLOCKSIZE_A::ALL),
181 i => Res(i),
182 }
183 }
184 #[doc = "Checks if the value of the field is `UNIT1`"]
185 #[inline(always)]
186 pub fn is_unit1(&self) -> bool {
187 *self == BLOCKSIZE_A::UNIT1
188 }
189 #[doc = "Checks if the value of the field is `UNIT2`"]
190 #[inline(always)]
191 pub fn is_unit2(&self) -> bool {
192 *self == BLOCKSIZE_A::UNIT2
193 }
194 #[doc = "Checks if the value of the field is `UNIT3`"]
195 #[inline(always)]
196 pub fn is_unit3(&self) -> bool {
197 *self == BLOCKSIZE_A::UNIT3
198 }
199 #[doc = "Checks if the value of the field is `UNIT4`"]
200 #[inline(always)]
201 pub fn is_unit4(&self) -> bool {
202 *self == BLOCKSIZE_A::UNIT4
203 }
204 #[doc = "Checks if the value of the field is `UNIT6`"]
205 #[inline(always)]
206 pub fn is_unit6(&self) -> bool {
207 *self == BLOCKSIZE_A::UNIT6
208 }
209 #[doc = "Checks if the value of the field is `UNIT8`"]
210 #[inline(always)]
211 pub fn is_unit8(&self) -> bool {
212 *self == BLOCKSIZE_A::UNIT8
213 }
214 #[doc = "Checks if the value of the field is `UNIT16`"]
215 #[inline(always)]
216 pub fn is_unit16(&self) -> bool {
217 *self == BLOCKSIZE_A::UNIT16
218 }
219 #[doc = "Checks if the value of the field is `UNIT32`"]
220 #[inline(always)]
221 pub fn is_unit32(&self) -> bool {
222 *self == BLOCKSIZE_A::UNIT32
223 }
224 #[doc = "Checks if the value of the field is `UNIT64`"]
225 #[inline(always)]
226 pub fn is_unit64(&self) -> bool {
227 *self == BLOCKSIZE_A::UNIT64
228 }
229 #[doc = "Checks if the value of the field is `UNIT128`"]
230 #[inline(always)]
231 pub fn is_unit128(&self) -> bool {
232 *self == BLOCKSIZE_A::UNIT128
233 }
234 #[doc = "Checks if the value of the field is `UNIT256`"]
235 #[inline(always)]
236 pub fn is_unit256(&self) -> bool {
237 *self == BLOCKSIZE_A::UNIT256
238 }
239 #[doc = "Checks if the value of the field is `UNIT512`"]
240 #[inline(always)]
241 pub fn is_unit512(&self) -> bool {
242 *self == BLOCKSIZE_A::UNIT512
243 }
244 #[doc = "Checks if the value of the field is `UNIT1024`"]
245 #[inline(always)]
246 pub fn is_unit1024(&self) -> bool {
247 *self == BLOCKSIZE_A::UNIT1024
248 }
249 #[doc = "Checks if the value of the field is `ALL`"]
250 #[inline(always)]
251 pub fn is_all(&self) -> bool {
252 *self == BLOCKSIZE_A::ALL
253 }
254}
255#[doc = "Write proxy for field `BLOCKSIZE`"]
256pub struct BLOCKSIZE_W<'a> {
257 w: &'a mut W,
258}
259impl<'a> BLOCKSIZE_W<'a> {
260 #[doc = r"Writes `variant` to the field"]
261 #[inline(always)]
262 pub fn variant(self, variant: BLOCKSIZE_A) -> &'a mut W {
263 unsafe { self.bits(variant.into()) }
264 }
265 #[doc = "One unit transfer per arbitration"]
266 #[inline(always)]
267 pub fn unit1(self) -> &'a mut W {
268 self.variant(BLOCKSIZE_A::UNIT1)
269 }
270 #[doc = "Two unit transfers per arbitration"]
271 #[inline(always)]
272 pub fn unit2(self) -> &'a mut W {
273 self.variant(BLOCKSIZE_A::UNIT2)
274 }
275 #[doc = "Three unit transfers per arbitration"]
276 #[inline(always)]
277 pub fn unit3(self) -> &'a mut W {
278 self.variant(BLOCKSIZE_A::UNIT3)
279 }
280 #[doc = "Four unit transfers per arbitration"]
281 #[inline(always)]
282 pub fn unit4(self) -> &'a mut W {
283 self.variant(BLOCKSIZE_A::UNIT4)
284 }
285 #[doc = "Six unit transfers per arbitration"]
286 #[inline(always)]
287 pub fn unit6(self) -> &'a mut W {
288 self.variant(BLOCKSIZE_A::UNIT6)
289 }
290 #[doc = "Eight unit transfers per arbitration"]
291 #[inline(always)]
292 pub fn unit8(self) -> &'a mut W {
293 self.variant(BLOCKSIZE_A::UNIT8)
294 }
295 #[doc = "Sixteen unit transfers per arbitration"]
296 #[inline(always)]
297 pub fn unit16(self) -> &'a mut W {
298 self.variant(BLOCKSIZE_A::UNIT16)
299 }
300 #[doc = "32 unit transfers per arbitration"]
301 #[inline(always)]
302 pub fn unit32(self) -> &'a mut W {
303 self.variant(BLOCKSIZE_A::UNIT32)
304 }
305 #[doc = "64 unit transfers per arbitration"]
306 #[inline(always)]
307 pub fn unit64(self) -> &'a mut W {
308 self.variant(BLOCKSIZE_A::UNIT64)
309 }
310 #[doc = "128 unit transfers per arbitration"]
311 #[inline(always)]
312 pub fn unit128(self) -> &'a mut W {
313 self.variant(BLOCKSIZE_A::UNIT128)
314 }
315 #[doc = "256 unit transfers per arbitration"]
316 #[inline(always)]
317 pub fn unit256(self) -> &'a mut W {
318 self.variant(BLOCKSIZE_A::UNIT256)
319 }
320 #[doc = "512 unit transfers per arbitration"]
321 #[inline(always)]
322 pub fn unit512(self) -> &'a mut W {
323 self.variant(BLOCKSIZE_A::UNIT512)
324 }
325 #[doc = "1024 unit transfers per arbitration"]
326 #[inline(always)]
327 pub fn unit1024(self) -> &'a mut W {
328 self.variant(BLOCKSIZE_A::UNIT1024)
329 }
330 #[doc = "Transfer all units as specified by the XFRCNT field"]
331 #[inline(always)]
332 pub fn all(self) -> &'a mut W {
333 self.variant(BLOCKSIZE_A::ALL)
334 }
335 #[doc = r"Writes raw bits to the field"]
336 #[inline(always)]
337 pub unsafe fn bits(self, value: u8) -> &'a mut W {
338 self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16);
339 self.w
340 }
341}
342#[doc = "Reader of field `DONEIFSEN`"]
343pub type DONEIFSEN_R = crate::R<bool, bool>;
344#[doc = "Write proxy for field `DONEIFSEN`"]
345pub struct DONEIFSEN_W<'a> {
346 w: &'a mut W,
347}
348impl<'a> DONEIFSEN_W<'a> {
349 #[doc = r"Sets the field bit"]
350 #[inline(always)]
351 pub fn set_bit(self) -> &'a mut W {
352 self.bit(true)
353 }
354 #[doc = r"Clears the field bit"]
355 #[inline(always)]
356 pub fn clear_bit(self) -> &'a mut W {
357 self.bit(false)
358 }
359 #[doc = r"Writes raw bits to the field"]
360 #[inline(always)]
361 pub fn bit(self, value: bool) -> &'a mut W {
362 self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
363 self.w
364 }
365}
366#[doc = "Reader of field `REQMODE`"]
367pub type REQMODE_R = crate::R<bool, bool>;
368#[doc = "Write proxy for field `REQMODE`"]
369pub struct REQMODE_W<'a> {
370 w: &'a mut W,
371}
372impl<'a> REQMODE_W<'a> {
373 #[doc = r"Sets the field bit"]
374 #[inline(always)]
375 pub fn set_bit(self) -> &'a mut W {
376 self.bit(true)
377 }
378 #[doc = r"Clears the field bit"]
379 #[inline(always)]
380 pub fn clear_bit(self) -> &'a mut W {
381 self.bit(false)
382 }
383 #[doc = r"Writes raw bits to the field"]
384 #[inline(always)]
385 pub fn bit(self, value: bool) -> &'a mut W {
386 self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
387 self.w
388 }
389}
390#[doc = "Reader of field `DECLOOPCNT`"]
391pub type DECLOOPCNT_R = crate::R<bool, bool>;
392#[doc = "Write proxy for field `DECLOOPCNT`"]
393pub struct DECLOOPCNT_W<'a> {
394 w: &'a mut W,
395}
396impl<'a> DECLOOPCNT_W<'a> {
397 #[doc = r"Sets the field bit"]
398 #[inline(always)]
399 pub fn set_bit(self) -> &'a mut W {
400 self.bit(true)
401 }
402 #[doc = r"Clears the field bit"]
403 #[inline(always)]
404 pub fn clear_bit(self) -> &'a mut W {
405 self.bit(false)
406 }
407 #[doc = r"Writes raw bits to the field"]
408 #[inline(always)]
409 pub fn bit(self, value: bool) -> &'a mut W {
410 self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
411 self.w
412 }
413}
414#[doc = "Reader of field `IGNORESREQ`"]
415pub type IGNORESREQ_R = crate::R<bool, bool>;
416#[doc = "Write proxy for field `IGNORESREQ`"]
417pub struct IGNORESREQ_W<'a> {
418 w: &'a mut W,
419}
420impl<'a> IGNORESREQ_W<'a> {
421 #[doc = r"Sets the field bit"]
422 #[inline(always)]
423 pub fn set_bit(self) -> &'a mut W {
424 self.bit(true)
425 }
426 #[doc = r"Clears the field bit"]
427 #[inline(always)]
428 pub fn clear_bit(self) -> &'a mut W {
429 self.bit(false)
430 }
431 #[doc = r"Writes raw bits to the field"]
432 #[inline(always)]
433 pub fn bit(self, value: bool) -> &'a mut W {
434 self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
435 self.w
436 }
437}
438#[doc = "Source Address Increment Size\n\nValue on reset: 0"]
439#[derive(Clone, Copy, Debug, PartialEq)]
440#[repr(u8)]
441pub enum SRCINC_A {
442 #[doc = "0: Increment source address by one unit data size after each read"]
443 ONE = 0,
444 #[doc = "1: Increment source address by two unit data sizes after each read"]
445 TWO = 1,
446 #[doc = "2: Increment source address by four unit data sizes after each read"]
447 FOUR = 2,
448 #[doc = "3: Do not increment the source address. In this mode reads are made from a fixed source address, for example reading FIFO."]
449 NONE = 3,
450}
451impl From<SRCINC_A> for u8 {
452 #[inline(always)]
453 fn from(variant: SRCINC_A) -> Self {
454 variant as _
455 }
456}
457#[doc = "Reader of field `SRCINC`"]
458pub type SRCINC_R = crate::R<u8, SRCINC_A>;
459impl SRCINC_R {
460 #[doc = r"Get enumerated values variant"]
461 #[inline(always)]
462 pub fn variant(&self) -> SRCINC_A {
463 match self.bits {
464 0 => SRCINC_A::ONE,
465 1 => SRCINC_A::TWO,
466 2 => SRCINC_A::FOUR,
467 3 => SRCINC_A::NONE,
468 _ => unreachable!(),
469 }
470 }
471 #[doc = "Checks if the value of the field is `ONE`"]
472 #[inline(always)]
473 pub fn is_one(&self) -> bool {
474 *self == SRCINC_A::ONE
475 }
476 #[doc = "Checks if the value of the field is `TWO`"]
477 #[inline(always)]
478 pub fn is_two(&self) -> bool {
479 *self == SRCINC_A::TWO
480 }
481 #[doc = "Checks if the value of the field is `FOUR`"]
482 #[inline(always)]
483 pub fn is_four(&self) -> bool {
484 *self == SRCINC_A::FOUR
485 }
486 #[doc = "Checks if the value of the field is `NONE`"]
487 #[inline(always)]
488 pub fn is_none(&self) -> bool {
489 *self == SRCINC_A::NONE
490 }
491}
492#[doc = "Write proxy for field `SRCINC`"]
493pub struct SRCINC_W<'a> {
494 w: &'a mut W,
495}
496impl<'a> SRCINC_W<'a> {
497 #[doc = r"Writes `variant` to the field"]
498 #[inline(always)]
499 pub fn variant(self, variant: SRCINC_A) -> &'a mut W {
500 {
501 self.bits(variant.into())
502 }
503 }
504 #[doc = "Increment source address by one unit data size after each read"]
505 #[inline(always)]
506 pub fn one(self) -> &'a mut W {
507 self.variant(SRCINC_A::ONE)
508 }
509 #[doc = "Increment source address by two unit data sizes after each read"]
510 #[inline(always)]
511 pub fn two(self) -> &'a mut W {
512 self.variant(SRCINC_A::TWO)
513 }
514 #[doc = "Increment source address by four unit data sizes after each read"]
515 #[inline(always)]
516 pub fn four(self) -> &'a mut W {
517 self.variant(SRCINC_A::FOUR)
518 }
519 #[doc = "Do not increment the source address. In this mode reads are made from a fixed source address, for example reading FIFO."]
520 #[inline(always)]
521 pub fn none(self) -> &'a mut W {
522 self.variant(SRCINC_A::NONE)
523 }
524 #[doc = r"Writes raw bits to the field"]
525 #[inline(always)]
526 pub fn bits(self, value: u8) -> &'a mut W {
527 self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24);
528 self.w
529 }
530}
531#[doc = "Unit Data Transfer Size\n\nValue on reset: 0"]
532#[derive(Clone, Copy, Debug, PartialEq)]
533#[repr(u8)]
534pub enum SIZE_A {
535 #[doc = "0: Each unit transfer is a byte"]
536 BYTE = 0,
537 #[doc = "1: Each unit transfer is a half-word"]
538 HALFWORD = 1,
539 #[doc = "2: Each unit transfer is a word"]
540 WORD = 2,
541}
542impl From<SIZE_A> for u8 {
543 #[inline(always)]
544 fn from(variant: SIZE_A) -> Self {
545 variant as _
546 }
547}
548#[doc = "Reader of field `SIZE`"]
549pub type SIZE_R = crate::R<u8, SIZE_A>;
550impl SIZE_R {
551 #[doc = r"Get enumerated values variant"]
552 #[inline(always)]
553 pub fn variant(&self) -> crate::Variant<u8, SIZE_A> {
554 use crate::Variant::*;
555 match self.bits {
556 0 => Val(SIZE_A::BYTE),
557 1 => Val(SIZE_A::HALFWORD),
558 2 => Val(SIZE_A::WORD),
559 i => Res(i),
560 }
561 }
562 #[doc = "Checks if the value of the field is `BYTE`"]
563 #[inline(always)]
564 pub fn is_byte(&self) -> bool {
565 *self == SIZE_A::BYTE
566 }
567 #[doc = "Checks if the value of the field is `HALFWORD`"]
568 #[inline(always)]
569 pub fn is_halfword(&self) -> bool {
570 *self == SIZE_A::HALFWORD
571 }
572 #[doc = "Checks if the value of the field is `WORD`"]
573 #[inline(always)]
574 pub fn is_word(&self) -> bool {
575 *self == SIZE_A::WORD
576 }
577}
578#[doc = "Write proxy for field `SIZE`"]
579pub struct SIZE_W<'a> {
580 w: &'a mut W,
581}
582impl<'a> SIZE_W<'a> {
583 #[doc = r"Writes `variant` to the field"]
584 #[inline(always)]
585 pub fn variant(self, variant: SIZE_A) -> &'a mut W {
586 unsafe { self.bits(variant.into()) }
587 }
588 #[doc = "Each unit transfer is a byte"]
589 #[inline(always)]
590 pub fn byte(self) -> &'a mut W {
591 self.variant(SIZE_A::BYTE)
592 }
593 #[doc = "Each unit transfer is a half-word"]
594 #[inline(always)]
595 pub fn halfword(self) -> &'a mut W {
596 self.variant(SIZE_A::HALFWORD)
597 }
598 #[doc = "Each unit transfer is a word"]
599 #[inline(always)]
600 pub fn word(self) -> &'a mut W {
601 self.variant(SIZE_A::WORD)
602 }
603 #[doc = r"Writes raw bits to the field"]
604 #[inline(always)]
605 pub unsafe fn bits(self, value: u8) -> &'a mut W {
606 self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26);
607 self.w
608 }
609}
610#[doc = "Destination Address Increment Size\n\nValue on reset: 0"]
611#[derive(Clone, Copy, Debug, PartialEq)]
612#[repr(u8)]
613pub enum DSTINC_A {
614 #[doc = "0: Increment destination address by one unit data size after each write"]
615 ONE = 0,
616 #[doc = "1: Increment destination address by two unit data sizes after each write"]
617 TWO = 1,
618 #[doc = "2: Increment destination address by four unit data sizes after each write"]
619 FOUR = 2,
620 #[doc = "3: Do not increment the destination address. Writes are made to a fixed destination address, for example writing to a FIFO."]
621 NONE = 3,
622}
623impl From<DSTINC_A> for u8 {
624 #[inline(always)]
625 fn from(variant: DSTINC_A) -> Self {
626 variant as _
627 }
628}
629#[doc = "Reader of field `DSTINC`"]
630pub type DSTINC_R = crate::R<u8, DSTINC_A>;
631impl DSTINC_R {
632 #[doc = r"Get enumerated values variant"]
633 #[inline(always)]
634 pub fn variant(&self) -> DSTINC_A {
635 match self.bits {
636 0 => DSTINC_A::ONE,
637 1 => DSTINC_A::TWO,
638 2 => DSTINC_A::FOUR,
639 3 => DSTINC_A::NONE,
640 _ => unreachable!(),
641 }
642 }
643 #[doc = "Checks if the value of the field is `ONE`"]
644 #[inline(always)]
645 pub fn is_one(&self) -> bool {
646 *self == DSTINC_A::ONE
647 }
648 #[doc = "Checks if the value of the field is `TWO`"]
649 #[inline(always)]
650 pub fn is_two(&self) -> bool {
651 *self == DSTINC_A::TWO
652 }
653 #[doc = "Checks if the value of the field is `FOUR`"]
654 #[inline(always)]
655 pub fn is_four(&self) -> bool {
656 *self == DSTINC_A::FOUR
657 }
658 #[doc = "Checks if the value of the field is `NONE`"]
659 #[inline(always)]
660 pub fn is_none(&self) -> bool {
661 *self == DSTINC_A::NONE
662 }
663}
664#[doc = "Write proxy for field `DSTINC`"]
665pub struct DSTINC_W<'a> {
666 w: &'a mut W,
667}
668impl<'a> DSTINC_W<'a> {
669 #[doc = r"Writes `variant` to the field"]
670 #[inline(always)]
671 pub fn variant(self, variant: DSTINC_A) -> &'a mut W {
672 {
673 self.bits(variant.into())
674 }
675 }
676 #[doc = "Increment destination address by one unit data size after each write"]
677 #[inline(always)]
678 pub fn one(self) -> &'a mut W {
679 self.variant(DSTINC_A::ONE)
680 }
681 #[doc = "Increment destination address by two unit data sizes after each write"]
682 #[inline(always)]
683 pub fn two(self) -> &'a mut W {
684 self.variant(DSTINC_A::TWO)
685 }
686 #[doc = "Increment destination address by four unit data sizes after each write"]
687 #[inline(always)]
688 pub fn four(self) -> &'a mut W {
689 self.variant(DSTINC_A::FOUR)
690 }
691 #[doc = "Do not increment the destination address. Writes are made to a fixed destination address, for example writing to a FIFO."]
692 #[inline(always)]
693 pub fn none(self) -> &'a mut W {
694 self.variant(DSTINC_A::NONE)
695 }
696 #[doc = r"Writes raw bits to the field"]
697 #[inline(always)]
698 pub fn bits(self, value: u8) -> &'a mut W {
699 self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28);
700 self.w
701 }
702}
703#[doc = "Reader of field `SRCMODE`"]
704pub type SRCMODE_R = crate::R<bool, bool>;
705#[doc = "Reader of field `DSTMODE`"]
706pub type DSTMODE_R = crate::R<bool, bool>;
707impl R {
708 #[doc = "Bits 0:1 - DMA Structure Type"]
709 #[inline(always)]
710 pub fn structtype(&self) -> STRUCTTYPE_R {
711 STRUCTTYPE_R::new((self.bits & 0x03) as u8)
712 }
713 #[doc = "Bits 4:14 - DMA Unit Data Transfer Count"]
714 #[inline(always)]
715 pub fn xfercnt(&self) -> XFERCNT_R {
716 XFERCNT_R::new(((self.bits >> 4) & 0x07ff) as u16)
717 }
718 #[doc = "Bit 15 - Endian Byte Swap"]
719 #[inline(always)]
720 pub fn byteswap(&self) -> BYTESWAP_R {
721 BYTESWAP_R::new(((self.bits >> 15) & 0x01) != 0)
722 }
723 #[doc = "Bits 16:19 - Block Transfer Size"]
724 #[inline(always)]
725 pub fn blocksize(&self) -> BLOCKSIZE_R {
726 BLOCKSIZE_R::new(((self.bits >> 16) & 0x0f) as u8)
727 }
728 #[doc = "Bit 20 - DMA Operation Done Interrupt Flag Set Enable"]
729 #[inline(always)]
730 pub fn doneifsen(&self) -> DONEIFSEN_R {
731 DONEIFSEN_R::new(((self.bits >> 20) & 0x01) != 0)
732 }
733 #[doc = "Bit 21 - DMA Request Transfer Mode Select"]
734 #[inline(always)]
735 pub fn reqmode(&self) -> REQMODE_R {
736 REQMODE_R::new(((self.bits >> 21) & 0x01) != 0)
737 }
738 #[doc = "Bit 22 - Decrement Loop Count"]
739 #[inline(always)]
740 pub fn decloopcnt(&self) -> DECLOOPCNT_R {
741 DECLOOPCNT_R::new(((self.bits >> 22) & 0x01) != 0)
742 }
743 #[doc = "Bit 23 - Ignore Sreq"]
744 #[inline(always)]
745 pub fn ignoresreq(&self) -> IGNORESREQ_R {
746 IGNORESREQ_R::new(((self.bits >> 23) & 0x01) != 0)
747 }
748 #[doc = "Bits 24:25 - Source Address Increment Size"]
749 #[inline(always)]
750 pub fn srcinc(&self) -> SRCINC_R {
751 SRCINC_R::new(((self.bits >> 24) & 0x03) as u8)
752 }
753 #[doc = "Bits 26:27 - Unit Data Transfer Size"]
754 #[inline(always)]
755 pub fn size(&self) -> SIZE_R {
756 SIZE_R::new(((self.bits >> 26) & 0x03) as u8)
757 }
758 #[doc = "Bits 28:29 - Destination Address Increment Size"]
759 #[inline(always)]
760 pub fn dstinc(&self) -> DSTINC_R {
761 DSTINC_R::new(((self.bits >> 28) & 0x03) as u8)
762 }
763 #[doc = "Bit 30 - Source Addressing Mode"]
764 #[inline(always)]
765 pub fn srcmode(&self) -> SRCMODE_R {
766 SRCMODE_R::new(((self.bits >> 30) & 0x01) != 0)
767 }
768 #[doc = "Bit 31 - Destination Addressing Mode"]
769 #[inline(always)]
770 pub fn dstmode(&self) -> DSTMODE_R {
771 DSTMODE_R::new(((self.bits >> 31) & 0x01) != 0)
772 }
773}
774impl W {
775 #[doc = "Bit 3 - Structure DMA Transfer Request"]
776 #[inline(always)]
777 pub fn structreq(&mut self) -> STRUCTREQ_W {
778 STRUCTREQ_W { w: self }
779 }
780 #[doc = "Bits 4:14 - DMA Unit Data Transfer Count"]
781 #[inline(always)]
782 pub fn xfercnt(&mut self) -> XFERCNT_W {
783 XFERCNT_W { w: self }
784 }
785 #[doc = "Bit 15 - Endian Byte Swap"]
786 #[inline(always)]
787 pub fn byteswap(&mut self) -> BYTESWAP_W {
788 BYTESWAP_W { w: self }
789 }
790 #[doc = "Bits 16:19 - Block Transfer Size"]
791 #[inline(always)]
792 pub fn blocksize(&mut self) -> BLOCKSIZE_W {
793 BLOCKSIZE_W { w: self }
794 }
795 #[doc = "Bit 20 - DMA Operation Done Interrupt Flag Set Enable"]
796 #[inline(always)]
797 pub fn doneifsen(&mut self) -> DONEIFSEN_W {
798 DONEIFSEN_W { w: self }
799 }
800 #[doc = "Bit 21 - DMA Request Transfer Mode Select"]
801 #[inline(always)]
802 pub fn reqmode(&mut self) -> REQMODE_W {
803 REQMODE_W { w: self }
804 }
805 #[doc = "Bit 22 - Decrement Loop Count"]
806 #[inline(always)]
807 pub fn decloopcnt(&mut self) -> DECLOOPCNT_W {
808 DECLOOPCNT_W { w: self }
809 }
810 #[doc = "Bit 23 - Ignore Sreq"]
811 #[inline(always)]
812 pub fn ignoresreq(&mut self) -> IGNORESREQ_W {
813 IGNORESREQ_W { w: self }
814 }
815 #[doc = "Bits 24:25 - Source Address Increment Size"]
816 #[inline(always)]
817 pub fn srcinc(&mut self) -> SRCINC_W {
818 SRCINC_W { w: self }
819 }
820 #[doc = "Bits 26:27 - Unit Data Transfer Size"]
821 #[inline(always)]
822 pub fn size(&mut self) -> SIZE_W {
823 SIZE_W { w: self }
824 }
825 #[doc = "Bits 28:29 - Destination Address Increment Size"]
826 #[inline(always)]
827 pub fn dstinc(&mut self) -> DSTINC_W {
828 DSTINC_W { w: self }
829 }
830}