mimxrt595s/adc0/
cmdh8.rs

1#[doc = "Register `CMDH8` reader"]
2pub struct R(crate::R<CMDH8_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CMDH8_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CMDH8_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CMDH8_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CMDH8` writer"]
17pub struct W(crate::W<CMDH8_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CMDH8_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<CMDH8_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CMDH8_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: Command executes automatically."]
43    DISABLED = 0,
44    #[doc = "1: Active trigger must be asserted again before executing this command."]
45    ENABLED = 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::DISABLED,
59            true => WAIT_TRIG_A::ENABLED,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLED`"]
63    #[inline(always)]
64    pub fn is_disabled(&self) -> bool {
65        *self == WAIT_TRIG_A::DISABLED
66    }
67    #[doc = "Checks if the value of the field is `ENABLED`"]
68    #[inline(always)]
69    pub fn is_enabled(&self) -> bool {
70        *self == WAIT_TRIG_A::ENABLED
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, CMDH8_SPEC, WAIT_TRIG_A, O>;
75impl<'a, const O: u8> WAIT_TRIG_W<'a, O> {
76    #[doc = "Command executes automatically."]
77    #[inline(always)]
78    pub fn disabled(self) -> &'a mut W {
79        self.variant(WAIT_TRIG_A::DISABLED)
80    }
81    #[doc = "Active trigger must be asserted again before executing this command."]
82    #[inline(always)]
83    pub fn enabled(self) -> &'a mut W {
84        self.variant(WAIT_TRIG_A::ENABLED)
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: Disabled"]
93    DISABLED = 0,
94    #[doc = "1: Enabled"]
95    ENABLED = 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::DISABLED,
109            true => LWI_A::ENABLED,
110        }
111    }
112    #[doc = "Checks if the value of the field is `DISABLED`"]
113    #[inline(always)]
114    pub fn is_disabled(&self) -> bool {
115        *self == LWI_A::DISABLED
116    }
117    #[doc = "Checks if the value of the field is `ENABLED`"]
118    #[inline(always)]
119    pub fn is_enabled(&self) -> bool {
120        *self == LWI_A::ENABLED
121    }
122}
123#[doc = "Field `LWI` writer - Loop with Increment"]
124pub type LWI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMDH8_SPEC, LWI_A, O>;
125impl<'a, const O: u8> LWI_W<'a, O> {
126    #[doc = "Disabled"]
127    #[inline(always)]
128    pub fn disabled(self) -> &'a mut W {
129        self.variant(LWI_A::DISABLED)
130    }
131    #[doc = "Enabled"]
132    #[inline(always)]
133    pub fn enabled(self) -> &'a mut W {
134        self.variant(LWI_A::ENABLED)
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.5 ADCK cycles."]
144    SAMPLE_3P5 = 0,
145    #[doc = "1: 5.5 ADCK cycles"]
146    SAMPLE_5P5 = 1,
147    #[doc = "2: 7.5 ADCK cycles"]
148    SAMPLE_7P5 = 2,
149    #[doc = "3: 11.5 ADCK cycles"]
150    SAMPLE_11P5 = 3,
151    #[doc = "4: 19.5 ADCK cycles"]
152    SAMPLE_19P5 = 4,
153    #[doc = "5: 35.5 ADCK cycles"]
154    SAMPLE_35P5 = 5,
155    #[doc = "6: 67.5 ADCK cycles"]
156    SAMPLE_67P5 = 6,
157    #[doc = "7: 131.5 ADCK cycles"]
158    SAMPLE_131P5 = 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::SAMPLE_3P5,
172            1 => STS_A::SAMPLE_5P5,
173            2 => STS_A::SAMPLE_7P5,
174            3 => STS_A::SAMPLE_11P5,
175            4 => STS_A::SAMPLE_19P5,
176            5 => STS_A::SAMPLE_35P5,
177            6 => STS_A::SAMPLE_67P5,
178            7 => STS_A::SAMPLE_131P5,
179            _ => unreachable!(),
180        }
181    }
182    #[doc = "Checks if the value of the field is `SAMPLE_3P5`"]
183    #[inline(always)]
184    pub fn is_sample_3p5(&self) -> bool {
185        *self == STS_A::SAMPLE_3P5
186    }
187    #[doc = "Checks if the value of the field is `SAMPLE_5P5`"]
188    #[inline(always)]
189    pub fn is_sample_5p5(&self) -> bool {
190        *self == STS_A::SAMPLE_5P5
191    }
192    #[doc = "Checks if the value of the field is `SAMPLE_7P5`"]
193    #[inline(always)]
194    pub fn is_sample_7p5(&self) -> bool {
195        *self == STS_A::SAMPLE_7P5
196    }
197    #[doc = "Checks if the value of the field is `SAMPLE_11P5`"]
198    #[inline(always)]
199    pub fn is_sample_11p5(&self) -> bool {
200        *self == STS_A::SAMPLE_11P5
201    }
202    #[doc = "Checks if the value of the field is `SAMPLE_19P5`"]
203    #[inline(always)]
204    pub fn is_sample_19p5(&self) -> bool {
205        *self == STS_A::SAMPLE_19P5
206    }
207    #[doc = "Checks if the value of the field is `SAMPLE_35P5`"]
208    #[inline(always)]
209    pub fn is_sample_35p5(&self) -> bool {
210        *self == STS_A::SAMPLE_35P5
211    }
212    #[doc = "Checks if the value of the field is `SAMPLE_67P5`"]
213    #[inline(always)]
214    pub fn is_sample_67p5(&self) -> bool {
215        *self == STS_A::SAMPLE_67P5
216    }
217    #[doc = "Checks if the value of the field is `SAMPLE_131P5`"]
218    #[inline(always)]
219    pub fn is_sample_131p5(&self) -> bool {
220        *self == STS_A::SAMPLE_131P5
221    }
222}
223#[doc = "Field `STS` writer - Sample Time Select"]
224pub type STS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMDH8_SPEC, u8, STS_A, 3, O>;
225impl<'a, const O: u8> STS_W<'a, O> {
226    #[doc = "Minimum sample time of 3.5 ADCK cycles."]
227    #[inline(always)]
228    pub fn sample_3p5(self) -> &'a mut W {
229        self.variant(STS_A::SAMPLE_3P5)
230    }
231    #[doc = "5.5 ADCK cycles"]
232    #[inline(always)]
233    pub fn sample_5p5(self) -> &'a mut W {
234        self.variant(STS_A::SAMPLE_5P5)
235    }
236    #[doc = "7.5 ADCK cycles"]
237    #[inline(always)]
238    pub fn sample_7p5(self) -> &'a mut W {
239        self.variant(STS_A::SAMPLE_7P5)
240    }
241    #[doc = "11.5 ADCK cycles"]
242    #[inline(always)]
243    pub fn sample_11p5(self) -> &'a mut W {
244        self.variant(STS_A::SAMPLE_11P5)
245    }
246    #[doc = "19.5 ADCK cycles"]
247    #[inline(always)]
248    pub fn sample_19p5(self) -> &'a mut W {
249        self.variant(STS_A::SAMPLE_19P5)
250    }
251    #[doc = "35.5 ADCK cycles"]
252    #[inline(always)]
253    pub fn sample_35p5(self) -> &'a mut W {
254        self.variant(STS_A::SAMPLE_35P5)
255    }
256    #[doc = "67.5 ADCK cycles"]
257    #[inline(always)]
258    pub fn sample_67p5(self) -> &'a mut W {
259        self.variant(STS_A::SAMPLE_67P5)
260    }
261    #[doc = "131.5 ADCK cycles"]
262    #[inline(always)]
263    pub fn sample_131p5(self) -> &'a mut W {
264        self.variant(STS_A::SAMPLE_131P5)
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    NO_AVERAGE = 0,
275    #[doc = "1: 2"]
276    AVERAGE_2 = 1,
277    #[doc = "2: 4"]
278    AVERAGE_4 = 2,
279    #[doc = "3: 8"]
280    AVERAGE_8 = 3,
281    #[doc = "4: 16"]
282    AVERAGE_16 = 4,
283    #[doc = "5: 32"]
284    AVERAGE_32 = 5,
285    #[doc = "6: 64"]
286    AVERAGE_64 = 6,
287    #[doc = "7: 128"]
288    AVERAGE_128 = 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::NO_AVERAGE,
302            1 => AVGS_A::AVERAGE_2,
303            2 => AVGS_A::AVERAGE_4,
304            3 => AVGS_A::AVERAGE_8,
305            4 => AVGS_A::AVERAGE_16,
306            5 => AVGS_A::AVERAGE_32,
307            6 => AVGS_A::AVERAGE_64,
308            7 => AVGS_A::AVERAGE_128,
309            _ => unreachable!(),
310        }
311    }
312    #[doc = "Checks if the value of the field is `NO_AVERAGE`"]
313    #[inline(always)]
314    pub fn is_no_average(&self) -> bool {
315        *self == AVGS_A::NO_AVERAGE
316    }
317    #[doc = "Checks if the value of the field is `AVERAGE_2`"]
318    #[inline(always)]
319    pub fn is_average_2(&self) -> bool {
320        *self == AVGS_A::AVERAGE_2
321    }
322    #[doc = "Checks if the value of the field is `AVERAGE_4`"]
323    #[inline(always)]
324    pub fn is_average_4(&self) -> bool {
325        *self == AVGS_A::AVERAGE_4
326    }
327    #[doc = "Checks if the value of the field is `AVERAGE_8`"]
328    #[inline(always)]
329    pub fn is_average_8(&self) -> bool {
330        *self == AVGS_A::AVERAGE_8
331    }
332    #[doc = "Checks if the value of the field is `AVERAGE_16`"]
333    #[inline(always)]
334    pub fn is_average_16(&self) -> bool {
335        *self == AVGS_A::AVERAGE_16
336    }
337    #[doc = "Checks if the value of the field is `AVERAGE_32`"]
338    #[inline(always)]
339    pub fn is_average_32(&self) -> bool {
340        *self == AVGS_A::AVERAGE_32
341    }
342    #[doc = "Checks if the value of the field is `AVERAGE_64`"]
343    #[inline(always)]
344    pub fn is_average_64(&self) -> bool {
345        *self == AVGS_A::AVERAGE_64
346    }
347    #[doc = "Checks if the value of the field is `AVERAGE_128`"]
348    #[inline(always)]
349    pub fn is_average_128(&self) -> bool {
350        *self == AVGS_A::AVERAGE_128
351    }
352}
353#[doc = "Field `AVGS` writer - Hardware Average Select"]
354pub type AVGS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMDH8_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 no_average(self) -> &'a mut W {
359        self.variant(AVGS_A::NO_AVERAGE)
360    }
361    #[doc = "2"]
362    #[inline(always)]
363    pub fn average_2(self) -> &'a mut W {
364        self.variant(AVGS_A::AVERAGE_2)
365    }
366    #[doc = "4"]
367    #[inline(always)]
368    pub fn average_4(self) -> &'a mut W {
369        self.variant(AVGS_A::AVERAGE_4)
370    }
371    #[doc = "8"]
372    #[inline(always)]
373    pub fn average_8(self) -> &'a mut W {
374        self.variant(AVGS_A::AVERAGE_8)
375    }
376    #[doc = "16"]
377    #[inline(always)]
378    pub fn average_16(self) -> &'a mut W {
379        self.variant(AVGS_A::AVERAGE_16)
380    }
381    #[doc = "32"]
382    #[inline(always)]
383    pub fn average_32(self) -> &'a mut W {
384        self.variant(AVGS_A::AVERAGE_32)
385    }
386    #[doc = "64"]
387    #[inline(always)]
388    pub fn average_64(self) -> &'a mut W {
389        self.variant(AVGS_A::AVERAGE_64)
390    }
391    #[doc = "128"]
392    #[inline(always)]
393    pub fn average_128(self) -> &'a mut W {
394        self.variant(AVGS_A::AVERAGE_128)
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 one time."]
404    CMD_EXEC_1X = 0,
405    #[doc = "1: Loop one time. Command executes two times."]
406    CMD_EXEC_2X = 1,
407    #[doc = "2: Loop two times. Command executes three times."]
408    CMD_EXEC_3X = 2,
409    #[doc = "3: Loop corresponding number of times. Command executes LOOP + 1 times."]
410    CMD_EXECUTES_CORRESPONDING_TIMES_3 = 3,
411    #[doc = "4: Loop corresponding number of times. Command executes LOOP + 1 times."]
412    CMD_EXECUTES_CORRESPONDING_TIMES_4 = 4,
413    #[doc = "5: Loop corresponding number of times. Command executes LOOP + 1 times."]
414    CMD_EXECUTES_CORRESPONDING_TIMES_5 = 5,
415    #[doc = "6: Loop corresponding number of times. Command executes LOOP + 1 times."]
416    CMD_EXECUTES_CORRESPONDING_TIMES_6 = 6,
417    #[doc = "7: Loop corresponding number of times. Command executes LOOP + 1 times."]
418    CMD_EXECUTES_CORRESPONDING_TIMES_7 = 7,
419    #[doc = "8: Loop corresponding number of times. Command executes LOOP + 1 times."]
420    CMD_EXECUTES_CORRESPONDING_TIMES_8 = 8,
421    #[doc = "9: Loop corresponding number of times. Command executes LOOP + 1 times."]
422    CMD_EXECUTES_CORRESPONDING_TIMES_9 = 9,
423    #[doc = "15: Loop 15 times. Command executes 16 times."]
424    CMD_EXEC_15X = 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::CMD_EXEC_1X),
438            1 => Some(LOOP_A::CMD_EXEC_2X),
439            2 => Some(LOOP_A::CMD_EXEC_3X),
440            3 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_3),
441            4 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_4),
442            5 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_5),
443            6 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_6),
444            7 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_7),
445            8 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_8),
446            9 => Some(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_9),
447            15 => Some(LOOP_A::CMD_EXEC_15X),
448            _ => None,
449        }
450    }
451    #[doc = "Checks if the value of the field is `CMD_EXEC_1X`"]
452    #[inline(always)]
453    pub fn is_cmd_exec_1x(&self) -> bool {
454        *self == LOOP_A::CMD_EXEC_1X
455    }
456    #[doc = "Checks if the value of the field is `CMD_EXEC_2X`"]
457    #[inline(always)]
458    pub fn is_cmd_exec_2x(&self) -> bool {
459        *self == LOOP_A::CMD_EXEC_2X
460    }
461    #[doc = "Checks if the value of the field is `CMD_EXEC_3X`"]
462    #[inline(always)]
463    pub fn is_cmd_exec_3x(&self) -> bool {
464        *self == LOOP_A::CMD_EXEC_3X
465    }
466    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_3`"]
467    #[inline(always)]
468    pub fn is_cmd_executes_corresponding_times_3(&self) -> bool {
469        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_3
470    }
471    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_4`"]
472    #[inline(always)]
473    pub fn is_cmd_executes_corresponding_times_4(&self) -> bool {
474        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_4
475    }
476    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_5`"]
477    #[inline(always)]
478    pub fn is_cmd_executes_corresponding_times_5(&self) -> bool {
479        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_5
480    }
481    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_6`"]
482    #[inline(always)]
483    pub fn is_cmd_executes_corresponding_times_6(&self) -> bool {
484        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_6
485    }
486    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_7`"]
487    #[inline(always)]
488    pub fn is_cmd_executes_corresponding_times_7(&self) -> bool {
489        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_7
490    }
491    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_8`"]
492    #[inline(always)]
493    pub fn is_cmd_executes_corresponding_times_8(&self) -> bool {
494        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_8
495    }
496    #[doc = "Checks if the value of the field is `CMD_EXECUTES_CORRESPONDING_TIMES_9`"]
497    #[inline(always)]
498    pub fn is_cmd_executes_corresponding_times_9(&self) -> bool {
499        *self == LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_9
500    }
501    #[doc = "Checks if the value of the field is `CMD_EXEC_15X`"]
502    #[inline(always)]
503    pub fn is_cmd_exec_15x(&self) -> bool {
504        *self == LOOP_A::CMD_EXEC_15X
505    }
506}
507#[doc = "Field `LOOP` writer - Loop Count Select"]
508pub type LOOP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMDH8_SPEC, u8, LOOP_A, 4, O>;
509impl<'a, const O: u8> LOOP_W<'a, O> {
510    #[doc = "Looping not enabled. Command executes one time."]
511    #[inline(always)]
512    pub fn cmd_exec_1x(self) -> &'a mut W {
513        self.variant(LOOP_A::CMD_EXEC_1X)
514    }
515    #[doc = "Loop one time. Command executes two times."]
516    #[inline(always)]
517    pub fn cmd_exec_2x(self) -> &'a mut W {
518        self.variant(LOOP_A::CMD_EXEC_2X)
519    }
520    #[doc = "Loop two times. Command executes three times."]
521    #[inline(always)]
522    pub fn cmd_exec_3x(self) -> &'a mut W {
523        self.variant(LOOP_A::CMD_EXEC_3X)
524    }
525    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
526    #[inline(always)]
527    pub fn cmd_executes_corresponding_times_3(self) -> &'a mut W {
528        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_3)
529    }
530    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
531    #[inline(always)]
532    pub fn cmd_executes_corresponding_times_4(self) -> &'a mut W {
533        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_4)
534    }
535    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
536    #[inline(always)]
537    pub fn cmd_executes_corresponding_times_5(self) -> &'a mut W {
538        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_5)
539    }
540    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
541    #[inline(always)]
542    pub fn cmd_executes_corresponding_times_6(self) -> &'a mut W {
543        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_6)
544    }
545    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
546    #[inline(always)]
547    pub fn cmd_executes_corresponding_times_7(self) -> &'a mut W {
548        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_7)
549    }
550    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
551    #[inline(always)]
552    pub fn cmd_executes_corresponding_times_8(self) -> &'a mut W {
553        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_8)
554    }
555    #[doc = "Loop corresponding number of times. Command executes LOOP + 1 times."]
556    #[inline(always)]
557    pub fn cmd_executes_corresponding_times_9(self) -> &'a mut W {
558        self.variant(LOOP_A::CMD_EXECUTES_CORRESPONDING_TIMES_9)
559    }
560    #[doc = "Loop 15 times. Command executes 16 times."]
561    #[inline(always)]
562    pub fn cmd_exec_15x(self) -> &'a mut W {
563        self.variant(LOOP_A::CMD_EXEC_15X)
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    NO_NEXT_CMD_TERMINATE_ON_FINISH = 0,
574    #[doc = "1: CMD1"]
575    DO_CMD1_NEXT = 1,
576    #[doc = "2: Select corresponding CMD command buffer register as next command"]
577    DO_CORRESPONDING_CMD_NEXT_2 = 2,
578    #[doc = "3: Select corresponding CMD command buffer register as next command"]
579    DO_CORRESPONDING_CMD_NEXT_3 = 3,
580    #[doc = "4: Select corresponding CMD command buffer register as next command"]
581    DO_CORRESPONDING_CMD_NEXT_4 = 4,
582    #[doc = "5: Select corresponding CMD command buffer register as next command"]
583    DO_CORRESPONDING_CMD_NEXT_5 = 5,
584    #[doc = "6: Select corresponding CMD command buffer register as next command"]
585    DO_CORRESPONDING_CMD_NEXT_6 = 6,
586    #[doc = "7: Select corresponding CMD command buffer register as next command"]
587    DO_CORRESPONDING_CMD_NEXT_7 = 7,
588    #[doc = "8: Select corresponding CMD command buffer register as next command"]
589    DO_CORRESPONDING_CMD_NEXT_8 = 8,
590    #[doc = "9: Select corresponding CMD command buffer register as next command"]
591    DO_CORRESPONDING_CMD_NEXT_9 = 9,
592    #[doc = "15: CMD15"]
593    DO_CMD15_NEXT = 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::NO_NEXT_CMD_TERMINATE_ON_FINISH),
607            1 => Some(NEXT_A::DO_CMD1_NEXT),
608            2 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_2),
609            3 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_3),
610            4 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_4),
611            5 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_5),
612            6 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_6),
613            7 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_7),
614            8 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_8),
615            9 => Some(NEXT_A::DO_CORRESPONDING_CMD_NEXT_9),
616            15 => Some(NEXT_A::DO_CMD15_NEXT),
617            _ => None,
618        }
619    }
620    #[doc = "Checks if the value of the field is `NO_NEXT_CMD_TERMINATE_ON_FINISH`"]
621    #[inline(always)]
622    pub fn is_no_next_cmd_terminate_on_finish(&self) -> bool {
623        *self == NEXT_A::NO_NEXT_CMD_TERMINATE_ON_FINISH
624    }
625    #[doc = "Checks if the value of the field is `DO_CMD1_NEXT`"]
626    #[inline(always)]
627    pub fn is_do_cmd1_next(&self) -> bool {
628        *self == NEXT_A::DO_CMD1_NEXT
629    }
630    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_2`"]
631    #[inline(always)]
632    pub fn is_do_corresponding_cmd_next_2(&self) -> bool {
633        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_2
634    }
635    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_3`"]
636    #[inline(always)]
637    pub fn is_do_corresponding_cmd_next_3(&self) -> bool {
638        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_3
639    }
640    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_4`"]
641    #[inline(always)]
642    pub fn is_do_corresponding_cmd_next_4(&self) -> bool {
643        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_4
644    }
645    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_5`"]
646    #[inline(always)]
647    pub fn is_do_corresponding_cmd_next_5(&self) -> bool {
648        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_5
649    }
650    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_6`"]
651    #[inline(always)]
652    pub fn is_do_corresponding_cmd_next_6(&self) -> bool {
653        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_6
654    }
655    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_7`"]
656    #[inline(always)]
657    pub fn is_do_corresponding_cmd_next_7(&self) -> bool {
658        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_7
659    }
660    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_8`"]
661    #[inline(always)]
662    pub fn is_do_corresponding_cmd_next_8(&self) -> bool {
663        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_8
664    }
665    #[doc = "Checks if the value of the field is `DO_CORRESPONDING_CMD_NEXT_9`"]
666    #[inline(always)]
667    pub fn is_do_corresponding_cmd_next_9(&self) -> bool {
668        *self == NEXT_A::DO_CORRESPONDING_CMD_NEXT_9
669    }
670    #[doc = "Checks if the value of the field is `DO_CMD15_NEXT`"]
671    #[inline(always)]
672    pub fn is_do_cmd15_next(&self) -> bool {
673        *self == NEXT_A::DO_CMD15_NEXT
674    }
675}
676#[doc = "Field `NEXT` writer - Next Command Select"]
677pub type NEXT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMDH8_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 no_next_cmd_terminate_on_finish(self) -> &'a mut W {
682        self.variant(NEXT_A::NO_NEXT_CMD_TERMINATE_ON_FINISH)
683    }
684    #[doc = "CMD1"]
685    #[inline(always)]
686    pub fn do_cmd1_next(self) -> &'a mut W {
687        self.variant(NEXT_A::DO_CMD1_NEXT)
688    }
689    #[doc = "Select corresponding CMD command buffer register as next command"]
690    #[inline(always)]
691    pub fn do_corresponding_cmd_next_2(self) -> &'a mut W {
692        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_2)
693    }
694    #[doc = "Select corresponding CMD command buffer register as next command"]
695    #[inline(always)]
696    pub fn do_corresponding_cmd_next_3(self) -> &'a mut W {
697        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_3)
698    }
699    #[doc = "Select corresponding CMD command buffer register as next command"]
700    #[inline(always)]
701    pub fn do_corresponding_cmd_next_4(self) -> &'a mut W {
702        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_4)
703    }
704    #[doc = "Select corresponding CMD command buffer register as next command"]
705    #[inline(always)]
706    pub fn do_corresponding_cmd_next_5(self) -> &'a mut W {
707        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_5)
708    }
709    #[doc = "Select corresponding CMD command buffer register as next command"]
710    #[inline(always)]
711    pub fn do_corresponding_cmd_next_6(self) -> &'a mut W {
712        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_6)
713    }
714    #[doc = "Select corresponding CMD command buffer register as next command"]
715    #[inline(always)]
716    pub fn do_corresponding_cmd_next_7(self) -> &'a mut W {
717        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_7)
718    }
719    #[doc = "Select corresponding CMD command buffer register as next command"]
720    #[inline(always)]
721    pub fn do_corresponding_cmd_next_8(self) -> &'a mut W {
722        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_8)
723    }
724    #[doc = "Select corresponding CMD command buffer register as next command"]
725    #[inline(always)]
726    pub fn do_corresponding_cmd_next_9(self) -> &'a mut W {
727        self.variant(NEXT_A::DO_CORRESPONDING_CMD_NEXT_9)
728    }
729    #[doc = "CMD15"]
730    #[inline(always)]
731    pub fn do_cmd15_next(self) -> &'a mut W {
732        self.variant(NEXT_A::DO_CMD15_NEXT)
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    #[must_use]
771    pub fn wait_trig(&mut self) -> WAIT_TRIG_W<2> {
772        WAIT_TRIG_W::new(self)
773    }
774    #[doc = "Bit 7 - Loop with Increment"]
775    #[inline(always)]
776    #[must_use]
777    pub fn lwi(&mut self) -> LWI_W<7> {
778        LWI_W::new(self)
779    }
780    #[doc = "Bits 8:10 - Sample Time Select"]
781    #[inline(always)]
782    #[must_use]
783    pub fn sts(&mut self) -> STS_W<8> {
784        STS_W::new(self)
785    }
786    #[doc = "Bits 12:14 - Hardware Average Select"]
787    #[inline(always)]
788    #[must_use]
789    pub fn avgs(&mut self) -> AVGS_W<12> {
790        AVGS_W::new(self)
791    }
792    #[doc = "Bits 16:19 - Loop Count Select"]
793    #[inline(always)]
794    #[must_use]
795    pub fn loop_(&mut self) -> LOOP_W<16> {
796        LOOP_W::new(self)
797    }
798    #[doc = "Bits 24:27 - Next Command Select"]
799    #[inline(always)]
800    #[must_use]
801    pub fn next(&mut self) -> NEXT_W<24> {
802        NEXT_W::new(self)
803    }
804    #[doc = "Writes raw bits to the register."]
805    #[inline(always)]
806    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
807        self.0.bits(bits);
808        self
809    }
810}
811#[doc = "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 [cmdh8](index.html) module"]
812pub struct CMDH8_SPEC;
813impl crate::RegisterSpec for CMDH8_SPEC {
814    type Ux = u32;
815}
816#[doc = "`read()` method returns [cmdh8::R](R) reader structure"]
817impl crate::Readable for CMDH8_SPEC {
818    type Reader = R;
819}
820#[doc = "`write(|w| ..)` method takes [cmdh8::W](W) writer structure"]
821impl crate::Writable for CMDH8_SPEC {
822    type Writer = W;
823    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
824    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
825}
826#[doc = "`reset()` method sets CMDH8 to value 0"]
827impl crate::Resettable for CMDH8_SPEC {
828    const RESET_VALUE: Self::Ux = 0;
829}