efm32pg22_pac/efm32pg22c200/iadc0_s/
cfg1.rs

1#[doc = "Register `CFG1` reader"]
2pub struct R(crate::R<CFG1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CFG1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CFG1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CFG1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CFG1` writer"]
17pub struct W(crate::W<CFG1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CFG1_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<CFG1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CFG1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ADCMODE` reader - ADC Mode"]
38pub type ADCMODE_R = crate::FieldReader<u8, ADCMODE_A>;
39#[doc = "ADC Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum ADCMODE_A {
43    #[doc = "0: High speed mode with a maximum CLK_ADC of 10 MHz."]
44    NORMAL = 0,
45}
46impl From<ADCMODE_A> for u8 {
47    #[inline(always)]
48    fn from(variant: ADCMODE_A) -> Self {
49        variant as _
50    }
51}
52impl ADCMODE_R {
53    #[doc = "Get enumerated values variant"]
54    #[inline(always)]
55    pub fn variant(&self) -> Option<ADCMODE_A> {
56        match self.bits {
57            0 => Some(ADCMODE_A::NORMAL),
58            _ => None,
59        }
60    }
61    #[doc = "Checks if the value of the field is `NORMAL`"]
62    #[inline(always)]
63    pub fn is_normal(&self) -> bool {
64        *self == ADCMODE_A::NORMAL
65    }
66}
67#[doc = "Field `ADCMODE` writer - ADC Mode"]
68pub type ADCMODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG1_SPEC, u8, ADCMODE_A, 2, O>;
69impl<'a, const O: u8> ADCMODE_W<'a, O> {
70    #[doc = "High speed mode with a maximum CLK_ADC of 10 MHz."]
71    #[inline(always)]
72    pub fn normal(self) -> &'a mut W {
73        self.variant(ADCMODE_A::NORMAL)
74    }
75}
76#[doc = "Field `OSRHS` reader - High Speed OSR"]
77pub type OSRHS_R = crate::FieldReader<u8, OSRHS_A>;
78#[doc = "High Speed OSR\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80#[repr(u8)]
81pub enum OSRHS_A {
82    #[doc = "0: High speed over sampling of 2x."]
83    HISPD2 = 0,
84    #[doc = "1: High speed over sampling of 4x."]
85    HISPD4 = 1,
86    #[doc = "2: High speed over sampling of 8x."]
87    HISPD8 = 2,
88    #[doc = "3: High speed over sampling of 16x."]
89    HISPD16 = 3,
90    #[doc = "4: HIgh speed over sampling of 32x."]
91    HISPD32 = 4,
92    #[doc = "5: High speed over sampling of 64x."]
93    HISPD64 = 5,
94}
95impl From<OSRHS_A> for u8 {
96    #[inline(always)]
97    fn from(variant: OSRHS_A) -> Self {
98        variant as _
99    }
100}
101impl OSRHS_R {
102    #[doc = "Get enumerated values variant"]
103    #[inline(always)]
104    pub fn variant(&self) -> Option<OSRHS_A> {
105        match self.bits {
106            0 => Some(OSRHS_A::HISPD2),
107            1 => Some(OSRHS_A::HISPD4),
108            2 => Some(OSRHS_A::HISPD8),
109            3 => Some(OSRHS_A::HISPD16),
110            4 => Some(OSRHS_A::HISPD32),
111            5 => Some(OSRHS_A::HISPD64),
112            _ => None,
113        }
114    }
115    #[doc = "Checks if the value of the field is `HISPD2`"]
116    #[inline(always)]
117    pub fn is_hispd2(&self) -> bool {
118        *self == OSRHS_A::HISPD2
119    }
120    #[doc = "Checks if the value of the field is `HISPD4`"]
121    #[inline(always)]
122    pub fn is_hispd4(&self) -> bool {
123        *self == OSRHS_A::HISPD4
124    }
125    #[doc = "Checks if the value of the field is `HISPD8`"]
126    #[inline(always)]
127    pub fn is_hispd8(&self) -> bool {
128        *self == OSRHS_A::HISPD8
129    }
130    #[doc = "Checks if the value of the field is `HISPD16`"]
131    #[inline(always)]
132    pub fn is_hispd16(&self) -> bool {
133        *self == OSRHS_A::HISPD16
134    }
135    #[doc = "Checks if the value of the field is `HISPD32`"]
136    #[inline(always)]
137    pub fn is_hispd32(&self) -> bool {
138        *self == OSRHS_A::HISPD32
139    }
140    #[doc = "Checks if the value of the field is `HISPD64`"]
141    #[inline(always)]
142    pub fn is_hispd64(&self) -> bool {
143        *self == OSRHS_A::HISPD64
144    }
145}
146#[doc = "Field `OSRHS` writer - High Speed OSR"]
147pub type OSRHS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG1_SPEC, u8, OSRHS_A, 3, O>;
148impl<'a, const O: u8> OSRHS_W<'a, O> {
149    #[doc = "High speed over sampling of 2x."]
150    #[inline(always)]
151    pub fn hispd2(self) -> &'a mut W {
152        self.variant(OSRHS_A::HISPD2)
153    }
154    #[doc = "High speed over sampling of 4x."]
155    #[inline(always)]
156    pub fn hispd4(self) -> &'a mut W {
157        self.variant(OSRHS_A::HISPD4)
158    }
159    #[doc = "High speed over sampling of 8x."]
160    #[inline(always)]
161    pub fn hispd8(self) -> &'a mut W {
162        self.variant(OSRHS_A::HISPD8)
163    }
164    #[doc = "High speed over sampling of 16x."]
165    #[inline(always)]
166    pub fn hispd16(self) -> &'a mut W {
167        self.variant(OSRHS_A::HISPD16)
168    }
169    #[doc = "HIgh speed over sampling of 32x."]
170    #[inline(always)]
171    pub fn hispd32(self) -> &'a mut W {
172        self.variant(OSRHS_A::HISPD32)
173    }
174    #[doc = "High speed over sampling of 64x."]
175    #[inline(always)]
176    pub fn hispd64(self) -> &'a mut W {
177        self.variant(OSRHS_A::HISPD64)
178    }
179}
180#[doc = "Field `ANALOGGAIN` reader - Analog Gain"]
181pub type ANALOGGAIN_R = crate::FieldReader<u8, ANALOGGAIN_A>;
182#[doc = "Analog Gain\n\nValue on reset: 2"]
183#[derive(Clone, Copy, Debug, PartialEq, Eq)]
184#[repr(u8)]
185pub enum ANALOGGAIN_A {
186    #[doc = "1: Analog gain of 0.5x."]
187    ANAGAIN0P5 = 1,
188    #[doc = "2: Analog gain of 1x."]
189    ANAGAIN1 = 2,
190    #[doc = "3: Analog gain of 2x."]
191    ANAGAIN2 = 3,
192    #[doc = "4: Analog gain of 3x."]
193    ANAGAIN3 = 4,
194    #[doc = "5: Analog gain of 4x."]
195    ANAGAIN4 = 5,
196}
197impl From<ANALOGGAIN_A> for u8 {
198    #[inline(always)]
199    fn from(variant: ANALOGGAIN_A) -> Self {
200        variant as _
201    }
202}
203impl ANALOGGAIN_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> Option<ANALOGGAIN_A> {
207        match self.bits {
208            1 => Some(ANALOGGAIN_A::ANAGAIN0P5),
209            2 => Some(ANALOGGAIN_A::ANAGAIN1),
210            3 => Some(ANALOGGAIN_A::ANAGAIN2),
211            4 => Some(ANALOGGAIN_A::ANAGAIN3),
212            5 => Some(ANALOGGAIN_A::ANAGAIN4),
213            _ => None,
214        }
215    }
216    #[doc = "Checks if the value of the field is `ANAGAIN0P5`"]
217    #[inline(always)]
218    pub fn is_anagain0p5(&self) -> bool {
219        *self == ANALOGGAIN_A::ANAGAIN0P5
220    }
221    #[doc = "Checks if the value of the field is `ANAGAIN1`"]
222    #[inline(always)]
223    pub fn is_anagain1(&self) -> bool {
224        *self == ANALOGGAIN_A::ANAGAIN1
225    }
226    #[doc = "Checks if the value of the field is `ANAGAIN2`"]
227    #[inline(always)]
228    pub fn is_anagain2(&self) -> bool {
229        *self == ANALOGGAIN_A::ANAGAIN2
230    }
231    #[doc = "Checks if the value of the field is `ANAGAIN3`"]
232    #[inline(always)]
233    pub fn is_anagain3(&self) -> bool {
234        *self == ANALOGGAIN_A::ANAGAIN3
235    }
236    #[doc = "Checks if the value of the field is `ANAGAIN4`"]
237    #[inline(always)]
238    pub fn is_anagain4(&self) -> bool {
239        *self == ANALOGGAIN_A::ANAGAIN4
240    }
241}
242#[doc = "Field `ANALOGGAIN` writer - Analog Gain"]
243pub type ANALOGGAIN_W<'a, const O: u8> =
244    crate::FieldWriter<'a, u32, CFG1_SPEC, u8, ANALOGGAIN_A, 3, O>;
245impl<'a, const O: u8> ANALOGGAIN_W<'a, O> {
246    #[doc = "Analog gain of 0.5x."]
247    #[inline(always)]
248    pub fn anagain0p5(self) -> &'a mut W {
249        self.variant(ANALOGGAIN_A::ANAGAIN0P5)
250    }
251    #[doc = "Analog gain of 1x."]
252    #[inline(always)]
253    pub fn anagain1(self) -> &'a mut W {
254        self.variant(ANALOGGAIN_A::ANAGAIN1)
255    }
256    #[doc = "Analog gain of 2x."]
257    #[inline(always)]
258    pub fn anagain2(self) -> &'a mut W {
259        self.variant(ANALOGGAIN_A::ANAGAIN2)
260    }
261    #[doc = "Analog gain of 3x."]
262    #[inline(always)]
263    pub fn anagain3(self) -> &'a mut W {
264        self.variant(ANALOGGAIN_A::ANAGAIN3)
265    }
266    #[doc = "Analog gain of 4x."]
267    #[inline(always)]
268    pub fn anagain4(self) -> &'a mut W {
269        self.variant(ANALOGGAIN_A::ANAGAIN4)
270    }
271}
272#[doc = "Field `REFSEL` reader - Reference Select"]
273pub type REFSEL_R = crate::FieldReader<u8, REFSEL_A>;
274#[doc = "Reference Select\n\nValue on reset: 0"]
275#[derive(Clone, Copy, Debug, PartialEq, Eq)]
276#[repr(u8)]
277pub enum REFSEL_A {
278    #[doc = "0: Internal 1.21 V reference."]
279    VBGR = 0,
280    #[doc = "1: External Reference. (Calibrated for 1.25V nominal.)"]
281    VREF = 1,
282    #[doc = "3: AVDD (unbuffered)"]
283    VDDX = 3,
284    #[doc = "4: AVDD (buffered) * 0.8"]
285    VDDX0P8BUF = 4,
286}
287impl From<REFSEL_A> for u8 {
288    #[inline(always)]
289    fn from(variant: REFSEL_A) -> Self {
290        variant as _
291    }
292}
293impl REFSEL_R {
294    #[doc = "Get enumerated values variant"]
295    #[inline(always)]
296    pub fn variant(&self) -> Option<REFSEL_A> {
297        match self.bits {
298            0 => Some(REFSEL_A::VBGR),
299            1 => Some(REFSEL_A::VREF),
300            3 => Some(REFSEL_A::VDDX),
301            4 => Some(REFSEL_A::VDDX0P8BUF),
302            _ => None,
303        }
304    }
305    #[doc = "Checks if the value of the field is `VBGR`"]
306    #[inline(always)]
307    pub fn is_vbgr(&self) -> bool {
308        *self == REFSEL_A::VBGR
309    }
310    #[doc = "Checks if the value of the field is `VREF`"]
311    #[inline(always)]
312    pub fn is_vref(&self) -> bool {
313        *self == REFSEL_A::VREF
314    }
315    #[doc = "Checks if the value of the field is `VDDX`"]
316    #[inline(always)]
317    pub fn is_vddx(&self) -> bool {
318        *self == REFSEL_A::VDDX
319    }
320    #[doc = "Checks if the value of the field is `VDDX0P8BUF`"]
321    #[inline(always)]
322    pub fn is_vddx0p8buf(&self) -> bool {
323        *self == REFSEL_A::VDDX0P8BUF
324    }
325}
326#[doc = "Field `REFSEL` writer - Reference Select"]
327pub type REFSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG1_SPEC, u8, REFSEL_A, 3, O>;
328impl<'a, const O: u8> REFSEL_W<'a, O> {
329    #[doc = "Internal 1.21 V reference."]
330    #[inline(always)]
331    pub fn vbgr(self) -> &'a mut W {
332        self.variant(REFSEL_A::VBGR)
333    }
334    #[doc = "External Reference. (Calibrated for 1.25V nominal.)"]
335    #[inline(always)]
336    pub fn vref(self) -> &'a mut W {
337        self.variant(REFSEL_A::VREF)
338    }
339    #[doc = "AVDD (unbuffered)"]
340    #[inline(always)]
341    pub fn vddx(self) -> &'a mut W {
342        self.variant(REFSEL_A::VDDX)
343    }
344    #[doc = "AVDD (buffered) * 0.8"]
345    #[inline(always)]
346    pub fn vddx0p8buf(self) -> &'a mut W {
347        self.variant(REFSEL_A::VDDX0P8BUF)
348    }
349}
350#[doc = "Field `DIGAVG` reader - Digital Averaging"]
351pub type DIGAVG_R = crate::FieldReader<u8, DIGAVG_A>;
352#[doc = "Digital Averaging\n\nValue on reset: 0"]
353#[derive(Clone, Copy, Debug, PartialEq, Eq)]
354#[repr(u8)]
355pub enum DIGAVG_A {
356    #[doc = "0: Collect one output word (no digital averaging)."]
357    AVG1 = 0,
358    #[doc = "1: Collect and average 2 digital output words."]
359    AVG2 = 1,
360    #[doc = "2: Collect and average 4 digital output words."]
361    AVG4 = 2,
362    #[doc = "3: Collect and average 8 digital output words."]
363    AVG8 = 3,
364    #[doc = "4: Collect and average 16 digital output words."]
365    AVG16 = 4,
366}
367impl From<DIGAVG_A> for u8 {
368    #[inline(always)]
369    fn from(variant: DIGAVG_A) -> Self {
370        variant as _
371    }
372}
373impl DIGAVG_R {
374    #[doc = "Get enumerated values variant"]
375    #[inline(always)]
376    pub fn variant(&self) -> Option<DIGAVG_A> {
377        match self.bits {
378            0 => Some(DIGAVG_A::AVG1),
379            1 => Some(DIGAVG_A::AVG2),
380            2 => Some(DIGAVG_A::AVG4),
381            3 => Some(DIGAVG_A::AVG8),
382            4 => Some(DIGAVG_A::AVG16),
383            _ => None,
384        }
385    }
386    #[doc = "Checks if the value of the field is `AVG1`"]
387    #[inline(always)]
388    pub fn is_avg1(&self) -> bool {
389        *self == DIGAVG_A::AVG1
390    }
391    #[doc = "Checks if the value of the field is `AVG2`"]
392    #[inline(always)]
393    pub fn is_avg2(&self) -> bool {
394        *self == DIGAVG_A::AVG2
395    }
396    #[doc = "Checks if the value of the field is `AVG4`"]
397    #[inline(always)]
398    pub fn is_avg4(&self) -> bool {
399        *self == DIGAVG_A::AVG4
400    }
401    #[doc = "Checks if the value of the field is `AVG8`"]
402    #[inline(always)]
403    pub fn is_avg8(&self) -> bool {
404        *self == DIGAVG_A::AVG8
405    }
406    #[doc = "Checks if the value of the field is `AVG16`"]
407    #[inline(always)]
408    pub fn is_avg16(&self) -> bool {
409        *self == DIGAVG_A::AVG16
410    }
411}
412#[doc = "Field `DIGAVG` writer - Digital Averaging"]
413pub type DIGAVG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG1_SPEC, u8, DIGAVG_A, 3, O>;
414impl<'a, const O: u8> DIGAVG_W<'a, O> {
415    #[doc = "Collect one output word (no digital averaging)."]
416    #[inline(always)]
417    pub fn avg1(self) -> &'a mut W {
418        self.variant(DIGAVG_A::AVG1)
419    }
420    #[doc = "Collect and average 2 digital output words."]
421    #[inline(always)]
422    pub fn avg2(self) -> &'a mut W {
423        self.variant(DIGAVG_A::AVG2)
424    }
425    #[doc = "Collect and average 4 digital output words."]
426    #[inline(always)]
427    pub fn avg4(self) -> &'a mut W {
428        self.variant(DIGAVG_A::AVG4)
429    }
430    #[doc = "Collect and average 8 digital output words."]
431    #[inline(always)]
432    pub fn avg8(self) -> &'a mut W {
433        self.variant(DIGAVG_A::AVG8)
434    }
435    #[doc = "Collect and average 16 digital output words."]
436    #[inline(always)]
437    pub fn avg16(self) -> &'a mut W {
438        self.variant(DIGAVG_A::AVG16)
439    }
440}
441#[doc = "Field `TWOSCOMPL` reader - Two's Complement"]
442pub type TWOSCOMPL_R = crate::FieldReader<u8, TWOSCOMPL_A>;
443#[doc = "Two's Complement\n\nValue on reset: 0"]
444#[derive(Clone, Copy, Debug, PartialEq, Eq)]
445#[repr(u8)]
446pub enum TWOSCOMPL_A {
447    #[doc = "0: Automatic: Single ended measurements are reported as unipolar and differential measurements are reported as bipolar."]
448    AUTO = 0,
449    #[doc = "1: Force all measurements to result in unipolar output. Negative differential numbers will saturate to 0."]
450    FORCEUNIPOLAR = 1,
451    #[doc = "2: Force all measurements to result in bipolar output. Single ended measurements are half the range, but allow for small negative measurements."]
452    FORCEBIPOLAR = 2,
453}
454impl From<TWOSCOMPL_A> for u8 {
455    #[inline(always)]
456    fn from(variant: TWOSCOMPL_A) -> Self {
457        variant as _
458    }
459}
460impl TWOSCOMPL_R {
461    #[doc = "Get enumerated values variant"]
462    #[inline(always)]
463    pub fn variant(&self) -> Option<TWOSCOMPL_A> {
464        match self.bits {
465            0 => Some(TWOSCOMPL_A::AUTO),
466            1 => Some(TWOSCOMPL_A::FORCEUNIPOLAR),
467            2 => Some(TWOSCOMPL_A::FORCEBIPOLAR),
468            _ => None,
469        }
470    }
471    #[doc = "Checks if the value of the field is `AUTO`"]
472    #[inline(always)]
473    pub fn is_auto(&self) -> bool {
474        *self == TWOSCOMPL_A::AUTO
475    }
476    #[doc = "Checks if the value of the field is `FORCEUNIPOLAR`"]
477    #[inline(always)]
478    pub fn is_forceunipolar(&self) -> bool {
479        *self == TWOSCOMPL_A::FORCEUNIPOLAR
480    }
481    #[doc = "Checks if the value of the field is `FORCEBIPOLAR`"]
482    #[inline(always)]
483    pub fn is_forcebipolar(&self) -> bool {
484        *self == TWOSCOMPL_A::FORCEBIPOLAR
485    }
486}
487#[doc = "Field `TWOSCOMPL` writer - Two's Complement"]
488pub type TWOSCOMPL_W<'a, const O: u8> =
489    crate::FieldWriter<'a, u32, CFG1_SPEC, u8, TWOSCOMPL_A, 2, O>;
490impl<'a, const O: u8> TWOSCOMPL_W<'a, O> {
491    #[doc = "Automatic: Single ended measurements are reported as unipolar and differential measurements are reported as bipolar."]
492    #[inline(always)]
493    pub fn auto(self) -> &'a mut W {
494        self.variant(TWOSCOMPL_A::AUTO)
495    }
496    #[doc = "Force all measurements to result in unipolar output. Negative differential numbers will saturate to 0."]
497    #[inline(always)]
498    pub fn forceunipolar(self) -> &'a mut W {
499        self.variant(TWOSCOMPL_A::FORCEUNIPOLAR)
500    }
501    #[doc = "Force all measurements to result in bipolar output. Single ended measurements are half the range, but allow for small negative measurements."]
502    #[inline(always)]
503    pub fn forcebipolar(self) -> &'a mut W {
504        self.variant(TWOSCOMPL_A::FORCEBIPOLAR)
505    }
506}
507impl R {
508    #[doc = "Bits 0:1 - ADC Mode"]
509    #[inline(always)]
510    pub fn adcmode(&self) -> ADCMODE_R {
511        ADCMODE_R::new((self.bits & 3) as u8)
512    }
513    #[doc = "Bits 2:4 - High Speed OSR"]
514    #[inline(always)]
515    pub fn osrhs(&self) -> OSRHS_R {
516        OSRHS_R::new(((self.bits >> 2) & 7) as u8)
517    }
518    #[doc = "Bits 12:14 - Analog Gain"]
519    #[inline(always)]
520    pub fn analoggain(&self) -> ANALOGGAIN_R {
521        ANALOGGAIN_R::new(((self.bits >> 12) & 7) as u8)
522    }
523    #[doc = "Bits 16:18 - Reference Select"]
524    #[inline(always)]
525    pub fn refsel(&self) -> REFSEL_R {
526        REFSEL_R::new(((self.bits >> 16) & 7) as u8)
527    }
528    #[doc = "Bits 21:23 - Digital Averaging"]
529    #[inline(always)]
530    pub fn digavg(&self) -> DIGAVG_R {
531        DIGAVG_R::new(((self.bits >> 21) & 7) as u8)
532    }
533    #[doc = "Bits 28:29 - Two's Complement"]
534    #[inline(always)]
535    pub fn twoscompl(&self) -> TWOSCOMPL_R {
536        TWOSCOMPL_R::new(((self.bits >> 28) & 3) as u8)
537    }
538}
539impl W {
540    #[doc = "Bits 0:1 - ADC Mode"]
541    #[inline(always)]
542    #[must_use]
543    pub fn adcmode(&mut self) -> ADCMODE_W<0> {
544        ADCMODE_W::new(self)
545    }
546    #[doc = "Bits 2:4 - High Speed OSR"]
547    #[inline(always)]
548    #[must_use]
549    pub fn osrhs(&mut self) -> OSRHS_W<2> {
550        OSRHS_W::new(self)
551    }
552    #[doc = "Bits 12:14 - Analog Gain"]
553    #[inline(always)]
554    #[must_use]
555    pub fn analoggain(&mut self) -> ANALOGGAIN_W<12> {
556        ANALOGGAIN_W::new(self)
557    }
558    #[doc = "Bits 16:18 - Reference Select"]
559    #[inline(always)]
560    #[must_use]
561    pub fn refsel(&mut self) -> REFSEL_W<16> {
562        REFSEL_W::new(self)
563    }
564    #[doc = "Bits 21:23 - Digital Averaging"]
565    #[inline(always)]
566    #[must_use]
567    pub fn digavg(&mut self) -> DIGAVG_W<21> {
568        DIGAVG_W::new(self)
569    }
570    #[doc = "Bits 28:29 - Two's Complement"]
571    #[inline(always)]
572    #[must_use]
573    pub fn twoscompl(&mut self) -> TWOSCOMPL_W<28> {
574        TWOSCOMPL_W::new(self)
575    }
576    #[doc = "Writes raw bits to the register."]
577    #[inline(always)]
578    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
579        self.0.bits(bits);
580        self
581    }
582}
583#[doc = "Configration\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 [cfg1](index.html) module"]
584pub struct CFG1_SPEC;
585impl crate::RegisterSpec for CFG1_SPEC {
586    type Ux = u32;
587}
588#[doc = "`read()` method returns [cfg1::R](R) reader structure"]
589impl crate::Readable for CFG1_SPEC {
590    type Reader = R;
591}
592#[doc = "`write(|w| ..)` method takes [cfg1::W](W) writer structure"]
593impl crate::Writable for CFG1_SPEC {
594    type Writer = W;
595    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
596    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
597}
598#[doc = "`reset()` method sets CFG1 to value 0x2060"]
599impl crate::Resettable for CFG1_SPEC {
600    const RESET_VALUE: Self::Ux = 0x2060;
601}