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
#[doc = "Register `RESFIFO[%s]` reader"]
pub struct R(crate::R<RESFIFO_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<RESFIFO_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<RESFIFO_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<RESFIFO_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `D` reader - Data result"]
pub struct D_R(crate::FieldReader<u16, u16>);
impl D_R {
    #[inline(always)]
    pub(crate) fn new(bits: u16) -> Self {
        D_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for D_R {
    type Target = crate::FieldReader<u16, u16>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Trigger Source\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TSRC_A {
    #[doc = "0: Trigger source 0 initiated this conversion."]
    TSRC_0 = 0,
    #[doc = "1: Trigger source 1 initiated this conversion."]
    TSRC_1 = 1,
    #[doc = "2: Corresponding trigger source initiated this conversion."]
    TSRC_2 = 2,
    #[doc = "3: Corresponding trigger source initiated this conversion."]
    TSRC_3 = 3,
    #[doc = "4: Corresponding trigger source initiated this conversion."]
    TSRC_4 = 4,
    #[doc = "5: Corresponding trigger source initiated this conversion."]
    TSRC_5 = 5,
    #[doc = "6: Corresponding trigger source initiated this conversion."]
    TSRC_6 = 6,
    #[doc = "7: Corresponding trigger source initiated this conversion."]
    TSRC_7 = 7,
    #[doc = "8: Corresponding trigger source initiated this conversion."]
    TSRC_8 = 8,
    #[doc = "9: Corresponding trigger source initiated this conversion."]
    TSRC_9 = 9,
    #[doc = "15: Trigger source 15 initiated this conversion."]
    TSRC_15 = 15,
}
impl From<TSRC_A> for u8 {
    #[inline(always)]
    fn from(variant: TSRC_A) -> Self {
        variant as _
    }
}
#[doc = "Field `TSRC` reader - Trigger Source"]
pub struct TSRC_R(crate::FieldReader<u8, TSRC_A>);
impl TSRC_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        TSRC_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<TSRC_A> {
        match self.bits {
            0 => Some(TSRC_A::TSRC_0),
            1 => Some(TSRC_A::TSRC_1),
            2 => Some(TSRC_A::TSRC_2),
            3 => Some(TSRC_A::TSRC_3),
            4 => Some(TSRC_A::TSRC_4),
            5 => Some(TSRC_A::TSRC_5),
            6 => Some(TSRC_A::TSRC_6),
            7 => Some(TSRC_A::TSRC_7),
            8 => Some(TSRC_A::TSRC_8),
            9 => Some(TSRC_A::TSRC_9),
            15 => Some(TSRC_A::TSRC_15),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `TSRC_0`"]
    #[inline(always)]
    pub fn is_tsrc_0(&self) -> bool {
        **self == TSRC_A::TSRC_0
    }
    #[doc = "Checks if the value of the field is `TSRC_1`"]
    #[inline(always)]
    pub fn is_tsrc_1(&self) -> bool {
        **self == TSRC_A::TSRC_1
    }
    #[doc = "Checks if the value of the field is `TSRC_2`"]
    #[inline(always)]
    pub fn is_tsrc_2(&self) -> bool {
        **self == TSRC_A::TSRC_2
    }
    #[doc = "Checks if the value of the field is `TSRC_3`"]
    #[inline(always)]
    pub fn is_tsrc_3(&self) -> bool {
        **self == TSRC_A::TSRC_3
    }
    #[doc = "Checks if the value of the field is `TSRC_4`"]
    #[inline(always)]
    pub fn is_tsrc_4(&self) -> bool {
        **self == TSRC_A::TSRC_4
    }
    #[doc = "Checks if the value of the field is `TSRC_5`"]
    #[inline(always)]
    pub fn is_tsrc_5(&self) -> bool {
        **self == TSRC_A::TSRC_5
    }
    #[doc = "Checks if the value of the field is `TSRC_6`"]
    #[inline(always)]
    pub fn is_tsrc_6(&self) -> bool {
        **self == TSRC_A::TSRC_6
    }
    #[doc = "Checks if the value of the field is `TSRC_7`"]
    #[inline(always)]
    pub fn is_tsrc_7(&self) -> bool {
        **self == TSRC_A::TSRC_7
    }
    #[doc = "Checks if the value of the field is `TSRC_8`"]
    #[inline(always)]
    pub fn is_tsrc_8(&self) -> bool {
        **self == TSRC_A::TSRC_8
    }
    #[doc = "Checks if the value of the field is `TSRC_9`"]
    #[inline(always)]
    pub fn is_tsrc_9(&self) -> bool {
        **self == TSRC_A::TSRC_9
    }
    #[doc = "Checks if the value of the field is `TSRC_15`"]
    #[inline(always)]
    pub fn is_tsrc_15(&self) -> bool {
        **self == TSRC_A::TSRC_15
    }
}
impl core::ops::Deref for TSRC_R {
    type Target = crate::FieldReader<u8, TSRC_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Loop count value\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum LOOPCNT_A {
    #[doc = "0: Result is from initial conversion in command."]
    LOOPCNT_0 = 0,
    #[doc = "1: Result is from second conversion in command."]
    LOOPCNT_1 = 1,
    #[doc = "2: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_2 = 2,
    #[doc = "3: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_3 = 3,
    #[doc = "4: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_4 = 4,
    #[doc = "5: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_5 = 5,
    #[doc = "6: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_6 = 6,
    #[doc = "7: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_7 = 7,
    #[doc = "8: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_8 = 8,
    #[doc = "9: Result is from LOOPCNT+1 conversion in command."]
    LOOPCNT_9 = 9,
    #[doc = "15: Result is from 16th conversion in command."]
    LOOPCNT_15 = 15,
}
impl From<LOOPCNT_A> for u8 {
    #[inline(always)]
    fn from(variant: LOOPCNT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `LOOPCNT` reader - Loop count value"]
pub struct LOOPCNT_R(crate::FieldReader<u8, LOOPCNT_A>);
impl LOOPCNT_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        LOOPCNT_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<LOOPCNT_A> {
        match self.bits {
            0 => Some(LOOPCNT_A::LOOPCNT_0),
            1 => Some(LOOPCNT_A::LOOPCNT_1),
            2 => Some(LOOPCNT_A::LOOPCNT_2),
            3 => Some(LOOPCNT_A::LOOPCNT_3),
            4 => Some(LOOPCNT_A::LOOPCNT_4),
            5 => Some(LOOPCNT_A::LOOPCNT_5),
            6 => Some(LOOPCNT_A::LOOPCNT_6),
            7 => Some(LOOPCNT_A::LOOPCNT_7),
            8 => Some(LOOPCNT_A::LOOPCNT_8),
            9 => Some(LOOPCNT_A::LOOPCNT_9),
            15 => Some(LOOPCNT_A::LOOPCNT_15),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_0`"]
    #[inline(always)]
    pub fn is_loopcnt_0(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_0
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_1`"]
    #[inline(always)]
    pub fn is_loopcnt_1(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_1
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_2`"]
    #[inline(always)]
    pub fn is_loopcnt_2(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_2
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_3`"]
    #[inline(always)]
    pub fn is_loopcnt_3(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_3
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_4`"]
    #[inline(always)]
    pub fn is_loopcnt_4(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_4
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_5`"]
    #[inline(always)]
    pub fn is_loopcnt_5(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_5
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_6`"]
    #[inline(always)]
    pub fn is_loopcnt_6(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_6
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_7`"]
    #[inline(always)]
    pub fn is_loopcnt_7(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_7
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_8`"]
    #[inline(always)]
    pub fn is_loopcnt_8(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_8
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_9`"]
    #[inline(always)]
    pub fn is_loopcnt_9(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_9
    }
    #[doc = "Checks if the value of the field is `LOOPCNT_15`"]
    #[inline(always)]
    pub fn is_loopcnt_15(&self) -> bool {
        **self == LOOPCNT_A::LOOPCNT_15
    }
}
impl core::ops::Deref for LOOPCNT_R {
    type Target = crate::FieldReader<u8, LOOPCNT_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Command Buffer Source\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CMDSRC_A {
    #[doc = "0: Not a valid value CMDSRC value for a dataword in RESFIFO. 0x0 is only found in initial FIFO state prior to an ADC conversion result dataword being stored to a RESFIFO buffer."]
    CMDSRC_0 = 0,
    #[doc = "1: CMD1 buffer used as control settings for this conversion."]
    CMDSRC_1 = 1,
    #[doc = "2: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_2 = 2,
    #[doc = "3: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_3 = 3,
    #[doc = "4: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_4 = 4,
    #[doc = "5: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_5 = 5,
    #[doc = "6: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_6 = 6,
    #[doc = "7: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_7 = 7,
    #[doc = "8: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_8 = 8,
    #[doc = "9: Corresponding command buffer used as control settings for this conversion."]
    CMDSRC_9 = 9,
    #[doc = "15: CMD15 buffer used as control settings for this conversion."]
    CMDSRC_15 = 15,
}
impl From<CMDSRC_A> for u8 {
    #[inline(always)]
    fn from(variant: CMDSRC_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CMDSRC` reader - Command Buffer Source"]
pub struct CMDSRC_R(crate::FieldReader<u8, CMDSRC_A>);
impl CMDSRC_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        CMDSRC_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<CMDSRC_A> {
        match self.bits {
            0 => Some(CMDSRC_A::CMDSRC_0),
            1 => Some(CMDSRC_A::CMDSRC_1),
            2 => Some(CMDSRC_A::CMDSRC_2),
            3 => Some(CMDSRC_A::CMDSRC_3),
            4 => Some(CMDSRC_A::CMDSRC_4),
            5 => Some(CMDSRC_A::CMDSRC_5),
            6 => Some(CMDSRC_A::CMDSRC_6),
            7 => Some(CMDSRC_A::CMDSRC_7),
            8 => Some(CMDSRC_A::CMDSRC_8),
            9 => Some(CMDSRC_A::CMDSRC_9),
            15 => Some(CMDSRC_A::CMDSRC_15),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `CMDSRC_0`"]
    #[inline(always)]
    pub fn is_cmdsrc_0(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_0
    }
    #[doc = "Checks if the value of the field is `CMDSRC_1`"]
    #[inline(always)]
    pub fn is_cmdsrc_1(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_1
    }
    #[doc = "Checks if the value of the field is `CMDSRC_2`"]
    #[inline(always)]
    pub fn is_cmdsrc_2(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_2
    }
    #[doc = "Checks if the value of the field is `CMDSRC_3`"]
    #[inline(always)]
    pub fn is_cmdsrc_3(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_3
    }
    #[doc = "Checks if the value of the field is `CMDSRC_4`"]
    #[inline(always)]
    pub fn is_cmdsrc_4(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_4
    }
    #[doc = "Checks if the value of the field is `CMDSRC_5`"]
    #[inline(always)]
    pub fn is_cmdsrc_5(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_5
    }
    #[doc = "Checks if the value of the field is `CMDSRC_6`"]
    #[inline(always)]
    pub fn is_cmdsrc_6(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_6
    }
    #[doc = "Checks if the value of the field is `CMDSRC_7`"]
    #[inline(always)]
    pub fn is_cmdsrc_7(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_7
    }
    #[doc = "Checks if the value of the field is `CMDSRC_8`"]
    #[inline(always)]
    pub fn is_cmdsrc_8(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_8
    }
    #[doc = "Checks if the value of the field is `CMDSRC_9`"]
    #[inline(always)]
    pub fn is_cmdsrc_9(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_9
    }
    #[doc = "Checks if the value of the field is `CMDSRC_15`"]
    #[inline(always)]
    pub fn is_cmdsrc_15(&self) -> bool {
        **self == CMDSRC_A::CMDSRC_15
    }
}
impl core::ops::Deref for CMDSRC_R {
    type Target = crate::FieldReader<u8, CMDSRC_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "FIFO entry is valid\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VALID_A {
    #[doc = "0: FIFO is empty. Discard any read from RESFIFO."]
    VALID_0 = 0,
    #[doc = "1: FIFO record read from RESFIFO is valid."]
    VALID_1 = 1,
}
impl From<VALID_A> for bool {
    #[inline(always)]
    fn from(variant: VALID_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VALID` reader - FIFO entry is valid"]
pub struct VALID_R(crate::FieldReader<bool, VALID_A>);
impl VALID_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        VALID_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VALID_A {
        match self.bits {
            false => VALID_A::VALID_0,
            true => VALID_A::VALID_1,
        }
    }
    #[doc = "Checks if the value of the field is `VALID_0`"]
    #[inline(always)]
    pub fn is_valid_0(&self) -> bool {
        **self == VALID_A::VALID_0
    }
    #[doc = "Checks if the value of the field is `VALID_1`"]
    #[inline(always)]
    pub fn is_valid_1(&self) -> bool {
        **self == VALID_A::VALID_1
    }
}
impl core::ops::Deref for VALID_R {
    type Target = crate::FieldReader<bool, VALID_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:15 - Data result"]
    #[inline(always)]
    pub fn d(&self) -> D_R {
        D_R::new((self.bits & 0xffff) as u16)
    }
    #[doc = "Bits 16:19 - Trigger Source"]
    #[inline(always)]
    pub fn tsrc(&self) -> TSRC_R {
        TSRC_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bits 20:23 - Loop count value"]
    #[inline(always)]
    pub fn loopcnt(&self) -> LOOPCNT_R {
        LOOPCNT_R::new(((self.bits >> 20) & 0x0f) as u8)
    }
    #[doc = "Bits 24:27 - Command Buffer Source"]
    #[inline(always)]
    pub fn cmdsrc(&self) -> CMDSRC_R {
        CMDSRC_R::new(((self.bits >> 24) & 0x0f) as u8)
    }
    #[doc = "Bit 31 - FIFO entry is valid"]
    #[inline(always)]
    pub fn valid(&self) -> VALID_R {
        VALID_R::new(((self.bits >> 31) & 0x01) != 0)
    }
}
#[doc = "ADC Data Result FIFO Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resfifo](index.html) module"]
pub struct RESFIFO_SPEC;
impl crate::RegisterSpec for RESFIFO_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [resfifo::R](R) reader structure"]
impl crate::Readable for RESFIFO_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets RESFIFO[%s]
to value 0"]
impl crate::Resettable for RESFIFO_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}