lpc550x/adc0/
cmdh14.rs

1#[doc = "Register `CMDH14` reader"]
2pub struct R(crate::R<CMDH14_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CMDH14_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CMDH14_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CMDH14_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CMDH14` writer"]
17pub struct W(crate::W<CMDH14_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CMDH14_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CMDH14_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CMDH14_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `WAIT_TRIG` reader - Wait for trigger assertion before execution."]
38pub type WAIT_TRIG_R = crate::BitReader<WAIT_TRIG_A>;
39#[doc = "Wait for trigger assertion before execution.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum WAIT_TRIG_A {
42    #[doc = "0: This command will be automatically executed."]
43    WAIT_TRIG_0 = 0,
44    #[doc = "1: The active trigger must be asserted again before executing this command."]
45    WAIT_TRIG_1 = 1,
46}
47impl From<WAIT_TRIG_A> for bool {
48    #[inline(always)]
49    fn from(variant: WAIT_TRIG_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl WAIT_TRIG_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> WAIT_TRIG_A {
57        match self.bits {
58            false => WAIT_TRIG_A::WAIT_TRIG_0,
59            true => WAIT_TRIG_A::WAIT_TRIG_1,
60        }
61    }
62    #[doc = "Checks if the value of the field is `WAIT_TRIG_0`"]
63    #[inline(always)]
64    pub fn is_wait_trig_0(&self) -> bool {
65        *self == WAIT_TRIG_A::WAIT_TRIG_0
66    }
67    #[doc = "Checks if the value of the field is `WAIT_TRIG_1`"]
68    #[inline(always)]
69    pub fn is_wait_trig_1(&self) -> bool {
70        *self == WAIT_TRIG_A::WAIT_TRIG_1
71    }
72}
73#[doc = "Field `WAIT_TRIG` writer - Wait for trigger assertion before execution."]
74pub type WAIT_TRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMDH14_SPEC, WAIT_TRIG_A, O>;
75impl<'a, const O: u8> WAIT_TRIG_W<'a, O> {
76    #[doc = "This command will be automatically executed."]
77    #[inline(always)]
78    pub fn wait_trig_0(self) -> &'a mut W {
79        self.variant(WAIT_TRIG_A::WAIT_TRIG_0)
80    }
81    #[doc = "The active trigger must be asserted again before executing this command."]
82    #[inline(always)]
83    pub fn wait_trig_1(self) -> &'a mut W {
84        self.variant(WAIT_TRIG_A::WAIT_TRIG_1)
85    }
86}
87#[doc = "Field `LWI` reader - Loop with Increment."]
88pub type LWI_R = crate::BitReader<LWI_A>;
89#[doc = "Loop with Increment.\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum LWI_A {
92    #[doc = "0: Auto channel increment disabled."]
93    LWI_0 = 0,
94    #[doc = "1: Auto channel increment enabled."]
95    LWI_1 = 1,
96}
97impl From<LWI_A> for bool {
98    #[inline(always)]
99    fn from(variant: LWI_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl LWI_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> LWI_A {
107        match self.bits {
108            false => LWI_A::LWI_0,
109            true => LWI_A::LWI_1,
110        }
111    }
112    #[doc = "Checks if the value of the field is `LWI_0`"]
113    #[inline(always)]
114    pub fn is_lwi_0(&self) -> bool {
115        *self == LWI_A::LWI_0
116    }
117    #[doc = "Checks if the value of the field is `LWI_1`"]
118    #[inline(always)]
119    pub fn is_lwi_1(&self) -> bool {
120        *self == LWI_A::LWI_1
121    }
122}
123#[doc = "Field `LWI` writer - Loop with Increment."]
124pub type LWI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMDH14_SPEC, LWI_A, O>;
125impl<'a, const O: u8> LWI_W<'a, O> {
126    #[doc = "Auto channel increment disabled."]
127    #[inline(always)]
128    pub fn lwi_0(self) -> &'a mut W {
129        self.variant(LWI_A::LWI_0)
130    }
131    #[doc = "Auto channel increment enabled."]
132    #[inline(always)]
133    pub fn lwi_1(self) -> &'a mut W {
134        self.variant(LWI_A::LWI_1)
135    }
136}
137#[doc = "Field `STS` reader - Sample Time Select."]
138pub type STS_R = crate::FieldReader<u8, STS_A>;
139#[doc = "Sample Time Select.\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141#[repr(u8)]
142pub enum STS_A {
143    #[doc = "0: Minimum sample time of 3 ADCK cycles."]
144    STS_0 = 0,
145    #[doc = "1: 3 + 21 ADCK cycles; 5 ADCK cycles total sample time."]
146    STS_1 = 1,
147    #[doc = "2: 3 + 22 ADCK cycles; 7 ADCK cycles total sample time."]
148    STS_2 = 2,
149    #[doc = "3: 3 + 23 ADCK cycles; 11 ADCK cycles total sample time."]
150    STS_3 = 3,
151    #[doc = "4: 3 + 24 ADCK cycles; 19 ADCK cycles total sample time."]
152    STS_4 = 4,
153    #[doc = "5: 3 + 25 ADCK cycles; 35 ADCK cycles total sample time."]
154    STS_5 = 5,
155    #[doc = "6: 3 + 26 ADCK cycles; 67 ADCK cycles total sample time."]
156    STS_6 = 6,
157    #[doc = "7: 3 + 27 ADCK cycles; 131 ADCK cycles total sample time."]
158    STS_7 = 7,
159}
160impl From<STS_A> for u8 {
161    #[inline(always)]
162    fn from(variant: STS_A) -> Self {
163        variant as _
164    }
165}
166impl STS_R {
167    #[doc = "Get enumerated values variant"]
168    #[inline(always)]
169    pub fn variant(&self) -> STS_A {
170        match self.bits {
171            0 => STS_A::STS_0,
172            1 => STS_A::STS_1,
173            2 => STS_A::STS_2,
174            3 => STS_A::STS_3,
175            4 => STS_A::STS_4,
176            5 => STS_A::STS_5,
177            6 => STS_A::STS_6,
178            7 => STS_A::STS_7,
179            _ => unreachable!(),
180        }
181    }
182    #[doc = "Checks if the value of the field is `STS_0`"]
183    #[inline(always)]
184    pub fn is_sts_0(&self) -> bool {
185        *self == STS_A::STS_0
186    }
187    #[doc = "Checks if the value of the field is `STS_1`"]
188    #[inline(always)]
189    pub fn is_sts_1(&self) -> bool {
190        *self == STS_A::STS_1
191    }
192    #[doc = "Checks if the value of the field is `STS_2`"]
193    #[inline(always)]
194    pub fn is_sts_2(&self) -> bool {
195        *self == STS_A::STS_2
196    }
197    #[doc = "Checks if the value of the field is `STS_3`"]
198    #[inline(always)]
199    pub fn is_sts_3(&self) -> bool {
200        *self == STS_A::STS_3
201    }
202    #[doc = "Checks if the value of the field is `STS_4`"]
203    #[inline(always)]
204    pub fn is_sts_4(&self) -> bool {
205        *self == STS_A::STS_4
206    }
207    #[doc = "Checks if the value of the field is `STS_5`"]
208    #[inline(always)]
209    pub fn is_sts_5(&self) -> bool {
210        *self == STS_A::STS_5
211    }
212    #[doc = "Checks if the value of the field is `STS_6`"]
213    #[inline(always)]
214    pub fn is_sts_6(&self) -> bool {
215        *self == STS_A::STS_6
216    }
217    #[doc = "Checks if the value of the field is `STS_7`"]
218    #[inline(always)]
219    pub fn is_sts_7(&self) -> bool {
220        *self == STS_A::STS_7
221    }
222}
223#[doc = "Field `STS` writer - Sample Time Select."]
224pub type STS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMDH14_SPEC, u8, STS_A, 3, O>;
225impl<'a, const O: u8> STS_W<'a, O> {
226    #[doc = "Minimum sample time of 3 ADCK cycles."]
227    #[inline(always)]
228    pub fn sts_0(self) -> &'a mut W {
229        self.variant(STS_A::STS_0)
230    }
231    #[doc = "3 + 21 ADCK cycles; 5 ADCK cycles total sample time."]
232    #[inline(always)]
233    pub fn sts_1(self) -> &'a mut W {
234        self.variant(STS_A::STS_1)
235    }
236    #[doc = "3 + 22 ADCK cycles; 7 ADCK cycles total sample time."]
237    #[inline(always)]
238    pub fn sts_2(self) -> &'a mut W {
239        self.variant(STS_A::STS_2)
240    }
241    #[doc = "3 + 23 ADCK cycles; 11 ADCK cycles total sample time."]
242    #[inline(always)]
243    pub fn sts_3(self) -> &'a mut W {
244        self.variant(STS_A::STS_3)
245    }
246    #[doc = "3 + 24 ADCK cycles; 19 ADCK cycles total sample time."]
247    #[inline(always)]
248    pub fn sts_4(self) -> &'a mut W {
249        self.variant(STS_A::STS_4)
250    }
251    #[doc = "3 + 25 ADCK cycles; 35 ADCK cycles total sample time."]
252    #[inline(always)]
253    pub fn sts_5(self) -> &'a mut W {
254        self.variant(STS_A::STS_5)
255    }
256    #[doc = "3 + 26 ADCK cycles; 67 ADCK cycles total sample time."]
257    #[inline(always)]
258    pub fn sts_6(self) -> &'a mut W {
259        self.variant(STS_A::STS_6)
260    }
261    #[doc = "3 + 27 ADCK cycles; 131 ADCK cycles total sample time."]
262    #[inline(always)]
263    pub fn sts_7(self) -> &'a mut W {
264        self.variant(STS_A::STS_7)
265    }
266}
267#[doc = "Field `AVGS` reader - Hardware Average Select."]
268pub type AVGS_R = crate::FieldReader<u8, AVGS_A>;
269#[doc = "Hardware Average Select.\n\nValue on reset: 0"]
270#[derive(Clone, Copy, Debug, PartialEq, Eq)]
271#[repr(u8)]
272pub enum AVGS_A {
273    #[doc = "0: Single conversion."]
274    AVGS_0 = 0,
275    #[doc = "1: 2 conversions averaged."]
276    AVGS_1 = 1,
277    #[doc = "2: 4 conversions averaged."]
278    AVGS_2 = 2,
279    #[doc = "3: 8 conversions averaged."]
280    AVGS_3 = 3,
281    #[doc = "4: 16 conversions averaged."]
282    AVGS_4 = 4,
283    #[doc = "5: 32 conversions averaged."]
284    AVGS_5 = 5,
285    #[doc = "6: 64 conversions averaged."]
286    AVGS_6 = 6,
287    #[doc = "7: 128 conversions averaged."]
288    AVGS_7 = 7,
289}
290impl From<AVGS_A> for u8 {
291    #[inline(always)]
292    fn from(variant: AVGS_A) -> Self {
293        variant as _
294    }
295}
296impl AVGS_R {
297    #[doc = "Get enumerated values variant"]
298    #[inline(always)]
299    pub fn variant(&self) -> AVGS_A {
300        match self.bits {
301            0 => AVGS_A::AVGS_0,
302            1 => AVGS_A::AVGS_1,
303            2 => AVGS_A::AVGS_2,
304            3 => AVGS_A::AVGS_3,
305            4 => AVGS_A::AVGS_4,
306            5 => AVGS_A::AVGS_5,
307            6 => AVGS_A::AVGS_6,
308            7 => AVGS_A::AVGS_7,
309            _ => unreachable!(),
310        }
311    }
312    #[doc = "Checks if the value of the field is `AVGS_0`"]
313    #[inline(always)]
314    pub fn is_avgs_0(&self) -> bool {
315        *self == AVGS_A::AVGS_0
316    }
317    #[doc = "Checks if the value of the field is `AVGS_1`"]
318    #[inline(always)]
319    pub fn is_avgs_1(&self) -> bool {
320        *self == AVGS_A::AVGS_1
321    }
322    #[doc = "Checks if the value of the field is `AVGS_2`"]
323    #[inline(always)]
324    pub fn is_avgs_2(&self) -> bool {
325        *self == AVGS_A::AVGS_2
326    }
327    #[doc = "Checks if the value of the field is `AVGS_3`"]
328    #[inline(always)]
329    pub fn is_avgs_3(&self) -> bool {
330        *self == AVGS_A::AVGS_3
331    }
332    #[doc = "Checks if the value of the field is `AVGS_4`"]
333    #[inline(always)]
334    pub fn is_avgs_4(&self) -> bool {
335        *self == AVGS_A::AVGS_4
336    }
337    #[doc = "Checks if the value of the field is `AVGS_5`"]
338    #[inline(always)]
339    pub fn is_avgs_5(&self) -> bool {
340        *self == AVGS_A::AVGS_5
341    }
342    #[doc = "Checks if the value of the field is `AVGS_6`"]
343    #[inline(always)]
344    pub fn is_avgs_6(&self) -> bool {
345        *self == AVGS_A::AVGS_6
346    }
347    #[doc = "Checks if the value of the field is `AVGS_7`"]
348    #[inline(always)]
349    pub fn is_avgs_7(&self) -> bool {
350        *self == AVGS_A::AVGS_7
351    }
352}
353#[doc = "Field `AVGS` writer - Hardware Average Select."]
354pub type AVGS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMDH14_SPEC, u8, AVGS_A, 3, O>;
355impl<'a, const O: u8> AVGS_W<'a, O> {
356    #[doc = "Single conversion."]
357    #[inline(always)]
358    pub fn avgs_0(self) -> &'a mut W {
359        self.variant(AVGS_A::AVGS_0)
360    }
361    #[doc = "2 conversions averaged."]
362    #[inline(always)]
363    pub fn avgs_1(self) -> &'a mut W {
364        self.variant(AVGS_A::AVGS_1)
365    }
366    #[doc = "4 conversions averaged."]
367    #[inline(always)]
368    pub fn avgs_2(self) -> &'a mut W {
369        self.variant(AVGS_A::AVGS_2)
370    }
371    #[doc = "8 conversions averaged."]
372    #[inline(always)]
373    pub fn avgs_3(self) -> &'a mut W {
374        self.variant(AVGS_A::AVGS_3)
375    }
376    #[doc = "16 conversions averaged."]
377    #[inline(always)]
378    pub fn avgs_4(self) -> &'a mut W {
379        self.variant(AVGS_A::AVGS_4)
380    }
381    #[doc = "32 conversions averaged."]
382    #[inline(always)]
383    pub fn avgs_5(self) -> &'a mut W {
384        self.variant(AVGS_A::AVGS_5)
385    }
386    #[doc = "64 conversions averaged."]
387    #[inline(always)]
388    pub fn avgs_6(self) -> &'a mut W {
389        self.variant(AVGS_A::AVGS_6)
390    }
391    #[doc = "128 conversions averaged."]
392    #[inline(always)]
393    pub fn avgs_7(self) -> &'a mut W {
394        self.variant(AVGS_A::AVGS_7)
395    }
396}
397#[doc = "Field `LOOP` reader - Loop Count Select."]
398pub type LOOP_R = crate::FieldReader<u8, LOOP_A>;
399#[doc = "Loop Count Select.\n\nValue on reset: 0"]
400#[derive(Clone, Copy, Debug, PartialEq, Eq)]
401#[repr(u8)]
402pub enum LOOP_A {
403    #[doc = "0: Looping not enabled. Command executes 1 time."]
404    LOOP_0 = 0,
405    #[doc = "1: Loop 1 time. Command executes 2 times."]
406    LOOP_1 = 1,
407    #[doc = "2: Loop 2 times. Command executes 3 times."]
408    LOOP_2 = 2,
409    #[doc = "3: Loop corresponding number of times. Command executes LOOP+1 times."]
410    LOOP_3 = 3,
411    #[doc = "4: Loop corresponding number of times. Command executes LOOP+1 times."]
412    LOOP_4 = 4,
413    #[doc = "5: Loop corresponding number of times. Command executes LOOP+1 times."]
414    LOOP_5 = 5,
415    #[doc = "6: Loop corresponding number of times. Command executes LOOP+1 times."]
416    LOOP_6 = 6,
417    #[doc = "7: Loop corresponding number of times. Command executes LOOP+1 times."]
418    LOOP_7 = 7,
419    #[doc = "8: Loop corresponding number of times. Command executes LOOP+1 times."]
420    LOOP_8 = 8,
421    #[doc = "9: Loop corresponding number of times. Command executes LOOP+1 times."]
422    LOOP_9 = 9,
423    #[doc = "15: Loop 15 times. Command executes 16 times."]
424    LOOP_15 = 15,
425}
426impl From<LOOP_A> for u8 {
427    #[inline(always)]
428    fn from(variant: LOOP_A) -> Self {
429        variant as _
430    }
431}
432impl LOOP_R {
433    #[doc = "Get enumerated values variant"]
434    #[inline(always)]
435    pub fn variant(&self) -> Option<LOOP_A> {
436        match self.bits {
437            0 => Some(LOOP_A::LOOP_0),
438            1 => Some(LOOP_A::LOOP_1),
439            2 => Some(LOOP_A::LOOP_2),
440            3 => Some(LOOP_A::LOOP_3),
441            4 => Some(LOOP_A::LOOP_4),
442            5 => Some(LOOP_A::LOOP_5),
443            6 => Some(LOOP_A::LOOP_6),
444            7 => Some(LOOP_A::LOOP_7),
445            8 => Some(LOOP_A::LOOP_8),
446            9 => Some(LOOP_A::LOOP_9),
447            15 => Some(LOOP_A::LOOP_15),
448            _ => None,
449        }
450    }
451    #[doc = "Checks if the value of the field is `LOOP_0`"]
452    #[inline(always)]
453    pub fn is_loop_0(&self) -> bool {
454        *self == LOOP_A::LOOP_0
455    }
456    #[doc = "Checks if the value of the field is `LOOP_1`"]
457    #[inline(always)]
458    pub fn is_loop_1(&self) -> bool {
459        *self == LOOP_A::LOOP_1
460    }
461    #[doc = "Checks if the value of the field is `LOOP_2`"]
462    #[inline(always)]
463    pub fn is_loop_2(&self) -> bool {
464        *self == LOOP_A::LOOP_2
465    }
466    #[doc = "Checks if the value of the field is `LOOP_3`"]
467    #[inline(always)]
468    pub fn is_loop_3(&self) -> bool {
469        *self == LOOP_A::LOOP_3
470    }
471    #[doc = "Checks if the value of the field is `LOOP_4`"]
472    #[inline(always)]
473    pub fn is_loop_4(&self) -> bool {
474        *self == LOOP_A::LOOP_4
475    }
476    #[doc = "Checks if the value of the field is `LOOP_5`"]
477    #[inline(always)]
478    pub fn is_loop_5(&self) -> bool {
479        *self == LOOP_A::LOOP_5
480    }
481    #[doc = "Checks if the value of the field is `LOOP_6`"]
482    #[inline(always)]
483    pub fn is_loop_6(&self) -> bool {
484        *self == LOOP_A::LOOP_6
485    }
486    #[doc = "Checks if the value of the field is `LOOP_7`"]
487    #[inline(always)]
488    pub fn is_loop_7(&self) -> bool {
489        *self == LOOP_A::LOOP_7
490    }
491    #[doc = "Checks if the value of the field is `LOOP_8`"]
492    #[inline(always)]
493    pub fn is_loop_8(&self) -> bool {
494        *self == LOOP_A::LOOP_8
495    }
496    #[doc = "Checks if the value of the field is `LOOP_9`"]
497    #[inline(always)]
498    pub fn is_loop_9(&self) -> bool {
499        *self == LOOP_A::LOOP_9
500    }
501    #[doc = "Checks if the value of the field is `LOOP_15`"]
502    #[inline(always)]
503    pub fn is_loop_15(&self) -> bool {
504        *self == LOOP_A::LOOP_15
505    }
506}
507#[doc = "Field `LOOP` writer - Loop Count Select."]
508pub type LOOP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMDH14_SPEC, u8, LOOP_A, 4, O>;
509impl<'a, const O: u8> LOOP_W<'a, O> {
510    #[doc = "Looping not enabled. Command executes 1 time."]
511    #[inline(always)]
512    pub fn loop_0(self) -> &'a mut W {
513        self.variant(LOOP_A::LOOP_0)
514    }
515    #[doc = "Loop 1 time. Command executes 2 times."]
516    #[inline(always)]
517    pub fn loop_1(self) -> &'a mut W {
518        self.variant(LOOP_A::LOOP_1)
519    }
520    #[doc = "Loop 2 times. Command executes 3 times."]
521    #[inline(always)]
522    pub fn loop_2(self) -> &'a mut W {
523        self.variant(LOOP_A::LOOP_2)
524    }
525    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
526    #[inline(always)]
527    pub fn loop_3(self) -> &'a mut W {
528        self.variant(LOOP_A::LOOP_3)
529    }
530    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
531    #[inline(always)]
532    pub fn loop_4(self) -> &'a mut W {
533        self.variant(LOOP_A::LOOP_4)
534    }
535    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
536    #[inline(always)]
537    pub fn loop_5(self) -> &'a mut W {
538        self.variant(LOOP_A::LOOP_5)
539    }
540    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
541    #[inline(always)]
542    pub fn loop_6(self) -> &'a mut W {
543        self.variant(LOOP_A::LOOP_6)
544    }
545    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
546    #[inline(always)]
547    pub fn loop_7(self) -> &'a mut W {
548        self.variant(LOOP_A::LOOP_7)
549    }
550    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
551    #[inline(always)]
552    pub fn loop_8(self) -> &'a mut W {
553        self.variant(LOOP_A::LOOP_8)
554    }
555    #[doc = "Loop corresponding number of times. Command executes LOOP+1 times."]
556    #[inline(always)]
557    pub fn loop_9(self) -> &'a mut W {
558        self.variant(LOOP_A::LOOP_9)
559    }
560    #[doc = "Loop 15 times. Command executes 16 times."]
561    #[inline(always)]
562    pub fn loop_15(self) -> &'a mut W {
563        self.variant(LOOP_A::LOOP_15)
564    }
565}
566#[doc = "Field `NEXT` reader - Next Command Select."]
567pub type NEXT_R = crate::FieldReader<u8, NEXT_A>;
568#[doc = "Next Command Select.\n\nValue on reset: 0"]
569#[derive(Clone, Copy, Debug, PartialEq, Eq)]
570#[repr(u8)]
571pub enum NEXT_A {
572    #[doc = "0: No next command defined. Terminate conversions at completion of current command. If lower priority trigger pending, begin command associated with lower priority trigger."]
573    NEXT_0 = 0,
574    #[doc = "1: Select CMD1 command buffer register as next command."]
575    NEXT_1 = 1,
576    #[doc = "2: Select corresponding CMD command buffer register as next command."]
577    NEXT_2 = 2,
578    #[doc = "3: Select corresponding CMD command buffer register as next command."]
579    NEXT_3 = 3,
580    #[doc = "4: Select corresponding CMD command buffer register as next command."]
581    NEXT_4 = 4,
582    #[doc = "5: Select corresponding CMD command buffer register as next command."]
583    NEXT_5 = 5,
584    #[doc = "6: Select corresponding CMD command buffer register as next command."]
585    NEXT_6 = 6,
586    #[doc = "7: Select corresponding CMD command buffer register as next command."]
587    NEXT_7 = 7,
588    #[doc = "8: Select corresponding CMD command buffer register as next command."]
589    NEXT_8 = 8,
590    #[doc = "9: Select corresponding CMD command buffer register as next command."]
591    NEXT_9 = 9,
592    #[doc = "15: Select CMD15 command buffer register as next command."]
593    NEXT_15 = 15,
594}
595impl From<NEXT_A> for u8 {
596    #[inline(always)]
597    fn from(variant: NEXT_A) -> Self {
598        variant as _
599    }
600}
601impl NEXT_R {
602    #[doc = "Get enumerated values variant"]
603    #[inline(always)]
604    pub fn variant(&self) -> Option<NEXT_A> {
605        match self.bits {
606            0 => Some(NEXT_A::NEXT_0),
607            1 => Some(NEXT_A::NEXT_1),
608            2 => Some(NEXT_A::NEXT_2),
609            3 => Some(NEXT_A::NEXT_3),
610            4 => Some(NEXT_A::NEXT_4),
611            5 => Some(NEXT_A::NEXT_5),
612            6 => Some(NEXT_A::NEXT_6),
613            7 => Some(NEXT_A::NEXT_7),
614            8 => Some(NEXT_A::NEXT_8),
615            9 => Some(NEXT_A::NEXT_9),
616            15 => Some(NEXT_A::NEXT_15),
617            _ => None,
618        }
619    }
620    #[doc = "Checks if the value of the field is `NEXT_0`"]
621    #[inline(always)]
622    pub fn is_next_0(&self) -> bool {
623        *self == NEXT_A::NEXT_0
624    }
625    #[doc = "Checks if the value of the field is `NEXT_1`"]
626    #[inline(always)]
627    pub fn is_next_1(&self) -> bool {
628        *self == NEXT_A::NEXT_1
629    }
630    #[doc = "Checks if the value of the field is `NEXT_2`"]
631    #[inline(always)]
632    pub fn is_next_2(&self) -> bool {
633        *self == NEXT_A::NEXT_2
634    }
635    #[doc = "Checks if the value of the field is `NEXT_3`"]
636    #[inline(always)]
637    pub fn is_next_3(&self) -> bool {
638        *self == NEXT_A::NEXT_3
639    }
640    #[doc = "Checks if the value of the field is `NEXT_4`"]
641    #[inline(always)]
642    pub fn is_next_4(&self) -> bool {
643        *self == NEXT_A::NEXT_4
644    }
645    #[doc = "Checks if the value of the field is `NEXT_5`"]
646    #[inline(always)]
647    pub fn is_next_5(&self) -> bool {
648        *self == NEXT_A::NEXT_5
649    }
650    #[doc = "Checks if the value of the field is `NEXT_6`"]
651    #[inline(always)]
652    pub fn is_next_6(&self) -> bool {
653        *self == NEXT_A::NEXT_6
654    }
655    #[doc = "Checks if the value of the field is `NEXT_7`"]
656    #[inline(always)]
657    pub fn is_next_7(&self) -> bool {
658        *self == NEXT_A::NEXT_7
659    }
660    #[doc = "Checks if the value of the field is `NEXT_8`"]
661    #[inline(always)]
662    pub fn is_next_8(&self) -> bool {
663        *self == NEXT_A::NEXT_8
664    }
665    #[doc = "Checks if the value of the field is `NEXT_9`"]
666    #[inline(always)]
667    pub fn is_next_9(&self) -> bool {
668        *self == NEXT_A::NEXT_9
669    }
670    #[doc = "Checks if the value of the field is `NEXT_15`"]
671    #[inline(always)]
672    pub fn is_next_15(&self) -> bool {
673        *self == NEXT_A::NEXT_15
674    }
675}
676#[doc = "Field `NEXT` writer - Next Command Select."]
677pub type NEXT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMDH14_SPEC, u8, NEXT_A, 4, O>;
678impl<'a, const O: u8> NEXT_W<'a, O> {
679    #[doc = "No next command defined. Terminate conversions at completion of current command. If lower priority trigger pending, begin command associated with lower priority trigger."]
680    #[inline(always)]
681    pub fn next_0(self) -> &'a mut W {
682        self.variant(NEXT_A::NEXT_0)
683    }
684    #[doc = "Select CMD1 command buffer register as next command."]
685    #[inline(always)]
686    pub fn next_1(self) -> &'a mut W {
687        self.variant(NEXT_A::NEXT_1)
688    }
689    #[doc = "Select corresponding CMD command buffer register as next command."]
690    #[inline(always)]
691    pub fn next_2(self) -> &'a mut W {
692        self.variant(NEXT_A::NEXT_2)
693    }
694    #[doc = "Select corresponding CMD command buffer register as next command."]
695    #[inline(always)]
696    pub fn next_3(self) -> &'a mut W {
697        self.variant(NEXT_A::NEXT_3)
698    }
699    #[doc = "Select corresponding CMD command buffer register as next command."]
700    #[inline(always)]
701    pub fn next_4(self) -> &'a mut W {
702        self.variant(NEXT_A::NEXT_4)
703    }
704    #[doc = "Select corresponding CMD command buffer register as next command."]
705    #[inline(always)]
706    pub fn next_5(self) -> &'a mut W {
707        self.variant(NEXT_A::NEXT_5)
708    }
709    #[doc = "Select corresponding CMD command buffer register as next command."]
710    #[inline(always)]
711    pub fn next_6(self) -> &'a mut W {
712        self.variant(NEXT_A::NEXT_6)
713    }
714    #[doc = "Select corresponding CMD command buffer register as next command."]
715    #[inline(always)]
716    pub fn next_7(self) -> &'a mut W {
717        self.variant(NEXT_A::NEXT_7)
718    }
719    #[doc = "Select corresponding CMD command buffer register as next command."]
720    #[inline(always)]
721    pub fn next_8(self) -> &'a mut W {
722        self.variant(NEXT_A::NEXT_8)
723    }
724    #[doc = "Select corresponding CMD command buffer register as next command."]
725    #[inline(always)]
726    pub fn next_9(self) -> &'a mut W {
727        self.variant(NEXT_A::NEXT_9)
728    }
729    #[doc = "Select CMD15 command buffer register as next command."]
730    #[inline(always)]
731    pub fn next_15(self) -> &'a mut W {
732        self.variant(NEXT_A::NEXT_15)
733    }
734}
735impl R {
736    #[doc = "Bit 2 - Wait for trigger assertion before execution."]
737    #[inline(always)]
738    pub fn wait_trig(&self) -> WAIT_TRIG_R {
739        WAIT_TRIG_R::new(((self.bits >> 2) & 1) != 0)
740    }
741    #[doc = "Bit 7 - Loop with Increment."]
742    #[inline(always)]
743    pub fn lwi(&self) -> LWI_R {
744        LWI_R::new(((self.bits >> 7) & 1) != 0)
745    }
746    #[doc = "Bits 8:10 - Sample Time Select."]
747    #[inline(always)]
748    pub fn sts(&self) -> STS_R {
749        STS_R::new(((self.bits >> 8) & 7) as u8)
750    }
751    #[doc = "Bits 12:14 - Hardware Average Select."]
752    #[inline(always)]
753    pub fn avgs(&self) -> AVGS_R {
754        AVGS_R::new(((self.bits >> 12) & 7) as u8)
755    }
756    #[doc = "Bits 16:19 - Loop Count Select."]
757    #[inline(always)]
758    pub fn loop_(&self) -> LOOP_R {
759        LOOP_R::new(((self.bits >> 16) & 0x0f) as u8)
760    }
761    #[doc = "Bits 24:27 - Next Command Select."]
762    #[inline(always)]
763    pub fn next(&self) -> NEXT_R {
764        NEXT_R::new(((self.bits >> 24) & 0x0f) as u8)
765    }
766}
767impl W {
768    #[doc = "Bit 2 - Wait for trigger assertion before execution."]
769    #[inline(always)]
770    pub fn wait_trig(&mut self) -> WAIT_TRIG_W<2> {
771        WAIT_TRIG_W::new(self)
772    }
773    #[doc = "Bit 7 - Loop with Increment."]
774    #[inline(always)]
775    pub fn lwi(&mut self) -> LWI_W<7> {
776        LWI_W::new(self)
777    }
778    #[doc = "Bits 8:10 - Sample Time Select."]
779    #[inline(always)]
780    pub fn sts(&mut self) -> STS_W<8> {
781        STS_W::new(self)
782    }
783    #[doc = "Bits 12:14 - Hardware Average Select."]
784    #[inline(always)]
785    pub fn avgs(&mut self) -> AVGS_W<12> {
786        AVGS_W::new(self)
787    }
788    #[doc = "Bits 16:19 - Loop Count Select."]
789    #[inline(always)]
790    pub fn loop_(&mut self) -> LOOP_W<16> {
791        LOOP_W::new(self)
792    }
793    #[doc = "Bits 24:27 - Next Command Select."]
794    #[inline(always)]
795    pub fn next(&mut self) -> NEXT_W<24> {
796        NEXT_W::new(self)
797    }
798    #[doc = "Writes raw bits to the register."]
799    #[inline(always)]
800    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
801        self.0.bits(bits);
802        self
803    }
804}
805#[doc = "ADC Command High Buffer Register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cmdh14](index.html) module"]
806pub struct CMDH14_SPEC;
807impl crate::RegisterSpec for CMDH14_SPEC {
808    type Ux = u32;
809}
810#[doc = "`read()` method returns [cmdh14::R](R) reader structure"]
811impl crate::Readable for CMDH14_SPEC {
812    type Reader = R;
813}
814#[doc = "`write(|w| ..)` method takes [cmdh14::W](W) writer structure"]
815impl crate::Writable for CMDH14_SPEC {
816    type Writer = W;
817}
818#[doc = "`reset()` method sets CMDH14 to value 0"]
819impl crate::Resettable for CMDH14_SPEC {
820    #[inline(always)]
821    fn reset_value() -> Self::Ux {
822        0
823    }
824}