efm32tg11b_pac/efm32tg11b120/csen/
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 = "Field `EN` reader - CSEN Enable"]
38pub type EN_R = crate::BitReader<bool>;
39#[doc = "Field `EN` writer - CSEN Enable"]
40pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
41#[doc = "Field `CMPPOL` reader - CSEN Digital Comparator Polarity Select"]
42pub type CMPPOL_R = crate::BitReader<bool>;
43#[doc = "Field `CMPPOL` writer - CSEN Digital Comparator Polarity Select"]
44pub type CMPPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
45#[doc = "Field `CM` reader - CSEN Conversion Mode Select"]
46pub type CM_R = crate::FieldReader<u8, CM_A>;
47#[doc = "CSEN Conversion Mode Select\n\nValue on reset: 0"]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49#[repr(u8)]
50pub enum CM_A {
51    #[doc = "0: Single Channel Mode: One conversion of a single channel (when MCE = 0) or set of bonded channels (when MCE = 1) per conversion trigger."]
52    SGL = 0,
53    #[doc = "1: Scan Mode: Scans multiple selected channels once per conversion trigger."]
54    SCAN = 1,
55    #[doc = "2: Continuous Single Channel: Continuous conversion of a single channel (when MCE = 0) or set of bonded channels (when MCE = 1)."]
56    CONTSGL = 2,
57    #[doc = "3: Continuous Scan Mode: Continuously scans multiple selected channels."]
58    CONTSCAN = 3,
59}
60impl From<CM_A> for u8 {
61    #[inline(always)]
62    fn from(variant: CM_A) -> Self {
63        variant as _
64    }
65}
66impl CM_R {
67    #[doc = "Get enumerated values variant"]
68    #[inline(always)]
69    pub fn variant(&self) -> CM_A {
70        match self.bits {
71            0 => CM_A::SGL,
72            1 => CM_A::SCAN,
73            2 => CM_A::CONTSGL,
74            3 => CM_A::CONTSCAN,
75            _ => unreachable!(),
76        }
77    }
78    #[doc = "Checks if the value of the field is `SGL`"]
79    #[inline(always)]
80    pub fn is_sgl(&self) -> bool {
81        *self == CM_A::SGL
82    }
83    #[doc = "Checks if the value of the field is `SCAN`"]
84    #[inline(always)]
85    pub fn is_scan(&self) -> bool {
86        *self == CM_A::SCAN
87    }
88    #[doc = "Checks if the value of the field is `CONTSGL`"]
89    #[inline(always)]
90    pub fn is_contsgl(&self) -> bool {
91        *self == CM_A::CONTSGL
92    }
93    #[doc = "Checks if the value of the field is `CONTSCAN`"]
94    #[inline(always)]
95    pub fn is_contscan(&self) -> bool {
96        *self == CM_A::CONTSCAN
97    }
98}
99#[doc = "Field `CM` writer - CSEN Conversion Mode Select"]
100pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, CM_A, 2, O>;
101impl<'a, const O: u8> CM_W<'a, O> {
102    #[doc = "Single Channel Mode: One conversion of a single channel (when MCE = 0) or set of bonded channels (when MCE = 1) per conversion trigger."]
103    #[inline(always)]
104    pub fn sgl(self) -> &'a mut W {
105        self.variant(CM_A::SGL)
106    }
107    #[doc = "Scan Mode: Scans multiple selected channels once per conversion trigger."]
108    #[inline(always)]
109    pub fn scan(self) -> &'a mut W {
110        self.variant(CM_A::SCAN)
111    }
112    #[doc = "Continuous Single Channel: Continuous conversion of a single channel (when MCE = 0) or set of bonded channels (when MCE = 1)."]
113    #[inline(always)]
114    pub fn contsgl(self) -> &'a mut W {
115        self.variant(CM_A::CONTSGL)
116    }
117    #[doc = "Continuous Scan Mode: Continuously scans multiple selected channels."]
118    #[inline(always)]
119    pub fn contscan(self) -> &'a mut W {
120        self.variant(CM_A::CONTSCAN)
121    }
122}
123#[doc = "Field `SARCR` reader - SAR Conversion Resolution."]
124pub type SARCR_R = crate::FieldReader<u8, SARCR_A>;
125#[doc = "SAR Conversion Resolution.\n\nValue on reset: 0"]
126#[derive(Clone, Copy, Debug, PartialEq, Eq)]
127#[repr(u8)]
128pub enum SARCR_A {
129    #[doc = "0: Conversions last 10 internal CSEN clocks and are 10-bits in length."]
130    CLK10 = 0,
131    #[doc = "1: Conversions last 12 internal CSEN clocks and are 12-bits in length."]
132    CLK12 = 1,
133    #[doc = "2: Conversions last 14 internal CSEN clocks and are 14-bits in length."]
134    CLK14 = 2,
135    #[doc = "3: Conversions last 16 internal CSEN clocks and are 16-bits in length."]
136    CLK16 = 3,
137}
138impl From<SARCR_A> for u8 {
139    #[inline(always)]
140    fn from(variant: SARCR_A) -> Self {
141        variant as _
142    }
143}
144impl SARCR_R {
145    #[doc = "Get enumerated values variant"]
146    #[inline(always)]
147    pub fn variant(&self) -> SARCR_A {
148        match self.bits {
149            0 => SARCR_A::CLK10,
150            1 => SARCR_A::CLK12,
151            2 => SARCR_A::CLK14,
152            3 => SARCR_A::CLK16,
153            _ => unreachable!(),
154        }
155    }
156    #[doc = "Checks if the value of the field is `CLK10`"]
157    #[inline(always)]
158    pub fn is_clk10(&self) -> bool {
159        *self == SARCR_A::CLK10
160    }
161    #[doc = "Checks if the value of the field is `CLK12`"]
162    #[inline(always)]
163    pub fn is_clk12(&self) -> bool {
164        *self == SARCR_A::CLK12
165    }
166    #[doc = "Checks if the value of the field is `CLK14`"]
167    #[inline(always)]
168    pub fn is_clk14(&self) -> bool {
169        *self == SARCR_A::CLK14
170    }
171    #[doc = "Checks if the value of the field is `CLK16`"]
172    #[inline(always)]
173    pub fn is_clk16(&self) -> bool {
174        *self == SARCR_A::CLK16
175    }
176}
177#[doc = "Field `SARCR` writer - SAR Conversion Resolution."]
178pub type SARCR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, SARCR_A, 2, O>;
179impl<'a, const O: u8> SARCR_W<'a, O> {
180    #[doc = "Conversions last 10 internal CSEN clocks and are 10-bits in length."]
181    #[inline(always)]
182    pub fn clk10(self) -> &'a mut W {
183        self.variant(SARCR_A::CLK10)
184    }
185    #[doc = "Conversions last 12 internal CSEN clocks and are 12-bits in length."]
186    #[inline(always)]
187    pub fn clk12(self) -> &'a mut W {
188        self.variant(SARCR_A::CLK12)
189    }
190    #[doc = "Conversions last 14 internal CSEN clocks and are 14-bits in length."]
191    #[inline(always)]
192    pub fn clk14(self) -> &'a mut W {
193        self.variant(SARCR_A::CLK14)
194    }
195    #[doc = "Conversions last 16 internal CSEN clocks and are 16-bits in length."]
196    #[inline(always)]
197    pub fn clk16(self) -> &'a mut W {
198        self.variant(SARCR_A::CLK16)
199    }
200}
201#[doc = "Field `ACU` reader - CSEN Accumulator Mode Select"]
202pub type ACU_R = crate::FieldReader<u8, ACU_A>;
203#[doc = "CSEN Accumulator Mode Select\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq, Eq)]
205#[repr(u8)]
206pub enum ACU_A {
207    #[doc = "0: Accumulate 1 sample."]
208    ACC1 = 0,
209    #[doc = "1: Accumulate 2 sample."]
210    ACC2 = 1,
211    #[doc = "2: Accumulate 4 sample."]
212    ACC4 = 2,
213    #[doc = "3: Accumulate 8 sample."]
214    ACC8 = 3,
215    #[doc = "4: Accumulate 16 sample."]
216    ACC16 = 4,
217    #[doc = "5: Accumulate 32 sample."]
218    ACC32 = 5,
219    #[doc = "6: Accumulate 64 sample."]
220    ACC64 = 6,
221}
222impl From<ACU_A> for u8 {
223    #[inline(always)]
224    fn from(variant: ACU_A) -> Self {
225        variant as _
226    }
227}
228impl ACU_R {
229    #[doc = "Get enumerated values variant"]
230    #[inline(always)]
231    pub fn variant(&self) -> Option<ACU_A> {
232        match self.bits {
233            0 => Some(ACU_A::ACC1),
234            1 => Some(ACU_A::ACC2),
235            2 => Some(ACU_A::ACC4),
236            3 => Some(ACU_A::ACC8),
237            4 => Some(ACU_A::ACC16),
238            5 => Some(ACU_A::ACC32),
239            6 => Some(ACU_A::ACC64),
240            _ => None,
241        }
242    }
243    #[doc = "Checks if the value of the field is `ACC1`"]
244    #[inline(always)]
245    pub fn is_acc1(&self) -> bool {
246        *self == ACU_A::ACC1
247    }
248    #[doc = "Checks if the value of the field is `ACC2`"]
249    #[inline(always)]
250    pub fn is_acc2(&self) -> bool {
251        *self == ACU_A::ACC2
252    }
253    #[doc = "Checks if the value of the field is `ACC4`"]
254    #[inline(always)]
255    pub fn is_acc4(&self) -> bool {
256        *self == ACU_A::ACC4
257    }
258    #[doc = "Checks if the value of the field is `ACC8`"]
259    #[inline(always)]
260    pub fn is_acc8(&self) -> bool {
261        *self == ACU_A::ACC8
262    }
263    #[doc = "Checks if the value of the field is `ACC16`"]
264    #[inline(always)]
265    pub fn is_acc16(&self) -> bool {
266        *self == ACU_A::ACC16
267    }
268    #[doc = "Checks if the value of the field is `ACC32`"]
269    #[inline(always)]
270    pub fn is_acc32(&self) -> bool {
271        *self == ACU_A::ACC32
272    }
273    #[doc = "Checks if the value of the field is `ACC64`"]
274    #[inline(always)]
275    pub fn is_acc64(&self) -> bool {
276        *self == ACU_A::ACC64
277    }
278}
279#[doc = "Field `ACU` writer - CSEN Accumulator Mode Select"]
280pub type ACU_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, ACU_A, 3, O>;
281impl<'a, const O: u8> ACU_W<'a, O> {
282    #[doc = "Accumulate 1 sample."]
283    #[inline(always)]
284    pub fn acc1(self) -> &'a mut W {
285        self.variant(ACU_A::ACC1)
286    }
287    #[doc = "Accumulate 2 sample."]
288    #[inline(always)]
289    pub fn acc2(self) -> &'a mut W {
290        self.variant(ACU_A::ACC2)
291    }
292    #[doc = "Accumulate 4 sample."]
293    #[inline(always)]
294    pub fn acc4(self) -> &'a mut W {
295        self.variant(ACU_A::ACC4)
296    }
297    #[doc = "Accumulate 8 sample."]
298    #[inline(always)]
299    pub fn acc8(self) -> &'a mut W {
300        self.variant(ACU_A::ACC8)
301    }
302    #[doc = "Accumulate 16 sample."]
303    #[inline(always)]
304    pub fn acc16(self) -> &'a mut W {
305        self.variant(ACU_A::ACC16)
306    }
307    #[doc = "Accumulate 32 sample."]
308    #[inline(always)]
309    pub fn acc32(self) -> &'a mut W {
310        self.variant(ACU_A::ACC32)
311    }
312    #[doc = "Accumulate 64 sample."]
313    #[inline(always)]
314    pub fn acc64(self) -> &'a mut W {
315        self.variant(ACU_A::ACC64)
316    }
317}
318#[doc = "Field `MCEN` reader - CSEN Multiple Channel Enable"]
319pub type MCEN_R = crate::BitReader<bool>;
320#[doc = "Field `MCEN` writer - CSEN Multiple Channel Enable"]
321pub type MCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
322#[doc = "Field `STM` reader - Start Trigger Select"]
323pub type STM_R = crate::FieldReader<u8, STM_A>;
324#[doc = "Start Trigger Select\n\nValue on reset: 3"]
325#[derive(Clone, Copy, Debug, PartialEq, Eq)]
326#[repr(u8)]
327pub enum STM_A {
328    #[doc = "0: PRS Triggering. Conversions are triggered by the PRS channel selected in PRSSEL."]
329    PRS = 0,
330    #[doc = "1: Timer Triggering. Conversions are triggered by a local CSEN timer reload."]
331    TIMER = 1,
332    #[doc = "2: Software Triggering. Conversions are triggered by writing a 1 to the START field of the CMD register."]
333    START = 2,
334}
335impl From<STM_A> for u8 {
336    #[inline(always)]
337    fn from(variant: STM_A) -> Self {
338        variant as _
339    }
340}
341impl STM_R {
342    #[doc = "Get enumerated values variant"]
343    #[inline(always)]
344    pub fn variant(&self) -> Option<STM_A> {
345        match self.bits {
346            0 => Some(STM_A::PRS),
347            1 => Some(STM_A::TIMER),
348            2 => Some(STM_A::START),
349            _ => None,
350        }
351    }
352    #[doc = "Checks if the value of the field is `PRS`"]
353    #[inline(always)]
354    pub fn is_prs(&self) -> bool {
355        *self == STM_A::PRS
356    }
357    #[doc = "Checks if the value of the field is `TIMER`"]
358    #[inline(always)]
359    pub fn is_timer(&self) -> bool {
360        *self == STM_A::TIMER
361    }
362    #[doc = "Checks if the value of the field is `START`"]
363    #[inline(always)]
364    pub fn is_start(&self) -> bool {
365        *self == STM_A::START
366    }
367}
368#[doc = "Field `STM` writer - Start Trigger Select"]
369pub type STM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, STM_A, 2, O>;
370impl<'a, const O: u8> STM_W<'a, O> {
371    #[doc = "PRS Triggering. Conversions are triggered by the PRS channel selected in PRSSEL."]
372    #[inline(always)]
373    pub fn prs(self) -> &'a mut W {
374        self.variant(STM_A::PRS)
375    }
376    #[doc = "Timer Triggering. Conversions are triggered by a local CSEN timer reload."]
377    #[inline(always)]
378    pub fn timer(self) -> &'a mut W {
379        self.variant(STM_A::TIMER)
380    }
381    #[doc = "Software Triggering. Conversions are triggered by writing a 1 to the START field of the CMD register."]
382    #[inline(always)]
383    pub fn start(self) -> &'a mut W {
384        self.variant(STM_A::START)
385    }
386}
387#[doc = "Field `CMPEN` reader - CSEN Digital Comparator Enable"]
388pub type CMPEN_R = crate::BitReader<bool>;
389#[doc = "Field `CMPEN` writer - CSEN Digital Comparator Enable"]
390pub type CMPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
391#[doc = "Field `DRSF` reader - CSEN Disable Right-Shift"]
392pub type DRSF_R = crate::BitReader<bool>;
393#[doc = "Field `DRSF` writer - CSEN Disable Right-Shift"]
394pub type DRSF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
395#[doc = "Field `DMAEN` reader - CSEN DMA Enable Bit"]
396pub type DMAEN_R = crate::BitReader<bool>;
397#[doc = "Field `DMAEN` writer - CSEN DMA Enable Bit"]
398pub type DMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
399#[doc = "Field `CONVSEL` reader - CSEN Converter Select"]
400pub type CONVSEL_R = crate::BitReader<bool>;
401#[doc = "Field `CONVSEL` writer - CSEN Converter Select"]
402pub type CONVSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
403#[doc = "Field `CHOPEN` reader - CSEN Chop Enable"]
404pub type CHOPEN_R = crate::BitReader<bool>;
405#[doc = "Field `CHOPEN` writer - CSEN Chop Enable"]
406pub type CHOPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
407#[doc = "Field `AUTOGND` reader - CSEN Automatic Ground Enable"]
408pub type AUTOGND_R = crate::BitReader<bool>;
409#[doc = "Field `AUTOGND` writer - CSEN Automatic Ground Enable"]
410pub type AUTOGND_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
411#[doc = "Field `MXUC` reader - CSEN Mux Disconnect"]
412pub type MXUC_R = crate::BitReader<bool>;
413#[doc = "Field `MXUC` writer - CSEN Mux Disconnect"]
414pub type MXUC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
415#[doc = "Field `EMACMPEN` reader - Greater and Less Than Comparison Using the Exponential Moving Average (EMA) is Enabled"]
416pub type EMACMPEN_R = crate::BitReader<bool>;
417#[doc = "Field `EMACMPEN` writer - Greater and Less Than Comparison Using the Exponential Moving Average (EMA) is Enabled"]
418pub type EMACMPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
419#[doc = "Field `WARMUPMODE` reader - Select Warmup Mode for CSEN"]
420pub type WARMUPMODE_R = crate::BitReader<bool>;
421#[doc = "Field `WARMUPMODE` writer - Select Warmup Mode for CSEN"]
422pub type WARMUPMODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
423#[doc = "Field `LOCALSENS` reader - Local Sensing Enable"]
424pub type LOCALSENS_R = crate::BitReader<bool>;
425#[doc = "Field `LOCALSENS` writer - Local Sensing Enable"]
426pub type LOCALSENS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
427#[doc = "Field `CPACCURACY` reader - Charge Pump Accuracy"]
428pub type CPACCURACY_R = crate::BitReader<bool>;
429#[doc = "Field `CPACCURACY` writer - Charge Pump Accuracy"]
430pub type CPACCURACY_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
431impl R {
432    #[doc = "Bit 1 - CSEN Enable"]
433    #[inline(always)]
434    pub fn en(&self) -> EN_R {
435        EN_R::new(((self.bits >> 1) & 1) != 0)
436    }
437    #[doc = "Bit 2 - CSEN Digital Comparator Polarity Select"]
438    #[inline(always)]
439    pub fn cmppol(&self) -> CMPPOL_R {
440        CMPPOL_R::new(((self.bits >> 2) & 1) != 0)
441    }
442    #[doc = "Bits 4:5 - CSEN Conversion Mode Select"]
443    #[inline(always)]
444    pub fn cm(&self) -> CM_R {
445        CM_R::new(((self.bits >> 4) & 3) as u8)
446    }
447    #[doc = "Bits 8:9 - SAR Conversion Resolution."]
448    #[inline(always)]
449    pub fn sarcr(&self) -> SARCR_R {
450        SARCR_R::new(((self.bits >> 8) & 3) as u8)
451    }
452    #[doc = "Bits 12:14 - CSEN Accumulator Mode Select"]
453    #[inline(always)]
454    pub fn acu(&self) -> ACU_R {
455        ACU_R::new(((self.bits >> 12) & 7) as u8)
456    }
457    #[doc = "Bit 15 - CSEN Multiple Channel Enable"]
458    #[inline(always)]
459    pub fn mcen(&self) -> MCEN_R {
460        MCEN_R::new(((self.bits >> 15) & 1) != 0)
461    }
462    #[doc = "Bits 16:17 - Start Trigger Select"]
463    #[inline(always)]
464    pub fn stm(&self) -> STM_R {
465        STM_R::new(((self.bits >> 16) & 3) as u8)
466    }
467    #[doc = "Bit 18 - CSEN Digital Comparator Enable"]
468    #[inline(always)]
469    pub fn cmpen(&self) -> CMPEN_R {
470        CMPEN_R::new(((self.bits >> 18) & 1) != 0)
471    }
472    #[doc = "Bit 19 - CSEN Disable Right-Shift"]
473    #[inline(always)]
474    pub fn drsf(&self) -> DRSF_R {
475        DRSF_R::new(((self.bits >> 19) & 1) != 0)
476    }
477    #[doc = "Bit 20 - CSEN DMA Enable Bit"]
478    #[inline(always)]
479    pub fn dmaen(&self) -> DMAEN_R {
480        DMAEN_R::new(((self.bits >> 20) & 1) != 0)
481    }
482    #[doc = "Bit 21 - CSEN Converter Select"]
483    #[inline(always)]
484    pub fn convsel(&self) -> CONVSEL_R {
485        CONVSEL_R::new(((self.bits >> 21) & 1) != 0)
486    }
487    #[doc = "Bit 22 - CSEN Chop Enable"]
488    #[inline(always)]
489    pub fn chopen(&self) -> CHOPEN_R {
490        CHOPEN_R::new(((self.bits >> 22) & 1) != 0)
491    }
492    #[doc = "Bit 23 - CSEN Automatic Ground Enable"]
493    #[inline(always)]
494    pub fn autognd(&self) -> AUTOGND_R {
495        AUTOGND_R::new(((self.bits >> 23) & 1) != 0)
496    }
497    #[doc = "Bit 24 - CSEN Mux Disconnect"]
498    #[inline(always)]
499    pub fn mxuc(&self) -> MXUC_R {
500        MXUC_R::new(((self.bits >> 24) & 1) != 0)
501    }
502    #[doc = "Bit 25 - Greater and Less Than Comparison Using the Exponential Moving Average (EMA) is Enabled"]
503    #[inline(always)]
504    pub fn emacmpen(&self) -> EMACMPEN_R {
505        EMACMPEN_R::new(((self.bits >> 25) & 1) != 0)
506    }
507    #[doc = "Bit 26 - Select Warmup Mode for CSEN"]
508    #[inline(always)]
509    pub fn warmupmode(&self) -> WARMUPMODE_R {
510        WARMUPMODE_R::new(((self.bits >> 26) & 1) != 0)
511    }
512    #[doc = "Bit 27 - Local Sensing Enable"]
513    #[inline(always)]
514    pub fn localsens(&self) -> LOCALSENS_R {
515        LOCALSENS_R::new(((self.bits >> 27) & 1) != 0)
516    }
517    #[doc = "Bit 28 - Charge Pump Accuracy"]
518    #[inline(always)]
519    pub fn cpaccuracy(&self) -> CPACCURACY_R {
520        CPACCURACY_R::new(((self.bits >> 28) & 1) != 0)
521    }
522}
523impl W {
524    #[doc = "Bit 1 - CSEN Enable"]
525    #[inline(always)]
526    #[must_use]
527    pub fn en(&mut self) -> EN_W<1> {
528        EN_W::new(self)
529    }
530    #[doc = "Bit 2 - CSEN Digital Comparator Polarity Select"]
531    #[inline(always)]
532    #[must_use]
533    pub fn cmppol(&mut self) -> CMPPOL_W<2> {
534        CMPPOL_W::new(self)
535    }
536    #[doc = "Bits 4:5 - CSEN Conversion Mode Select"]
537    #[inline(always)]
538    #[must_use]
539    pub fn cm(&mut self) -> CM_W<4> {
540        CM_W::new(self)
541    }
542    #[doc = "Bits 8:9 - SAR Conversion Resolution."]
543    #[inline(always)]
544    #[must_use]
545    pub fn sarcr(&mut self) -> SARCR_W<8> {
546        SARCR_W::new(self)
547    }
548    #[doc = "Bits 12:14 - CSEN Accumulator Mode Select"]
549    #[inline(always)]
550    #[must_use]
551    pub fn acu(&mut self) -> ACU_W<12> {
552        ACU_W::new(self)
553    }
554    #[doc = "Bit 15 - CSEN Multiple Channel Enable"]
555    #[inline(always)]
556    #[must_use]
557    pub fn mcen(&mut self) -> MCEN_W<15> {
558        MCEN_W::new(self)
559    }
560    #[doc = "Bits 16:17 - Start Trigger Select"]
561    #[inline(always)]
562    #[must_use]
563    pub fn stm(&mut self) -> STM_W<16> {
564        STM_W::new(self)
565    }
566    #[doc = "Bit 18 - CSEN Digital Comparator Enable"]
567    #[inline(always)]
568    #[must_use]
569    pub fn cmpen(&mut self) -> CMPEN_W<18> {
570        CMPEN_W::new(self)
571    }
572    #[doc = "Bit 19 - CSEN Disable Right-Shift"]
573    #[inline(always)]
574    #[must_use]
575    pub fn drsf(&mut self) -> DRSF_W<19> {
576        DRSF_W::new(self)
577    }
578    #[doc = "Bit 20 - CSEN DMA Enable Bit"]
579    #[inline(always)]
580    #[must_use]
581    pub fn dmaen(&mut self) -> DMAEN_W<20> {
582        DMAEN_W::new(self)
583    }
584    #[doc = "Bit 21 - CSEN Converter Select"]
585    #[inline(always)]
586    #[must_use]
587    pub fn convsel(&mut self) -> CONVSEL_W<21> {
588        CONVSEL_W::new(self)
589    }
590    #[doc = "Bit 22 - CSEN Chop Enable"]
591    #[inline(always)]
592    #[must_use]
593    pub fn chopen(&mut self) -> CHOPEN_W<22> {
594        CHOPEN_W::new(self)
595    }
596    #[doc = "Bit 23 - CSEN Automatic Ground Enable"]
597    #[inline(always)]
598    #[must_use]
599    pub fn autognd(&mut self) -> AUTOGND_W<23> {
600        AUTOGND_W::new(self)
601    }
602    #[doc = "Bit 24 - CSEN Mux Disconnect"]
603    #[inline(always)]
604    #[must_use]
605    pub fn mxuc(&mut self) -> MXUC_W<24> {
606        MXUC_W::new(self)
607    }
608    #[doc = "Bit 25 - Greater and Less Than Comparison Using the Exponential Moving Average (EMA) is Enabled"]
609    #[inline(always)]
610    #[must_use]
611    pub fn emacmpen(&mut self) -> EMACMPEN_W<25> {
612        EMACMPEN_W::new(self)
613    }
614    #[doc = "Bit 26 - Select Warmup Mode for CSEN"]
615    #[inline(always)]
616    #[must_use]
617    pub fn warmupmode(&mut self) -> WARMUPMODE_W<26> {
618        WARMUPMODE_W::new(self)
619    }
620    #[doc = "Bit 27 - Local Sensing Enable"]
621    #[inline(always)]
622    #[must_use]
623    pub fn localsens(&mut self) -> LOCALSENS_W<27> {
624        LOCALSENS_W::new(self)
625    }
626    #[doc = "Bit 28 - Charge Pump Accuracy"]
627    #[inline(always)]
628    #[must_use]
629    pub fn cpaccuracy(&mut self) -> CPACCURACY_W<28> {
630        CPACCURACY_W::new(self)
631    }
632    #[doc = "Writes raw bits to the register."]
633    #[inline(always)]
634    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
635        self.0.bits(bits);
636        self
637    }
638}
639#[doc = "Control\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"]
640pub struct CTRL_SPEC;
641impl crate::RegisterSpec for CTRL_SPEC {
642    type Ux = u32;
643}
644#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
645impl crate::Readable for CTRL_SPEC {
646    type Reader = R;
647}
648#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
649impl crate::Writable for CTRL_SPEC {
650    type Writer = W;
651    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
652    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
653}
654#[doc = "`reset()` method sets CTRL to value 0x0003_0000"]
655impl crate::Resettable for CTRL_SPEC {
656    const RESET_VALUE: Self::Ux = 0x0003_0000;
657}