1#[doc = "Register `CONFIG` reader"]
2pub struct R(crate::R<CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CONFIG` writer"]
17pub struct W(crate::W<CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CONFIG_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<CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RESP` reader - Positive channel resistor control"]
38pub type RESP_R = crate::FieldReader<u8, RESP_A>;
39#[doc = "Positive channel resistor control\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41#[repr(u8)]
42pub enum RESP_A {
43 #[doc = "0: Bypass resistor ladder"]
44 BYPASS = 0,
45 #[doc = "1: Pull-down to GND"]
46 PULLDOWN = 1,
47 #[doc = "2: Pull-up to VDD"]
48 PULLUP = 2,
49 #[doc = "3: Set input at VDD/2"]
50 VDD1_2 = 3,
51}
52impl From<RESP_A> for u8 {
53 #[inline(always)]
54 fn from(variant: RESP_A) -> Self {
55 variant as _
56 }
57}
58impl RESP_R {
59 #[doc = "Get enumerated values variant"]
60 #[inline(always)]
61 pub fn variant(&self) -> RESP_A {
62 match self.bits {
63 0 => RESP_A::BYPASS,
64 1 => RESP_A::PULLDOWN,
65 2 => RESP_A::PULLUP,
66 3 => RESP_A::VDD1_2,
67 _ => unreachable!(),
68 }
69 }
70 #[doc = "Checks if the value of the field is `BYPASS`"]
71 #[inline(always)]
72 pub fn is_bypass(&self) -> bool {
73 *self == RESP_A::BYPASS
74 }
75 #[doc = "Checks if the value of the field is `PULLDOWN`"]
76 #[inline(always)]
77 pub fn is_pulldown(&self) -> bool {
78 *self == RESP_A::PULLDOWN
79 }
80 #[doc = "Checks if the value of the field is `PULLUP`"]
81 #[inline(always)]
82 pub fn is_pullup(&self) -> bool {
83 *self == RESP_A::PULLUP
84 }
85 #[doc = "Checks if the value of the field is `VDD1_2`"]
86 #[inline(always)]
87 pub fn is_vdd1_2(&self) -> bool {
88 *self == RESP_A::VDD1_2
89 }
90}
91#[doc = "Field `RESP` writer - Positive channel resistor control"]
92pub type RESP_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, RESP_A, 2, O>;
93impl<'a, const O: u8> RESP_W<'a, O> {
94 #[doc = "Bypass resistor ladder"]
95 #[inline(always)]
96 pub fn bypass(self) -> &'a mut W {
97 self.variant(RESP_A::BYPASS)
98 }
99 #[doc = "Pull-down to GND"]
100 #[inline(always)]
101 pub fn pulldown(self) -> &'a mut W {
102 self.variant(RESP_A::PULLDOWN)
103 }
104 #[doc = "Pull-up to VDD"]
105 #[inline(always)]
106 pub fn pullup(self) -> &'a mut W {
107 self.variant(RESP_A::PULLUP)
108 }
109 #[doc = "Set input at VDD/2"]
110 #[inline(always)]
111 pub fn vdd1_2(self) -> &'a mut W {
112 self.variant(RESP_A::VDD1_2)
113 }
114}
115#[doc = "Field `RESN` reader - Negative channel resistor control"]
116pub type RESN_R = crate::FieldReader<u8, RESN_A>;
117#[doc = "Negative channel resistor control\n\nValue on reset: 0"]
118#[derive(Clone, Copy, Debug, PartialEq)]
119#[repr(u8)]
120pub enum RESN_A {
121 #[doc = "0: Bypass resistor ladder"]
122 BYPASS = 0,
123 #[doc = "1: Pull-down to GND"]
124 PULLDOWN = 1,
125 #[doc = "2: Pull-up to VDD"]
126 PULLUP = 2,
127 #[doc = "3: Set input at VDD/2"]
128 VDD1_2 = 3,
129}
130impl From<RESN_A> for u8 {
131 #[inline(always)]
132 fn from(variant: RESN_A) -> Self {
133 variant as _
134 }
135}
136impl RESN_R {
137 #[doc = "Get enumerated values variant"]
138 #[inline(always)]
139 pub fn variant(&self) -> RESN_A {
140 match self.bits {
141 0 => RESN_A::BYPASS,
142 1 => RESN_A::PULLDOWN,
143 2 => RESN_A::PULLUP,
144 3 => RESN_A::VDD1_2,
145 _ => unreachable!(),
146 }
147 }
148 #[doc = "Checks if the value of the field is `BYPASS`"]
149 #[inline(always)]
150 pub fn is_bypass(&self) -> bool {
151 *self == RESN_A::BYPASS
152 }
153 #[doc = "Checks if the value of the field is `PULLDOWN`"]
154 #[inline(always)]
155 pub fn is_pulldown(&self) -> bool {
156 *self == RESN_A::PULLDOWN
157 }
158 #[doc = "Checks if the value of the field is `PULLUP`"]
159 #[inline(always)]
160 pub fn is_pullup(&self) -> bool {
161 *self == RESN_A::PULLUP
162 }
163 #[doc = "Checks if the value of the field is `VDD1_2`"]
164 #[inline(always)]
165 pub fn is_vdd1_2(&self) -> bool {
166 *self == RESN_A::VDD1_2
167 }
168}
169#[doc = "Field `RESN` writer - Negative channel resistor control"]
170pub type RESN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, RESN_A, 2, O>;
171impl<'a, const O: u8> RESN_W<'a, O> {
172 #[doc = "Bypass resistor ladder"]
173 #[inline(always)]
174 pub fn bypass(self) -> &'a mut W {
175 self.variant(RESN_A::BYPASS)
176 }
177 #[doc = "Pull-down to GND"]
178 #[inline(always)]
179 pub fn pulldown(self) -> &'a mut W {
180 self.variant(RESN_A::PULLDOWN)
181 }
182 #[doc = "Pull-up to VDD"]
183 #[inline(always)]
184 pub fn pullup(self) -> &'a mut W {
185 self.variant(RESN_A::PULLUP)
186 }
187 #[doc = "Set input at VDD/2"]
188 #[inline(always)]
189 pub fn vdd1_2(self) -> &'a mut W {
190 self.variant(RESN_A::VDD1_2)
191 }
192}
193#[doc = "Field `GAIN` reader - Gain control"]
194pub type GAIN_R = crate::FieldReader<u8, GAIN_A>;
195#[doc = "Gain control\n\nValue on reset: 0"]
196#[derive(Clone, Copy, Debug, PartialEq)]
197#[repr(u8)]
198pub enum GAIN_A {
199 #[doc = "0: 1/6"]
200 GAIN1_6 = 0,
201 #[doc = "1: 1/5"]
202 GAIN1_5 = 1,
203 #[doc = "2: 1/4"]
204 GAIN1_4 = 2,
205 #[doc = "3: 1/3"]
206 GAIN1_3 = 3,
207 #[doc = "4: 1/2"]
208 GAIN1_2 = 4,
209 #[doc = "5: 1"]
210 GAIN1 = 5,
211 #[doc = "6: 2"]
212 GAIN2 = 6,
213 #[doc = "7: 4"]
214 GAIN4 = 7,
215}
216impl From<GAIN_A> for u8 {
217 #[inline(always)]
218 fn from(variant: GAIN_A) -> Self {
219 variant as _
220 }
221}
222impl GAIN_R {
223 #[doc = "Get enumerated values variant"]
224 #[inline(always)]
225 pub fn variant(&self) -> GAIN_A {
226 match self.bits {
227 0 => GAIN_A::GAIN1_6,
228 1 => GAIN_A::GAIN1_5,
229 2 => GAIN_A::GAIN1_4,
230 3 => GAIN_A::GAIN1_3,
231 4 => GAIN_A::GAIN1_2,
232 5 => GAIN_A::GAIN1,
233 6 => GAIN_A::GAIN2,
234 7 => GAIN_A::GAIN4,
235 _ => unreachable!(),
236 }
237 }
238 #[doc = "Checks if the value of the field is `GAIN1_6`"]
239 #[inline(always)]
240 pub fn is_gain1_6(&self) -> bool {
241 *self == GAIN_A::GAIN1_6
242 }
243 #[doc = "Checks if the value of the field is `GAIN1_5`"]
244 #[inline(always)]
245 pub fn is_gain1_5(&self) -> bool {
246 *self == GAIN_A::GAIN1_5
247 }
248 #[doc = "Checks if the value of the field is `GAIN1_4`"]
249 #[inline(always)]
250 pub fn is_gain1_4(&self) -> bool {
251 *self == GAIN_A::GAIN1_4
252 }
253 #[doc = "Checks if the value of the field is `GAIN1_3`"]
254 #[inline(always)]
255 pub fn is_gain1_3(&self) -> bool {
256 *self == GAIN_A::GAIN1_3
257 }
258 #[doc = "Checks if the value of the field is `GAIN1_2`"]
259 #[inline(always)]
260 pub fn is_gain1_2(&self) -> bool {
261 *self == GAIN_A::GAIN1_2
262 }
263 #[doc = "Checks if the value of the field is `GAIN1`"]
264 #[inline(always)]
265 pub fn is_gain1(&self) -> bool {
266 *self == GAIN_A::GAIN1
267 }
268 #[doc = "Checks if the value of the field is `GAIN2`"]
269 #[inline(always)]
270 pub fn is_gain2(&self) -> bool {
271 *self == GAIN_A::GAIN2
272 }
273 #[doc = "Checks if the value of the field is `GAIN4`"]
274 #[inline(always)]
275 pub fn is_gain4(&self) -> bool {
276 *self == GAIN_A::GAIN4
277 }
278}
279#[doc = "Field `GAIN` writer - Gain control"]
280pub type GAIN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, GAIN_A, 3, O>;
281impl<'a, const O: u8> GAIN_W<'a, O> {
282 #[doc = "1/6"]
283 #[inline(always)]
284 pub fn gain1_6(self) -> &'a mut W {
285 self.variant(GAIN_A::GAIN1_6)
286 }
287 #[doc = "1/5"]
288 #[inline(always)]
289 pub fn gain1_5(self) -> &'a mut W {
290 self.variant(GAIN_A::GAIN1_5)
291 }
292 #[doc = "1/4"]
293 #[inline(always)]
294 pub fn gain1_4(self) -> &'a mut W {
295 self.variant(GAIN_A::GAIN1_4)
296 }
297 #[doc = "1/3"]
298 #[inline(always)]
299 pub fn gain1_3(self) -> &'a mut W {
300 self.variant(GAIN_A::GAIN1_3)
301 }
302 #[doc = "1/2"]
303 #[inline(always)]
304 pub fn gain1_2(self) -> &'a mut W {
305 self.variant(GAIN_A::GAIN1_2)
306 }
307 #[doc = "1"]
308 #[inline(always)]
309 pub fn gain1(self) -> &'a mut W {
310 self.variant(GAIN_A::GAIN1)
311 }
312 #[doc = "2"]
313 #[inline(always)]
314 pub fn gain2(self) -> &'a mut W {
315 self.variant(GAIN_A::GAIN2)
316 }
317 #[doc = "4"]
318 #[inline(always)]
319 pub fn gain4(self) -> &'a mut W {
320 self.variant(GAIN_A::GAIN4)
321 }
322}
323#[doc = "Field `REFSEL` reader - Reference control"]
324pub type REFSEL_R = crate::BitReader<REFSEL_A>;
325#[doc = "Reference control\n\nValue on reset: 0"]
326#[derive(Clone, Copy, Debug, PartialEq)]
327pub enum REFSEL_A {
328 #[doc = "0: Internal reference (0.6 V)"]
329 INTERNAL = 0,
330 #[doc = "1: VDD/4 as reference"]
331 VDD1_4 = 1,
332}
333impl From<REFSEL_A> for bool {
334 #[inline(always)]
335 fn from(variant: REFSEL_A) -> Self {
336 variant as u8 != 0
337 }
338}
339impl REFSEL_R {
340 #[doc = "Get enumerated values variant"]
341 #[inline(always)]
342 pub fn variant(&self) -> REFSEL_A {
343 match self.bits {
344 false => REFSEL_A::INTERNAL,
345 true => REFSEL_A::VDD1_4,
346 }
347 }
348 #[doc = "Checks if the value of the field is `INTERNAL`"]
349 #[inline(always)]
350 pub fn is_internal(&self) -> bool {
351 *self == REFSEL_A::INTERNAL
352 }
353 #[doc = "Checks if the value of the field is `VDD1_4`"]
354 #[inline(always)]
355 pub fn is_vdd1_4(&self) -> bool {
356 *self == REFSEL_A::VDD1_4
357 }
358}
359#[doc = "Field `REFSEL` writer - Reference control"]
360pub type REFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, REFSEL_A, O>;
361impl<'a, const O: u8> REFSEL_W<'a, O> {
362 #[doc = "Internal reference (0.6 V)"]
363 #[inline(always)]
364 pub fn internal(self) -> &'a mut W {
365 self.variant(REFSEL_A::INTERNAL)
366 }
367 #[doc = "VDD/4 as reference"]
368 #[inline(always)]
369 pub fn vdd1_4(self) -> &'a mut W {
370 self.variant(REFSEL_A::VDD1_4)
371 }
372}
373#[doc = "Field `TACQ` reader - Acquisition time, the time the SAADC uses to sample the input voltage"]
374pub type TACQ_R = crate::FieldReader<u8, TACQ_A>;
375#[doc = "Acquisition time, the time the SAADC uses to sample the input voltage\n\nValue on reset: 2"]
376#[derive(Clone, Copy, Debug, PartialEq)]
377#[repr(u8)]
378pub enum TACQ_A {
379 #[doc = "0: 3 us"]
380 _3US = 0,
381 #[doc = "1: 5 us"]
382 _5US = 1,
383 #[doc = "2: 10 us"]
384 _10US = 2,
385 #[doc = "3: 15 us"]
386 _15US = 3,
387 #[doc = "4: 20 us"]
388 _20US = 4,
389 #[doc = "5: 40 us"]
390 _40US = 5,
391}
392impl From<TACQ_A> for u8 {
393 #[inline(always)]
394 fn from(variant: TACQ_A) -> Self {
395 variant as _
396 }
397}
398impl TACQ_R {
399 #[doc = "Get enumerated values variant"]
400 #[inline(always)]
401 pub fn variant(&self) -> Option<TACQ_A> {
402 match self.bits {
403 0 => Some(TACQ_A::_3US),
404 1 => Some(TACQ_A::_5US),
405 2 => Some(TACQ_A::_10US),
406 3 => Some(TACQ_A::_15US),
407 4 => Some(TACQ_A::_20US),
408 5 => Some(TACQ_A::_40US),
409 _ => None,
410 }
411 }
412 #[doc = "Checks if the value of the field is `_3US`"]
413 #[inline(always)]
414 pub fn is_3us(&self) -> bool {
415 *self == TACQ_A::_3US
416 }
417 #[doc = "Checks if the value of the field is `_5US`"]
418 #[inline(always)]
419 pub fn is_5us(&self) -> bool {
420 *self == TACQ_A::_5US
421 }
422 #[doc = "Checks if the value of the field is `_10US`"]
423 #[inline(always)]
424 pub fn is_10us(&self) -> bool {
425 *self == TACQ_A::_10US
426 }
427 #[doc = "Checks if the value of the field is `_15US`"]
428 #[inline(always)]
429 pub fn is_15us(&self) -> bool {
430 *self == TACQ_A::_15US
431 }
432 #[doc = "Checks if the value of the field is `_20US`"]
433 #[inline(always)]
434 pub fn is_20us(&self) -> bool {
435 *self == TACQ_A::_20US
436 }
437 #[doc = "Checks if the value of the field is `_40US`"]
438 #[inline(always)]
439 pub fn is_40us(&self) -> bool {
440 *self == TACQ_A::_40US
441 }
442}
443#[doc = "Field `TACQ` writer - Acquisition time, the time the SAADC uses to sample the input voltage"]
444pub type TACQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CONFIG_SPEC, u8, TACQ_A, 3, O>;
445impl<'a, const O: u8> TACQ_W<'a, O> {
446 #[doc = "3 us"]
447 #[inline(always)]
448 pub fn _3us(self) -> &'a mut W {
449 self.variant(TACQ_A::_3US)
450 }
451 #[doc = "5 us"]
452 #[inline(always)]
453 pub fn _5us(self) -> &'a mut W {
454 self.variant(TACQ_A::_5US)
455 }
456 #[doc = "10 us"]
457 #[inline(always)]
458 pub fn _10us(self) -> &'a mut W {
459 self.variant(TACQ_A::_10US)
460 }
461 #[doc = "15 us"]
462 #[inline(always)]
463 pub fn _15us(self) -> &'a mut W {
464 self.variant(TACQ_A::_15US)
465 }
466 #[doc = "20 us"]
467 #[inline(always)]
468 pub fn _20us(self) -> &'a mut W {
469 self.variant(TACQ_A::_20US)
470 }
471 #[doc = "40 us"]
472 #[inline(always)]
473 pub fn _40us(self) -> &'a mut W {
474 self.variant(TACQ_A::_40US)
475 }
476}
477#[doc = "Field `MODE` reader - Enable differential mode"]
478pub type MODE_R = crate::BitReader<MODE_A>;
479#[doc = "Enable differential mode\n\nValue on reset: 0"]
480#[derive(Clone, Copy, Debug, PartialEq)]
481pub enum MODE_A {
482 #[doc = "0: Single-ended, PSELN will be ignored, negative input to SAADC shorted to GND"]
483 SE = 0,
484 #[doc = "1: Differential"]
485 DIFF = 1,
486}
487impl From<MODE_A> for bool {
488 #[inline(always)]
489 fn from(variant: MODE_A) -> Self {
490 variant as u8 != 0
491 }
492}
493impl MODE_R {
494 #[doc = "Get enumerated values variant"]
495 #[inline(always)]
496 pub fn variant(&self) -> MODE_A {
497 match self.bits {
498 false => MODE_A::SE,
499 true => MODE_A::DIFF,
500 }
501 }
502 #[doc = "Checks if the value of the field is `SE`"]
503 #[inline(always)]
504 pub fn is_se(&self) -> bool {
505 *self == MODE_A::SE
506 }
507 #[doc = "Checks if the value of the field is `DIFF`"]
508 #[inline(always)]
509 pub fn is_diff(&self) -> bool {
510 *self == MODE_A::DIFF
511 }
512}
513#[doc = "Field `MODE` writer - Enable differential mode"]
514pub type MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, MODE_A, O>;
515impl<'a, const O: u8> MODE_W<'a, O> {
516 #[doc = "Single-ended, PSELN will be ignored, negative input to SAADC shorted to GND"]
517 #[inline(always)]
518 pub fn se(self) -> &'a mut W {
519 self.variant(MODE_A::SE)
520 }
521 #[doc = "Differential"]
522 #[inline(always)]
523 pub fn diff(self) -> &'a mut W {
524 self.variant(MODE_A::DIFF)
525 }
526}
527#[doc = "Field `BURST` reader - Enable burst mode"]
528pub type BURST_R = crate::BitReader<BURST_A>;
529#[doc = "Enable burst mode\n\nValue on reset: 0"]
530#[derive(Clone, Copy, Debug, PartialEq)]
531pub enum BURST_A {
532 #[doc = "0: Burst mode is disabled (normal operation)"]
533 DISABLED = 0,
534 #[doc = "1: Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."]
535 ENABLED = 1,
536}
537impl From<BURST_A> for bool {
538 #[inline(always)]
539 fn from(variant: BURST_A) -> Self {
540 variant as u8 != 0
541 }
542}
543impl BURST_R {
544 #[doc = "Get enumerated values variant"]
545 #[inline(always)]
546 pub fn variant(&self) -> BURST_A {
547 match self.bits {
548 false => BURST_A::DISABLED,
549 true => BURST_A::ENABLED,
550 }
551 }
552 #[doc = "Checks if the value of the field is `DISABLED`"]
553 #[inline(always)]
554 pub fn is_disabled(&self) -> bool {
555 *self == BURST_A::DISABLED
556 }
557 #[doc = "Checks if the value of the field is `ENABLED`"]
558 #[inline(always)]
559 pub fn is_enabled(&self) -> bool {
560 *self == BURST_A::ENABLED
561 }
562}
563#[doc = "Field `BURST` writer - Enable burst mode"]
564pub type BURST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, BURST_A, O>;
565impl<'a, const O: u8> BURST_W<'a, O> {
566 #[doc = "Burst mode is disabled (normal operation)"]
567 #[inline(always)]
568 pub fn disabled(self) -> &'a mut W {
569 self.variant(BURST_A::DISABLED)
570 }
571 #[doc = "Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."]
572 #[inline(always)]
573 pub fn enabled(self) -> &'a mut W {
574 self.variant(BURST_A::ENABLED)
575 }
576}
577impl R {
578 #[doc = "Bits 0:1 - Positive channel resistor control"]
579 #[inline(always)]
580 pub fn resp(&self) -> RESP_R {
581 RESP_R::new((self.bits & 3) as u8)
582 }
583 #[doc = "Bits 4:5 - Negative channel resistor control"]
584 #[inline(always)]
585 pub fn resn(&self) -> RESN_R {
586 RESN_R::new(((self.bits >> 4) & 3) as u8)
587 }
588 #[doc = "Bits 8:10 - Gain control"]
589 #[inline(always)]
590 pub fn gain(&self) -> GAIN_R {
591 GAIN_R::new(((self.bits >> 8) & 7) as u8)
592 }
593 #[doc = "Bit 12 - Reference control"]
594 #[inline(always)]
595 pub fn refsel(&self) -> REFSEL_R {
596 REFSEL_R::new(((self.bits >> 12) & 1) != 0)
597 }
598 #[doc = "Bits 16:18 - Acquisition time, the time the SAADC uses to sample the input voltage"]
599 #[inline(always)]
600 pub fn tacq(&self) -> TACQ_R {
601 TACQ_R::new(((self.bits >> 16) & 7) as u8)
602 }
603 #[doc = "Bit 20 - Enable differential mode"]
604 #[inline(always)]
605 pub fn mode(&self) -> MODE_R {
606 MODE_R::new(((self.bits >> 20) & 1) != 0)
607 }
608 #[doc = "Bit 24 - Enable burst mode"]
609 #[inline(always)]
610 pub fn burst(&self) -> BURST_R {
611 BURST_R::new(((self.bits >> 24) & 1) != 0)
612 }
613}
614impl W {
615 #[doc = "Bits 0:1 - Positive channel resistor control"]
616 #[inline(always)]
617 pub fn resp(&mut self) -> RESP_W<0> {
618 RESP_W::new(self)
619 }
620 #[doc = "Bits 4:5 - Negative channel resistor control"]
621 #[inline(always)]
622 pub fn resn(&mut self) -> RESN_W<4> {
623 RESN_W::new(self)
624 }
625 #[doc = "Bits 8:10 - Gain control"]
626 #[inline(always)]
627 pub fn gain(&mut self) -> GAIN_W<8> {
628 GAIN_W::new(self)
629 }
630 #[doc = "Bit 12 - Reference control"]
631 #[inline(always)]
632 pub fn refsel(&mut self) -> REFSEL_W<12> {
633 REFSEL_W::new(self)
634 }
635 #[doc = "Bits 16:18 - Acquisition time, the time the SAADC uses to sample the input voltage"]
636 #[inline(always)]
637 pub fn tacq(&mut self) -> TACQ_W<16> {
638 TACQ_W::new(self)
639 }
640 #[doc = "Bit 20 - Enable differential mode"]
641 #[inline(always)]
642 pub fn mode(&mut self) -> MODE_W<20> {
643 MODE_W::new(self)
644 }
645 #[doc = "Bit 24 - Enable burst mode"]
646 #[inline(always)]
647 pub fn burst(&mut self) -> BURST_W<24> {
648 BURST_W::new(self)
649 }
650 #[doc = "Writes raw bits to the register."]
651 #[inline(always)]
652 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
653 self.0.bits(bits);
654 self
655 }
656}
657#[doc = "Description cluster\\[n\\]: Input configuration for CH\\[n\\]\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 [config](index.html) module"]
658pub struct CONFIG_SPEC;
659impl crate::RegisterSpec for CONFIG_SPEC {
660 type Ux = u32;
661}
662#[doc = "`read()` method returns [config::R](R) reader structure"]
663impl crate::Readable for CONFIG_SPEC {
664 type Reader = R;
665}
666#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"]
667impl crate::Writable for CONFIG_SPEC {
668 type Writer = W;
669}
670#[doc = "`reset()` method sets CONFIG to value 0x0002_0000"]
671impl crate::Resettable for CONFIG_SPEC {
672 #[inline(always)]
673 fn reset_value() -> Self::Ux {
674 0x0002_0000
675 }
676}