efm32gg12b110_pac/cmu/
calctrl.rs

1#[doc = "Register `CALCTRL` reader"]
2pub struct R(crate::R<CALCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CALCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CALCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CALCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CALCTRL` writer"]
17pub struct W(crate::W<CALCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CALCTRL_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<CALCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CALCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Calibration Up-counter Select\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum UPSEL_A {
41    #[doc = "0: Select HFXO as up-counter"]
42    HFXO = 0,
43    #[doc = "1: Select LFXO as up-counter"]
44    LFXO = 1,
45    #[doc = "2: Select HFRCO as up-counter"]
46    HFRCO = 2,
47    #[doc = "3: Select LFRCO as up-counter"]
48    LFRCO = 3,
49    #[doc = "4: Select AUXHFRCO as up-counter"]
50    AUXHFRCO = 4,
51    #[doc = "5: Select PRS input selected by PRSUPSEL as up-counter"]
52    PRS = 5,
53    #[doc = "7: Select USHFRCO as up-counter"]
54    USHFRCO = 7,
55}
56impl From<UPSEL_A> for u8 {
57    #[inline(always)]
58    fn from(variant: UPSEL_A) -> Self {
59        variant as _
60    }
61}
62#[doc = "Field `UPSEL` reader - Calibration Up-counter Select"]
63pub type UPSEL_R = crate::FieldReader<u8, UPSEL_A>;
64impl UPSEL_R {
65    #[doc = "Get enumerated values variant"]
66    #[inline(always)]
67    pub fn variant(&self) -> Option<UPSEL_A> {
68        match self.bits {
69            0 => Some(UPSEL_A::HFXO),
70            1 => Some(UPSEL_A::LFXO),
71            2 => Some(UPSEL_A::HFRCO),
72            3 => Some(UPSEL_A::LFRCO),
73            4 => Some(UPSEL_A::AUXHFRCO),
74            5 => Some(UPSEL_A::PRS),
75            7 => Some(UPSEL_A::USHFRCO),
76            _ => None,
77        }
78    }
79    #[doc = "Checks if the value of the field is `HFXO`"]
80    #[inline(always)]
81    pub fn is_hfxo(&self) -> bool {
82        *self == UPSEL_A::HFXO
83    }
84    #[doc = "Checks if the value of the field is `LFXO`"]
85    #[inline(always)]
86    pub fn is_lfxo(&self) -> bool {
87        *self == UPSEL_A::LFXO
88    }
89    #[doc = "Checks if the value of the field is `HFRCO`"]
90    #[inline(always)]
91    pub fn is_hfrco(&self) -> bool {
92        *self == UPSEL_A::HFRCO
93    }
94    #[doc = "Checks if the value of the field is `LFRCO`"]
95    #[inline(always)]
96    pub fn is_lfrco(&self) -> bool {
97        *self == UPSEL_A::LFRCO
98    }
99    #[doc = "Checks if the value of the field is `AUXHFRCO`"]
100    #[inline(always)]
101    pub fn is_auxhfrco(&self) -> bool {
102        *self == UPSEL_A::AUXHFRCO
103    }
104    #[doc = "Checks if the value of the field is `PRS`"]
105    #[inline(always)]
106    pub fn is_prs(&self) -> bool {
107        *self == UPSEL_A::PRS
108    }
109    #[doc = "Checks if the value of the field is `USHFRCO`"]
110    #[inline(always)]
111    pub fn is_ushfrco(&self) -> bool {
112        *self == UPSEL_A::USHFRCO
113    }
114}
115#[doc = "Field `UPSEL` writer - Calibration Up-counter Select"]
116pub type UPSEL_W<'a> = crate::FieldWriter<'a, u32, CALCTRL_SPEC, u8, UPSEL_A, 3, 0>;
117impl<'a> UPSEL_W<'a> {
118    #[doc = "Select HFXO as up-counter"]
119    #[inline(always)]
120    pub fn hfxo(self) -> &'a mut W {
121        self.variant(UPSEL_A::HFXO)
122    }
123    #[doc = "Select LFXO as up-counter"]
124    #[inline(always)]
125    pub fn lfxo(self) -> &'a mut W {
126        self.variant(UPSEL_A::LFXO)
127    }
128    #[doc = "Select HFRCO as up-counter"]
129    #[inline(always)]
130    pub fn hfrco(self) -> &'a mut W {
131        self.variant(UPSEL_A::HFRCO)
132    }
133    #[doc = "Select LFRCO as up-counter"]
134    #[inline(always)]
135    pub fn lfrco(self) -> &'a mut W {
136        self.variant(UPSEL_A::LFRCO)
137    }
138    #[doc = "Select AUXHFRCO as up-counter"]
139    #[inline(always)]
140    pub fn auxhfrco(self) -> &'a mut W {
141        self.variant(UPSEL_A::AUXHFRCO)
142    }
143    #[doc = "Select PRS input selected by PRSUPSEL as up-counter"]
144    #[inline(always)]
145    pub fn prs(self) -> &'a mut W {
146        self.variant(UPSEL_A::PRS)
147    }
148    #[doc = "Select USHFRCO as up-counter"]
149    #[inline(always)]
150    pub fn ushfrco(self) -> &'a mut W {
151        self.variant(UPSEL_A::USHFRCO)
152    }
153}
154#[doc = "Calibration Down-counter Select\n\nValue on reset: 0"]
155#[derive(Clone, Copy, Debug, PartialEq)]
156#[repr(u8)]
157pub enum DOWNSEL_A {
158    #[doc = "0: Select HFCLK for down-counter"]
159    HFCLK = 0,
160    #[doc = "1: Select HFXO for down-counter"]
161    HFXO = 1,
162    #[doc = "2: Select LFXO for down-counter"]
163    LFXO = 2,
164    #[doc = "3: Select HFRCO for down-counter"]
165    HFRCO = 3,
166    #[doc = "4: Select LFRCO for down-counter"]
167    LFRCO = 4,
168    #[doc = "5: Select AUXHFRCO for down-counter"]
169    AUXHFRCO = 5,
170    #[doc = "6: Select PRS input selected by PRSDOWNSEL as down-counter"]
171    PRS = 6,
172    #[doc = "8: Select USHFRCO for down-counter"]
173    USHFRCO = 8,
174}
175impl From<DOWNSEL_A> for u8 {
176    #[inline(always)]
177    fn from(variant: DOWNSEL_A) -> Self {
178        variant as _
179    }
180}
181#[doc = "Field `DOWNSEL` reader - Calibration Down-counter Select"]
182pub type DOWNSEL_R = crate::FieldReader<u8, DOWNSEL_A>;
183impl DOWNSEL_R {
184    #[doc = "Get enumerated values variant"]
185    #[inline(always)]
186    pub fn variant(&self) -> Option<DOWNSEL_A> {
187        match self.bits {
188            0 => Some(DOWNSEL_A::HFCLK),
189            1 => Some(DOWNSEL_A::HFXO),
190            2 => Some(DOWNSEL_A::LFXO),
191            3 => Some(DOWNSEL_A::HFRCO),
192            4 => Some(DOWNSEL_A::LFRCO),
193            5 => Some(DOWNSEL_A::AUXHFRCO),
194            6 => Some(DOWNSEL_A::PRS),
195            8 => Some(DOWNSEL_A::USHFRCO),
196            _ => None,
197        }
198    }
199    #[doc = "Checks if the value of the field is `HFCLK`"]
200    #[inline(always)]
201    pub fn is_hfclk(&self) -> bool {
202        *self == DOWNSEL_A::HFCLK
203    }
204    #[doc = "Checks if the value of the field is `HFXO`"]
205    #[inline(always)]
206    pub fn is_hfxo(&self) -> bool {
207        *self == DOWNSEL_A::HFXO
208    }
209    #[doc = "Checks if the value of the field is `LFXO`"]
210    #[inline(always)]
211    pub fn is_lfxo(&self) -> bool {
212        *self == DOWNSEL_A::LFXO
213    }
214    #[doc = "Checks if the value of the field is `HFRCO`"]
215    #[inline(always)]
216    pub fn is_hfrco(&self) -> bool {
217        *self == DOWNSEL_A::HFRCO
218    }
219    #[doc = "Checks if the value of the field is `LFRCO`"]
220    #[inline(always)]
221    pub fn is_lfrco(&self) -> bool {
222        *self == DOWNSEL_A::LFRCO
223    }
224    #[doc = "Checks if the value of the field is `AUXHFRCO`"]
225    #[inline(always)]
226    pub fn is_auxhfrco(&self) -> bool {
227        *self == DOWNSEL_A::AUXHFRCO
228    }
229    #[doc = "Checks if the value of the field is `PRS`"]
230    #[inline(always)]
231    pub fn is_prs(&self) -> bool {
232        *self == DOWNSEL_A::PRS
233    }
234    #[doc = "Checks if the value of the field is `USHFRCO`"]
235    #[inline(always)]
236    pub fn is_ushfrco(&self) -> bool {
237        *self == DOWNSEL_A::USHFRCO
238    }
239}
240#[doc = "Field `DOWNSEL` writer - Calibration Down-counter Select"]
241pub type DOWNSEL_W<'a> = crate::FieldWriter<'a, u32, CALCTRL_SPEC, u8, DOWNSEL_A, 4, 4>;
242impl<'a> DOWNSEL_W<'a> {
243    #[doc = "Select HFCLK for down-counter"]
244    #[inline(always)]
245    pub fn hfclk(self) -> &'a mut W {
246        self.variant(DOWNSEL_A::HFCLK)
247    }
248    #[doc = "Select HFXO for down-counter"]
249    #[inline(always)]
250    pub fn hfxo(self) -> &'a mut W {
251        self.variant(DOWNSEL_A::HFXO)
252    }
253    #[doc = "Select LFXO for down-counter"]
254    #[inline(always)]
255    pub fn lfxo(self) -> &'a mut W {
256        self.variant(DOWNSEL_A::LFXO)
257    }
258    #[doc = "Select HFRCO for down-counter"]
259    #[inline(always)]
260    pub fn hfrco(self) -> &'a mut W {
261        self.variant(DOWNSEL_A::HFRCO)
262    }
263    #[doc = "Select LFRCO for down-counter"]
264    #[inline(always)]
265    pub fn lfrco(self) -> &'a mut W {
266        self.variant(DOWNSEL_A::LFRCO)
267    }
268    #[doc = "Select AUXHFRCO for down-counter"]
269    #[inline(always)]
270    pub fn auxhfrco(self) -> &'a mut W {
271        self.variant(DOWNSEL_A::AUXHFRCO)
272    }
273    #[doc = "Select PRS input selected by PRSDOWNSEL as down-counter"]
274    #[inline(always)]
275    pub fn prs(self) -> &'a mut W {
276        self.variant(DOWNSEL_A::PRS)
277    }
278    #[doc = "Select USHFRCO for down-counter"]
279    #[inline(always)]
280    pub fn ushfrco(self) -> &'a mut W {
281        self.variant(DOWNSEL_A::USHFRCO)
282    }
283}
284#[doc = "Field `CONT` reader - Continuous Calibration"]
285pub type CONT_R = crate::BitReader<bool>;
286#[doc = "Field `CONT` writer - Continuous Calibration"]
287pub type CONT_W<'a> = crate::BitWriter<'a, u32, CALCTRL_SPEC, bool, 8>;
288#[doc = "PRS Select for PRS Input When Selected in UPSEL\n\nValue on reset: 0"]
289#[derive(Clone, Copy, Debug, PartialEq)]
290#[repr(u8)]
291pub enum PRSUPSEL_A {
292    #[doc = "0: PRS Channel 0 selected as input"]
293    PRSCH0 = 0,
294    #[doc = "1: PRS Channel 1 selected as input"]
295    PRSCH1 = 1,
296    #[doc = "2: PRS Channel 2 selected as input"]
297    PRSCH2 = 2,
298    #[doc = "3: PRS Channel 3 selected as input"]
299    PRSCH3 = 3,
300    #[doc = "4: PRS Channel 4 selected as input"]
301    PRSCH4 = 4,
302    #[doc = "5: PRS Channel 5 selected as input"]
303    PRSCH5 = 5,
304    #[doc = "6: PRS Channel 6 selected as input"]
305    PRSCH6 = 6,
306    #[doc = "7: PRS Channel 7 selected as input"]
307    PRSCH7 = 7,
308    #[doc = "8: PRS Channel 8 selected as input"]
309    PRSCH8 = 8,
310    #[doc = "9: PRS Channel 9 selected as input"]
311    PRSCH9 = 9,
312    #[doc = "10: PRS Channel 10 selected as input"]
313    PRSCH10 = 10,
314    #[doc = "11: PRS Channel 11 selected as input"]
315    PRSCH11 = 11,
316    #[doc = "12: PRS Channel 12 selected as input"]
317    PRSCH12 = 12,
318    #[doc = "13: PRS Channel 13 selected as input"]
319    PRSCH13 = 13,
320    #[doc = "14: PRS Channel 14 selected as input"]
321    PRSCH14 = 14,
322    #[doc = "15: PRS Channel 15 selected as input"]
323    PRSCH15 = 15,
324}
325impl From<PRSUPSEL_A> for u8 {
326    #[inline(always)]
327    fn from(variant: PRSUPSEL_A) -> Self {
328        variant as _
329    }
330}
331#[doc = "Field `PRSUPSEL` reader - PRS Select for PRS Input When Selected in UPSEL"]
332pub type PRSUPSEL_R = crate::FieldReader<u8, PRSUPSEL_A>;
333impl PRSUPSEL_R {
334    #[doc = "Get enumerated values variant"]
335    #[inline(always)]
336    pub fn variant(&self) -> PRSUPSEL_A {
337        match self.bits {
338            0 => PRSUPSEL_A::PRSCH0,
339            1 => PRSUPSEL_A::PRSCH1,
340            2 => PRSUPSEL_A::PRSCH2,
341            3 => PRSUPSEL_A::PRSCH3,
342            4 => PRSUPSEL_A::PRSCH4,
343            5 => PRSUPSEL_A::PRSCH5,
344            6 => PRSUPSEL_A::PRSCH6,
345            7 => PRSUPSEL_A::PRSCH7,
346            8 => PRSUPSEL_A::PRSCH8,
347            9 => PRSUPSEL_A::PRSCH9,
348            10 => PRSUPSEL_A::PRSCH10,
349            11 => PRSUPSEL_A::PRSCH11,
350            12 => PRSUPSEL_A::PRSCH12,
351            13 => PRSUPSEL_A::PRSCH13,
352            14 => PRSUPSEL_A::PRSCH14,
353            15 => PRSUPSEL_A::PRSCH15,
354            _ => unreachable!(),
355        }
356    }
357    #[doc = "Checks if the value of the field is `PRSCH0`"]
358    #[inline(always)]
359    pub fn is_prsch0(&self) -> bool {
360        *self == PRSUPSEL_A::PRSCH0
361    }
362    #[doc = "Checks if the value of the field is `PRSCH1`"]
363    #[inline(always)]
364    pub fn is_prsch1(&self) -> bool {
365        *self == PRSUPSEL_A::PRSCH1
366    }
367    #[doc = "Checks if the value of the field is `PRSCH2`"]
368    #[inline(always)]
369    pub fn is_prsch2(&self) -> bool {
370        *self == PRSUPSEL_A::PRSCH2
371    }
372    #[doc = "Checks if the value of the field is `PRSCH3`"]
373    #[inline(always)]
374    pub fn is_prsch3(&self) -> bool {
375        *self == PRSUPSEL_A::PRSCH3
376    }
377    #[doc = "Checks if the value of the field is `PRSCH4`"]
378    #[inline(always)]
379    pub fn is_prsch4(&self) -> bool {
380        *self == PRSUPSEL_A::PRSCH4
381    }
382    #[doc = "Checks if the value of the field is `PRSCH5`"]
383    #[inline(always)]
384    pub fn is_prsch5(&self) -> bool {
385        *self == PRSUPSEL_A::PRSCH5
386    }
387    #[doc = "Checks if the value of the field is `PRSCH6`"]
388    #[inline(always)]
389    pub fn is_prsch6(&self) -> bool {
390        *self == PRSUPSEL_A::PRSCH6
391    }
392    #[doc = "Checks if the value of the field is `PRSCH7`"]
393    #[inline(always)]
394    pub fn is_prsch7(&self) -> bool {
395        *self == PRSUPSEL_A::PRSCH7
396    }
397    #[doc = "Checks if the value of the field is `PRSCH8`"]
398    #[inline(always)]
399    pub fn is_prsch8(&self) -> bool {
400        *self == PRSUPSEL_A::PRSCH8
401    }
402    #[doc = "Checks if the value of the field is `PRSCH9`"]
403    #[inline(always)]
404    pub fn is_prsch9(&self) -> bool {
405        *self == PRSUPSEL_A::PRSCH9
406    }
407    #[doc = "Checks if the value of the field is `PRSCH10`"]
408    #[inline(always)]
409    pub fn is_prsch10(&self) -> bool {
410        *self == PRSUPSEL_A::PRSCH10
411    }
412    #[doc = "Checks if the value of the field is `PRSCH11`"]
413    #[inline(always)]
414    pub fn is_prsch11(&self) -> bool {
415        *self == PRSUPSEL_A::PRSCH11
416    }
417    #[doc = "Checks if the value of the field is `PRSCH12`"]
418    #[inline(always)]
419    pub fn is_prsch12(&self) -> bool {
420        *self == PRSUPSEL_A::PRSCH12
421    }
422    #[doc = "Checks if the value of the field is `PRSCH13`"]
423    #[inline(always)]
424    pub fn is_prsch13(&self) -> bool {
425        *self == PRSUPSEL_A::PRSCH13
426    }
427    #[doc = "Checks if the value of the field is `PRSCH14`"]
428    #[inline(always)]
429    pub fn is_prsch14(&self) -> bool {
430        *self == PRSUPSEL_A::PRSCH14
431    }
432    #[doc = "Checks if the value of the field is `PRSCH15`"]
433    #[inline(always)]
434    pub fn is_prsch15(&self) -> bool {
435        *self == PRSUPSEL_A::PRSCH15
436    }
437}
438#[doc = "Field `PRSUPSEL` writer - PRS Select for PRS Input When Selected in UPSEL"]
439pub type PRSUPSEL_W<'a> = crate::FieldWriterSafe<'a, u32, CALCTRL_SPEC, u8, PRSUPSEL_A, 4, 16>;
440impl<'a> PRSUPSEL_W<'a> {
441    #[doc = "PRS Channel 0 selected as input"]
442    #[inline(always)]
443    pub fn prsch0(self) -> &'a mut W {
444        self.variant(PRSUPSEL_A::PRSCH0)
445    }
446    #[doc = "PRS Channel 1 selected as input"]
447    #[inline(always)]
448    pub fn prsch1(self) -> &'a mut W {
449        self.variant(PRSUPSEL_A::PRSCH1)
450    }
451    #[doc = "PRS Channel 2 selected as input"]
452    #[inline(always)]
453    pub fn prsch2(self) -> &'a mut W {
454        self.variant(PRSUPSEL_A::PRSCH2)
455    }
456    #[doc = "PRS Channel 3 selected as input"]
457    #[inline(always)]
458    pub fn prsch3(self) -> &'a mut W {
459        self.variant(PRSUPSEL_A::PRSCH3)
460    }
461    #[doc = "PRS Channel 4 selected as input"]
462    #[inline(always)]
463    pub fn prsch4(self) -> &'a mut W {
464        self.variant(PRSUPSEL_A::PRSCH4)
465    }
466    #[doc = "PRS Channel 5 selected as input"]
467    #[inline(always)]
468    pub fn prsch5(self) -> &'a mut W {
469        self.variant(PRSUPSEL_A::PRSCH5)
470    }
471    #[doc = "PRS Channel 6 selected as input"]
472    #[inline(always)]
473    pub fn prsch6(self) -> &'a mut W {
474        self.variant(PRSUPSEL_A::PRSCH6)
475    }
476    #[doc = "PRS Channel 7 selected as input"]
477    #[inline(always)]
478    pub fn prsch7(self) -> &'a mut W {
479        self.variant(PRSUPSEL_A::PRSCH7)
480    }
481    #[doc = "PRS Channel 8 selected as input"]
482    #[inline(always)]
483    pub fn prsch8(self) -> &'a mut W {
484        self.variant(PRSUPSEL_A::PRSCH8)
485    }
486    #[doc = "PRS Channel 9 selected as input"]
487    #[inline(always)]
488    pub fn prsch9(self) -> &'a mut W {
489        self.variant(PRSUPSEL_A::PRSCH9)
490    }
491    #[doc = "PRS Channel 10 selected as input"]
492    #[inline(always)]
493    pub fn prsch10(self) -> &'a mut W {
494        self.variant(PRSUPSEL_A::PRSCH10)
495    }
496    #[doc = "PRS Channel 11 selected as input"]
497    #[inline(always)]
498    pub fn prsch11(self) -> &'a mut W {
499        self.variant(PRSUPSEL_A::PRSCH11)
500    }
501    #[doc = "PRS Channel 12 selected as input"]
502    #[inline(always)]
503    pub fn prsch12(self) -> &'a mut W {
504        self.variant(PRSUPSEL_A::PRSCH12)
505    }
506    #[doc = "PRS Channel 13 selected as input"]
507    #[inline(always)]
508    pub fn prsch13(self) -> &'a mut W {
509        self.variant(PRSUPSEL_A::PRSCH13)
510    }
511    #[doc = "PRS Channel 14 selected as input"]
512    #[inline(always)]
513    pub fn prsch14(self) -> &'a mut W {
514        self.variant(PRSUPSEL_A::PRSCH14)
515    }
516    #[doc = "PRS Channel 15 selected as input"]
517    #[inline(always)]
518    pub fn prsch15(self) -> &'a mut W {
519        self.variant(PRSUPSEL_A::PRSCH15)
520    }
521}
522#[doc = "PRS Select for PRS Input When Selected in DOWNSEL\n\nValue on reset: 0"]
523#[derive(Clone, Copy, Debug, PartialEq)]
524#[repr(u8)]
525pub enum PRSDOWNSEL_A {
526    #[doc = "0: PRS Channel 0 selected as input"]
527    PRSCH0 = 0,
528    #[doc = "1: PRS Channel 1 selected as input"]
529    PRSCH1 = 1,
530    #[doc = "2: PRS Channel 2 selected as input"]
531    PRSCH2 = 2,
532    #[doc = "3: PRS Channel 3 selected as input"]
533    PRSCH3 = 3,
534    #[doc = "4: PRS Channel 4 selected as input"]
535    PRSCH4 = 4,
536    #[doc = "5: PRS Channel 5 selected as input"]
537    PRSCH5 = 5,
538    #[doc = "6: PRS Channel 6 selected as input"]
539    PRSCH6 = 6,
540    #[doc = "7: PRS Channel 7 selected as input"]
541    PRSCH7 = 7,
542    #[doc = "8: PRS Channel 8 selected as input"]
543    PRSCH8 = 8,
544    #[doc = "9: PRS Channel 9 selected as input"]
545    PRSCH9 = 9,
546    #[doc = "10: PRS Channel 10 selected as input"]
547    PRSCH10 = 10,
548    #[doc = "11: PRS Channel 11 selected as input"]
549    PRSCH11 = 11,
550    #[doc = "12: PRS Channel 12 selected as input"]
551    PRSCH12 = 12,
552    #[doc = "13: PRS Channel 13 selected as input"]
553    PRSCH13 = 13,
554    #[doc = "14: PRS Channel 14 selected as input"]
555    PRSCH14 = 14,
556    #[doc = "15: PRS Channel 15 selected as input"]
557    PRSCH15 = 15,
558}
559impl From<PRSDOWNSEL_A> for u8 {
560    #[inline(always)]
561    fn from(variant: PRSDOWNSEL_A) -> Self {
562        variant as _
563    }
564}
565#[doc = "Field `PRSDOWNSEL` reader - PRS Select for PRS Input When Selected in DOWNSEL"]
566pub type PRSDOWNSEL_R = crate::FieldReader<u8, PRSDOWNSEL_A>;
567impl PRSDOWNSEL_R {
568    #[doc = "Get enumerated values variant"]
569    #[inline(always)]
570    pub fn variant(&self) -> PRSDOWNSEL_A {
571        match self.bits {
572            0 => PRSDOWNSEL_A::PRSCH0,
573            1 => PRSDOWNSEL_A::PRSCH1,
574            2 => PRSDOWNSEL_A::PRSCH2,
575            3 => PRSDOWNSEL_A::PRSCH3,
576            4 => PRSDOWNSEL_A::PRSCH4,
577            5 => PRSDOWNSEL_A::PRSCH5,
578            6 => PRSDOWNSEL_A::PRSCH6,
579            7 => PRSDOWNSEL_A::PRSCH7,
580            8 => PRSDOWNSEL_A::PRSCH8,
581            9 => PRSDOWNSEL_A::PRSCH9,
582            10 => PRSDOWNSEL_A::PRSCH10,
583            11 => PRSDOWNSEL_A::PRSCH11,
584            12 => PRSDOWNSEL_A::PRSCH12,
585            13 => PRSDOWNSEL_A::PRSCH13,
586            14 => PRSDOWNSEL_A::PRSCH14,
587            15 => PRSDOWNSEL_A::PRSCH15,
588            _ => unreachable!(),
589        }
590    }
591    #[doc = "Checks if the value of the field is `PRSCH0`"]
592    #[inline(always)]
593    pub fn is_prsch0(&self) -> bool {
594        *self == PRSDOWNSEL_A::PRSCH0
595    }
596    #[doc = "Checks if the value of the field is `PRSCH1`"]
597    #[inline(always)]
598    pub fn is_prsch1(&self) -> bool {
599        *self == PRSDOWNSEL_A::PRSCH1
600    }
601    #[doc = "Checks if the value of the field is `PRSCH2`"]
602    #[inline(always)]
603    pub fn is_prsch2(&self) -> bool {
604        *self == PRSDOWNSEL_A::PRSCH2
605    }
606    #[doc = "Checks if the value of the field is `PRSCH3`"]
607    #[inline(always)]
608    pub fn is_prsch3(&self) -> bool {
609        *self == PRSDOWNSEL_A::PRSCH3
610    }
611    #[doc = "Checks if the value of the field is `PRSCH4`"]
612    #[inline(always)]
613    pub fn is_prsch4(&self) -> bool {
614        *self == PRSDOWNSEL_A::PRSCH4
615    }
616    #[doc = "Checks if the value of the field is `PRSCH5`"]
617    #[inline(always)]
618    pub fn is_prsch5(&self) -> bool {
619        *self == PRSDOWNSEL_A::PRSCH5
620    }
621    #[doc = "Checks if the value of the field is `PRSCH6`"]
622    #[inline(always)]
623    pub fn is_prsch6(&self) -> bool {
624        *self == PRSDOWNSEL_A::PRSCH6
625    }
626    #[doc = "Checks if the value of the field is `PRSCH7`"]
627    #[inline(always)]
628    pub fn is_prsch7(&self) -> bool {
629        *self == PRSDOWNSEL_A::PRSCH7
630    }
631    #[doc = "Checks if the value of the field is `PRSCH8`"]
632    #[inline(always)]
633    pub fn is_prsch8(&self) -> bool {
634        *self == PRSDOWNSEL_A::PRSCH8
635    }
636    #[doc = "Checks if the value of the field is `PRSCH9`"]
637    #[inline(always)]
638    pub fn is_prsch9(&self) -> bool {
639        *self == PRSDOWNSEL_A::PRSCH9
640    }
641    #[doc = "Checks if the value of the field is `PRSCH10`"]
642    #[inline(always)]
643    pub fn is_prsch10(&self) -> bool {
644        *self == PRSDOWNSEL_A::PRSCH10
645    }
646    #[doc = "Checks if the value of the field is `PRSCH11`"]
647    #[inline(always)]
648    pub fn is_prsch11(&self) -> bool {
649        *self == PRSDOWNSEL_A::PRSCH11
650    }
651    #[doc = "Checks if the value of the field is `PRSCH12`"]
652    #[inline(always)]
653    pub fn is_prsch12(&self) -> bool {
654        *self == PRSDOWNSEL_A::PRSCH12
655    }
656    #[doc = "Checks if the value of the field is `PRSCH13`"]
657    #[inline(always)]
658    pub fn is_prsch13(&self) -> bool {
659        *self == PRSDOWNSEL_A::PRSCH13
660    }
661    #[doc = "Checks if the value of the field is `PRSCH14`"]
662    #[inline(always)]
663    pub fn is_prsch14(&self) -> bool {
664        *self == PRSDOWNSEL_A::PRSCH14
665    }
666    #[doc = "Checks if the value of the field is `PRSCH15`"]
667    #[inline(always)]
668    pub fn is_prsch15(&self) -> bool {
669        *self == PRSDOWNSEL_A::PRSCH15
670    }
671}
672#[doc = "Field `PRSDOWNSEL` writer - PRS Select for PRS Input When Selected in DOWNSEL"]
673pub type PRSDOWNSEL_W<'a> = crate::FieldWriterSafe<'a, u32, CALCTRL_SPEC, u8, PRSDOWNSEL_A, 4, 24>;
674impl<'a> PRSDOWNSEL_W<'a> {
675    #[doc = "PRS Channel 0 selected as input"]
676    #[inline(always)]
677    pub fn prsch0(self) -> &'a mut W {
678        self.variant(PRSDOWNSEL_A::PRSCH0)
679    }
680    #[doc = "PRS Channel 1 selected as input"]
681    #[inline(always)]
682    pub fn prsch1(self) -> &'a mut W {
683        self.variant(PRSDOWNSEL_A::PRSCH1)
684    }
685    #[doc = "PRS Channel 2 selected as input"]
686    #[inline(always)]
687    pub fn prsch2(self) -> &'a mut W {
688        self.variant(PRSDOWNSEL_A::PRSCH2)
689    }
690    #[doc = "PRS Channel 3 selected as input"]
691    #[inline(always)]
692    pub fn prsch3(self) -> &'a mut W {
693        self.variant(PRSDOWNSEL_A::PRSCH3)
694    }
695    #[doc = "PRS Channel 4 selected as input"]
696    #[inline(always)]
697    pub fn prsch4(self) -> &'a mut W {
698        self.variant(PRSDOWNSEL_A::PRSCH4)
699    }
700    #[doc = "PRS Channel 5 selected as input"]
701    #[inline(always)]
702    pub fn prsch5(self) -> &'a mut W {
703        self.variant(PRSDOWNSEL_A::PRSCH5)
704    }
705    #[doc = "PRS Channel 6 selected as input"]
706    #[inline(always)]
707    pub fn prsch6(self) -> &'a mut W {
708        self.variant(PRSDOWNSEL_A::PRSCH6)
709    }
710    #[doc = "PRS Channel 7 selected as input"]
711    #[inline(always)]
712    pub fn prsch7(self) -> &'a mut W {
713        self.variant(PRSDOWNSEL_A::PRSCH7)
714    }
715    #[doc = "PRS Channel 8 selected as input"]
716    #[inline(always)]
717    pub fn prsch8(self) -> &'a mut W {
718        self.variant(PRSDOWNSEL_A::PRSCH8)
719    }
720    #[doc = "PRS Channel 9 selected as input"]
721    #[inline(always)]
722    pub fn prsch9(self) -> &'a mut W {
723        self.variant(PRSDOWNSEL_A::PRSCH9)
724    }
725    #[doc = "PRS Channel 10 selected as input"]
726    #[inline(always)]
727    pub fn prsch10(self) -> &'a mut W {
728        self.variant(PRSDOWNSEL_A::PRSCH10)
729    }
730    #[doc = "PRS Channel 11 selected as input"]
731    #[inline(always)]
732    pub fn prsch11(self) -> &'a mut W {
733        self.variant(PRSDOWNSEL_A::PRSCH11)
734    }
735    #[doc = "PRS Channel 12 selected as input"]
736    #[inline(always)]
737    pub fn prsch12(self) -> &'a mut W {
738        self.variant(PRSDOWNSEL_A::PRSCH12)
739    }
740    #[doc = "PRS Channel 13 selected as input"]
741    #[inline(always)]
742    pub fn prsch13(self) -> &'a mut W {
743        self.variant(PRSDOWNSEL_A::PRSCH13)
744    }
745    #[doc = "PRS Channel 14 selected as input"]
746    #[inline(always)]
747    pub fn prsch14(self) -> &'a mut W {
748        self.variant(PRSDOWNSEL_A::PRSCH14)
749    }
750    #[doc = "PRS Channel 15 selected as input"]
751    #[inline(always)]
752    pub fn prsch15(self) -> &'a mut W {
753        self.variant(PRSDOWNSEL_A::PRSCH15)
754    }
755}
756impl R {
757    #[doc = "Bits 0:2 - Calibration Up-counter Select"]
758    #[inline(always)]
759    pub fn upsel(&self) -> UPSEL_R {
760        UPSEL_R::new((self.bits & 7) as u8)
761    }
762    #[doc = "Bits 4:7 - Calibration Down-counter Select"]
763    #[inline(always)]
764    pub fn downsel(&self) -> DOWNSEL_R {
765        DOWNSEL_R::new(((self.bits >> 4) & 0x0f) as u8)
766    }
767    #[doc = "Bit 8 - Continuous Calibration"]
768    #[inline(always)]
769    pub fn cont(&self) -> CONT_R {
770        CONT_R::new(((self.bits >> 8) & 1) != 0)
771    }
772    #[doc = "Bits 16:19 - PRS Select for PRS Input When Selected in UPSEL"]
773    #[inline(always)]
774    pub fn prsupsel(&self) -> PRSUPSEL_R {
775        PRSUPSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
776    }
777    #[doc = "Bits 24:27 - PRS Select for PRS Input When Selected in DOWNSEL"]
778    #[inline(always)]
779    pub fn prsdownsel(&self) -> PRSDOWNSEL_R {
780        PRSDOWNSEL_R::new(((self.bits >> 24) & 0x0f) as u8)
781    }
782}
783impl W {
784    #[doc = "Bits 0:2 - Calibration Up-counter Select"]
785    #[inline(always)]
786    pub fn upsel(&mut self) -> UPSEL_W {
787        UPSEL_W::new(self)
788    }
789    #[doc = "Bits 4:7 - Calibration Down-counter Select"]
790    #[inline(always)]
791    pub fn downsel(&mut self) -> DOWNSEL_W {
792        DOWNSEL_W::new(self)
793    }
794    #[doc = "Bit 8 - Continuous Calibration"]
795    #[inline(always)]
796    pub fn cont(&mut self) -> CONT_W {
797        CONT_W::new(self)
798    }
799    #[doc = "Bits 16:19 - PRS Select for PRS Input When Selected in UPSEL"]
800    #[inline(always)]
801    pub fn prsupsel(&mut self) -> PRSUPSEL_W {
802        PRSUPSEL_W::new(self)
803    }
804    #[doc = "Bits 24:27 - PRS Select for PRS Input When Selected in DOWNSEL"]
805    #[inline(always)]
806    pub fn prsdownsel(&mut self) -> PRSDOWNSEL_W {
807        PRSDOWNSEL_W::new(self)
808    }
809    #[doc = "Writes raw bits to the register."]
810    #[inline(always)]
811    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
812        self.0.bits(bits);
813        self
814    }
815}
816#[doc = "Calibration 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 [calctrl](index.html) module"]
817pub struct CALCTRL_SPEC;
818impl crate::RegisterSpec for CALCTRL_SPEC {
819    type Ux = u32;
820}
821#[doc = "`read()` method returns [calctrl::R](R) reader structure"]
822impl crate::Readable for CALCTRL_SPEC {
823    type Reader = R;
824}
825#[doc = "`write(|w| ..)` method takes [calctrl::W](W) writer structure"]
826impl crate::Writable for CALCTRL_SPEC {
827    type Writer = W;
828}
829#[doc = "`reset()` method sets CALCTRL to value 0"]
830impl crate::Resettable for CALCTRL_SPEC {
831    #[inline(always)]
832    fn reset_value() -> Self::Ux {
833        0
834    }
835}