efm32pg12_pac/cmu/
calctrl.rs

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