1#[doc = "Register `SCANCTRLX` reader"]
2pub struct R(crate::R<SCANCTRLX_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SCANCTRLX_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SCANCTRLX_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SCANCTRLX_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SCANCTRLX` writer"]
17pub struct W(crate::W<SCANCTRLX_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SCANCTRLX_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<SCANCTRLX_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SCANCTRLX_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Scan Channel Reference Selection\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum VREFSEL_A {
41 #[doc = "0: Internal 0.83V Bandgap reference"]
42 VBGR = 0,
43 #[doc = "1: Scaled AVDD: AVDD*(the VREF attenuation factor)"]
44 VDDXWATT = 1,
45 #[doc = "2: Scaled singled ended external Vref: ADCn_EXTP*(the VREF attenuation factor)"]
46 VREFPWATT = 2,
47 #[doc = "3: Raw single ended external Vref: ADCn_EXTP"]
48 VREFP = 3,
49 #[doc = "5: Scaled differential external Vref from : (ADCn_EXTP-ADCn_EXTN)*(the VREF attenuation factor)"]
50 VREFPNWATT = 5,
51 #[doc = "6: Raw differential external Vref from : (ADCn_EXTP-ADCn_EXTN)"]
52 VREFPN = 6,
53 #[doc = "7: Internal Bandgap reference at low setting 0.78V"]
54 VBGRLOW = 7,
55}
56impl From<VREFSEL_A> for u8 {
57 #[inline(always)]
58 fn from(variant: VREFSEL_A) -> Self {
59 variant as _
60 }
61}
62#[doc = "Field `VREFSEL` reader - Scan Channel Reference Selection"]
63pub type VREFSEL_R = crate::FieldReader<u8, VREFSEL_A>;
64impl VREFSEL_R {
65 #[doc = "Get enumerated values variant"]
66 #[inline(always)]
67 pub fn variant(&self) -> Option<VREFSEL_A> {
68 match self.bits {
69 0 => Some(VREFSEL_A::VBGR),
70 1 => Some(VREFSEL_A::VDDXWATT),
71 2 => Some(VREFSEL_A::VREFPWATT),
72 3 => Some(VREFSEL_A::VREFP),
73 5 => Some(VREFSEL_A::VREFPNWATT),
74 6 => Some(VREFSEL_A::VREFPN),
75 7 => Some(VREFSEL_A::VBGRLOW),
76 _ => None,
77 }
78 }
79 #[doc = "Checks if the value of the field is `VBGR`"]
80 #[inline(always)]
81 pub fn is_vbgr(&self) -> bool {
82 *self == VREFSEL_A::VBGR
83 }
84 #[doc = "Checks if the value of the field is `VDDXWATT`"]
85 #[inline(always)]
86 pub fn is_vddxwatt(&self) -> bool {
87 *self == VREFSEL_A::VDDXWATT
88 }
89 #[doc = "Checks if the value of the field is `VREFPWATT`"]
90 #[inline(always)]
91 pub fn is_vrefpwatt(&self) -> bool {
92 *self == VREFSEL_A::VREFPWATT
93 }
94 #[doc = "Checks if the value of the field is `VREFP`"]
95 #[inline(always)]
96 pub fn is_vrefp(&self) -> bool {
97 *self == VREFSEL_A::VREFP
98 }
99 #[doc = "Checks if the value of the field is `VREFPNWATT`"]
100 #[inline(always)]
101 pub fn is_vrefpnwatt(&self) -> bool {
102 *self == VREFSEL_A::VREFPNWATT
103 }
104 #[doc = "Checks if the value of the field is `VREFPN`"]
105 #[inline(always)]
106 pub fn is_vrefpn(&self) -> bool {
107 *self == VREFSEL_A::VREFPN
108 }
109 #[doc = "Checks if the value of the field is `VBGRLOW`"]
110 #[inline(always)]
111 pub fn is_vbgrlow(&self) -> bool {
112 *self == VREFSEL_A::VBGRLOW
113 }
114}
115#[doc = "Field `VREFSEL` writer - Scan Channel Reference Selection"]
116pub type VREFSEL_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, VREFSEL_A, 3, 0>;
117impl<'a> VREFSEL_W<'a> {
118 #[doc = "Internal 0.83V Bandgap reference"]
119 #[inline(always)]
120 pub fn vbgr(self) -> &'a mut W {
121 self.variant(VREFSEL_A::VBGR)
122 }
123 #[doc = "Scaled AVDD: AVDD*(the VREF attenuation factor)"]
124 #[inline(always)]
125 pub fn vddxwatt(self) -> &'a mut W {
126 self.variant(VREFSEL_A::VDDXWATT)
127 }
128 #[doc = "Scaled singled ended external Vref: ADCn_EXTP*(the VREF attenuation factor)"]
129 #[inline(always)]
130 pub fn vrefpwatt(self) -> &'a mut W {
131 self.variant(VREFSEL_A::VREFPWATT)
132 }
133 #[doc = "Raw single ended external Vref: ADCn_EXTP"]
134 #[inline(always)]
135 pub fn vrefp(self) -> &'a mut W {
136 self.variant(VREFSEL_A::VREFP)
137 }
138 #[doc = "Scaled differential external Vref from : (ADCn_EXTP-ADCn_EXTN)*(the VREF attenuation factor)"]
139 #[inline(always)]
140 pub fn vrefpnwatt(self) -> &'a mut W {
141 self.variant(VREFSEL_A::VREFPNWATT)
142 }
143 #[doc = "Raw differential external Vref from : (ADCn_EXTP-ADCn_EXTN)"]
144 #[inline(always)]
145 pub fn vrefpn(self) -> &'a mut W {
146 self.variant(VREFSEL_A::VREFPN)
147 }
148 #[doc = "Internal Bandgap reference at low setting 0.78V"]
149 #[inline(always)]
150 pub fn vbgrlow(self) -> &'a mut W {
151 self.variant(VREFSEL_A::VBGRLOW)
152 }
153}
154#[doc = "Field `VREFATTFIX` reader - Enable Fixed Scaling on VREF"]
155pub type VREFATTFIX_R = crate::BitReader<bool>;
156#[doc = "Field `VREFATTFIX` writer - Enable Fixed Scaling on VREF"]
157pub type VREFATTFIX_W<'a> = crate::BitWriter<'a, u32, SCANCTRLX_SPEC, bool, 3>;
158#[doc = "Field `VREFATT` reader - Code for VREF Attenuation Factor When VREFSEL is 1, 2 or 5"]
159pub type VREFATT_R = crate::FieldReader<u8, u8>;
160#[doc = "Field `VREFATT` writer - Code for VREF Attenuation Factor When VREFSEL is 1, 2 or 5"]
161pub type VREFATT_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, u8, 4, 4>;
162#[doc = "Field `VINATT` reader - Code for VIN Attenuation Factor"]
163pub type VINATT_R = crate::FieldReader<u8, u8>;
164#[doc = "Field `VINATT` writer - Code for VIN Attenuation Factor"]
165pub type VINATT_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, u8, 4, 8>;
166#[doc = "Field `DVL` reader - Scan DV Level Select"]
167pub type DVL_R = crate::FieldReader<u8, u8>;
168#[doc = "Field `DVL` writer - Scan DV Level Select"]
169pub type DVL_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, u8, 2, 12>;
170#[doc = "Field `FIFOOFACT` reader - Scan FIFO Overflow Action"]
171pub type FIFOOFACT_R = crate::BitReader<bool>;
172#[doc = "Field `FIFOOFACT` writer - Scan FIFO Overflow Action"]
173pub type FIFOOFACT_W<'a> = crate::BitWriter<'a, u32, SCANCTRLX_SPEC, bool, 14>;
174#[doc = "Field `PRSMODE` reader - Scan PRS Trigger Mode"]
175pub type PRSMODE_R = crate::BitReader<bool>;
176#[doc = "Field `PRSMODE` writer - Scan PRS Trigger Mode"]
177pub type PRSMODE_W<'a> = crate::BitWriter<'a, u32, SCANCTRLX_SPEC, bool, 16>;
178#[doc = "Scan Sequence PRS Trigger Select\n\nValue on reset: 0"]
179#[derive(Clone, Copy, Debug, PartialEq)]
180#[repr(u8)]
181pub enum PRSSEL_A {
182 #[doc = "0: PRS ch 0 triggers scan sequence"]
183 PRSCH0 = 0,
184 #[doc = "1: PRS ch 1 triggers scan sequence"]
185 PRSCH1 = 1,
186 #[doc = "2: PRS ch 2 triggers scan sequence"]
187 PRSCH2 = 2,
188 #[doc = "3: PRS ch 3 triggers scan sequence"]
189 PRSCH3 = 3,
190 #[doc = "4: PRS ch 4 triggers scan sequence"]
191 PRSCH4 = 4,
192 #[doc = "5: PRS ch 5 triggers scan sequence"]
193 PRSCH5 = 5,
194 #[doc = "6: PRS ch 6 triggers scan sequence"]
195 PRSCH6 = 6,
196 #[doc = "7: PRS ch 7 triggers scan sequence"]
197 PRSCH7 = 7,
198 #[doc = "8: PRS ch 8 triggers scan sequence"]
199 PRSCH8 = 8,
200 #[doc = "9: PRS ch 9 triggers scan sequence"]
201 PRSCH9 = 9,
202 #[doc = "10: PRS ch 10 triggers scan sequence"]
203 PRSCH10 = 10,
204 #[doc = "11: PRS ch 11 triggers scan sequence"]
205 PRSCH11 = 11,
206 #[doc = "12: PRS ch 12 triggers scan sequence"]
207 PRSCH12 = 12,
208 #[doc = "13: PRS ch 13 triggers scan sequence"]
209 PRSCH13 = 13,
210 #[doc = "14: PRS ch 14 triggers scan sequence"]
211 PRSCH14 = 14,
212 #[doc = "15: PRS ch 15 triggers scan sequence"]
213 PRSCH15 = 15,
214 #[doc = "16: PRS ch 16 triggers scan sequence"]
215 PRSCH16 = 16,
216 #[doc = "17: PRS ch 17 triggers scan sequence"]
217 PRSCH17 = 17,
218 #[doc = "18: PRS ch 18 triggers scan sequence"]
219 PRSCH18 = 18,
220 #[doc = "19: PRS ch 19 triggers scan sequence"]
221 PRSCH19 = 19,
222 #[doc = "20: PRS ch 20 triggers scan sequence"]
223 PRSCH20 = 20,
224 #[doc = "21: PRS ch 21 triggers scan sequence"]
225 PRSCH21 = 21,
226 #[doc = "22: PRS ch 22 triggers scan sequence"]
227 PRSCH22 = 22,
228 #[doc = "23: PRS ch 23 triggers scan sequence"]
229 PRSCH23 = 23,
230}
231impl From<PRSSEL_A> for u8 {
232 #[inline(always)]
233 fn from(variant: PRSSEL_A) -> Self {
234 variant as _
235 }
236}
237#[doc = "Field `PRSSEL` reader - Scan Sequence PRS Trigger Select"]
238pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
239impl PRSSEL_R {
240 #[doc = "Get enumerated values variant"]
241 #[inline(always)]
242 pub fn variant(&self) -> Option<PRSSEL_A> {
243 match self.bits {
244 0 => Some(PRSSEL_A::PRSCH0),
245 1 => Some(PRSSEL_A::PRSCH1),
246 2 => Some(PRSSEL_A::PRSCH2),
247 3 => Some(PRSSEL_A::PRSCH3),
248 4 => Some(PRSSEL_A::PRSCH4),
249 5 => Some(PRSSEL_A::PRSCH5),
250 6 => Some(PRSSEL_A::PRSCH6),
251 7 => Some(PRSSEL_A::PRSCH7),
252 8 => Some(PRSSEL_A::PRSCH8),
253 9 => Some(PRSSEL_A::PRSCH9),
254 10 => Some(PRSSEL_A::PRSCH10),
255 11 => Some(PRSSEL_A::PRSCH11),
256 12 => Some(PRSSEL_A::PRSCH12),
257 13 => Some(PRSSEL_A::PRSCH13),
258 14 => Some(PRSSEL_A::PRSCH14),
259 15 => Some(PRSSEL_A::PRSCH15),
260 16 => Some(PRSSEL_A::PRSCH16),
261 17 => Some(PRSSEL_A::PRSCH17),
262 18 => Some(PRSSEL_A::PRSCH18),
263 19 => Some(PRSSEL_A::PRSCH19),
264 20 => Some(PRSSEL_A::PRSCH20),
265 21 => Some(PRSSEL_A::PRSCH21),
266 22 => Some(PRSSEL_A::PRSCH22),
267 23 => Some(PRSSEL_A::PRSCH23),
268 _ => None,
269 }
270 }
271 #[doc = "Checks if the value of the field is `PRSCH0`"]
272 #[inline(always)]
273 pub fn is_prsch0(&self) -> bool {
274 *self == PRSSEL_A::PRSCH0
275 }
276 #[doc = "Checks if the value of the field is `PRSCH1`"]
277 #[inline(always)]
278 pub fn is_prsch1(&self) -> bool {
279 *self == PRSSEL_A::PRSCH1
280 }
281 #[doc = "Checks if the value of the field is `PRSCH2`"]
282 #[inline(always)]
283 pub fn is_prsch2(&self) -> bool {
284 *self == PRSSEL_A::PRSCH2
285 }
286 #[doc = "Checks if the value of the field is `PRSCH3`"]
287 #[inline(always)]
288 pub fn is_prsch3(&self) -> bool {
289 *self == PRSSEL_A::PRSCH3
290 }
291 #[doc = "Checks if the value of the field is `PRSCH4`"]
292 #[inline(always)]
293 pub fn is_prsch4(&self) -> bool {
294 *self == PRSSEL_A::PRSCH4
295 }
296 #[doc = "Checks if the value of the field is `PRSCH5`"]
297 #[inline(always)]
298 pub fn is_prsch5(&self) -> bool {
299 *self == PRSSEL_A::PRSCH5
300 }
301 #[doc = "Checks if the value of the field is `PRSCH6`"]
302 #[inline(always)]
303 pub fn is_prsch6(&self) -> bool {
304 *self == PRSSEL_A::PRSCH6
305 }
306 #[doc = "Checks if the value of the field is `PRSCH7`"]
307 #[inline(always)]
308 pub fn is_prsch7(&self) -> bool {
309 *self == PRSSEL_A::PRSCH7
310 }
311 #[doc = "Checks if the value of the field is `PRSCH8`"]
312 #[inline(always)]
313 pub fn is_prsch8(&self) -> bool {
314 *self == PRSSEL_A::PRSCH8
315 }
316 #[doc = "Checks if the value of the field is `PRSCH9`"]
317 #[inline(always)]
318 pub fn is_prsch9(&self) -> bool {
319 *self == PRSSEL_A::PRSCH9
320 }
321 #[doc = "Checks if the value of the field is `PRSCH10`"]
322 #[inline(always)]
323 pub fn is_prsch10(&self) -> bool {
324 *self == PRSSEL_A::PRSCH10
325 }
326 #[doc = "Checks if the value of the field is `PRSCH11`"]
327 #[inline(always)]
328 pub fn is_prsch11(&self) -> bool {
329 *self == PRSSEL_A::PRSCH11
330 }
331 #[doc = "Checks if the value of the field is `PRSCH12`"]
332 #[inline(always)]
333 pub fn is_prsch12(&self) -> bool {
334 *self == PRSSEL_A::PRSCH12
335 }
336 #[doc = "Checks if the value of the field is `PRSCH13`"]
337 #[inline(always)]
338 pub fn is_prsch13(&self) -> bool {
339 *self == PRSSEL_A::PRSCH13
340 }
341 #[doc = "Checks if the value of the field is `PRSCH14`"]
342 #[inline(always)]
343 pub fn is_prsch14(&self) -> bool {
344 *self == PRSSEL_A::PRSCH14
345 }
346 #[doc = "Checks if the value of the field is `PRSCH15`"]
347 #[inline(always)]
348 pub fn is_prsch15(&self) -> bool {
349 *self == PRSSEL_A::PRSCH15
350 }
351 #[doc = "Checks if the value of the field is `PRSCH16`"]
352 #[inline(always)]
353 pub fn is_prsch16(&self) -> bool {
354 *self == PRSSEL_A::PRSCH16
355 }
356 #[doc = "Checks if the value of the field is `PRSCH17`"]
357 #[inline(always)]
358 pub fn is_prsch17(&self) -> bool {
359 *self == PRSSEL_A::PRSCH17
360 }
361 #[doc = "Checks if the value of the field is `PRSCH18`"]
362 #[inline(always)]
363 pub fn is_prsch18(&self) -> bool {
364 *self == PRSSEL_A::PRSCH18
365 }
366 #[doc = "Checks if the value of the field is `PRSCH19`"]
367 #[inline(always)]
368 pub fn is_prsch19(&self) -> bool {
369 *self == PRSSEL_A::PRSCH19
370 }
371 #[doc = "Checks if the value of the field is `PRSCH20`"]
372 #[inline(always)]
373 pub fn is_prsch20(&self) -> bool {
374 *self == PRSSEL_A::PRSCH20
375 }
376 #[doc = "Checks if the value of the field is `PRSCH21`"]
377 #[inline(always)]
378 pub fn is_prsch21(&self) -> bool {
379 *self == PRSSEL_A::PRSCH21
380 }
381 #[doc = "Checks if the value of the field is `PRSCH22`"]
382 #[inline(always)]
383 pub fn is_prsch22(&self) -> bool {
384 *self == PRSSEL_A::PRSCH22
385 }
386 #[doc = "Checks if the value of the field is `PRSCH23`"]
387 #[inline(always)]
388 pub fn is_prsch23(&self) -> bool {
389 *self == PRSSEL_A::PRSCH23
390 }
391}
392#[doc = "Field `PRSSEL` writer - Scan Sequence PRS Trigger Select"]
393pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, PRSSEL_A, 5, 17>;
394impl<'a> PRSSEL_W<'a> {
395 #[doc = "PRS ch 0 triggers scan sequence"]
396 #[inline(always)]
397 pub fn prsch0(self) -> &'a mut W {
398 self.variant(PRSSEL_A::PRSCH0)
399 }
400 #[doc = "PRS ch 1 triggers scan sequence"]
401 #[inline(always)]
402 pub fn prsch1(self) -> &'a mut W {
403 self.variant(PRSSEL_A::PRSCH1)
404 }
405 #[doc = "PRS ch 2 triggers scan sequence"]
406 #[inline(always)]
407 pub fn prsch2(self) -> &'a mut W {
408 self.variant(PRSSEL_A::PRSCH2)
409 }
410 #[doc = "PRS ch 3 triggers scan sequence"]
411 #[inline(always)]
412 pub fn prsch3(self) -> &'a mut W {
413 self.variant(PRSSEL_A::PRSCH3)
414 }
415 #[doc = "PRS ch 4 triggers scan sequence"]
416 #[inline(always)]
417 pub fn prsch4(self) -> &'a mut W {
418 self.variant(PRSSEL_A::PRSCH4)
419 }
420 #[doc = "PRS ch 5 triggers scan sequence"]
421 #[inline(always)]
422 pub fn prsch5(self) -> &'a mut W {
423 self.variant(PRSSEL_A::PRSCH5)
424 }
425 #[doc = "PRS ch 6 triggers scan sequence"]
426 #[inline(always)]
427 pub fn prsch6(self) -> &'a mut W {
428 self.variant(PRSSEL_A::PRSCH6)
429 }
430 #[doc = "PRS ch 7 triggers scan sequence"]
431 #[inline(always)]
432 pub fn prsch7(self) -> &'a mut W {
433 self.variant(PRSSEL_A::PRSCH7)
434 }
435 #[doc = "PRS ch 8 triggers scan sequence"]
436 #[inline(always)]
437 pub fn prsch8(self) -> &'a mut W {
438 self.variant(PRSSEL_A::PRSCH8)
439 }
440 #[doc = "PRS ch 9 triggers scan sequence"]
441 #[inline(always)]
442 pub fn prsch9(self) -> &'a mut W {
443 self.variant(PRSSEL_A::PRSCH9)
444 }
445 #[doc = "PRS ch 10 triggers scan sequence"]
446 #[inline(always)]
447 pub fn prsch10(self) -> &'a mut W {
448 self.variant(PRSSEL_A::PRSCH10)
449 }
450 #[doc = "PRS ch 11 triggers scan sequence"]
451 #[inline(always)]
452 pub fn prsch11(self) -> &'a mut W {
453 self.variant(PRSSEL_A::PRSCH11)
454 }
455 #[doc = "PRS ch 12 triggers scan sequence"]
456 #[inline(always)]
457 pub fn prsch12(self) -> &'a mut W {
458 self.variant(PRSSEL_A::PRSCH12)
459 }
460 #[doc = "PRS ch 13 triggers scan sequence"]
461 #[inline(always)]
462 pub fn prsch13(self) -> &'a mut W {
463 self.variant(PRSSEL_A::PRSCH13)
464 }
465 #[doc = "PRS ch 14 triggers scan sequence"]
466 #[inline(always)]
467 pub fn prsch14(self) -> &'a mut W {
468 self.variant(PRSSEL_A::PRSCH14)
469 }
470 #[doc = "PRS ch 15 triggers scan sequence"]
471 #[inline(always)]
472 pub fn prsch15(self) -> &'a mut W {
473 self.variant(PRSSEL_A::PRSCH15)
474 }
475 #[doc = "PRS ch 16 triggers scan sequence"]
476 #[inline(always)]
477 pub fn prsch16(self) -> &'a mut W {
478 self.variant(PRSSEL_A::PRSCH16)
479 }
480 #[doc = "PRS ch 17 triggers scan sequence"]
481 #[inline(always)]
482 pub fn prsch17(self) -> &'a mut W {
483 self.variant(PRSSEL_A::PRSCH17)
484 }
485 #[doc = "PRS ch 18 triggers scan sequence"]
486 #[inline(always)]
487 pub fn prsch18(self) -> &'a mut W {
488 self.variant(PRSSEL_A::PRSCH18)
489 }
490 #[doc = "PRS ch 19 triggers scan sequence"]
491 #[inline(always)]
492 pub fn prsch19(self) -> &'a mut W {
493 self.variant(PRSSEL_A::PRSCH19)
494 }
495 #[doc = "PRS ch 20 triggers scan sequence"]
496 #[inline(always)]
497 pub fn prsch20(self) -> &'a mut W {
498 self.variant(PRSSEL_A::PRSCH20)
499 }
500 #[doc = "PRS ch 21 triggers scan sequence"]
501 #[inline(always)]
502 pub fn prsch21(self) -> &'a mut W {
503 self.variant(PRSSEL_A::PRSCH21)
504 }
505 #[doc = "PRS ch 22 triggers scan sequence"]
506 #[inline(always)]
507 pub fn prsch22(self) -> &'a mut W {
508 self.variant(PRSSEL_A::PRSCH22)
509 }
510 #[doc = "PRS ch 23 triggers scan sequence"]
511 #[inline(always)]
512 pub fn prsch23(self) -> &'a mut W {
513 self.variant(PRSSEL_A::PRSCH23)
514 }
515}
516#[doc = "Field `CONVSTARTDELAY` reader - Delay Next Conversion Start If CONVSTARTDELAYEN is Set"]
517pub type CONVSTARTDELAY_R = crate::FieldReader<u8, u8>;
518#[doc = "Field `CONVSTARTDELAY` writer - Delay Next Conversion Start If CONVSTARTDELAYEN is Set"]
519pub type CONVSTARTDELAY_W<'a> = crate::FieldWriter<'a, u32, SCANCTRLX_SPEC, u8, u8, 5, 22>;
520#[doc = "Field `CONVSTARTDELAYEN` reader - Enable Delaying Next Conversion Start"]
521pub type CONVSTARTDELAYEN_R = crate::BitReader<bool>;
522#[doc = "Field `CONVSTARTDELAYEN` writer - Enable Delaying Next Conversion Start"]
523pub type CONVSTARTDELAYEN_W<'a> = crate::BitWriter<'a, u32, SCANCTRLX_SPEC, bool, 27>;
524#[doc = "REPDELAY Select for SCAN REP Mode\n\nValue on reset: 0"]
525#[derive(Clone, Copy, Debug, PartialEq)]
526#[repr(u8)]
527pub enum REPDELAY_A {
528 #[doc = "0: No delay"]
529 NODELAY = 0,
530 #[doc = "1: 4 conversion clock cycles"]
531 _4CYCLES = 1,
532 #[doc = "2: 8 conversion clock cycles"]
533 _8CYCLES = 2,
534 #[doc = "3: 16 conversion clock cycles"]
535 _16CYCLES = 3,
536 #[doc = "4: 32 conversion clock cycles"]
537 _32CYCLES = 4,
538 #[doc = "5: 64 conversion clock cycles"]
539 _64CYCLES = 5,
540 #[doc = "6: 128 conversion clock cycles"]
541 _128CYCLES = 6,
542 #[doc = "7: 256 conversion clock cycles"]
543 _256CYCLES = 7,
544}
545impl From<REPDELAY_A> for u8 {
546 #[inline(always)]
547 fn from(variant: REPDELAY_A) -> Self {
548 variant as _
549 }
550}
551#[doc = "Field `REPDELAY` reader - REPDELAY Select for SCAN REP Mode"]
552pub type REPDELAY_R = crate::FieldReader<u8, REPDELAY_A>;
553impl REPDELAY_R {
554 #[doc = "Get enumerated values variant"]
555 #[inline(always)]
556 pub fn variant(&self) -> REPDELAY_A {
557 match self.bits {
558 0 => REPDELAY_A::NODELAY,
559 1 => REPDELAY_A::_4CYCLES,
560 2 => REPDELAY_A::_8CYCLES,
561 3 => REPDELAY_A::_16CYCLES,
562 4 => REPDELAY_A::_32CYCLES,
563 5 => REPDELAY_A::_64CYCLES,
564 6 => REPDELAY_A::_128CYCLES,
565 7 => REPDELAY_A::_256CYCLES,
566 _ => unreachable!(),
567 }
568 }
569 #[doc = "Checks if the value of the field is `NODELAY`"]
570 #[inline(always)]
571 pub fn is_nodelay(&self) -> bool {
572 *self == REPDELAY_A::NODELAY
573 }
574 #[doc = "Checks if the value of the field is `_4CYCLES`"]
575 #[inline(always)]
576 pub fn is_4cycles(&self) -> bool {
577 *self == REPDELAY_A::_4CYCLES
578 }
579 #[doc = "Checks if the value of the field is `_8CYCLES`"]
580 #[inline(always)]
581 pub fn is_8cycles(&self) -> bool {
582 *self == REPDELAY_A::_8CYCLES
583 }
584 #[doc = "Checks if the value of the field is `_16CYCLES`"]
585 #[inline(always)]
586 pub fn is_16cycles(&self) -> bool {
587 *self == REPDELAY_A::_16CYCLES
588 }
589 #[doc = "Checks if the value of the field is `_32CYCLES`"]
590 #[inline(always)]
591 pub fn is_32cycles(&self) -> bool {
592 *self == REPDELAY_A::_32CYCLES
593 }
594 #[doc = "Checks if the value of the field is `_64CYCLES`"]
595 #[inline(always)]
596 pub fn is_64cycles(&self) -> bool {
597 *self == REPDELAY_A::_64CYCLES
598 }
599 #[doc = "Checks if the value of the field is `_128CYCLES`"]
600 #[inline(always)]
601 pub fn is_128cycles(&self) -> bool {
602 *self == REPDELAY_A::_128CYCLES
603 }
604 #[doc = "Checks if the value of the field is `_256CYCLES`"]
605 #[inline(always)]
606 pub fn is_256cycles(&self) -> bool {
607 *self == REPDELAY_A::_256CYCLES
608 }
609}
610#[doc = "Field `REPDELAY` writer - REPDELAY Select for SCAN REP Mode"]
611pub type REPDELAY_W<'a> = crate::FieldWriterSafe<'a, u32, SCANCTRLX_SPEC, u8, REPDELAY_A, 3, 29>;
612impl<'a> REPDELAY_W<'a> {
613 #[doc = "No delay"]
614 #[inline(always)]
615 pub fn nodelay(self) -> &'a mut W {
616 self.variant(REPDELAY_A::NODELAY)
617 }
618 #[doc = "4 conversion clock cycles"]
619 #[inline(always)]
620 pub fn _4cycles(self) -> &'a mut W {
621 self.variant(REPDELAY_A::_4CYCLES)
622 }
623 #[doc = "8 conversion clock cycles"]
624 #[inline(always)]
625 pub fn _8cycles(self) -> &'a mut W {
626 self.variant(REPDELAY_A::_8CYCLES)
627 }
628 #[doc = "16 conversion clock cycles"]
629 #[inline(always)]
630 pub fn _16cycles(self) -> &'a mut W {
631 self.variant(REPDELAY_A::_16CYCLES)
632 }
633 #[doc = "32 conversion clock cycles"]
634 #[inline(always)]
635 pub fn _32cycles(self) -> &'a mut W {
636 self.variant(REPDELAY_A::_32CYCLES)
637 }
638 #[doc = "64 conversion clock cycles"]
639 #[inline(always)]
640 pub fn _64cycles(self) -> &'a mut W {
641 self.variant(REPDELAY_A::_64CYCLES)
642 }
643 #[doc = "128 conversion clock cycles"]
644 #[inline(always)]
645 pub fn _128cycles(self) -> &'a mut W {
646 self.variant(REPDELAY_A::_128CYCLES)
647 }
648 #[doc = "256 conversion clock cycles"]
649 #[inline(always)]
650 pub fn _256cycles(self) -> &'a mut W {
651 self.variant(REPDELAY_A::_256CYCLES)
652 }
653}
654impl R {
655 #[doc = "Bits 0:2 - Scan Channel Reference Selection"]
656 #[inline(always)]
657 pub fn vrefsel(&self) -> VREFSEL_R {
658 VREFSEL_R::new((self.bits & 7) as u8)
659 }
660 #[doc = "Bit 3 - Enable Fixed Scaling on VREF"]
661 #[inline(always)]
662 pub fn vrefattfix(&self) -> VREFATTFIX_R {
663 VREFATTFIX_R::new(((self.bits >> 3) & 1) != 0)
664 }
665 #[doc = "Bits 4:7 - Code for VREF Attenuation Factor When VREFSEL is 1, 2 or 5"]
666 #[inline(always)]
667 pub fn vrefatt(&self) -> VREFATT_R {
668 VREFATT_R::new(((self.bits >> 4) & 0x0f) as u8)
669 }
670 #[doc = "Bits 8:11 - Code for VIN Attenuation Factor"]
671 #[inline(always)]
672 pub fn vinatt(&self) -> VINATT_R {
673 VINATT_R::new(((self.bits >> 8) & 0x0f) as u8)
674 }
675 #[doc = "Bits 12:13 - Scan DV Level Select"]
676 #[inline(always)]
677 pub fn dvl(&self) -> DVL_R {
678 DVL_R::new(((self.bits >> 12) & 3) as u8)
679 }
680 #[doc = "Bit 14 - Scan FIFO Overflow Action"]
681 #[inline(always)]
682 pub fn fifoofact(&self) -> FIFOOFACT_R {
683 FIFOOFACT_R::new(((self.bits >> 14) & 1) != 0)
684 }
685 #[doc = "Bit 16 - Scan PRS Trigger Mode"]
686 #[inline(always)]
687 pub fn prsmode(&self) -> PRSMODE_R {
688 PRSMODE_R::new(((self.bits >> 16) & 1) != 0)
689 }
690 #[doc = "Bits 17:21 - Scan Sequence PRS Trigger Select"]
691 #[inline(always)]
692 pub fn prssel(&self) -> PRSSEL_R {
693 PRSSEL_R::new(((self.bits >> 17) & 0x1f) as u8)
694 }
695 #[doc = "Bits 22:26 - Delay Next Conversion Start If CONVSTARTDELAYEN is Set"]
696 #[inline(always)]
697 pub fn convstartdelay(&self) -> CONVSTARTDELAY_R {
698 CONVSTARTDELAY_R::new(((self.bits >> 22) & 0x1f) as u8)
699 }
700 #[doc = "Bit 27 - Enable Delaying Next Conversion Start"]
701 #[inline(always)]
702 pub fn convstartdelayen(&self) -> CONVSTARTDELAYEN_R {
703 CONVSTARTDELAYEN_R::new(((self.bits >> 27) & 1) != 0)
704 }
705 #[doc = "Bits 29:31 - REPDELAY Select for SCAN REP Mode"]
706 #[inline(always)]
707 pub fn repdelay(&self) -> REPDELAY_R {
708 REPDELAY_R::new(((self.bits >> 29) & 7) as u8)
709 }
710}
711impl W {
712 #[doc = "Bits 0:2 - Scan Channel Reference Selection"]
713 #[inline(always)]
714 pub fn vrefsel(&mut self) -> VREFSEL_W {
715 VREFSEL_W::new(self)
716 }
717 #[doc = "Bit 3 - Enable Fixed Scaling on VREF"]
718 #[inline(always)]
719 pub fn vrefattfix(&mut self) -> VREFATTFIX_W {
720 VREFATTFIX_W::new(self)
721 }
722 #[doc = "Bits 4:7 - Code for VREF Attenuation Factor When VREFSEL is 1, 2 or 5"]
723 #[inline(always)]
724 pub fn vrefatt(&mut self) -> VREFATT_W {
725 VREFATT_W::new(self)
726 }
727 #[doc = "Bits 8:11 - Code for VIN Attenuation Factor"]
728 #[inline(always)]
729 pub fn vinatt(&mut self) -> VINATT_W {
730 VINATT_W::new(self)
731 }
732 #[doc = "Bits 12:13 - Scan DV Level Select"]
733 #[inline(always)]
734 pub fn dvl(&mut self) -> DVL_W {
735 DVL_W::new(self)
736 }
737 #[doc = "Bit 14 - Scan FIFO Overflow Action"]
738 #[inline(always)]
739 pub fn fifoofact(&mut self) -> FIFOOFACT_W {
740 FIFOOFACT_W::new(self)
741 }
742 #[doc = "Bit 16 - Scan PRS Trigger Mode"]
743 #[inline(always)]
744 pub fn prsmode(&mut self) -> PRSMODE_W {
745 PRSMODE_W::new(self)
746 }
747 #[doc = "Bits 17:21 - Scan Sequence PRS Trigger Select"]
748 #[inline(always)]
749 pub fn prssel(&mut self) -> PRSSEL_W {
750 PRSSEL_W::new(self)
751 }
752 #[doc = "Bits 22:26 - Delay Next Conversion Start If CONVSTARTDELAYEN is Set"]
753 #[inline(always)]
754 pub fn convstartdelay(&mut self) -> CONVSTARTDELAY_W {
755 CONVSTARTDELAY_W::new(self)
756 }
757 #[doc = "Bit 27 - Enable Delaying Next Conversion Start"]
758 #[inline(always)]
759 pub fn convstartdelayen(&mut self) -> CONVSTARTDELAYEN_W {
760 CONVSTARTDELAYEN_W::new(self)
761 }
762 #[doc = "Bits 29:31 - REPDELAY Select for SCAN REP Mode"]
763 #[inline(always)]
764 pub fn repdelay(&mut self) -> REPDELAY_W {
765 REPDELAY_W::new(self)
766 }
767 #[doc = "Writes raw bits to the register."]
768 #[inline(always)]
769 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
770 self.0.bits(bits);
771 self
772 }
773}
774#[doc = "Scan Control Register Continued\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 [scanctrlx](index.html) module"]
775pub struct SCANCTRLX_SPEC;
776impl crate::RegisterSpec for SCANCTRLX_SPEC {
777 type Ux = u32;
778}
779#[doc = "`read()` method returns [scanctrlx::R](R) reader structure"]
780impl crate::Readable for SCANCTRLX_SPEC {
781 type Reader = R;
782}
783#[doc = "`write(|w| ..)` method takes [scanctrlx::W](W) writer structure"]
784impl crate::Writable for SCANCTRLX_SPEC {
785 type Writer = W;
786}
787#[doc = "`reset()` method sets SCANCTRLX to value 0"]
788impl crate::Resettable for SCANCTRLX_SPEC {
789 #[inline(always)]
790 fn reset_value() -> Self::Ux {
791 0
792 }
793}