efm32gg_pac/efm32gg995/adc0/
singlectrl.rs

1#[doc = "Register `SINGLECTRL` reader"]
2pub struct R(crate::R<SINGLECTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SINGLECTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SINGLECTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SINGLECTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SINGLECTRL` writer"]
17pub struct W(crate::W<SINGLECTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SINGLECTRL_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<SINGLECTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SINGLECTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `REP` reader - Single Sample Repetitive Mode"]
38pub type REP_R = crate::BitReader<bool>;
39#[doc = "Field `REP` writer - Single Sample Repetitive Mode"]
40pub type REP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
41#[doc = "Field `DIFF` reader - Single Sample Differential Mode"]
42pub type DIFF_R = crate::BitReader<bool>;
43#[doc = "Field `DIFF` writer - Single Sample Differential Mode"]
44pub type DIFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
45#[doc = "Field `ADJ` reader - Single Sample Result Adjustment"]
46pub type ADJ_R = crate::BitReader<bool>;
47#[doc = "Field `ADJ` writer - Single Sample Result Adjustment"]
48pub type ADJ_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
49#[doc = "Field `RES` reader - Single Sample Resolution Select"]
50pub type RES_R = crate::FieldReader<u8, RES_A>;
51#[doc = "Single Sample Resolution Select\n\nValue on reset: 0"]
52#[derive(Clone, Copy, Debug, PartialEq, Eq)]
53#[repr(u8)]
54pub enum RES_A {
55    #[doc = "0: 12-bit resolution"]
56    _12BIT = 0,
57    #[doc = "1: 8-bit resolution"]
58    _8BIT = 1,
59    #[doc = "2: 6-bit resolution"]
60    _6BIT = 2,
61    #[doc = "3: Oversampling enabled. Oversampling rate is set in OVSRSEL"]
62    OVS = 3,
63}
64impl From<RES_A> for u8 {
65    #[inline(always)]
66    fn from(variant: RES_A) -> Self {
67        variant as _
68    }
69}
70impl RES_R {
71    #[doc = "Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> RES_A {
74        match self.bits {
75            0 => RES_A::_12BIT,
76            1 => RES_A::_8BIT,
77            2 => RES_A::_6BIT,
78            3 => RES_A::OVS,
79            _ => unreachable!(),
80        }
81    }
82    #[doc = "Checks if the value of the field is `_12BIT`"]
83    #[inline(always)]
84    pub fn is_12bit(&self) -> bool {
85        *self == RES_A::_12BIT
86    }
87    #[doc = "Checks if the value of the field is `_8BIT`"]
88    #[inline(always)]
89    pub fn is_8bit(&self) -> bool {
90        *self == RES_A::_8BIT
91    }
92    #[doc = "Checks if the value of the field is `_6BIT`"]
93    #[inline(always)]
94    pub fn is_6bit(&self) -> bool {
95        *self == RES_A::_6BIT
96    }
97    #[doc = "Checks if the value of the field is `OVS`"]
98    #[inline(always)]
99    pub fn is_ovs(&self) -> bool {
100        *self == RES_A::OVS
101    }
102}
103#[doc = "Field `RES` writer - Single Sample Resolution Select"]
104pub type RES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SINGLECTRL_SPEC, u8, RES_A, 2, O>;
105impl<'a, const O: u8> RES_W<'a, O> {
106    #[doc = "12-bit resolution"]
107    #[inline(always)]
108    pub fn _12bit(self) -> &'a mut W {
109        self.variant(RES_A::_12BIT)
110    }
111    #[doc = "8-bit resolution"]
112    #[inline(always)]
113    pub fn _8bit(self) -> &'a mut W {
114        self.variant(RES_A::_8BIT)
115    }
116    #[doc = "6-bit resolution"]
117    #[inline(always)]
118    pub fn _6bit(self) -> &'a mut W {
119        self.variant(RES_A::_6BIT)
120    }
121    #[doc = "Oversampling enabled. Oversampling rate is set in OVSRSEL"]
122    #[inline(always)]
123    pub fn ovs(self) -> &'a mut W {
124        self.variant(RES_A::OVS)
125    }
126}
127#[doc = "Field `INPUTSEL` reader - Single Sample Input Selection"]
128pub type INPUTSEL_R = crate::FieldReader<u8, u8>;
129#[doc = "Field `INPUTSEL` writer - Single Sample Input Selection"]
130pub type INPUTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, u8, 4, O>;
131#[doc = "Field `REF` reader - Single Sample Reference Selection"]
132pub type REF_R = crate::FieldReader<u8, REF_A>;
133#[doc = "Single Sample Reference Selection\n\nValue on reset: 0"]
134#[derive(Clone, Copy, Debug, PartialEq, Eq)]
135#[repr(u8)]
136pub enum REF_A {
137    #[doc = "0: Internal 1.25 V reference"]
138    _1V25 = 0,
139    #[doc = "1: Internal 2.5 V reference"]
140    _2V5 = 1,
141    #[doc = "2: Buffered VDD"]
142    VDD = 2,
143    #[doc = "3: Internal differential 5 V reference"]
144    _5VDIFF = 3,
145    #[doc = "4: Single ended external reference from ADCn_CH6"]
146    EXTSINGLE = 4,
147    #[doc = "5: Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
148    _2XEXTDIFF = 5,
149    #[doc = "6: Unbuffered 2xVDD"]
150    _2XVDD = 6,
151}
152impl From<REF_A> for u8 {
153    #[inline(always)]
154    fn from(variant: REF_A) -> Self {
155        variant as _
156    }
157}
158impl REF_R {
159    #[doc = "Get enumerated values variant"]
160    #[inline(always)]
161    pub fn variant(&self) -> Option<REF_A> {
162        match self.bits {
163            0 => Some(REF_A::_1V25),
164            1 => Some(REF_A::_2V5),
165            2 => Some(REF_A::VDD),
166            3 => Some(REF_A::_5VDIFF),
167            4 => Some(REF_A::EXTSINGLE),
168            5 => Some(REF_A::_2XEXTDIFF),
169            6 => Some(REF_A::_2XVDD),
170            _ => None,
171        }
172    }
173    #[doc = "Checks if the value of the field is `_1V25`"]
174    #[inline(always)]
175    pub fn is_1v25(&self) -> bool {
176        *self == REF_A::_1V25
177    }
178    #[doc = "Checks if the value of the field is `_2V5`"]
179    #[inline(always)]
180    pub fn is_2v5(&self) -> bool {
181        *self == REF_A::_2V5
182    }
183    #[doc = "Checks if the value of the field is `VDD`"]
184    #[inline(always)]
185    pub fn is_vdd(&self) -> bool {
186        *self == REF_A::VDD
187    }
188    #[doc = "Checks if the value of the field is `_5VDIFF`"]
189    #[inline(always)]
190    pub fn is_5vdiff(&self) -> bool {
191        *self == REF_A::_5VDIFF
192    }
193    #[doc = "Checks if the value of the field is `EXTSINGLE`"]
194    #[inline(always)]
195    pub fn is_extsingle(&self) -> bool {
196        *self == REF_A::EXTSINGLE
197    }
198    #[doc = "Checks if the value of the field is `_2XEXTDIFF`"]
199    #[inline(always)]
200    pub fn is_2xextdiff(&self) -> bool {
201        *self == REF_A::_2XEXTDIFF
202    }
203    #[doc = "Checks if the value of the field is `_2XVDD`"]
204    #[inline(always)]
205    pub fn is_2xvdd(&self) -> bool {
206        *self == REF_A::_2XVDD
207    }
208}
209#[doc = "Field `REF` writer - Single Sample Reference Selection"]
210pub type REF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, REF_A, 3, O>;
211impl<'a, const O: u8> REF_W<'a, O> {
212    #[doc = "Internal 1.25 V reference"]
213    #[inline(always)]
214    pub fn _1v25(self) -> &'a mut W {
215        self.variant(REF_A::_1V25)
216    }
217    #[doc = "Internal 2.5 V reference"]
218    #[inline(always)]
219    pub fn _2v5(self) -> &'a mut W {
220        self.variant(REF_A::_2V5)
221    }
222    #[doc = "Buffered VDD"]
223    #[inline(always)]
224    pub fn vdd(self) -> &'a mut W {
225        self.variant(REF_A::VDD)
226    }
227    #[doc = "Internal differential 5 V reference"]
228    #[inline(always)]
229    pub fn _5vdiff(self) -> &'a mut W {
230        self.variant(REF_A::_5VDIFF)
231    }
232    #[doc = "Single ended external reference from ADCn_CH6"]
233    #[inline(always)]
234    pub fn extsingle(self) -> &'a mut W {
235        self.variant(REF_A::EXTSINGLE)
236    }
237    #[doc = "Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
238    #[inline(always)]
239    pub fn _2xextdiff(self) -> &'a mut W {
240        self.variant(REF_A::_2XEXTDIFF)
241    }
242    #[doc = "Unbuffered 2xVDD"]
243    #[inline(always)]
244    pub fn _2xvdd(self) -> &'a mut W {
245        self.variant(REF_A::_2XVDD)
246    }
247}
248#[doc = "Field `AT` reader - Single Sample Acquisition Time"]
249pub type AT_R = crate::FieldReader<u8, AT_A>;
250#[doc = "Single Sample Acquisition Time\n\nValue on reset: 0"]
251#[derive(Clone, Copy, Debug, PartialEq, Eq)]
252#[repr(u8)]
253pub enum AT_A {
254    #[doc = "0: 1 ADC_CLK cycle acquisition time for single sample"]
255    _1CYCLE = 0,
256    #[doc = "1: 2 ADC_CLK cycles acquisition time for single sample"]
257    _2CYCLES = 1,
258    #[doc = "2: 4 ADC_CLK cycles acquisition time for single sample"]
259    _4CYCLES = 2,
260    #[doc = "3: 8 ADC_CLK cycles acquisition time for single sample"]
261    _8CYCLES = 3,
262    #[doc = "4: 16 ADC_CLK cycles acquisition time for single sample"]
263    _16CYCLES = 4,
264    #[doc = "5: 32 ADC_CLK cycles acquisition time for single sample"]
265    _32CYCLES = 5,
266    #[doc = "6: 64 ADC_CLK cycles acquisition time for single sample"]
267    _64CYCLES = 6,
268    #[doc = "7: 128 ADC_CLK cycles acquisition time for single sample"]
269    _128CYCLES = 7,
270    #[doc = "8: 256 ADC_CLK cycles acquisition time for single sample"]
271    _256CYCLES = 8,
272}
273impl From<AT_A> for u8 {
274    #[inline(always)]
275    fn from(variant: AT_A) -> Self {
276        variant as _
277    }
278}
279impl AT_R {
280    #[doc = "Get enumerated values variant"]
281    #[inline(always)]
282    pub fn variant(&self) -> Option<AT_A> {
283        match self.bits {
284            0 => Some(AT_A::_1CYCLE),
285            1 => Some(AT_A::_2CYCLES),
286            2 => Some(AT_A::_4CYCLES),
287            3 => Some(AT_A::_8CYCLES),
288            4 => Some(AT_A::_16CYCLES),
289            5 => Some(AT_A::_32CYCLES),
290            6 => Some(AT_A::_64CYCLES),
291            7 => Some(AT_A::_128CYCLES),
292            8 => Some(AT_A::_256CYCLES),
293            _ => None,
294        }
295    }
296    #[doc = "Checks if the value of the field is `_1CYCLE`"]
297    #[inline(always)]
298    pub fn is_1cycle(&self) -> bool {
299        *self == AT_A::_1CYCLE
300    }
301    #[doc = "Checks if the value of the field is `_2CYCLES`"]
302    #[inline(always)]
303    pub fn is_2cycles(&self) -> bool {
304        *self == AT_A::_2CYCLES
305    }
306    #[doc = "Checks if the value of the field is `_4CYCLES`"]
307    #[inline(always)]
308    pub fn is_4cycles(&self) -> bool {
309        *self == AT_A::_4CYCLES
310    }
311    #[doc = "Checks if the value of the field is `_8CYCLES`"]
312    #[inline(always)]
313    pub fn is_8cycles(&self) -> bool {
314        *self == AT_A::_8CYCLES
315    }
316    #[doc = "Checks if the value of the field is `_16CYCLES`"]
317    #[inline(always)]
318    pub fn is_16cycles(&self) -> bool {
319        *self == AT_A::_16CYCLES
320    }
321    #[doc = "Checks if the value of the field is `_32CYCLES`"]
322    #[inline(always)]
323    pub fn is_32cycles(&self) -> bool {
324        *self == AT_A::_32CYCLES
325    }
326    #[doc = "Checks if the value of the field is `_64CYCLES`"]
327    #[inline(always)]
328    pub fn is_64cycles(&self) -> bool {
329        *self == AT_A::_64CYCLES
330    }
331    #[doc = "Checks if the value of the field is `_128CYCLES`"]
332    #[inline(always)]
333    pub fn is_128cycles(&self) -> bool {
334        *self == AT_A::_128CYCLES
335    }
336    #[doc = "Checks if the value of the field is `_256CYCLES`"]
337    #[inline(always)]
338    pub fn is_256cycles(&self) -> bool {
339        *self == AT_A::_256CYCLES
340    }
341}
342#[doc = "Field `AT` writer - Single Sample Acquisition Time"]
343pub type AT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, AT_A, 4, O>;
344impl<'a, const O: u8> AT_W<'a, O> {
345    #[doc = "1 ADC_CLK cycle acquisition time for single sample"]
346    #[inline(always)]
347    pub fn _1cycle(self) -> &'a mut W {
348        self.variant(AT_A::_1CYCLE)
349    }
350    #[doc = "2 ADC_CLK cycles acquisition time for single sample"]
351    #[inline(always)]
352    pub fn _2cycles(self) -> &'a mut W {
353        self.variant(AT_A::_2CYCLES)
354    }
355    #[doc = "4 ADC_CLK cycles acquisition time for single sample"]
356    #[inline(always)]
357    pub fn _4cycles(self) -> &'a mut W {
358        self.variant(AT_A::_4CYCLES)
359    }
360    #[doc = "8 ADC_CLK cycles acquisition time for single sample"]
361    #[inline(always)]
362    pub fn _8cycles(self) -> &'a mut W {
363        self.variant(AT_A::_8CYCLES)
364    }
365    #[doc = "16 ADC_CLK cycles acquisition time for single sample"]
366    #[inline(always)]
367    pub fn _16cycles(self) -> &'a mut W {
368        self.variant(AT_A::_16CYCLES)
369    }
370    #[doc = "32 ADC_CLK cycles acquisition time for single sample"]
371    #[inline(always)]
372    pub fn _32cycles(self) -> &'a mut W {
373        self.variant(AT_A::_32CYCLES)
374    }
375    #[doc = "64 ADC_CLK cycles acquisition time for single sample"]
376    #[inline(always)]
377    pub fn _64cycles(self) -> &'a mut W {
378        self.variant(AT_A::_64CYCLES)
379    }
380    #[doc = "128 ADC_CLK cycles acquisition time for single sample"]
381    #[inline(always)]
382    pub fn _128cycles(self) -> &'a mut W {
383        self.variant(AT_A::_128CYCLES)
384    }
385    #[doc = "256 ADC_CLK cycles acquisition time for single sample"]
386    #[inline(always)]
387    pub fn _256cycles(self) -> &'a mut W {
388        self.variant(AT_A::_256CYCLES)
389    }
390}
391#[doc = "Field `PRSEN` reader - Single Sample PRS Trigger Enable"]
392pub type PRSEN_R = crate::BitReader<bool>;
393#[doc = "Field `PRSEN` writer - Single Sample PRS Trigger Enable"]
394pub type PRSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGLECTRL_SPEC, bool, O>;
395#[doc = "Field `PRSSEL` reader - Single Sample PRS Trigger Select"]
396pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
397#[doc = "Single Sample PRS Trigger Select\n\nValue on reset: 0"]
398#[derive(Clone, Copy, Debug, PartialEq, Eq)]
399#[repr(u8)]
400pub enum PRSSEL_A {
401    #[doc = "0: PRS ch 0 triggers single sample"]
402    PRSCH0 = 0,
403    #[doc = "1: PRS ch 1 triggers single sample"]
404    PRSCH1 = 1,
405    #[doc = "2: PRS ch 2 triggers single sample"]
406    PRSCH2 = 2,
407    #[doc = "3: PRS ch 3 triggers single sample"]
408    PRSCH3 = 3,
409    #[doc = "4: PRS ch 4 triggers single sample"]
410    PRSCH4 = 4,
411    #[doc = "5: PRS ch 5 triggers single sample"]
412    PRSCH5 = 5,
413    #[doc = "6: PRS ch 6 triggers single sample"]
414    PRSCH6 = 6,
415    #[doc = "7: PRS ch 7 triggers single sample"]
416    PRSCH7 = 7,
417    #[doc = "8: PRS ch 8 triggers single sample"]
418    PRSCH8 = 8,
419    #[doc = "9: PRS ch 9 triggers single sample"]
420    PRSCH9 = 9,
421    #[doc = "10: PRS ch 10 triggers single sample"]
422    PRSCH10 = 10,
423    #[doc = "11: PRS ch 11 triggers single sample"]
424    PRSCH11 = 11,
425}
426impl From<PRSSEL_A> for u8 {
427    #[inline(always)]
428    fn from(variant: PRSSEL_A) -> Self {
429        variant as _
430    }
431}
432impl PRSSEL_R {
433    #[doc = "Get enumerated values variant"]
434    #[inline(always)]
435    pub fn variant(&self) -> Option<PRSSEL_A> {
436        match self.bits {
437            0 => Some(PRSSEL_A::PRSCH0),
438            1 => Some(PRSSEL_A::PRSCH1),
439            2 => Some(PRSSEL_A::PRSCH2),
440            3 => Some(PRSSEL_A::PRSCH3),
441            4 => Some(PRSSEL_A::PRSCH4),
442            5 => Some(PRSSEL_A::PRSCH5),
443            6 => Some(PRSSEL_A::PRSCH6),
444            7 => Some(PRSSEL_A::PRSCH7),
445            8 => Some(PRSSEL_A::PRSCH8),
446            9 => Some(PRSSEL_A::PRSCH9),
447            10 => Some(PRSSEL_A::PRSCH10),
448            11 => Some(PRSSEL_A::PRSCH11),
449            _ => None,
450        }
451    }
452    #[doc = "Checks if the value of the field is `PRSCH0`"]
453    #[inline(always)]
454    pub fn is_prsch0(&self) -> bool {
455        *self == PRSSEL_A::PRSCH0
456    }
457    #[doc = "Checks if the value of the field is `PRSCH1`"]
458    #[inline(always)]
459    pub fn is_prsch1(&self) -> bool {
460        *self == PRSSEL_A::PRSCH1
461    }
462    #[doc = "Checks if the value of the field is `PRSCH2`"]
463    #[inline(always)]
464    pub fn is_prsch2(&self) -> bool {
465        *self == PRSSEL_A::PRSCH2
466    }
467    #[doc = "Checks if the value of the field is `PRSCH3`"]
468    #[inline(always)]
469    pub fn is_prsch3(&self) -> bool {
470        *self == PRSSEL_A::PRSCH3
471    }
472    #[doc = "Checks if the value of the field is `PRSCH4`"]
473    #[inline(always)]
474    pub fn is_prsch4(&self) -> bool {
475        *self == PRSSEL_A::PRSCH4
476    }
477    #[doc = "Checks if the value of the field is `PRSCH5`"]
478    #[inline(always)]
479    pub fn is_prsch5(&self) -> bool {
480        *self == PRSSEL_A::PRSCH5
481    }
482    #[doc = "Checks if the value of the field is `PRSCH6`"]
483    #[inline(always)]
484    pub fn is_prsch6(&self) -> bool {
485        *self == PRSSEL_A::PRSCH6
486    }
487    #[doc = "Checks if the value of the field is `PRSCH7`"]
488    #[inline(always)]
489    pub fn is_prsch7(&self) -> bool {
490        *self == PRSSEL_A::PRSCH7
491    }
492    #[doc = "Checks if the value of the field is `PRSCH8`"]
493    #[inline(always)]
494    pub fn is_prsch8(&self) -> bool {
495        *self == PRSSEL_A::PRSCH8
496    }
497    #[doc = "Checks if the value of the field is `PRSCH9`"]
498    #[inline(always)]
499    pub fn is_prsch9(&self) -> bool {
500        *self == PRSSEL_A::PRSCH9
501    }
502    #[doc = "Checks if the value of the field is `PRSCH10`"]
503    #[inline(always)]
504    pub fn is_prsch10(&self) -> bool {
505        *self == PRSSEL_A::PRSCH10
506    }
507    #[doc = "Checks if the value of the field is `PRSCH11`"]
508    #[inline(always)]
509    pub fn is_prsch11(&self) -> bool {
510        *self == PRSSEL_A::PRSCH11
511    }
512}
513#[doc = "Field `PRSSEL` writer - Single Sample PRS Trigger Select"]
514pub type PRSSEL_W<'a, const O: u8> =
515    crate::FieldWriter<'a, u32, SINGLECTRL_SPEC, u8, PRSSEL_A, 4, O>;
516impl<'a, const O: u8> PRSSEL_W<'a, O> {
517    #[doc = "PRS ch 0 triggers single sample"]
518    #[inline(always)]
519    pub fn prsch0(self) -> &'a mut W {
520        self.variant(PRSSEL_A::PRSCH0)
521    }
522    #[doc = "PRS ch 1 triggers single sample"]
523    #[inline(always)]
524    pub fn prsch1(self) -> &'a mut W {
525        self.variant(PRSSEL_A::PRSCH1)
526    }
527    #[doc = "PRS ch 2 triggers single sample"]
528    #[inline(always)]
529    pub fn prsch2(self) -> &'a mut W {
530        self.variant(PRSSEL_A::PRSCH2)
531    }
532    #[doc = "PRS ch 3 triggers single sample"]
533    #[inline(always)]
534    pub fn prsch3(self) -> &'a mut W {
535        self.variant(PRSSEL_A::PRSCH3)
536    }
537    #[doc = "PRS ch 4 triggers single sample"]
538    #[inline(always)]
539    pub fn prsch4(self) -> &'a mut W {
540        self.variant(PRSSEL_A::PRSCH4)
541    }
542    #[doc = "PRS ch 5 triggers single sample"]
543    #[inline(always)]
544    pub fn prsch5(self) -> &'a mut W {
545        self.variant(PRSSEL_A::PRSCH5)
546    }
547    #[doc = "PRS ch 6 triggers single sample"]
548    #[inline(always)]
549    pub fn prsch6(self) -> &'a mut W {
550        self.variant(PRSSEL_A::PRSCH6)
551    }
552    #[doc = "PRS ch 7 triggers single sample"]
553    #[inline(always)]
554    pub fn prsch7(self) -> &'a mut W {
555        self.variant(PRSSEL_A::PRSCH7)
556    }
557    #[doc = "PRS ch 8 triggers single sample"]
558    #[inline(always)]
559    pub fn prsch8(self) -> &'a mut W {
560        self.variant(PRSSEL_A::PRSCH8)
561    }
562    #[doc = "PRS ch 9 triggers single sample"]
563    #[inline(always)]
564    pub fn prsch9(self) -> &'a mut W {
565        self.variant(PRSSEL_A::PRSCH9)
566    }
567    #[doc = "PRS ch 10 triggers single sample"]
568    #[inline(always)]
569    pub fn prsch10(self) -> &'a mut W {
570        self.variant(PRSSEL_A::PRSCH10)
571    }
572    #[doc = "PRS ch 11 triggers single sample"]
573    #[inline(always)]
574    pub fn prsch11(self) -> &'a mut W {
575        self.variant(PRSSEL_A::PRSCH11)
576    }
577}
578impl R {
579    #[doc = "Bit 0 - Single Sample Repetitive Mode"]
580    #[inline(always)]
581    pub fn rep(&self) -> REP_R {
582        REP_R::new((self.bits & 1) != 0)
583    }
584    #[doc = "Bit 1 - Single Sample Differential Mode"]
585    #[inline(always)]
586    pub fn diff(&self) -> DIFF_R {
587        DIFF_R::new(((self.bits >> 1) & 1) != 0)
588    }
589    #[doc = "Bit 2 - Single Sample Result Adjustment"]
590    #[inline(always)]
591    pub fn adj(&self) -> ADJ_R {
592        ADJ_R::new(((self.bits >> 2) & 1) != 0)
593    }
594    #[doc = "Bits 4:5 - Single Sample Resolution Select"]
595    #[inline(always)]
596    pub fn res(&self) -> RES_R {
597        RES_R::new(((self.bits >> 4) & 3) as u8)
598    }
599    #[doc = "Bits 8:11 - Single Sample Input Selection"]
600    #[inline(always)]
601    pub fn inputsel(&self) -> INPUTSEL_R {
602        INPUTSEL_R::new(((self.bits >> 8) & 0x0f) as u8)
603    }
604    #[doc = "Bits 16:18 - Single Sample Reference Selection"]
605    #[inline(always)]
606    pub fn ref_(&self) -> REF_R {
607        REF_R::new(((self.bits >> 16) & 7) as u8)
608    }
609    #[doc = "Bits 20:23 - Single Sample Acquisition Time"]
610    #[inline(always)]
611    pub fn at(&self) -> AT_R {
612        AT_R::new(((self.bits >> 20) & 0x0f) as u8)
613    }
614    #[doc = "Bit 24 - Single Sample PRS Trigger Enable"]
615    #[inline(always)]
616    pub fn prsen(&self) -> PRSEN_R {
617        PRSEN_R::new(((self.bits >> 24) & 1) != 0)
618    }
619    #[doc = "Bits 28:31 - Single Sample PRS Trigger Select"]
620    #[inline(always)]
621    pub fn prssel(&self) -> PRSSEL_R {
622        PRSSEL_R::new(((self.bits >> 28) & 0x0f) as u8)
623    }
624}
625impl W {
626    #[doc = "Bit 0 - Single Sample Repetitive Mode"]
627    #[inline(always)]
628    #[must_use]
629    pub fn rep(&mut self) -> REP_W<0> {
630        REP_W::new(self)
631    }
632    #[doc = "Bit 1 - Single Sample Differential Mode"]
633    #[inline(always)]
634    #[must_use]
635    pub fn diff(&mut self) -> DIFF_W<1> {
636        DIFF_W::new(self)
637    }
638    #[doc = "Bit 2 - Single Sample Result Adjustment"]
639    #[inline(always)]
640    #[must_use]
641    pub fn adj(&mut self) -> ADJ_W<2> {
642        ADJ_W::new(self)
643    }
644    #[doc = "Bits 4:5 - Single Sample Resolution Select"]
645    #[inline(always)]
646    #[must_use]
647    pub fn res(&mut self) -> RES_W<4> {
648        RES_W::new(self)
649    }
650    #[doc = "Bits 8:11 - Single Sample Input Selection"]
651    #[inline(always)]
652    #[must_use]
653    pub fn inputsel(&mut self) -> INPUTSEL_W<8> {
654        INPUTSEL_W::new(self)
655    }
656    #[doc = "Bits 16:18 - Single Sample Reference Selection"]
657    #[inline(always)]
658    #[must_use]
659    pub fn ref_(&mut self) -> REF_W<16> {
660        REF_W::new(self)
661    }
662    #[doc = "Bits 20:23 - Single Sample Acquisition Time"]
663    #[inline(always)]
664    #[must_use]
665    pub fn at(&mut self) -> AT_W<20> {
666        AT_W::new(self)
667    }
668    #[doc = "Bit 24 - Single Sample PRS Trigger Enable"]
669    #[inline(always)]
670    #[must_use]
671    pub fn prsen(&mut self) -> PRSEN_W<24> {
672        PRSEN_W::new(self)
673    }
674    #[doc = "Bits 28:31 - Single Sample PRS Trigger Select"]
675    #[inline(always)]
676    #[must_use]
677    pub fn prssel(&mut self) -> PRSSEL_W<28> {
678        PRSSEL_W::new(self)
679    }
680    #[doc = "Writes raw bits to the register."]
681    #[inline(always)]
682    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
683        self.0.bits(bits);
684        self
685    }
686}
687#[doc = "Single Sample 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 [singlectrl](index.html) module"]
688pub struct SINGLECTRL_SPEC;
689impl crate::RegisterSpec for SINGLECTRL_SPEC {
690    type Ux = u32;
691}
692#[doc = "`read()` method returns [singlectrl::R](R) reader structure"]
693impl crate::Readable for SINGLECTRL_SPEC {
694    type Reader = R;
695}
696#[doc = "`write(|w| ..)` method takes [singlectrl::W](W) writer structure"]
697impl crate::Writable for SINGLECTRL_SPEC {
698    type Writer = W;
699    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
700    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
701}
702#[doc = "`reset()` method sets SINGLECTRL to value 0"]
703impl crate::Resettable for SINGLECTRL_SPEC {
704    const RESET_VALUE: Self::Ux = 0;
705}