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