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