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