1#[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 = "Wait Duration in HFXO Startup Enable Wait State\n\nValue on reset: 7"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum STARTUPTIMEOUT_A {
41 #[doc = "0: Timeout period of 2 cycles"]
42 _2CYCLES = 0,
43 #[doc = "1: Timeout period of 4 cycles"]
44 _4CYCLES = 1,
45 #[doc = "2: Timeout period of 16 cycles"]
46 _16CYCLES = 2,
47 #[doc = "3: Timeout period of 32 cycles"]
48 _32CYCLES = 3,
49 #[doc = "4: Timeout period of 256 cycles"]
50 _256CYCLES = 4,
51 #[doc = "5: Timeout period of 1024 cycles"]
52 _1KCYCLES = 5,
53 #[doc = "6: Timeout period of 2048 cycles"]
54 _2KCYCLES = 6,
55 #[doc = "7: Timeout period of 4096 cycles"]
56 _4KCYCLES = 7,
57 #[doc = "8: Timeout period of 8192 cycles"]
58 _8KCYCLES = 8,
59 #[doc = "9: Timeout period of 16384 cycles"]
60 _16KCYCLES = 9,
61 #[doc = "10: Timeout period of 32768 cycles"]
62 _32KCYCLES = 10,
63}
64impl From<STARTUPTIMEOUT_A> for u8 {
65 #[inline(always)]
66 fn from(variant: STARTUPTIMEOUT_A) -> Self {
67 variant as _
68 }
69}
70#[doc = "Field `STARTUPTIMEOUT` reader - Wait Duration in HFXO Startup Enable Wait State"]
71pub type STARTUPTIMEOUT_R = crate::FieldReader<u8, STARTUPTIMEOUT_A>;
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> =
149 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STARTUPTIMEOUT_A, 4, 0>;
150impl<'a> STARTUPTIMEOUT_W<'a> {
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 = "Wait Duration in HFXO Startup Steady Wait State\n\nValue on reset: 6"]
208#[derive(Clone, Copy, Debug, PartialEq)]
209#[repr(u8)]
210pub enum STEADYTIMEOUT_A {
211 #[doc = "0: Timeout period of 2 cycles"]
212 _2CYCLES = 0,
213 #[doc = "1: Timeout period of 4 cycles"]
214 _4CYCLES = 1,
215 #[doc = "2: Timeout period of 16 cycles"]
216 _16CYCLES = 2,
217 #[doc = "3: Timeout period of 32 cycles"]
218 _32CYCLES = 3,
219 #[doc = "4: Timeout period of 256 cycles"]
220 _256CYCLES = 4,
221 #[doc = "5: Timeout period of 1024 cycles"]
222 _1KCYCLES = 5,
223 #[doc = "6: Timeout period of 2048 cycles"]
224 _2KCYCLES = 6,
225 #[doc = "7: Timeout period of 4096 cycles"]
226 _4KCYCLES = 7,
227 #[doc = "8: Timeout period of 8192 cycles"]
228 _8KCYCLES = 8,
229 #[doc = "9: Timeout period of 16384 cycles"]
230 _16KCYCLES = 9,
231 #[doc = "10: Timeout period of 32768 cycles"]
232 _32KCYCLES = 10,
233}
234impl From<STEADYTIMEOUT_A> for u8 {
235 #[inline(always)]
236 fn from(variant: STEADYTIMEOUT_A) -> Self {
237 variant as _
238 }
239}
240#[doc = "Field `STEADYTIMEOUT` reader - Wait Duration in HFXO Startup Steady Wait State"]
241pub type STEADYTIMEOUT_R = crate::FieldReader<u8, STEADYTIMEOUT_A>;
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> =
319 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STEADYTIMEOUT_A, 4, 4>;
320impl<'a> STEADYTIMEOUT_W<'a> {
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 `RESERVED2` reader - Wait Duration in HFXO Warm Startup Steady Wait State"]
378pub type RESERVED2_R = crate::FieldReader<u8, u8>;
379#[doc = "Field `RESERVED2` writer - Wait Duration in HFXO Warm Startup Steady Wait State"]
380pub type RESERVED2_W<'a> = crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, u8, 4, 8>;
381#[doc = "Wait Duration in HFXO Peak Detection Wait State\n\nValue on reset: 6"]
382#[derive(Clone, Copy, Debug, PartialEq)]
383#[repr(u8)]
384pub enum PEAKDETTIMEOUT_A {
385 #[doc = "0: Timeout period of 2 cycles"]
386 _2CYCLES = 0,
387 #[doc = "1: Timeout period of 4 cycles"]
388 _4CYCLES = 1,
389 #[doc = "2: Timeout period of 16 cycles"]
390 _16CYCLES = 2,
391 #[doc = "3: Timeout period of 32 cycles"]
392 _32CYCLES = 3,
393 #[doc = "4: Timeout period of 256 cycles"]
394 _256CYCLES = 4,
395 #[doc = "5: Timeout period of 1024 cycles"]
396 _1KCYCLES = 5,
397 #[doc = "6: Timeout period of 2048 cycles"]
398 _2KCYCLES = 6,
399 #[doc = "7: Timeout period of 4096 cycles"]
400 _4KCYCLES = 7,
401 #[doc = "8: Timeout period of 8192 cycles"]
402 _8KCYCLES = 8,
403 #[doc = "9: Timeout period of 16384 cycles"]
404 _16KCYCLES = 9,
405 #[doc = "10: Timeout period of 32768 cycles"]
406 _32KCYCLES = 10,
407}
408impl From<PEAKDETTIMEOUT_A> for u8 {
409 #[inline(always)]
410 fn from(variant: PEAKDETTIMEOUT_A) -> Self {
411 variant as _
412 }
413}
414#[doc = "Field `PEAKDETTIMEOUT` reader - Wait Duration in HFXO Peak Detection Wait State"]
415pub type PEAKDETTIMEOUT_R = crate::FieldReader<u8, PEAKDETTIMEOUT_A>;
416impl PEAKDETTIMEOUT_R {
417 #[doc = "Get enumerated values variant"]
418 #[inline(always)]
419 pub fn variant(&self) -> Option<PEAKDETTIMEOUT_A> {
420 match self.bits {
421 0 => Some(PEAKDETTIMEOUT_A::_2CYCLES),
422 1 => Some(PEAKDETTIMEOUT_A::_4CYCLES),
423 2 => Some(PEAKDETTIMEOUT_A::_16CYCLES),
424 3 => Some(PEAKDETTIMEOUT_A::_32CYCLES),
425 4 => Some(PEAKDETTIMEOUT_A::_256CYCLES),
426 5 => Some(PEAKDETTIMEOUT_A::_1KCYCLES),
427 6 => Some(PEAKDETTIMEOUT_A::_2KCYCLES),
428 7 => Some(PEAKDETTIMEOUT_A::_4KCYCLES),
429 8 => Some(PEAKDETTIMEOUT_A::_8KCYCLES),
430 9 => Some(PEAKDETTIMEOUT_A::_16KCYCLES),
431 10 => Some(PEAKDETTIMEOUT_A::_32KCYCLES),
432 _ => None,
433 }
434 }
435 #[doc = "Checks if the value of the field is `_2CYCLES`"]
436 #[inline(always)]
437 pub fn is_2cycles(&self) -> bool {
438 *self == PEAKDETTIMEOUT_A::_2CYCLES
439 }
440 #[doc = "Checks if the value of the field is `_4CYCLES`"]
441 #[inline(always)]
442 pub fn is_4cycles(&self) -> bool {
443 *self == PEAKDETTIMEOUT_A::_4CYCLES
444 }
445 #[doc = "Checks if the value of the field is `_16CYCLES`"]
446 #[inline(always)]
447 pub fn is_16cycles(&self) -> bool {
448 *self == PEAKDETTIMEOUT_A::_16CYCLES
449 }
450 #[doc = "Checks if the value of the field is `_32CYCLES`"]
451 #[inline(always)]
452 pub fn is_32cycles(&self) -> bool {
453 *self == PEAKDETTIMEOUT_A::_32CYCLES
454 }
455 #[doc = "Checks if the value of the field is `_256CYCLES`"]
456 #[inline(always)]
457 pub fn is_256cycles(&self) -> bool {
458 *self == PEAKDETTIMEOUT_A::_256CYCLES
459 }
460 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
461 #[inline(always)]
462 pub fn is_1kcycles(&self) -> bool {
463 *self == PEAKDETTIMEOUT_A::_1KCYCLES
464 }
465 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
466 #[inline(always)]
467 pub fn is_2kcycles(&self) -> bool {
468 *self == PEAKDETTIMEOUT_A::_2KCYCLES
469 }
470 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
471 #[inline(always)]
472 pub fn is_4kcycles(&self) -> bool {
473 *self == PEAKDETTIMEOUT_A::_4KCYCLES
474 }
475 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
476 #[inline(always)]
477 pub fn is_8kcycles(&self) -> bool {
478 *self == PEAKDETTIMEOUT_A::_8KCYCLES
479 }
480 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
481 #[inline(always)]
482 pub fn is_16kcycles(&self) -> bool {
483 *self == PEAKDETTIMEOUT_A::_16KCYCLES
484 }
485 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
486 #[inline(always)]
487 pub fn is_32kcycles(&self) -> bool {
488 *self == PEAKDETTIMEOUT_A::_32KCYCLES
489 }
490}
491#[doc = "Field `PEAKDETTIMEOUT` writer - Wait Duration in HFXO Peak Detection Wait State"]
492pub type PEAKDETTIMEOUT_W<'a> =
493 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, PEAKDETTIMEOUT_A, 4, 12>;
494impl<'a> PEAKDETTIMEOUT_W<'a> {
495 #[doc = "Timeout period of 2 cycles"]
496 #[inline(always)]
497 pub fn _2cycles(self) -> &'a mut W {
498 self.variant(PEAKDETTIMEOUT_A::_2CYCLES)
499 }
500 #[doc = "Timeout period of 4 cycles"]
501 #[inline(always)]
502 pub fn _4cycles(self) -> &'a mut W {
503 self.variant(PEAKDETTIMEOUT_A::_4CYCLES)
504 }
505 #[doc = "Timeout period of 16 cycles"]
506 #[inline(always)]
507 pub fn _16cycles(self) -> &'a mut W {
508 self.variant(PEAKDETTIMEOUT_A::_16CYCLES)
509 }
510 #[doc = "Timeout period of 32 cycles"]
511 #[inline(always)]
512 pub fn _32cycles(self) -> &'a mut W {
513 self.variant(PEAKDETTIMEOUT_A::_32CYCLES)
514 }
515 #[doc = "Timeout period of 256 cycles"]
516 #[inline(always)]
517 pub fn _256cycles(self) -> &'a mut W {
518 self.variant(PEAKDETTIMEOUT_A::_256CYCLES)
519 }
520 #[doc = "Timeout period of 1024 cycles"]
521 #[inline(always)]
522 pub fn _1kcycles(self) -> &'a mut W {
523 self.variant(PEAKDETTIMEOUT_A::_1KCYCLES)
524 }
525 #[doc = "Timeout period of 2048 cycles"]
526 #[inline(always)]
527 pub fn _2kcycles(self) -> &'a mut W {
528 self.variant(PEAKDETTIMEOUT_A::_2KCYCLES)
529 }
530 #[doc = "Timeout period of 4096 cycles"]
531 #[inline(always)]
532 pub fn _4kcycles(self) -> &'a mut W {
533 self.variant(PEAKDETTIMEOUT_A::_4KCYCLES)
534 }
535 #[doc = "Timeout period of 8192 cycles"]
536 #[inline(always)]
537 pub fn _8kcycles(self) -> &'a mut W {
538 self.variant(PEAKDETTIMEOUT_A::_8KCYCLES)
539 }
540 #[doc = "Timeout period of 16384 cycles"]
541 #[inline(always)]
542 pub fn _16kcycles(self) -> &'a mut W {
543 self.variant(PEAKDETTIMEOUT_A::_16KCYCLES)
544 }
545 #[doc = "Timeout period of 32768 cycles"]
546 #[inline(always)]
547 pub fn _32kcycles(self) -> &'a mut W {
548 self.variant(PEAKDETTIMEOUT_A::_32KCYCLES)
549 }
550}
551#[doc = "Wait Duration in HFXO Shunt Current Optimization Wait State\n\nValue on reset: 2"]
552#[derive(Clone, Copy, Debug, PartialEq)]
553#[repr(u8)]
554pub enum SHUNTOPTTIMEOUT_A {
555 #[doc = "0: Timeout period of 2 cycles"]
556 _2CYCLES = 0,
557 #[doc = "1: Timeout period of 4 cycles"]
558 _4CYCLES = 1,
559 #[doc = "2: Timeout period of 16 cycles"]
560 _16CYCLES = 2,
561 #[doc = "3: Timeout period of 32 cycles"]
562 _32CYCLES = 3,
563 #[doc = "4: Timeout period of 256 cycles"]
564 _256CYCLES = 4,
565 #[doc = "5: Timeout period of 1024 cycles"]
566 _1KCYCLES = 5,
567 #[doc = "6: Timeout period of 2048 cycles"]
568 _2KCYCLES = 6,
569 #[doc = "7: Timeout period of 4096 cycles"]
570 _4KCYCLES = 7,
571 #[doc = "8: Timeout period of 8192 cycles"]
572 _8KCYCLES = 8,
573 #[doc = "9: Timeout period of 16384 cycles"]
574 _16KCYCLES = 9,
575 #[doc = "10: Timeout period of 32768 cycles"]
576 _32KCYCLES = 10,
577}
578impl From<SHUNTOPTTIMEOUT_A> for u8 {
579 #[inline(always)]
580 fn from(variant: SHUNTOPTTIMEOUT_A) -> Self {
581 variant as _
582 }
583}
584#[doc = "Field `SHUNTOPTTIMEOUT` reader - Wait Duration in HFXO Shunt Current Optimization Wait State"]
585pub type SHUNTOPTTIMEOUT_R = crate::FieldReader<u8, SHUNTOPTTIMEOUT_A>;
586impl SHUNTOPTTIMEOUT_R {
587 #[doc = "Get enumerated values variant"]
588 #[inline(always)]
589 pub fn variant(&self) -> Option<SHUNTOPTTIMEOUT_A> {
590 match self.bits {
591 0 => Some(SHUNTOPTTIMEOUT_A::_2CYCLES),
592 1 => Some(SHUNTOPTTIMEOUT_A::_4CYCLES),
593 2 => Some(SHUNTOPTTIMEOUT_A::_16CYCLES),
594 3 => Some(SHUNTOPTTIMEOUT_A::_32CYCLES),
595 4 => Some(SHUNTOPTTIMEOUT_A::_256CYCLES),
596 5 => Some(SHUNTOPTTIMEOUT_A::_1KCYCLES),
597 6 => Some(SHUNTOPTTIMEOUT_A::_2KCYCLES),
598 7 => Some(SHUNTOPTTIMEOUT_A::_4KCYCLES),
599 8 => Some(SHUNTOPTTIMEOUT_A::_8KCYCLES),
600 9 => Some(SHUNTOPTTIMEOUT_A::_16KCYCLES),
601 10 => Some(SHUNTOPTTIMEOUT_A::_32KCYCLES),
602 _ => None,
603 }
604 }
605 #[doc = "Checks if the value of the field is `_2CYCLES`"]
606 #[inline(always)]
607 pub fn is_2cycles(&self) -> bool {
608 *self == SHUNTOPTTIMEOUT_A::_2CYCLES
609 }
610 #[doc = "Checks if the value of the field is `_4CYCLES`"]
611 #[inline(always)]
612 pub fn is_4cycles(&self) -> bool {
613 *self == SHUNTOPTTIMEOUT_A::_4CYCLES
614 }
615 #[doc = "Checks if the value of the field is `_16CYCLES`"]
616 #[inline(always)]
617 pub fn is_16cycles(&self) -> bool {
618 *self == SHUNTOPTTIMEOUT_A::_16CYCLES
619 }
620 #[doc = "Checks if the value of the field is `_32CYCLES`"]
621 #[inline(always)]
622 pub fn is_32cycles(&self) -> bool {
623 *self == SHUNTOPTTIMEOUT_A::_32CYCLES
624 }
625 #[doc = "Checks if the value of the field is `_256CYCLES`"]
626 #[inline(always)]
627 pub fn is_256cycles(&self) -> bool {
628 *self == SHUNTOPTTIMEOUT_A::_256CYCLES
629 }
630 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
631 #[inline(always)]
632 pub fn is_1kcycles(&self) -> bool {
633 *self == SHUNTOPTTIMEOUT_A::_1KCYCLES
634 }
635 #[doc = "Checks if the value of the field is `_2KCYCLES`"]
636 #[inline(always)]
637 pub fn is_2kcycles(&self) -> bool {
638 *self == SHUNTOPTTIMEOUT_A::_2KCYCLES
639 }
640 #[doc = "Checks if the value of the field is `_4KCYCLES`"]
641 #[inline(always)]
642 pub fn is_4kcycles(&self) -> bool {
643 *self == SHUNTOPTTIMEOUT_A::_4KCYCLES
644 }
645 #[doc = "Checks if the value of the field is `_8KCYCLES`"]
646 #[inline(always)]
647 pub fn is_8kcycles(&self) -> bool {
648 *self == SHUNTOPTTIMEOUT_A::_8KCYCLES
649 }
650 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
651 #[inline(always)]
652 pub fn is_16kcycles(&self) -> bool {
653 *self == SHUNTOPTTIMEOUT_A::_16KCYCLES
654 }
655 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
656 #[inline(always)]
657 pub fn is_32kcycles(&self) -> bool {
658 *self == SHUNTOPTTIMEOUT_A::_32KCYCLES
659 }
660}
661#[doc = "Field `SHUNTOPTTIMEOUT` writer - Wait Duration in HFXO Shunt Current Optimization Wait State"]
662pub type SHUNTOPTTIMEOUT_W<'a> =
663 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, SHUNTOPTTIMEOUT_A, 4, 16>;
664impl<'a> SHUNTOPTTIMEOUT_W<'a> {
665 #[doc = "Timeout period of 2 cycles"]
666 #[inline(always)]
667 pub fn _2cycles(self) -> &'a mut W {
668 self.variant(SHUNTOPTTIMEOUT_A::_2CYCLES)
669 }
670 #[doc = "Timeout period of 4 cycles"]
671 #[inline(always)]
672 pub fn _4cycles(self) -> &'a mut W {
673 self.variant(SHUNTOPTTIMEOUT_A::_4CYCLES)
674 }
675 #[doc = "Timeout period of 16 cycles"]
676 #[inline(always)]
677 pub fn _16cycles(self) -> &'a mut W {
678 self.variant(SHUNTOPTTIMEOUT_A::_16CYCLES)
679 }
680 #[doc = "Timeout period of 32 cycles"]
681 #[inline(always)]
682 pub fn _32cycles(self) -> &'a mut W {
683 self.variant(SHUNTOPTTIMEOUT_A::_32CYCLES)
684 }
685 #[doc = "Timeout period of 256 cycles"]
686 #[inline(always)]
687 pub fn _256cycles(self) -> &'a mut W {
688 self.variant(SHUNTOPTTIMEOUT_A::_256CYCLES)
689 }
690 #[doc = "Timeout period of 1024 cycles"]
691 #[inline(always)]
692 pub fn _1kcycles(self) -> &'a mut W {
693 self.variant(SHUNTOPTTIMEOUT_A::_1KCYCLES)
694 }
695 #[doc = "Timeout period of 2048 cycles"]
696 #[inline(always)]
697 pub fn _2kcycles(self) -> &'a mut W {
698 self.variant(SHUNTOPTTIMEOUT_A::_2KCYCLES)
699 }
700 #[doc = "Timeout period of 4096 cycles"]
701 #[inline(always)]
702 pub fn _4kcycles(self) -> &'a mut W {
703 self.variant(SHUNTOPTTIMEOUT_A::_4KCYCLES)
704 }
705 #[doc = "Timeout period of 8192 cycles"]
706 #[inline(always)]
707 pub fn _8kcycles(self) -> &'a mut W {
708 self.variant(SHUNTOPTTIMEOUT_A::_8KCYCLES)
709 }
710 #[doc = "Timeout period of 16384 cycles"]
711 #[inline(always)]
712 pub fn _16kcycles(self) -> &'a mut W {
713 self.variant(SHUNTOPTTIMEOUT_A::_16KCYCLES)
714 }
715 #[doc = "Timeout period of 32768 cycles"]
716 #[inline(always)]
717 pub fn _32kcycles(self) -> &'a mut W {
718 self.variant(SHUNTOPTTIMEOUT_A::_32KCYCLES)
719 }
720}
721impl R {
722 #[doc = "Bits 0:3 - Wait Duration in HFXO Startup Enable Wait State"]
723 #[inline(always)]
724 pub fn startuptimeout(&self) -> STARTUPTIMEOUT_R {
725 STARTUPTIMEOUT_R::new((self.bits & 0x0f) as u8)
726 }
727 #[doc = "Bits 4:7 - Wait Duration in HFXO Startup Steady Wait State"]
728 #[inline(always)]
729 pub fn steadytimeout(&self) -> STEADYTIMEOUT_R {
730 STEADYTIMEOUT_R::new(((self.bits >> 4) & 0x0f) as u8)
731 }
732 #[doc = "Bits 8:11 - Wait Duration in HFXO Warm Startup Steady Wait State"]
733 #[inline(always)]
734 pub fn reserved2(&self) -> RESERVED2_R {
735 RESERVED2_R::new(((self.bits >> 8) & 0x0f) as u8)
736 }
737 #[doc = "Bits 12:15 - Wait Duration in HFXO Peak Detection Wait State"]
738 #[inline(always)]
739 pub fn peakdettimeout(&self) -> PEAKDETTIMEOUT_R {
740 PEAKDETTIMEOUT_R::new(((self.bits >> 12) & 0x0f) as u8)
741 }
742 #[doc = "Bits 16:19 - Wait Duration in HFXO Shunt Current Optimization Wait State"]
743 #[inline(always)]
744 pub fn shuntopttimeout(&self) -> SHUNTOPTTIMEOUT_R {
745 SHUNTOPTTIMEOUT_R::new(((self.bits >> 16) & 0x0f) as u8)
746 }
747}
748impl W {
749 #[doc = "Bits 0:3 - Wait Duration in HFXO Startup Enable Wait State"]
750 #[inline(always)]
751 pub fn startuptimeout(&mut self) -> STARTUPTIMEOUT_W {
752 STARTUPTIMEOUT_W::new(self)
753 }
754 #[doc = "Bits 4:7 - Wait Duration in HFXO Startup Steady Wait State"]
755 #[inline(always)]
756 pub fn steadytimeout(&mut self) -> STEADYTIMEOUT_W {
757 STEADYTIMEOUT_W::new(self)
758 }
759 #[doc = "Bits 8:11 - Wait Duration in HFXO Warm Startup Steady Wait State"]
760 #[inline(always)]
761 pub fn reserved2(&mut self) -> RESERVED2_W {
762 RESERVED2_W::new(self)
763 }
764 #[doc = "Bits 12:15 - Wait Duration in HFXO Peak Detection Wait State"]
765 #[inline(always)]
766 pub fn peakdettimeout(&mut self) -> PEAKDETTIMEOUT_W {
767 PEAKDETTIMEOUT_W::new(self)
768 }
769 #[doc = "Bits 16:19 - Wait Duration in HFXO Shunt Current Optimization Wait State"]
770 #[inline(always)]
771 pub fn shuntopttimeout(&mut self) -> SHUNTOPTTIMEOUT_W {
772 SHUNTOPTTIMEOUT_W::new(self)
773 }
774 #[doc = "Writes raw bits to the register."]
775 #[inline(always)]
776 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
777 self.0.bits(bits);
778 self
779 }
780}
781#[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"]
782pub struct HFXOTIMEOUTCTRL_SPEC;
783impl crate::RegisterSpec for HFXOTIMEOUTCTRL_SPEC {
784 type Ux = u32;
785}
786#[doc = "`read()` method returns [hfxotimeoutctrl::R](R) reader structure"]
787impl crate::Readable for HFXOTIMEOUTCTRL_SPEC {
788 type Reader = R;
789}
790#[doc = "`write(|w| ..)` method takes [hfxotimeoutctrl::W](W) writer structure"]
791impl crate::Writable for HFXOTIMEOUTCTRL_SPEC {
792 type Writer = W;
793}
794#[doc = "`reset()` method sets HFXOTIMEOUTCTRL to value 0x0002_6667"]
795impl crate::Resettable for HFXOTIMEOUTCTRL_SPEC {
796 #[inline(always)]
797 fn reset_value() -> Self::Ux {
798 0x0002_6667
799 }
800}