efm32pg12b500_pac/cmu/
hfxotimeoutctrl.rs

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