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