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