efm32jg12b_pac/efm32jg12b500/cmu/
hfxotimeoutctrl.rs1#[doc = "Register `HFXOTIMEOUTCTRL` reader"]
2pub struct R(crate::R<HFXOTIMEOUTCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HFXOTIMEOUTCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HFXOTIMEOUTCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HFXOTIMEOUTCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HFXOTIMEOUTCTRL` writer"]
17pub struct W(crate::W<HFXOTIMEOUTCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HFXOTIMEOUTCTRL_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<HFXOTIMEOUTCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HFXOTIMEOUTCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `STARTUPTIMEOUT` reader - Wait Duration in HFXO Startup Enable Wait State"]
38pub type STARTUPTIMEOUT_R = crate::FieldReader<u8, STARTUPTIMEOUT_A>;
39#[doc = "Wait Duration in HFXO Startup Enable Wait State\n\nValue on reset: 7"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum STARTUPTIMEOUT_A {
43 #[doc = "0: Timeout period of 2 cycles"]
44 _2CYCLES = 0,
45 #[doc = "1: Timeout period of 4 cycles"]
46 _4CYCLES = 1,
47 #[doc = "2: Timeout period of 16 cycles"]
48 _16CYCLES = 2,
49 #[doc = "3: Timeout period of 32 cycles"]
50 _32CYCLES = 3,
51 #[doc = "4: Timeout period of 256 cycles"]
52 _256CYCLES = 4,
53 #[doc = "5: Timeout period of 1024 cycles"]
54 _1KCYCLES = 5,
55 #[doc = "6: Timeout period of 2048 cycles"]
56 _2KCYCLES = 6,
57 #[doc = "7: Timeout period of 4096 cycles"]
58 _4KCYCLES = 7,
59 #[doc = "8: Timeout period of 8192 cycles"]
60 _8KCYCLES = 8,
61 #[doc = "9: Timeout period of 16384 cycles"]
62 _16KCYCLES = 9,
63 #[doc = "10: Timeout period of 32768 cycles"]
64 _32KCYCLES = 10,
65}
66impl From<STARTUPTIMEOUT_A> for u8 {
67 #[inline(always)]
68 fn from(variant: STARTUPTIMEOUT_A) -> Self {
69 variant as _
70 }
71}
72impl STARTUPTIMEOUT_R {
73 #[doc = "Get enumerated values variant"]
74 #[inline(always)]
75 pub fn variant(&self) -> Option<STARTUPTIMEOUT_A> {
76 match self.bits {
77 0 => Some(STARTUPTIMEOUT_A::_2CYCLES),
78 1 => Some(STARTUPTIMEOUT_A::_4CYCLES),
79 2 => Some(STARTUPTIMEOUT_A::_16CYCLES),
80 3 => Some(STARTUPTIMEOUT_A::_32CYCLES),
81 4 => Some(STARTUPTIMEOUT_A::_256CYCLES),
82 5 => Some(STARTUPTIMEOUT_A::_1KCYCLES),
83 6 => Some(STARTUPTIMEOUT_A::_2KCYCLES),
84 7 => Some(STARTUPTIMEOUT_A::_4KCYCLES),
85 8 => Some(STARTUPTIMEOUT_A::_8KCYCLES),
86 9 => Some(STARTUPTIMEOUT_A::_16KCYCLES),
87 10 => Some(STARTUPTIMEOUT_A::_32KCYCLES),
88 _ => None,
89 }
90 }
91 #[doc = "Checks if the value of the field is `_2CYCLES`"]
92 #[inline(always)]
93 pub fn is_2cycles(&self) -> bool {
94 *self == STARTUPTIMEOUT_A::_2CYCLES
95 }
96 #[doc = "Checks if the value of the field is `_4CYCLES`"]
97 #[inline(always)]
98 pub fn is_4cycles(&self) -> bool {
99 *self == STARTUPTIMEOUT_A::_4CYCLES
100 }
101 #[doc = "Checks if the value of the field is `_16CYCLES`"]
102 #[inline(always)]
103 pub fn is_16cycles(&self) -> bool {
104 *self == STARTUPTIMEOUT_A::_16CYCLES
105 }
106 #[doc = "Checks if the value of the field is `_32CYCLES`"]
107 #[inline(always)]
108 pub fn is_32cycles(&self) -> bool {
109 *self == STARTUPTIMEOUT_A::_32CYCLES
110 }
111 #[doc = "Checks if the value of the field is `_256CYCLES`"]
112 #[inline(always)]
113 pub fn is_256cycles(&self) -> bool {
114 *self == STARTUPTIMEOUT_A::_256CYCLES
115 }
116 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
117 #[inline(always)]
118 pub fn is_1kcycles(&self) -> bool {
119 *self == STARTUPTIMEOUT_A::_1KCYCLES
120 }
121 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
122 #[inline(always)]
123 pub fn is_2kcycles(&self) -> bool {
124 *self == STARTUPTIMEOUT_A::_2KCYCLES
125 }
126 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
127 #[inline(always)]
128 pub fn is_4kcycles(&self) -> bool {
129 *self == STARTUPTIMEOUT_A::_4KCYCLES
130 }
131 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
132 #[inline(always)]
133 pub fn is_8kcycles(&self) -> bool {
134 *self == STARTUPTIMEOUT_A::_8KCYCLES
135 }
136 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
137 #[inline(always)]
138 pub fn is_16kcycles(&self) -> bool {
139 *self == STARTUPTIMEOUT_A::_16KCYCLES
140 }
141 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
142 #[inline(always)]
143 pub fn is_32kcycles(&self) -> bool {
144 *self == STARTUPTIMEOUT_A::_32KCYCLES
145 }
146}
147#[doc = "Field `STARTUPTIMEOUT` writer - Wait Duration in HFXO Startup Enable Wait State"]
148pub type STARTUPTIMEOUT_W<'a, const O: u8> =
149 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STARTUPTIMEOUT_A, 4, O>;
150impl<'a, const O: u8> STARTUPTIMEOUT_W<'a, O> {
151 #[doc = "Timeout period of 2 cycles"]
152 #[inline(always)]
153 pub fn _2cycles(self) -> &'a mut W {
154 self.variant(STARTUPTIMEOUT_A::_2CYCLES)
155 }
156 #[doc = "Timeout period of 4 cycles"]
157 #[inline(always)]
158 pub fn _4cycles(self) -> &'a mut W {
159 self.variant(STARTUPTIMEOUT_A::_4CYCLES)
160 }
161 #[doc = "Timeout period of 16 cycles"]
162 #[inline(always)]
163 pub fn _16cycles(self) -> &'a mut W {
164 self.variant(STARTUPTIMEOUT_A::_16CYCLES)
165 }
166 #[doc = "Timeout period of 32 cycles"]
167 #[inline(always)]
168 pub fn _32cycles(self) -> &'a mut W {
169 self.variant(STARTUPTIMEOUT_A::_32CYCLES)
170 }
171 #[doc = "Timeout period of 256 cycles"]
172 #[inline(always)]
173 pub fn _256cycles(self) -> &'a mut W {
174 self.variant(STARTUPTIMEOUT_A::_256CYCLES)
175 }
176 #[doc = "Timeout period of 1024 cycles"]
177 #[inline(always)]
178 pub fn _1kcycles(self) -> &'a mut W {
179 self.variant(STARTUPTIMEOUT_A::_1KCYCLES)
180 }
181 #[doc = "Timeout period of 2048 cycles"]
182 #[inline(always)]
183 pub fn _2kcycles(self) -> &'a mut W {
184 self.variant(STARTUPTIMEOUT_A::_2KCYCLES)
185 }
186 #[doc = "Timeout period of 4096 cycles"]
187 #[inline(always)]
188 pub fn _4kcycles(self) -> &'a mut W {
189 self.variant(STARTUPTIMEOUT_A::_4KCYCLES)
190 }
191 #[doc = "Timeout period of 8192 cycles"]
192 #[inline(always)]
193 pub fn _8kcycles(self) -> &'a mut W {
194 self.variant(STARTUPTIMEOUT_A::_8KCYCLES)
195 }
196 #[doc = "Timeout period of 16384 cycles"]
197 #[inline(always)]
198 pub fn _16kcycles(self) -> &'a mut W {
199 self.variant(STARTUPTIMEOUT_A::_16KCYCLES)
200 }
201 #[doc = "Timeout period of 32768 cycles"]
202 #[inline(always)]
203 pub fn _32kcycles(self) -> &'a mut W {
204 self.variant(STARTUPTIMEOUT_A::_32KCYCLES)
205 }
206}
207#[doc = "Field `STEADYTIMEOUT` reader - Wait Duration in HFXO Startup Steady Wait State"]
208pub type STEADYTIMEOUT_R = crate::FieldReader<u8, STEADYTIMEOUT_A>;
209#[doc = "Wait Duration in HFXO Startup Steady Wait State\n\nValue on reset: 6"]
210#[derive(Clone, Copy, Debug, PartialEq, Eq)]
211#[repr(u8)]
212pub enum STEADYTIMEOUT_A {
213 #[doc = "0: Timeout period of 2 cycles"]
214 _2CYCLES = 0,
215 #[doc = "1: Timeout period of 4 cycles"]
216 _4CYCLES = 1,
217 #[doc = "2: Timeout period of 16 cycles"]
218 _16CYCLES = 2,
219 #[doc = "3: Timeout period of 32 cycles"]
220 _32CYCLES = 3,
221 #[doc = "4: Timeout period of 256 cycles"]
222 _256CYCLES = 4,
223 #[doc = "5: Timeout period of 1024 cycles"]
224 _1KCYCLES = 5,
225 #[doc = "6: Timeout period of 2048 cycles"]
226 _2KCYCLES = 6,
227 #[doc = "7: Timeout period of 4096 cycles"]
228 _4KCYCLES = 7,
229 #[doc = "8: Timeout period of 8192 cycles"]
230 _8KCYCLES = 8,
231 #[doc = "9: Timeout period of 16384 cycles"]
232 _16KCYCLES = 9,
233 #[doc = "10: Timeout period of 32768 cycles"]
234 _32KCYCLES = 10,
235}
236impl From<STEADYTIMEOUT_A> for u8 {
237 #[inline(always)]
238 fn from(variant: STEADYTIMEOUT_A) -> Self {
239 variant as _
240 }
241}
242impl STEADYTIMEOUT_R {
243 #[doc = "Get enumerated values variant"]
244 #[inline(always)]
245 pub fn variant(&self) -> Option<STEADYTIMEOUT_A> {
246 match self.bits {
247 0 => Some(STEADYTIMEOUT_A::_2CYCLES),
248 1 => Some(STEADYTIMEOUT_A::_4CYCLES),
249 2 => Some(STEADYTIMEOUT_A::_16CYCLES),
250 3 => Some(STEADYTIMEOUT_A::_32CYCLES),
251 4 => Some(STEADYTIMEOUT_A::_256CYCLES),
252 5 => Some(STEADYTIMEOUT_A::_1KCYCLES),
253 6 => Some(STEADYTIMEOUT_A::_2KCYCLES),
254 7 => Some(STEADYTIMEOUT_A::_4KCYCLES),
255 8 => Some(STEADYTIMEOUT_A::_8KCYCLES),
256 9 => Some(STEADYTIMEOUT_A::_16KCYCLES),
257 10 => Some(STEADYTIMEOUT_A::_32KCYCLES),
258 _ => None,
259 }
260 }
261 #[doc = "Checks if the value of the field is `_2CYCLES`"]
262 #[inline(always)]
263 pub fn is_2cycles(&self) -> bool {
264 *self == STEADYTIMEOUT_A::_2CYCLES
265 }
266 #[doc = "Checks if the value of the field is `_4CYCLES`"]
267 #[inline(always)]
268 pub fn is_4cycles(&self) -> bool {
269 *self == STEADYTIMEOUT_A::_4CYCLES
270 }
271 #[doc = "Checks if the value of the field is `_16CYCLES`"]
272 #[inline(always)]
273 pub fn is_16cycles(&self) -> bool {
274 *self == STEADYTIMEOUT_A::_16CYCLES
275 }
276 #[doc = "Checks if the value of the field is `_32CYCLES`"]
277 #[inline(always)]
278 pub fn is_32cycles(&self) -> bool {
279 *self == STEADYTIMEOUT_A::_32CYCLES
280 }
281 #[doc = "Checks if the value of the field is `_256CYCLES`"]
282 #[inline(always)]
283 pub fn is_256cycles(&self) -> bool {
284 *self == STEADYTIMEOUT_A::_256CYCLES
285 }
286 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
287 #[inline(always)]
288 pub fn is_1kcycles(&self) -> bool {
289 *self == STEADYTIMEOUT_A::_1KCYCLES
290 }
291 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
292 #[inline(always)]
293 pub fn is_2kcycles(&self) -> bool {
294 *self == STEADYTIMEOUT_A::_2KCYCLES
295 }
296 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
297 #[inline(always)]
298 pub fn is_4kcycles(&self) -> bool {
299 *self == STEADYTIMEOUT_A::_4KCYCLES
300 }
301 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
302 #[inline(always)]
303 pub fn is_8kcycles(&self) -> bool {
304 *self == STEADYTIMEOUT_A::_8KCYCLES
305 }
306 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
307 #[inline(always)]
308 pub fn is_16kcycles(&self) -> bool {
309 *self == STEADYTIMEOUT_A::_16KCYCLES
310 }
311 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
312 #[inline(always)]
313 pub fn is_32kcycles(&self) -> bool {
314 *self == STEADYTIMEOUT_A::_32KCYCLES
315 }
316}
317#[doc = "Field `STEADYTIMEOUT` writer - Wait Duration in HFXO Startup Steady Wait State"]
318pub type STEADYTIMEOUT_W<'a, const O: u8> =
319 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STEADYTIMEOUT_A, 4, O>;
320impl<'a, const O: u8> STEADYTIMEOUT_W<'a, O> {
321 #[doc = "Timeout period of 2 cycles"]
322 #[inline(always)]
323 pub fn _2cycles(self) -> &'a mut W {
324 self.variant(STEADYTIMEOUT_A::_2CYCLES)
325 }
326 #[doc = "Timeout period of 4 cycles"]
327 #[inline(always)]
328 pub fn _4cycles(self) -> &'a mut W {
329 self.variant(STEADYTIMEOUT_A::_4CYCLES)
330 }
331 #[doc = "Timeout period of 16 cycles"]
332 #[inline(always)]
333 pub fn _16cycles(self) -> &'a mut W {
334 self.variant(STEADYTIMEOUT_A::_16CYCLES)
335 }
336 #[doc = "Timeout period of 32 cycles"]
337 #[inline(always)]
338 pub fn _32cycles(self) -> &'a mut W {
339 self.variant(STEADYTIMEOUT_A::_32CYCLES)
340 }
341 #[doc = "Timeout period of 256 cycles"]
342 #[inline(always)]
343 pub fn _256cycles(self) -> &'a mut W {
344 self.variant(STEADYTIMEOUT_A::_256CYCLES)
345 }
346 #[doc = "Timeout period of 1024 cycles"]
347 #[inline(always)]
348 pub fn _1kcycles(self) -> &'a mut W {
349 self.variant(STEADYTIMEOUT_A::_1KCYCLES)
350 }
351 #[doc = "Timeout period of 2048 cycles"]
352 #[inline(always)]
353 pub fn _2kcycles(self) -> &'a mut W {
354 self.variant(STEADYTIMEOUT_A::_2KCYCLES)
355 }
356 #[doc = "Timeout period of 4096 cycles"]
357 #[inline(always)]
358 pub fn _4kcycles(self) -> &'a mut W {
359 self.variant(STEADYTIMEOUT_A::_4KCYCLES)
360 }
361 #[doc = "Timeout period of 8192 cycles"]
362 #[inline(always)]
363 pub fn _8kcycles(self) -> &'a mut W {
364 self.variant(STEADYTIMEOUT_A::_8KCYCLES)
365 }
366 #[doc = "Timeout period of 16384 cycles"]
367 #[inline(always)]
368 pub fn _16kcycles(self) -> &'a mut W {
369 self.variant(STEADYTIMEOUT_A::_16KCYCLES)
370 }
371 #[doc = "Timeout period of 32768 cycles"]
372 #[inline(always)]
373 pub fn _32kcycles(self) -> &'a mut W {
374 self.variant(STEADYTIMEOUT_A::_32KCYCLES)
375 }
376}
377#[doc = "Field `PEAKDETTIMEOUT` reader - Wait Duration in HFXO Peak Detection Wait State"]
378pub type PEAKDETTIMEOUT_R = crate::FieldReader<u8, PEAKDETTIMEOUT_A>;
379#[doc = "Wait Duration in HFXO Peak Detection Wait State\n\nValue on reset: 10"]
380#[derive(Clone, Copy, Debug, PartialEq, Eq)]
381#[repr(u8)]
382pub enum PEAKDETTIMEOUT_A {
383 #[doc = "0: Timeout period of 2 cycles"]
384 _2CYCLES = 0,
385 #[doc = "1: Timeout period of 4 cycles"]
386 _4CYCLES = 1,
387 #[doc = "2: Timeout period of 16 cycles"]
388 _16CYCLES = 2,
389 #[doc = "3: Timeout period of 32 cycles"]
390 _32CYCLES = 3,
391 #[doc = "4: Timeout period of 256 cycles"]
392 _256CYCLES = 4,
393 #[doc = "5: Timeout period of 1024 cycles"]
394 _1KCYCLES = 5,
395 #[doc = "6: Timeout period of 2048 cycles"]
396 _2KCYCLES = 6,
397 #[doc = "7: Timeout period of 4096 cycles"]
398 _4KCYCLES = 7,
399 #[doc = "8: Timeout period of 8192 cycles"]
400 _8KCYCLES = 8,
401 #[doc = "9: Timeout period of 16384 cycles"]
402 _16KCYCLES = 9,
403 #[doc = "10: Timeout period of 32768 cycles"]
404 _32KCYCLES = 10,
405}
406impl From<PEAKDETTIMEOUT_A> for u8 {
407 #[inline(always)]
408 fn from(variant: PEAKDETTIMEOUT_A) -> Self {
409 variant as _
410 }
411}
412impl PEAKDETTIMEOUT_R {
413 #[doc = "Get enumerated values variant"]
414 #[inline(always)]
415 pub fn variant(&self) -> Option<PEAKDETTIMEOUT_A> {
416 match self.bits {
417 0 => Some(PEAKDETTIMEOUT_A::_2CYCLES),
418 1 => Some(PEAKDETTIMEOUT_A::_4CYCLES),
419 2 => Some(PEAKDETTIMEOUT_A::_16CYCLES),
420 3 => Some(PEAKDETTIMEOUT_A::_32CYCLES),
421 4 => Some(PEAKDETTIMEOUT_A::_256CYCLES),
422 5 => Some(PEAKDETTIMEOUT_A::_1KCYCLES),
423 6 => Some(PEAKDETTIMEOUT_A::_2KCYCLES),
424 7 => Some(PEAKDETTIMEOUT_A::_4KCYCLES),
425 8 => Some(PEAKDETTIMEOUT_A::_8KCYCLES),
426 9 => Some(PEAKDETTIMEOUT_A::_16KCYCLES),
427 10 => Some(PEAKDETTIMEOUT_A::_32KCYCLES),
428 _ => None,
429 }
430 }
431 #[doc = "Checks if the value of the field is `_2CYCLES`"]
432 #[inline(always)]
433 pub fn is_2cycles(&self) -> bool {
434 *self == PEAKDETTIMEOUT_A::_2CYCLES
435 }
436 #[doc = "Checks if the value of the field is `_4CYCLES`"]
437 #[inline(always)]
438 pub fn is_4cycles(&self) -> bool {
439 *self == PEAKDETTIMEOUT_A::_4CYCLES
440 }
441 #[doc = "Checks if the value of the field is `_16CYCLES`"]
442 #[inline(always)]
443 pub fn is_16cycles(&self) -> bool {
444 *self == PEAKDETTIMEOUT_A::_16CYCLES
445 }
446 #[doc = "Checks if the value of the field is `_32CYCLES`"]
447 #[inline(always)]
448 pub fn is_32cycles(&self) -> bool {
449 *self == PEAKDETTIMEOUT_A::_32CYCLES
450 }
451 #[doc = "Checks if the value of the field is `_256CYCLES`"]
452 #[inline(always)]
453 pub fn is_256cycles(&self) -> bool {
454 *self == PEAKDETTIMEOUT_A::_256CYCLES
455 }
456 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
457 #[inline(always)]
458 pub fn is_1kcycles(&self) -> bool {
459 *self == PEAKDETTIMEOUT_A::_1KCYCLES
460 }
461 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
462 #[inline(always)]
463 pub fn is_2kcycles(&self) -> bool {
464 *self == PEAKDETTIMEOUT_A::_2KCYCLES
465 }
466 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
467 #[inline(always)]
468 pub fn is_4kcycles(&self) -> bool {
469 *self == PEAKDETTIMEOUT_A::_4KCYCLES
470 }
471 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
472 #[inline(always)]
473 pub fn is_8kcycles(&self) -> bool {
474 *self == PEAKDETTIMEOUT_A::_8KCYCLES
475 }
476 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
477 #[inline(always)]
478 pub fn is_16kcycles(&self) -> bool {
479 *self == PEAKDETTIMEOUT_A::_16KCYCLES
480 }
481 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
482 #[inline(always)]
483 pub fn is_32kcycles(&self) -> bool {
484 *self == PEAKDETTIMEOUT_A::_32KCYCLES
485 }
486}
487#[doc = "Field `PEAKDETTIMEOUT` writer - Wait Duration in HFXO Peak Detection Wait State"]
488pub type PEAKDETTIMEOUT_W<'a, const O: u8> =
489 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, PEAKDETTIMEOUT_A, 4, O>;
490impl<'a, const O: u8> PEAKDETTIMEOUT_W<'a, O> {
491 #[doc = "Timeout period of 2 cycles"]
492 #[inline(always)]
493 pub fn _2cycles(self) -> &'a mut W {
494 self.variant(PEAKDETTIMEOUT_A::_2CYCLES)
495 }
496 #[doc = "Timeout period of 4 cycles"]
497 #[inline(always)]
498 pub fn _4cycles(self) -> &'a mut W {
499 self.variant(PEAKDETTIMEOUT_A::_4CYCLES)
500 }
501 #[doc = "Timeout period of 16 cycles"]
502 #[inline(always)]
503 pub fn _16cycles(self) -> &'a mut W {
504 self.variant(PEAKDETTIMEOUT_A::_16CYCLES)
505 }
506 #[doc = "Timeout period of 32 cycles"]
507 #[inline(always)]
508 pub fn _32cycles(self) -> &'a mut W {
509 self.variant(PEAKDETTIMEOUT_A::_32CYCLES)
510 }
511 #[doc = "Timeout period of 256 cycles"]
512 #[inline(always)]
513 pub fn _256cycles(self) -> &'a mut W {
514 self.variant(PEAKDETTIMEOUT_A::_256CYCLES)
515 }
516 #[doc = "Timeout period of 1024 cycles"]
517 #[inline(always)]
518 pub fn _1kcycles(self) -> &'a mut W {
519 self.variant(PEAKDETTIMEOUT_A::_1KCYCLES)
520 }
521 #[doc = "Timeout period of 2048 cycles"]
522 #[inline(always)]
523 pub fn _2kcycles(self) -> &'a mut W {
524 self.variant(PEAKDETTIMEOUT_A::_2KCYCLES)
525 }
526 #[doc = "Timeout period of 4096 cycles"]
527 #[inline(always)]
528 pub fn _4kcycles(self) -> &'a mut W {
529 self.variant(PEAKDETTIMEOUT_A::_4KCYCLES)
530 }
531 #[doc = "Timeout period of 8192 cycles"]
532 #[inline(always)]
533 pub fn _8kcycles(self) -> &'a mut W {
534 self.variant(PEAKDETTIMEOUT_A::_8KCYCLES)
535 }
536 #[doc = "Timeout period of 16384 cycles"]
537 #[inline(always)]
538 pub fn _16kcycles(self) -> &'a mut W {
539 self.variant(PEAKDETTIMEOUT_A::_16KCYCLES)
540 }
541 #[doc = "Timeout period of 32768 cycles"]
542 #[inline(always)]
543 pub fn _32kcycles(self) -> &'a mut W {
544 self.variant(PEAKDETTIMEOUT_A::_32KCYCLES)
545 }
546}
547#[doc = "Field `SHUNTOPTTIMEOUT` reader - Wait Duration in HFXO Shunt Current Optimization Wait State"]
548pub type SHUNTOPTTIMEOUT_R = crate::FieldReader<u8, SHUNTOPTTIMEOUT_A>;
549#[doc = "Wait Duration in HFXO Shunt Current Optimization Wait State\n\nValue on reset: 2"]
550#[derive(Clone, Copy, Debug, PartialEq, Eq)]
551#[repr(u8)]
552pub enum SHUNTOPTTIMEOUT_A {
553 #[doc = "0: Timeout period of 2 cycles"]
554 _2CYCLES = 0,
555 #[doc = "1: Timeout period of 4 cycles"]
556 _4CYCLES = 1,
557 #[doc = "2: Timeout period of 16 cycles"]
558 _16CYCLES = 2,
559 #[doc = "3: Timeout period of 32 cycles"]
560 _32CYCLES = 3,
561 #[doc = "4: Timeout period of 256 cycles"]
562 _256CYCLES = 4,
563 #[doc = "5: Timeout period of 1024 cycles"]
564 _1KCYCLES = 5,
565 #[doc = "6: Timeout period of 2048 cycles"]
566 _2KCYCLES = 6,
567 #[doc = "7: Timeout period of 4096 cycles"]
568 _4KCYCLES = 7,
569 #[doc = "8: Timeout period of 8192 cycles"]
570 _8KCYCLES = 8,
571 #[doc = "9: Timeout period of 16384 cycles"]
572 _16KCYCLES = 9,
573 #[doc = "10: Timeout period of 32768 cycles"]
574 _32KCYCLES = 10,
575}
576impl From<SHUNTOPTTIMEOUT_A> for u8 {
577 #[inline(always)]
578 fn from(variant: SHUNTOPTTIMEOUT_A) -> Self {
579 variant as _
580 }
581}
582impl SHUNTOPTTIMEOUT_R {
583 #[doc = "Get enumerated values variant"]
584 #[inline(always)]
585 pub fn variant(&self) -> Option<SHUNTOPTTIMEOUT_A> {
586 match self.bits {
587 0 => Some(SHUNTOPTTIMEOUT_A::_2CYCLES),
588 1 => Some(SHUNTOPTTIMEOUT_A::_4CYCLES),
589 2 => Some(SHUNTOPTTIMEOUT_A::_16CYCLES),
590 3 => Some(SHUNTOPTTIMEOUT_A::_32CYCLES),
591 4 => Some(SHUNTOPTTIMEOUT_A::_256CYCLES),
592 5 => Some(SHUNTOPTTIMEOUT_A::_1KCYCLES),
593 6 => Some(SHUNTOPTTIMEOUT_A::_2KCYCLES),
594 7 => Some(SHUNTOPTTIMEOUT_A::_4KCYCLES),
595 8 => Some(SHUNTOPTTIMEOUT_A::_8KCYCLES),
596 9 => Some(SHUNTOPTTIMEOUT_A::_16KCYCLES),
597 10 => Some(SHUNTOPTTIMEOUT_A::_32KCYCLES),
598 _ => None,
599 }
600 }
601 #[doc = "Checks if the value of the field is `_2CYCLES`"]
602 #[inline(always)]
603 pub fn is_2cycles(&self) -> bool {
604 *self == SHUNTOPTTIMEOUT_A::_2CYCLES
605 }
606 #[doc = "Checks if the value of the field is `_4CYCLES`"]
607 #[inline(always)]
608 pub fn is_4cycles(&self) -> bool {
609 *self == SHUNTOPTTIMEOUT_A::_4CYCLES
610 }
611 #[doc = "Checks if the value of the field is `_16CYCLES`"]
612 #[inline(always)]
613 pub fn is_16cycles(&self) -> bool {
614 *self == SHUNTOPTTIMEOUT_A::_16CYCLES
615 }
616 #[doc = "Checks if the value of the field is `_32CYCLES`"]
617 #[inline(always)]
618 pub fn is_32cycles(&self) -> bool {
619 *self == SHUNTOPTTIMEOUT_A::_32CYCLES
620 }
621 #[doc = "Checks if the value of the field is `_256CYCLES`"]
622 #[inline(always)]
623 pub fn is_256cycles(&self) -> bool {
624 *self == SHUNTOPTTIMEOUT_A::_256CYCLES
625 }
626 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
627 #[inline(always)]
628 pub fn is_1kcycles(&self) -> bool {
629 *self == SHUNTOPTTIMEOUT_A::_1KCYCLES
630 }
631 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
632 #[inline(always)]
633 pub fn is_2kcycles(&self) -> bool {
634 *self == SHUNTOPTTIMEOUT_A::_2KCYCLES
635 }
636 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
637 #[inline(always)]
638 pub fn is_4kcycles(&self) -> bool {
639 *self == SHUNTOPTTIMEOUT_A::_4KCYCLES
640 }
641 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
642 #[inline(always)]
643 pub fn is_8kcycles(&self) -> bool {
644 *self == SHUNTOPTTIMEOUT_A::_8KCYCLES
645 }
646 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
647 #[inline(always)]
648 pub fn is_16kcycles(&self) -> bool {
649 *self == SHUNTOPTTIMEOUT_A::_16KCYCLES
650 }
651 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
652 #[inline(always)]
653 pub fn is_32kcycles(&self) -> bool {
654 *self == SHUNTOPTTIMEOUT_A::_32KCYCLES
655 }
656}
657#[doc = "Field `SHUNTOPTTIMEOUT` writer - Wait Duration in HFXO Shunt Current Optimization Wait State"]
658pub type SHUNTOPTTIMEOUT_W<'a, const O: u8> =
659 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, SHUNTOPTTIMEOUT_A, 4, O>;
660impl<'a, const O: u8> SHUNTOPTTIMEOUT_W<'a, O> {
661 #[doc = "Timeout period of 2 cycles"]
662 #[inline(always)]
663 pub fn _2cycles(self) -> &'a mut W {
664 self.variant(SHUNTOPTTIMEOUT_A::_2CYCLES)
665 }
666 #[doc = "Timeout period of 4 cycles"]
667 #[inline(always)]
668 pub fn _4cycles(self) -> &'a mut W {
669 self.variant(SHUNTOPTTIMEOUT_A::_4CYCLES)
670 }
671 #[doc = "Timeout period of 16 cycles"]
672 #[inline(always)]
673 pub fn _16cycles(self) -> &'a mut W {
674 self.variant(SHUNTOPTTIMEOUT_A::_16CYCLES)
675 }
676 #[doc = "Timeout period of 32 cycles"]
677 #[inline(always)]
678 pub fn _32cycles(self) -> &'a mut W {
679 self.variant(SHUNTOPTTIMEOUT_A::_32CYCLES)
680 }
681 #[doc = "Timeout period of 256 cycles"]
682 #[inline(always)]
683 pub fn _256cycles(self) -> &'a mut W {
684 self.variant(SHUNTOPTTIMEOUT_A::_256CYCLES)
685 }
686 #[doc = "Timeout period of 1024 cycles"]
687 #[inline(always)]
688 pub fn _1kcycles(self) -> &'a mut W {
689 self.variant(SHUNTOPTTIMEOUT_A::_1KCYCLES)
690 }
691 #[doc = "Timeout period of 2048 cycles"]
692 #[inline(always)]
693 pub fn _2kcycles(self) -> &'a mut W {
694 self.variant(SHUNTOPTTIMEOUT_A::_2KCYCLES)
695 }
696 #[doc = "Timeout period of 4096 cycles"]
697 #[inline(always)]
698 pub fn _4kcycles(self) -> &'a mut W {
699 self.variant(SHUNTOPTTIMEOUT_A::_4KCYCLES)
700 }
701 #[doc = "Timeout period of 8192 cycles"]
702 #[inline(always)]
703 pub fn _8kcycles(self) -> &'a mut W {
704 self.variant(SHUNTOPTTIMEOUT_A::_8KCYCLES)
705 }
706 #[doc = "Timeout period of 16384 cycles"]
707 #[inline(always)]
708 pub fn _16kcycles(self) -> &'a mut W {
709 self.variant(SHUNTOPTTIMEOUT_A::_16KCYCLES)
710 }
711 #[doc = "Timeout period of 32768 cycles"]
712 #[inline(always)]
713 pub fn _32kcycles(self) -> &'a mut W {
714 self.variant(SHUNTOPTTIMEOUT_A::_32KCYCLES)
715 }
716}
717impl R {
718 #[doc = "Bits 0:3 - Wait Duration in HFXO Startup Enable Wait State"]
719 #[inline(always)]
720 pub fn startuptimeout(&self) -> STARTUPTIMEOUT_R {
721 STARTUPTIMEOUT_R::new((self.bits & 0x0f) as u8)
722 }
723 #[doc = "Bits 4:7 - Wait Duration in HFXO Startup Steady Wait State"]
724 #[inline(always)]
725 pub fn steadytimeout(&self) -> STEADYTIMEOUT_R {
726 STEADYTIMEOUT_R::new(((self.bits >> 4) & 0x0f) as u8)
727 }
728 #[doc = "Bits 12:15 - Wait Duration in HFXO Peak Detection Wait State"]
729 #[inline(always)]
730 pub fn peakdettimeout(&self) -> PEAKDETTIMEOUT_R {
731 PEAKDETTIMEOUT_R::new(((self.bits >> 12) & 0x0f) as u8)
732 }
733 #[doc = "Bits 16:19 - Wait Duration in HFXO Shunt Current Optimization Wait State"]
734 #[inline(always)]
735 pub fn shuntopttimeout(&self) -> SHUNTOPTTIMEOUT_R {
736 SHUNTOPTTIMEOUT_R::new(((self.bits >> 16) & 0x0f) as u8)
737 }
738}
739impl W {
740 #[doc = "Bits 0:3 - Wait Duration in HFXO Startup Enable Wait State"]
741 #[inline(always)]
742 #[must_use]
743 pub fn startuptimeout(&mut self) -> STARTUPTIMEOUT_W<0> {
744 STARTUPTIMEOUT_W::new(self)
745 }
746 #[doc = "Bits 4:7 - Wait Duration in HFXO Startup Steady Wait State"]
747 #[inline(always)]
748 #[must_use]
749 pub fn steadytimeout(&mut self) -> STEADYTIMEOUT_W<4> {
750 STEADYTIMEOUT_W::new(self)
751 }
752 #[doc = "Bits 12:15 - Wait Duration in HFXO Peak Detection Wait State"]
753 #[inline(always)]
754 #[must_use]
755 pub fn peakdettimeout(&mut self) -> PEAKDETTIMEOUT_W<12> {
756 PEAKDETTIMEOUT_W::new(self)
757 }
758 #[doc = "Bits 16:19 - Wait Duration in HFXO Shunt Current Optimization Wait State"]
759 #[inline(always)]
760 #[must_use]
761 pub fn shuntopttimeout(&mut self) -> SHUNTOPTTIMEOUT_W<16> {
762 SHUNTOPTTIMEOUT_W::new(self)
763 }
764 #[doc = "Writes raw bits to the register."]
765 #[inline(always)]
766 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
767 self.0.bits(bits);
768 self
769 }
770}
771#[doc = "HFXO Timeout Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hfxotimeoutctrl](index.html) module"]
772pub struct HFXOTIMEOUTCTRL_SPEC;
773impl crate::RegisterSpec for HFXOTIMEOUTCTRL_SPEC {
774 type Ux = u32;
775}
776#[doc = "`read()` method returns [hfxotimeoutctrl::R](R) reader structure"]
777impl crate::Readable for HFXOTIMEOUTCTRL_SPEC {
778 type Reader = R;
779}
780#[doc = "`write(|w| ..)` method takes [hfxotimeoutctrl::W](W) writer structure"]
781impl crate::Writable for HFXOTIMEOUTCTRL_SPEC {
782 type Writer = W;
783 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
784 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
785}
786#[doc = "`reset()` method sets HFXOTIMEOUTCTRL to value 0x0002_a067"]
787impl crate::Resettable for HFXOTIMEOUTCTRL_SPEC {
788 const RESET_VALUE: Self::Ux = 0x0002_a067;
789}