efm32tg11b_pac/efm32tg11b540/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: 14"]
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 64 cycles"]
52 _64CYCLES = 4,
53 #[doc = "5: Timeout period of 128 cycles"]
54 _128CYCLES = 5,
55 #[doc = "6: Timeout period of 256 cycles"]
56 _256CYCLES = 6,
57 #[doc = "7: Timeout period of 1024 cycles"]
58 _1KCYCLES = 7,
59 #[doc = "8: Timeout period of 2048 cycles"]
60 _2KCYCLES = 8,
61 #[doc = "9: Timeout period of 4096 cycles"]
62 _4KCYCLES = 9,
63 #[doc = "10: Timeout period of 8192 cycles"]
64 _8KCYCLES = 10,
65 #[doc = "11: Timeout period of 16384 cycles"]
66 _16KCYCLES = 11,
67 #[doc = "12: Timeout period of 32768 cycles"]
68 _32KCYCLES = 12,
69 #[doc = "13: Timeout period of 65536 cycles"]
70 _64KCYCLES = 13,
71 #[doc = "14: Timeout period of 131072 cycles"]
72 _128KCYCLES = 14,
73}
74impl From<STARTUPTIMEOUT_A> for u8 {
75 #[inline(always)]
76 fn from(variant: STARTUPTIMEOUT_A) -> Self {
77 variant as _
78 }
79}
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, const O: u8> =
181 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STARTUPTIMEOUT_A, 4, O>;
182impl<'a, const O: u8> STARTUPTIMEOUT_W<'a, O> {
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 = "Field `STEADYTIMEOUT` reader - Wait Duration in HFXO Startup Steady Wait State"]
260pub type STEADYTIMEOUT_R = crate::FieldReader<u8, STEADYTIMEOUT_A>;
261#[doc = "Wait Duration in HFXO Startup Steady Wait State\n\nValue on reset: 8"]
262#[derive(Clone, Copy, Debug, PartialEq, Eq)]
263#[repr(u8)]
264pub enum STEADYTIMEOUT_A {
265 #[doc = "0: Timeout period of 2 cycles"]
266 _2CYCLES = 0,
267 #[doc = "1: Timeout period of 4 cycles"]
268 _4CYCLES = 1,
269 #[doc = "2: Timeout period of 16 cycles"]
270 _16CYCLES = 2,
271 #[doc = "3: Timeout period of 32 cycles"]
272 _32CYCLES = 3,
273 #[doc = "4: Timeout period of 64 cycles"]
274 _64CYCLES = 4,
275 #[doc = "5: Timeout period of 128 cycles"]
276 _128CYCLES = 5,
277 #[doc = "6: Timeout period of 256 cycles"]
278 _256CYCLES = 6,
279 #[doc = "7: Timeout period of 1024 cycles"]
280 _1KCYCLES = 7,
281 #[doc = "8: Timeout period of 2048 cycles"]
282 _2KCYCLES = 8,
283 #[doc = "9: Timeout period of 4096 cycles"]
284 _4KCYCLES = 9,
285 #[doc = "10: Timeout period of 8192 cycles"]
286 _8KCYCLES = 10,
287 #[doc = "11: Timeout period of 16384 cycles"]
288 _16KCYCLES = 11,
289 #[doc = "12: Timeout period of 32768 cycles"]
290 _32KCYCLES = 12,
291 #[doc = "13: Timeout period of 65536 cycles"]
292 _64KCYCLES = 13,
293 #[doc = "14: Timeout period of 131072 cycles"]
294 _128KCYCLES = 14,
295}
296impl From<STEADYTIMEOUT_A> for u8 {
297 #[inline(always)]
298 fn from(variant: STEADYTIMEOUT_A) -> Self {
299 variant as _
300 }
301}
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, const O: u8> =
403 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, STEADYTIMEOUT_A, 4, O>;
404impl<'a, const O: u8> STEADYTIMEOUT_W<'a, O> {
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 = "Field `PEAKDETTIMEOUT` reader - Wait Duration in HFXO Peak Detection Wait State"]
482pub type PEAKDETTIMEOUT_R = crate::FieldReader<u8, PEAKDETTIMEOUT_A>;
483#[doc = "Wait Duration in HFXO Peak Detection Wait State\n\nValue on reset: 13"]
484#[derive(Clone, Copy, Debug, PartialEq, Eq)]
485#[repr(u8)]
486pub enum PEAKDETTIMEOUT_A {
487 #[doc = "0: Timeout period of 2 cycles"]
488 _2CYCLES = 0,
489 #[doc = "1: Timeout period of 4 cycles"]
490 _4CYCLES = 1,
491 #[doc = "2: Timeout period of 16 cycles"]
492 _16CYCLES = 2,
493 #[doc = "3: Timeout period of 32 cycles"]
494 _32CYCLES = 3,
495 #[doc = "4: Timeout period of 64 cycles"]
496 _64CYCLES = 4,
497 #[doc = "5: Timeout period of 128 cycles"]
498 _128CYCLES = 5,
499 #[doc = "6: Timeout period of 256 cycles"]
500 _256CYCLES = 6,
501 #[doc = "7: Timeout period of 1024 cycles"]
502 _1KCYCLES = 7,
503 #[doc = "8: Timeout period of 2048 cycles"]
504 _2KCYCLES = 8,
505 #[doc = "9: Timeout period of 4096 cycles"]
506 _4KCYCLES = 9,
507 #[doc = "10: Timeout period of 8192 cycles"]
508 _8KCYCLES = 10,
509 #[doc = "11: Timeout period of 16384 cycles"]
510 _16KCYCLES = 11,
511 #[doc = "12: Timeout period of 32768 cycles"]
512 _32KCYCLES = 12,
513 #[doc = "13: Timeout period of 65536 cycles"]
514 _64KCYCLES = 13,
515 #[doc = "14: Timeout period of 131072 cycles"]
516 _128KCYCLES = 14,
517}
518impl From<PEAKDETTIMEOUT_A> for u8 {
519 #[inline(always)]
520 fn from(variant: PEAKDETTIMEOUT_A) -> Self {
521 variant as _
522 }
523}
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, const O: u8> =
625 crate::FieldWriter<'a, u32, HFXOTIMEOUTCTRL_SPEC, u8, PEAKDETTIMEOUT_A, 4, O>;
626impl<'a, const O: u8> PEAKDETTIMEOUT_W<'a, O> {
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 #[must_use]
724 pub fn startuptimeout(&mut self) -> STARTUPTIMEOUT_W<0> {
725 STARTUPTIMEOUT_W::new(self)
726 }
727 #[doc = "Bits 4:7 - Wait Duration in HFXO Startup Steady Wait State"]
728 #[inline(always)]
729 #[must_use]
730 pub fn steadytimeout(&mut self) -> STEADYTIMEOUT_W<4> {
731 STEADYTIMEOUT_W::new(self)
732 }
733 #[doc = "Bits 12:15 - Wait Duration in HFXO Peak Detection Wait State"]
734 #[inline(always)]
735 #[must_use]
736 pub fn peakdettimeout(&mut self) -> PEAKDETTIMEOUT_W<12> {
737 PEAKDETTIMEOUT_W::new(self)
738 }
739 #[doc = "Writes raw bits to the register."]
740 #[inline(always)]
741 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
742 self.0.bits(bits);
743 self
744 }
745}
746#[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"]
747pub struct HFXOTIMEOUTCTRL_SPEC;
748impl crate::RegisterSpec for HFXOTIMEOUTCTRL_SPEC {
749 type Ux = u32;
750}
751#[doc = "`read()` method returns [hfxotimeoutctrl::R](R) reader structure"]
752impl crate::Readable for HFXOTIMEOUTCTRL_SPEC {
753 type Reader = R;
754}
755#[doc = "`write(|w| ..)` method takes [hfxotimeoutctrl::W](W) writer structure"]
756impl crate::Writable for HFXOTIMEOUTCTRL_SPEC {
757 type Writer = W;
758 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
759 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
760}
761#[doc = "`reset()` method sets HFXOTIMEOUTCTRL to value 0xd08e"]
762impl crate::Resettable for HFXOTIMEOUTCTRL_SPEC {
763 const RESET_VALUE: Self::Ux = 0xd08e;
764}