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