efm32gg12b330_pac/adc1/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL_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<CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Warm-up Mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum WARMUPMODE_A {
41    #[doc = "0: ADC is shut down after each conversion. 5us warmup time is used before each conversion."]
42    NORMAL = 0,
43    #[doc = "1: ADC is kept in standby mode between conversions. 1us warmup time is used before each conversion."]
44    KEEPINSTANDBY = 1,
45    #[doc = "2: ADC is kept in slow acquisition mode between conversions. 1us warmup time is used before each conversion."]
46    KEEPINSLOWACC = 2,
47    #[doc = "3: ADC is kept on after conversions, allowing for continuous conversion."]
48    KEEPADCWARM = 3,
49}
50impl From<WARMUPMODE_A> for u8 {
51    #[inline(always)]
52    fn from(variant: WARMUPMODE_A) -> Self {
53        variant as _
54    }
55}
56#[doc = "Field `WARMUPMODE` reader - Warm-up Mode"]
57pub type WARMUPMODE_R = crate::FieldReader<u8, WARMUPMODE_A>;
58impl WARMUPMODE_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> WARMUPMODE_A {
62        match self.bits {
63            0 => WARMUPMODE_A::NORMAL,
64            1 => WARMUPMODE_A::KEEPINSTANDBY,
65            2 => WARMUPMODE_A::KEEPINSLOWACC,
66            3 => WARMUPMODE_A::KEEPADCWARM,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `NORMAL`"]
71    #[inline(always)]
72    pub fn is_normal(&self) -> bool {
73        *self == WARMUPMODE_A::NORMAL
74    }
75    #[doc = "Checks if the value of the field is `KEEPINSTANDBY`"]
76    #[inline(always)]
77    pub fn is_keepinstandby(&self) -> bool {
78        *self == WARMUPMODE_A::KEEPINSTANDBY
79    }
80    #[doc = "Checks if the value of the field is `KEEPINSLOWACC`"]
81    #[inline(always)]
82    pub fn is_keepinslowacc(&self) -> bool {
83        *self == WARMUPMODE_A::KEEPINSLOWACC
84    }
85    #[doc = "Checks if the value of the field is `KEEPADCWARM`"]
86    #[inline(always)]
87    pub fn is_keepadcwarm(&self) -> bool {
88        *self == WARMUPMODE_A::KEEPADCWARM
89    }
90}
91#[doc = "Field `WARMUPMODE` writer - Warm-up Mode"]
92pub type WARMUPMODE_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, WARMUPMODE_A, 2, 0>;
93impl<'a> WARMUPMODE_W<'a> {
94    #[doc = "ADC is shut down after each conversion. 5us warmup time is used before each conversion."]
95    #[inline(always)]
96    pub fn normal(self) -> &'a mut W {
97        self.variant(WARMUPMODE_A::NORMAL)
98    }
99    #[doc = "ADC is kept in standby mode between conversions. 1us warmup time is used before each conversion."]
100    #[inline(always)]
101    pub fn keepinstandby(self) -> &'a mut W {
102        self.variant(WARMUPMODE_A::KEEPINSTANDBY)
103    }
104    #[doc = "ADC is kept in slow acquisition mode between conversions. 1us warmup time is used before each conversion."]
105    #[inline(always)]
106    pub fn keepinslowacc(self) -> &'a mut W {
107        self.variant(WARMUPMODE_A::KEEPINSLOWACC)
108    }
109    #[doc = "ADC is kept on after conversions, allowing for continuous conversion."]
110    #[inline(always)]
111    pub fn keepadcwarm(self) -> &'a mut W {
112        self.variant(WARMUPMODE_A::KEEPADCWARM)
113    }
114}
115#[doc = "Field `SINGLEDMAWU` reader - SINGLEFIFO DMA Wakeup"]
116pub type SINGLEDMAWU_R = crate::BitReader<bool>;
117#[doc = "Field `SINGLEDMAWU` writer - SINGLEFIFO DMA Wakeup"]
118pub type SINGLEDMAWU_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 2>;
119#[doc = "Field `SCANDMAWU` reader - SCANFIFO DMA Wakeup"]
120pub type SCANDMAWU_R = crate::BitReader<bool>;
121#[doc = "Field `SCANDMAWU` writer - SCANFIFO DMA Wakeup"]
122pub type SCANDMAWU_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 3>;
123#[doc = "Field `TAILGATE` reader - Conversion Tailgating"]
124pub type TAILGATE_R = crate::BitReader<bool>;
125#[doc = "Field `TAILGATE` writer - Conversion Tailgating"]
126pub type TAILGATE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 4>;
127#[doc = "Field `ASYNCCLKEN` reader - Selects ASYNC CLK Enable Mode When ADCCLKMODE=1"]
128pub type ASYNCCLKEN_R = crate::BitReader<bool>;
129#[doc = "Field `ASYNCCLKEN` writer - Selects ASYNC CLK Enable Mode When ADCCLKMODE=1"]
130pub type ASYNCCLKEN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 6>;
131#[doc = "Field `ADCCLKMODE` reader - ADC Clock Mode"]
132pub type ADCCLKMODE_R = crate::BitReader<bool>;
133#[doc = "Field `ADCCLKMODE` writer - ADC Clock Mode"]
134pub type ADCCLKMODE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 7>;
135#[doc = "Prescalar Setting for ADC Sample and Conversion Clock\n\nValue on reset: 0"]
136#[derive(Clone, Copy, Debug, PartialEq)]
137#[repr(u8)]
138pub enum PRESC_A {
139    #[doc = "0: `0`"]
140    NODIVISION = 0,
141}
142impl From<PRESC_A> for u8 {
143    #[inline(always)]
144    fn from(variant: PRESC_A) -> Self {
145        variant as _
146    }
147}
148#[doc = "Field `PRESC` reader - Prescalar Setting for ADC Sample and Conversion Clock"]
149pub type PRESC_R = crate::FieldReader<u8, PRESC_A>;
150impl PRESC_R {
151    #[doc = "Get enumerated values variant"]
152    #[inline(always)]
153    pub fn variant(&self) -> Option<PRESC_A> {
154        match self.bits {
155            0 => Some(PRESC_A::NODIVISION),
156            _ => None,
157        }
158    }
159    #[doc = "Checks if the value of the field is `NODIVISION`"]
160    #[inline(always)]
161    pub fn is_nodivision(&self) -> bool {
162        *self == PRESC_A::NODIVISION
163    }
164}
165#[doc = "Field `PRESC` writer - Prescalar Setting for ADC Sample and Conversion Clock"]
166pub type PRESC_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRESC_A, 7, 8>;
167impl<'a> PRESC_W<'a> {
168    #[doc = "`0`"]
169    #[inline(always)]
170    pub fn nodivision(self) -> &'a mut W {
171        self.variant(PRESC_A::NODIVISION)
172    }
173}
174#[doc = "Field `TIMEBASE` reader - 1us Time Base"]
175pub type TIMEBASE_R = crate::FieldReader<u8, u8>;
176#[doc = "Field `TIMEBASE` writer - 1us Time Base"]
177pub type TIMEBASE_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, u8, 7, 16>;
178#[doc = "Oversample Rate Select\n\nValue on reset: 0"]
179#[derive(Clone, Copy, Debug, PartialEq)]
180#[repr(u8)]
181pub enum OVSRSEL_A {
182    #[doc = "0: 2 samples for each conversion result"]
183    X2 = 0,
184    #[doc = "1: 4 samples for each conversion result"]
185    X4 = 1,
186    #[doc = "2: 8 samples for each conversion result"]
187    X8 = 2,
188    #[doc = "3: 16 samples for each conversion result"]
189    X16 = 3,
190    #[doc = "4: 32 samples for each conversion result"]
191    X32 = 4,
192    #[doc = "5: 64 samples for each conversion result"]
193    X64 = 5,
194    #[doc = "6: 128 samples for each conversion result"]
195    X128 = 6,
196    #[doc = "7: 256 samples for each conversion result"]
197    X256 = 7,
198    #[doc = "8: 512 samples for each conversion result"]
199    X512 = 8,
200    #[doc = "9: 1024 samples for each conversion result"]
201    X1024 = 9,
202    #[doc = "10: 2048 samples for each conversion result"]
203    X2048 = 10,
204    #[doc = "11: 4096 samples for each conversion result"]
205    X4096 = 11,
206}
207impl From<OVSRSEL_A> for u8 {
208    #[inline(always)]
209    fn from(variant: OVSRSEL_A) -> Self {
210        variant as _
211    }
212}
213#[doc = "Field `OVSRSEL` reader - Oversample Rate Select"]
214pub type OVSRSEL_R = crate::FieldReader<u8, OVSRSEL_A>;
215impl OVSRSEL_R {
216    #[doc = "Get enumerated values variant"]
217    #[inline(always)]
218    pub fn variant(&self) -> Option<OVSRSEL_A> {
219        match self.bits {
220            0 => Some(OVSRSEL_A::X2),
221            1 => Some(OVSRSEL_A::X4),
222            2 => Some(OVSRSEL_A::X8),
223            3 => Some(OVSRSEL_A::X16),
224            4 => Some(OVSRSEL_A::X32),
225            5 => Some(OVSRSEL_A::X64),
226            6 => Some(OVSRSEL_A::X128),
227            7 => Some(OVSRSEL_A::X256),
228            8 => Some(OVSRSEL_A::X512),
229            9 => Some(OVSRSEL_A::X1024),
230            10 => Some(OVSRSEL_A::X2048),
231            11 => Some(OVSRSEL_A::X4096),
232            _ => None,
233        }
234    }
235    #[doc = "Checks if the value of the field is `X2`"]
236    #[inline(always)]
237    pub fn is_x2(&self) -> bool {
238        *self == OVSRSEL_A::X2
239    }
240    #[doc = "Checks if the value of the field is `X4`"]
241    #[inline(always)]
242    pub fn is_x4(&self) -> bool {
243        *self == OVSRSEL_A::X4
244    }
245    #[doc = "Checks if the value of the field is `X8`"]
246    #[inline(always)]
247    pub fn is_x8(&self) -> bool {
248        *self == OVSRSEL_A::X8
249    }
250    #[doc = "Checks if the value of the field is `X16`"]
251    #[inline(always)]
252    pub fn is_x16(&self) -> bool {
253        *self == OVSRSEL_A::X16
254    }
255    #[doc = "Checks if the value of the field is `X32`"]
256    #[inline(always)]
257    pub fn is_x32(&self) -> bool {
258        *self == OVSRSEL_A::X32
259    }
260    #[doc = "Checks if the value of the field is `X64`"]
261    #[inline(always)]
262    pub fn is_x64(&self) -> bool {
263        *self == OVSRSEL_A::X64
264    }
265    #[doc = "Checks if the value of the field is `X128`"]
266    #[inline(always)]
267    pub fn is_x128(&self) -> bool {
268        *self == OVSRSEL_A::X128
269    }
270    #[doc = "Checks if the value of the field is `X256`"]
271    #[inline(always)]
272    pub fn is_x256(&self) -> bool {
273        *self == OVSRSEL_A::X256
274    }
275    #[doc = "Checks if the value of the field is `X512`"]
276    #[inline(always)]
277    pub fn is_x512(&self) -> bool {
278        *self == OVSRSEL_A::X512
279    }
280    #[doc = "Checks if the value of the field is `X1024`"]
281    #[inline(always)]
282    pub fn is_x1024(&self) -> bool {
283        *self == OVSRSEL_A::X1024
284    }
285    #[doc = "Checks if the value of the field is `X2048`"]
286    #[inline(always)]
287    pub fn is_x2048(&self) -> bool {
288        *self == OVSRSEL_A::X2048
289    }
290    #[doc = "Checks if the value of the field is `X4096`"]
291    #[inline(always)]
292    pub fn is_x4096(&self) -> bool {
293        *self == OVSRSEL_A::X4096
294    }
295}
296#[doc = "Field `OVSRSEL` writer - Oversample Rate Select"]
297pub type OVSRSEL_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, OVSRSEL_A, 4, 24>;
298impl<'a> OVSRSEL_W<'a> {
299    #[doc = "2 samples for each conversion result"]
300    #[inline(always)]
301    pub fn x2(self) -> &'a mut W {
302        self.variant(OVSRSEL_A::X2)
303    }
304    #[doc = "4 samples for each conversion result"]
305    #[inline(always)]
306    pub fn x4(self) -> &'a mut W {
307        self.variant(OVSRSEL_A::X4)
308    }
309    #[doc = "8 samples for each conversion result"]
310    #[inline(always)]
311    pub fn x8(self) -> &'a mut W {
312        self.variant(OVSRSEL_A::X8)
313    }
314    #[doc = "16 samples for each conversion result"]
315    #[inline(always)]
316    pub fn x16(self) -> &'a mut W {
317        self.variant(OVSRSEL_A::X16)
318    }
319    #[doc = "32 samples for each conversion result"]
320    #[inline(always)]
321    pub fn x32(self) -> &'a mut W {
322        self.variant(OVSRSEL_A::X32)
323    }
324    #[doc = "64 samples for each conversion result"]
325    #[inline(always)]
326    pub fn x64(self) -> &'a mut W {
327        self.variant(OVSRSEL_A::X64)
328    }
329    #[doc = "128 samples for each conversion result"]
330    #[inline(always)]
331    pub fn x128(self) -> &'a mut W {
332        self.variant(OVSRSEL_A::X128)
333    }
334    #[doc = "256 samples for each conversion result"]
335    #[inline(always)]
336    pub fn x256(self) -> &'a mut W {
337        self.variant(OVSRSEL_A::X256)
338    }
339    #[doc = "512 samples for each conversion result"]
340    #[inline(always)]
341    pub fn x512(self) -> &'a mut W {
342        self.variant(OVSRSEL_A::X512)
343    }
344    #[doc = "1024 samples for each conversion result"]
345    #[inline(always)]
346    pub fn x1024(self) -> &'a mut W {
347        self.variant(OVSRSEL_A::X1024)
348    }
349    #[doc = "2048 samples for each conversion result"]
350    #[inline(always)]
351    pub fn x2048(self) -> &'a mut W {
352        self.variant(OVSRSEL_A::X2048)
353    }
354    #[doc = "4096 samples for each conversion result"]
355    #[inline(always)]
356    pub fn x4096(self) -> &'a mut W {
357        self.variant(OVSRSEL_A::X4096)
358    }
359}
360#[doc = "Field `DBGHALT` reader - Debug Mode Halt Enable"]
361pub type DBGHALT_R = crate::BitReader<bool>;
362#[doc = "Field `DBGHALT` writer - Debug Mode Halt Enable"]
363pub type DBGHALT_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 28>;
364#[doc = "Field `CHCONMODE` reader - Channel Connect"]
365pub type CHCONMODE_R = crate::BitReader<bool>;
366#[doc = "Field `CHCONMODE` writer - Channel Connect"]
367pub type CHCONMODE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 29>;
368#[doc = "Channel Connect and Reference Warm Sel When ADC is IDLE\n\nValue on reset: 0"]
369#[derive(Clone, Copy, Debug, PartialEq)]
370#[repr(u8)]
371pub enum CHCONREFWARMIDLE_A {
372    #[doc = "0: Keep scan reference warm and APORT switches for first scan channel closed if WARMUPMODE is not NORMAL"]
373    PREFSCAN = 0,
374    #[doc = "1: Keep single reference warm and keep APORT switches for single channel closed if WARMUPMODE is not NORMAL"]
375    PREFSINGLE = 1,
376    #[doc = "2: Keep last used reference warm and keep APORT switches for corresponding channel closed if WARMUPMODE is not NORMAL"]
377    KEEPPREV = 2,
378}
379impl From<CHCONREFWARMIDLE_A> for u8 {
380    #[inline(always)]
381    fn from(variant: CHCONREFWARMIDLE_A) -> Self {
382        variant as _
383    }
384}
385#[doc = "Field `CHCONREFWARMIDLE` reader - Channel Connect and Reference Warm Sel When ADC is IDLE"]
386pub type CHCONREFWARMIDLE_R = crate::FieldReader<u8, CHCONREFWARMIDLE_A>;
387impl CHCONREFWARMIDLE_R {
388    #[doc = "Get enumerated values variant"]
389    #[inline(always)]
390    pub fn variant(&self) -> Option<CHCONREFWARMIDLE_A> {
391        match self.bits {
392            0 => Some(CHCONREFWARMIDLE_A::PREFSCAN),
393            1 => Some(CHCONREFWARMIDLE_A::PREFSINGLE),
394            2 => Some(CHCONREFWARMIDLE_A::KEEPPREV),
395            _ => None,
396        }
397    }
398    #[doc = "Checks if the value of the field is `PREFSCAN`"]
399    #[inline(always)]
400    pub fn is_prefscan(&self) -> bool {
401        *self == CHCONREFWARMIDLE_A::PREFSCAN
402    }
403    #[doc = "Checks if the value of the field is `PREFSINGLE`"]
404    #[inline(always)]
405    pub fn is_prefsingle(&self) -> bool {
406        *self == CHCONREFWARMIDLE_A::PREFSINGLE
407    }
408    #[doc = "Checks if the value of the field is `KEEPPREV`"]
409    #[inline(always)]
410    pub fn is_keepprev(&self) -> bool {
411        *self == CHCONREFWARMIDLE_A::KEEPPREV
412    }
413}
414#[doc = "Field `CHCONREFWARMIDLE` writer - Channel Connect and Reference Warm Sel When ADC is IDLE"]
415pub type CHCONREFWARMIDLE_W<'a> =
416    crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CHCONREFWARMIDLE_A, 2, 30>;
417impl<'a> CHCONREFWARMIDLE_W<'a> {
418    #[doc = "Keep scan reference warm and APORT switches for first scan channel closed if WARMUPMODE is not NORMAL"]
419    #[inline(always)]
420    pub fn prefscan(self) -> &'a mut W {
421        self.variant(CHCONREFWARMIDLE_A::PREFSCAN)
422    }
423    #[doc = "Keep single reference warm and keep APORT switches for single channel closed if WARMUPMODE is not NORMAL"]
424    #[inline(always)]
425    pub fn prefsingle(self) -> &'a mut W {
426        self.variant(CHCONREFWARMIDLE_A::PREFSINGLE)
427    }
428    #[doc = "Keep last used reference warm and keep APORT switches for corresponding channel closed if WARMUPMODE is not NORMAL"]
429    #[inline(always)]
430    pub fn keepprev(self) -> &'a mut W {
431        self.variant(CHCONREFWARMIDLE_A::KEEPPREV)
432    }
433}
434impl R {
435    #[doc = "Bits 0:1 - Warm-up Mode"]
436    #[inline(always)]
437    pub fn warmupmode(&self) -> WARMUPMODE_R {
438        WARMUPMODE_R::new((self.bits & 3) as u8)
439    }
440    #[doc = "Bit 2 - SINGLEFIFO DMA Wakeup"]
441    #[inline(always)]
442    pub fn singledmawu(&self) -> SINGLEDMAWU_R {
443        SINGLEDMAWU_R::new(((self.bits >> 2) & 1) != 0)
444    }
445    #[doc = "Bit 3 - SCANFIFO DMA Wakeup"]
446    #[inline(always)]
447    pub fn scandmawu(&self) -> SCANDMAWU_R {
448        SCANDMAWU_R::new(((self.bits >> 3) & 1) != 0)
449    }
450    #[doc = "Bit 4 - Conversion Tailgating"]
451    #[inline(always)]
452    pub fn tailgate(&self) -> TAILGATE_R {
453        TAILGATE_R::new(((self.bits >> 4) & 1) != 0)
454    }
455    #[doc = "Bit 6 - Selects ASYNC CLK Enable Mode When ADCCLKMODE=1"]
456    #[inline(always)]
457    pub fn asyncclken(&self) -> ASYNCCLKEN_R {
458        ASYNCCLKEN_R::new(((self.bits >> 6) & 1) != 0)
459    }
460    #[doc = "Bit 7 - ADC Clock Mode"]
461    #[inline(always)]
462    pub fn adcclkmode(&self) -> ADCCLKMODE_R {
463        ADCCLKMODE_R::new(((self.bits >> 7) & 1) != 0)
464    }
465    #[doc = "Bits 8:14 - Prescalar Setting for ADC Sample and Conversion Clock"]
466    #[inline(always)]
467    pub fn presc(&self) -> PRESC_R {
468        PRESC_R::new(((self.bits >> 8) & 0x7f) as u8)
469    }
470    #[doc = "Bits 16:22 - 1us Time Base"]
471    #[inline(always)]
472    pub fn timebase(&self) -> TIMEBASE_R {
473        TIMEBASE_R::new(((self.bits >> 16) & 0x7f) as u8)
474    }
475    #[doc = "Bits 24:27 - Oversample Rate Select"]
476    #[inline(always)]
477    pub fn ovsrsel(&self) -> OVSRSEL_R {
478        OVSRSEL_R::new(((self.bits >> 24) & 0x0f) as u8)
479    }
480    #[doc = "Bit 28 - Debug Mode Halt Enable"]
481    #[inline(always)]
482    pub fn dbghalt(&self) -> DBGHALT_R {
483        DBGHALT_R::new(((self.bits >> 28) & 1) != 0)
484    }
485    #[doc = "Bit 29 - Channel Connect"]
486    #[inline(always)]
487    pub fn chconmode(&self) -> CHCONMODE_R {
488        CHCONMODE_R::new(((self.bits >> 29) & 1) != 0)
489    }
490    #[doc = "Bits 30:31 - Channel Connect and Reference Warm Sel When ADC is IDLE"]
491    #[inline(always)]
492    pub fn chconrefwarmidle(&self) -> CHCONREFWARMIDLE_R {
493        CHCONREFWARMIDLE_R::new(((self.bits >> 30) & 3) as u8)
494    }
495}
496impl W {
497    #[doc = "Bits 0:1 - Warm-up Mode"]
498    #[inline(always)]
499    pub fn warmupmode(&mut self) -> WARMUPMODE_W {
500        WARMUPMODE_W::new(self)
501    }
502    #[doc = "Bit 2 - SINGLEFIFO DMA Wakeup"]
503    #[inline(always)]
504    pub fn singledmawu(&mut self) -> SINGLEDMAWU_W {
505        SINGLEDMAWU_W::new(self)
506    }
507    #[doc = "Bit 3 - SCANFIFO DMA Wakeup"]
508    #[inline(always)]
509    pub fn scandmawu(&mut self) -> SCANDMAWU_W {
510        SCANDMAWU_W::new(self)
511    }
512    #[doc = "Bit 4 - Conversion Tailgating"]
513    #[inline(always)]
514    pub fn tailgate(&mut self) -> TAILGATE_W {
515        TAILGATE_W::new(self)
516    }
517    #[doc = "Bit 6 - Selects ASYNC CLK Enable Mode When ADCCLKMODE=1"]
518    #[inline(always)]
519    pub fn asyncclken(&mut self) -> ASYNCCLKEN_W {
520        ASYNCCLKEN_W::new(self)
521    }
522    #[doc = "Bit 7 - ADC Clock Mode"]
523    #[inline(always)]
524    pub fn adcclkmode(&mut self) -> ADCCLKMODE_W {
525        ADCCLKMODE_W::new(self)
526    }
527    #[doc = "Bits 8:14 - Prescalar Setting for ADC Sample and Conversion Clock"]
528    #[inline(always)]
529    pub fn presc(&mut self) -> PRESC_W {
530        PRESC_W::new(self)
531    }
532    #[doc = "Bits 16:22 - 1us Time Base"]
533    #[inline(always)]
534    pub fn timebase(&mut self) -> TIMEBASE_W {
535        TIMEBASE_W::new(self)
536    }
537    #[doc = "Bits 24:27 - Oversample Rate Select"]
538    #[inline(always)]
539    pub fn ovsrsel(&mut self) -> OVSRSEL_W {
540        OVSRSEL_W::new(self)
541    }
542    #[doc = "Bit 28 - Debug Mode Halt Enable"]
543    #[inline(always)]
544    pub fn dbghalt(&mut self) -> DBGHALT_W {
545        DBGHALT_W::new(self)
546    }
547    #[doc = "Bit 29 - Channel Connect"]
548    #[inline(always)]
549    pub fn chconmode(&mut self) -> CHCONMODE_W {
550        CHCONMODE_W::new(self)
551    }
552    #[doc = "Bits 30:31 - Channel Connect and Reference Warm Sel When ADC is IDLE"]
553    #[inline(always)]
554    pub fn chconrefwarmidle(&mut self) -> CHCONREFWARMIDLE_W {
555        CHCONREFWARMIDLE_W::new(self)
556    }
557    #[doc = "Writes raw bits to the register."]
558    #[inline(always)]
559    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
560        self.0.bits(bits);
561        self
562    }
563}
564#[doc = "Control 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 [ctrl](index.html) module"]
565pub struct CTRL_SPEC;
566impl crate::RegisterSpec for CTRL_SPEC {
567    type Ux = u32;
568}
569#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
570impl crate::Readable for CTRL_SPEC {
571    type Reader = R;
572}
573#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
574impl crate::Writable for CTRL_SPEC {
575    type Writer = W;
576}
577#[doc = "`reset()` method sets CTRL to value 0x001f_0000"]
578impl crate::Resettable for CTRL_SPEC {
579    #[inline(always)]
580    fn reset_value() -> Self::Ux {
581        0x001f_0000
582    }
583}