efm32hg_pac/efm32hg108/cmu/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL_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<CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `HFXOMODE` reader - HFXO Mode"]
38pub type HFXOMODE_R = crate::FieldReader<u8, HFXOMODE_A>;
39#[doc = "HFXO Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum HFXOMODE_A {
43    #[doc = "0: 4-25 MHz crystal oscillator."]
44    XTAL = 0,
45    #[doc = "1: An AC coupled buffer is coupled in series with HFXTAL_N, suitable for external sine wave (4-25 MHz). The sine wave should have a minimum of 200 mV peak to peak."]
46    BUFEXTCLK = 1,
47    #[doc = "2: Digital external clock on HFXTAL_N pin. Oscillator is effectively bypassed."]
48    DIGEXTCLK = 2,
49}
50impl From<HFXOMODE_A> for u8 {
51    #[inline(always)]
52    fn from(variant: HFXOMODE_A) -> Self {
53        variant as _
54    }
55}
56impl HFXOMODE_R {
57    #[doc = "Get enumerated values variant"]
58    #[inline(always)]
59    pub fn variant(&self) -> Option<HFXOMODE_A> {
60        match self.bits {
61            0 => Some(HFXOMODE_A::XTAL),
62            1 => Some(HFXOMODE_A::BUFEXTCLK),
63            2 => Some(HFXOMODE_A::DIGEXTCLK),
64            _ => None,
65        }
66    }
67    #[doc = "Checks if the value of the field is `XTAL`"]
68    #[inline(always)]
69    pub fn is_xtal(&self) -> bool {
70        *self == HFXOMODE_A::XTAL
71    }
72    #[doc = "Checks if the value of the field is `BUFEXTCLK`"]
73    #[inline(always)]
74    pub fn is_bufextclk(&self) -> bool {
75        *self == HFXOMODE_A::BUFEXTCLK
76    }
77    #[doc = "Checks if the value of the field is `DIGEXTCLK`"]
78    #[inline(always)]
79    pub fn is_digextclk(&self) -> bool {
80        *self == HFXOMODE_A::DIGEXTCLK
81    }
82}
83#[doc = "Field `HFXOMODE` writer - HFXO Mode"]
84pub type HFXOMODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, HFXOMODE_A, 2, O>;
85impl<'a, const O: u8> HFXOMODE_W<'a, O> {
86    #[doc = "4-25 MHz crystal oscillator."]
87    #[inline(always)]
88    pub fn xtal(self) -> &'a mut W {
89        self.variant(HFXOMODE_A::XTAL)
90    }
91    #[doc = "An AC coupled buffer is coupled in series with HFXTAL_N, suitable for external sine wave (4-25 MHz). The sine wave should have a minimum of 200 mV peak to peak."]
92    #[inline(always)]
93    pub fn bufextclk(self) -> &'a mut W {
94        self.variant(HFXOMODE_A::BUFEXTCLK)
95    }
96    #[doc = "Digital external clock on HFXTAL_N pin. Oscillator is effectively bypassed."]
97    #[inline(always)]
98    pub fn digextclk(self) -> &'a mut W {
99        self.variant(HFXOMODE_A::DIGEXTCLK)
100    }
101}
102#[doc = "Field `HFXOBOOST` reader - HFXO Start-up Boost Current"]
103pub type HFXOBOOST_R = crate::FieldReader<u8, HFXOBOOST_A>;
104#[doc = "HFXO Start-up Boost Current\n\nValue on reset: 3"]
105#[derive(Clone, Copy, Debug, PartialEq, Eq)]
106#[repr(u8)]
107pub enum HFXOBOOST_A {
108    #[doc = "0: 50 %."]
109    _50PCENT = 0,
110    #[doc = "1: 70 %."]
111    _70PCENT = 1,
112    #[doc = "2: 80 %."]
113    _80PCENT = 2,
114    #[doc = "3: 100 % (default)."]
115    _100PCENT = 3,
116}
117impl From<HFXOBOOST_A> for u8 {
118    #[inline(always)]
119    fn from(variant: HFXOBOOST_A) -> Self {
120        variant as _
121    }
122}
123impl HFXOBOOST_R {
124    #[doc = "Get enumerated values variant"]
125    #[inline(always)]
126    pub fn variant(&self) -> HFXOBOOST_A {
127        match self.bits {
128            0 => HFXOBOOST_A::_50PCENT,
129            1 => HFXOBOOST_A::_70PCENT,
130            2 => HFXOBOOST_A::_80PCENT,
131            3 => HFXOBOOST_A::_100PCENT,
132            _ => unreachable!(),
133        }
134    }
135    #[doc = "Checks if the value of the field is `_50PCENT`"]
136    #[inline(always)]
137    pub fn is_50pcent(&self) -> bool {
138        *self == HFXOBOOST_A::_50PCENT
139    }
140    #[doc = "Checks if the value of the field is `_70PCENT`"]
141    #[inline(always)]
142    pub fn is_70pcent(&self) -> bool {
143        *self == HFXOBOOST_A::_70PCENT
144    }
145    #[doc = "Checks if the value of the field is `_80PCENT`"]
146    #[inline(always)]
147    pub fn is_80pcent(&self) -> bool {
148        *self == HFXOBOOST_A::_80PCENT
149    }
150    #[doc = "Checks if the value of the field is `_100PCENT`"]
151    #[inline(always)]
152    pub fn is_100pcent(&self) -> bool {
153        *self == HFXOBOOST_A::_100PCENT
154    }
155}
156#[doc = "Field `HFXOBOOST` writer - HFXO Start-up Boost Current"]
157pub type HFXOBOOST_W<'a, const O: u8> =
158    crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, HFXOBOOST_A, 2, O>;
159impl<'a, const O: u8> HFXOBOOST_W<'a, O> {
160    #[doc = "50 %."]
161    #[inline(always)]
162    pub fn _50pcent(self) -> &'a mut W {
163        self.variant(HFXOBOOST_A::_50PCENT)
164    }
165    #[doc = "70 %."]
166    #[inline(always)]
167    pub fn _70pcent(self) -> &'a mut W {
168        self.variant(HFXOBOOST_A::_70PCENT)
169    }
170    #[doc = "80 %."]
171    #[inline(always)]
172    pub fn _80pcent(self) -> &'a mut W {
173        self.variant(HFXOBOOST_A::_80PCENT)
174    }
175    #[doc = "100 % (default)."]
176    #[inline(always)]
177    pub fn _100pcent(self) -> &'a mut W {
178        self.variant(HFXOBOOST_A::_100PCENT)
179    }
180}
181#[doc = "Field `HFXOBUFCUR` reader - HFXO Boost Buffer Current"]
182pub type HFXOBUFCUR_R = crate::FieldReader<u8, u8>;
183#[doc = "Field `HFXOBUFCUR` writer - HFXO Boost Buffer Current"]
184pub type HFXOBUFCUR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, u8, 2, O>;
185#[doc = "Field `HFXOGLITCHDETEN` reader - HFXO Glitch Detector Enable"]
186pub type HFXOGLITCHDETEN_R = crate::BitReader<bool>;
187#[doc = "Field `HFXOGLITCHDETEN` writer - HFXO Glitch Detector Enable"]
188pub type HFXOGLITCHDETEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
189#[doc = "Field `HFXOTIMEOUT` reader - HFXO Timeout"]
190pub type HFXOTIMEOUT_R = crate::FieldReader<u8, HFXOTIMEOUT_A>;
191#[doc = "HFXO Timeout\n\nValue on reset: 3"]
192#[derive(Clone, Copy, Debug, PartialEq, Eq)]
193#[repr(u8)]
194pub enum HFXOTIMEOUT_A {
195    #[doc = "0: Timeout period of 8 cycles."]
196    _8CYCLES = 0,
197    #[doc = "1: Timeout period of 256 cycles."]
198    _256CYCLES = 1,
199    #[doc = "2: Timeout period of 1024 cycles."]
200    _1KCYCLES = 2,
201    #[doc = "3: Timeout period of 16384 cycles."]
202    _16KCYCLES = 3,
203}
204impl From<HFXOTIMEOUT_A> for u8 {
205    #[inline(always)]
206    fn from(variant: HFXOTIMEOUT_A) -> Self {
207        variant as _
208    }
209}
210impl HFXOTIMEOUT_R {
211    #[doc = "Get enumerated values variant"]
212    #[inline(always)]
213    pub fn variant(&self) -> HFXOTIMEOUT_A {
214        match self.bits {
215            0 => HFXOTIMEOUT_A::_8CYCLES,
216            1 => HFXOTIMEOUT_A::_256CYCLES,
217            2 => HFXOTIMEOUT_A::_1KCYCLES,
218            3 => HFXOTIMEOUT_A::_16KCYCLES,
219            _ => unreachable!(),
220        }
221    }
222    #[doc = "Checks if the value of the field is `_8CYCLES`"]
223    #[inline(always)]
224    pub fn is_8cycles(&self) -> bool {
225        *self == HFXOTIMEOUT_A::_8CYCLES
226    }
227    #[doc = "Checks if the value of the field is `_256CYCLES`"]
228    #[inline(always)]
229    pub fn is_256cycles(&self) -> bool {
230        *self == HFXOTIMEOUT_A::_256CYCLES
231    }
232    #[doc = "Checks if the value of the field is `_1KCYCLES`"]
233    #[inline(always)]
234    pub fn is_1kcycles(&self) -> bool {
235        *self == HFXOTIMEOUT_A::_1KCYCLES
236    }
237    #[doc = "Checks if the value of the field is `_16KCYCLES`"]
238    #[inline(always)]
239    pub fn is_16kcycles(&self) -> bool {
240        *self == HFXOTIMEOUT_A::_16KCYCLES
241    }
242}
243#[doc = "Field `HFXOTIMEOUT` writer - HFXO Timeout"]
244pub type HFXOTIMEOUT_W<'a, const O: u8> =
245    crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, HFXOTIMEOUT_A, 2, O>;
246impl<'a, const O: u8> HFXOTIMEOUT_W<'a, O> {
247    #[doc = "Timeout period of 8 cycles."]
248    #[inline(always)]
249    pub fn _8cycles(self) -> &'a mut W {
250        self.variant(HFXOTIMEOUT_A::_8CYCLES)
251    }
252    #[doc = "Timeout period of 256 cycles."]
253    #[inline(always)]
254    pub fn _256cycles(self) -> &'a mut W {
255        self.variant(HFXOTIMEOUT_A::_256CYCLES)
256    }
257    #[doc = "Timeout period of 1024 cycles."]
258    #[inline(always)]
259    pub fn _1kcycles(self) -> &'a mut W {
260        self.variant(HFXOTIMEOUT_A::_1KCYCLES)
261    }
262    #[doc = "Timeout period of 16384 cycles."]
263    #[inline(always)]
264    pub fn _16kcycles(self) -> &'a mut W {
265        self.variant(HFXOTIMEOUT_A::_16KCYCLES)
266    }
267}
268#[doc = "Field `LFXOMODE` reader - LFXO Mode"]
269pub type LFXOMODE_R = crate::FieldReader<u8, LFXOMODE_A>;
270#[doc = "LFXO Mode\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq, Eq)]
272#[repr(u8)]
273pub enum LFXOMODE_A {
274    #[doc = "0: 32.768 kHz crystal oscillator."]
275    XTAL = 0,
276    #[doc = "1: An AC coupled buffer is coupled in series with LFXTAL_N pin, suitable for external sinus wave (32.768 kHz)."]
277    BUFEXTCLK = 1,
278    #[doc = "2: Digital external clock on LFXTAL_N pin. Oscillator is effectively bypassed."]
279    DIGEXTCLK = 2,
280}
281impl From<LFXOMODE_A> for u8 {
282    #[inline(always)]
283    fn from(variant: LFXOMODE_A) -> Self {
284        variant as _
285    }
286}
287impl LFXOMODE_R {
288    #[doc = "Get enumerated values variant"]
289    #[inline(always)]
290    pub fn variant(&self) -> Option<LFXOMODE_A> {
291        match self.bits {
292            0 => Some(LFXOMODE_A::XTAL),
293            1 => Some(LFXOMODE_A::BUFEXTCLK),
294            2 => Some(LFXOMODE_A::DIGEXTCLK),
295            _ => None,
296        }
297    }
298    #[doc = "Checks if the value of the field is `XTAL`"]
299    #[inline(always)]
300    pub fn is_xtal(&self) -> bool {
301        *self == LFXOMODE_A::XTAL
302    }
303    #[doc = "Checks if the value of the field is `BUFEXTCLK`"]
304    #[inline(always)]
305    pub fn is_bufextclk(&self) -> bool {
306        *self == LFXOMODE_A::BUFEXTCLK
307    }
308    #[doc = "Checks if the value of the field is `DIGEXTCLK`"]
309    #[inline(always)]
310    pub fn is_digextclk(&self) -> bool {
311        *self == LFXOMODE_A::DIGEXTCLK
312    }
313}
314#[doc = "Field `LFXOMODE` writer - LFXO Mode"]
315pub type LFXOMODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, LFXOMODE_A, 2, O>;
316impl<'a, const O: u8> LFXOMODE_W<'a, O> {
317    #[doc = "32.768 kHz crystal oscillator."]
318    #[inline(always)]
319    pub fn xtal(self) -> &'a mut W {
320        self.variant(LFXOMODE_A::XTAL)
321    }
322    #[doc = "An AC coupled buffer is coupled in series with LFXTAL_N pin, suitable for external sinus wave (32.768 kHz)."]
323    #[inline(always)]
324    pub fn bufextclk(self) -> &'a mut W {
325        self.variant(LFXOMODE_A::BUFEXTCLK)
326    }
327    #[doc = "Digital external clock on LFXTAL_N pin. Oscillator is effectively bypassed."]
328    #[inline(always)]
329    pub fn digextclk(self) -> &'a mut W {
330        self.variant(LFXOMODE_A::DIGEXTCLK)
331    }
332}
333#[doc = "Field `LFXOBOOST` reader - LFXO Start-up Boost Current"]
334pub type LFXOBOOST_R = crate::BitReader<bool>;
335#[doc = "Field `LFXOBOOST` writer - LFXO Start-up Boost Current"]
336pub type LFXOBOOST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
337#[doc = "Field `HFCLKDIV` reader - HFCLK Division"]
338pub type HFCLKDIV_R = crate::FieldReader<u8, u8>;
339#[doc = "Field `HFCLKDIV` writer - HFCLK Division"]
340pub type HFCLKDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, u8, 3, O>;
341#[doc = "Field `LFXOBUFCUR` reader - LFXO Boost Buffer Current"]
342pub type LFXOBUFCUR_R = crate::BitReader<bool>;
343#[doc = "Field `LFXOBUFCUR` writer - LFXO Boost Buffer Current"]
344pub type LFXOBUFCUR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
345#[doc = "Field `LFXOTIMEOUT` reader - LFXO Timeout"]
346pub type LFXOTIMEOUT_R = crate::FieldReader<u8, LFXOTIMEOUT_A>;
347#[doc = "LFXO Timeout\n\nValue on reset: 3"]
348#[derive(Clone, Copy, Debug, PartialEq, Eq)]
349#[repr(u8)]
350pub enum LFXOTIMEOUT_A {
351    #[doc = "0: Timeout period of 8 cycles."]
352    _8CYCLES = 0,
353    #[doc = "1: Timeout period of 1024 cycles."]
354    _1KCYCLES = 1,
355    #[doc = "2: Timeout period of 16384 cycles."]
356    _16KCYCLES = 2,
357    #[doc = "3: Timeout period of 32768 cycles."]
358    _32KCYCLES = 3,
359}
360impl From<LFXOTIMEOUT_A> for u8 {
361    #[inline(always)]
362    fn from(variant: LFXOTIMEOUT_A) -> Self {
363        variant as _
364    }
365}
366impl LFXOTIMEOUT_R {
367    #[doc = "Get enumerated values variant"]
368    #[inline(always)]
369    pub fn variant(&self) -> LFXOTIMEOUT_A {
370        match self.bits {
371            0 => LFXOTIMEOUT_A::_8CYCLES,
372            1 => LFXOTIMEOUT_A::_1KCYCLES,
373            2 => LFXOTIMEOUT_A::_16KCYCLES,
374            3 => LFXOTIMEOUT_A::_32KCYCLES,
375            _ => unreachable!(),
376        }
377    }
378    #[doc = "Checks if the value of the field is `_8CYCLES`"]
379    #[inline(always)]
380    pub fn is_8cycles(&self) -> bool {
381        *self == LFXOTIMEOUT_A::_8CYCLES
382    }
383    #[doc = "Checks if the value of the field is `_1KCYCLES`"]
384    #[inline(always)]
385    pub fn is_1kcycles(&self) -> bool {
386        *self == LFXOTIMEOUT_A::_1KCYCLES
387    }
388    #[doc = "Checks if the value of the field is `_16KCYCLES`"]
389    #[inline(always)]
390    pub fn is_16kcycles(&self) -> bool {
391        *self == LFXOTIMEOUT_A::_16KCYCLES
392    }
393    #[doc = "Checks if the value of the field is `_32KCYCLES`"]
394    #[inline(always)]
395    pub fn is_32kcycles(&self) -> bool {
396        *self == LFXOTIMEOUT_A::_32KCYCLES
397    }
398}
399#[doc = "Field `LFXOTIMEOUT` writer - LFXO Timeout"]
400pub type LFXOTIMEOUT_W<'a, const O: u8> =
401    crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, LFXOTIMEOUT_A, 2, O>;
402impl<'a, const O: u8> LFXOTIMEOUT_W<'a, O> {
403    #[doc = "Timeout period of 8 cycles."]
404    #[inline(always)]
405    pub fn _8cycles(self) -> &'a mut W {
406        self.variant(LFXOTIMEOUT_A::_8CYCLES)
407    }
408    #[doc = "Timeout period of 1024 cycles."]
409    #[inline(always)]
410    pub fn _1kcycles(self) -> &'a mut W {
411        self.variant(LFXOTIMEOUT_A::_1KCYCLES)
412    }
413    #[doc = "Timeout period of 16384 cycles."]
414    #[inline(always)]
415    pub fn _16kcycles(self) -> &'a mut W {
416        self.variant(LFXOTIMEOUT_A::_16KCYCLES)
417    }
418    #[doc = "Timeout period of 32768 cycles."]
419    #[inline(always)]
420    pub fn _32kcycles(self) -> &'a mut W {
421        self.variant(LFXOTIMEOUT_A::_32KCYCLES)
422    }
423}
424#[doc = "Field `CLKOUTSEL0` reader - Clock Output Select 0"]
425pub type CLKOUTSEL0_R = crate::FieldReader<u8, CLKOUTSEL0_A>;
426#[doc = "Clock Output Select 0\n\nValue on reset: 0"]
427#[derive(Clone, Copy, Debug, PartialEq, Eq)]
428#[repr(u8)]
429pub enum CLKOUTSEL0_A {
430    #[doc = "0: HFRCO (directly from oscillator)."]
431    HFRCO = 0,
432    #[doc = "1: HFXO (directly from oscillator)."]
433    HFXO = 1,
434    #[doc = "2: HFCLK/2."]
435    HFCLK2 = 2,
436    #[doc = "3: HFCLK/4."]
437    HFCLK4 = 3,
438    #[doc = "4: HFCLK/8."]
439    HFCLK8 = 4,
440    #[doc = "5: HFCLK/16."]
441    HFCLK16 = 5,
442    #[doc = "6: ULFRCO (directly from oscillator)."]
443    ULFRCO = 6,
444    #[doc = "7: AUXHFRCO (directly from oscillator)."]
445    AUXHFRCO = 7,
446}
447impl From<CLKOUTSEL0_A> for u8 {
448    #[inline(always)]
449    fn from(variant: CLKOUTSEL0_A) -> Self {
450        variant as _
451    }
452}
453impl CLKOUTSEL0_R {
454    #[doc = "Get enumerated values variant"]
455    #[inline(always)]
456    pub fn variant(&self) -> CLKOUTSEL0_A {
457        match self.bits {
458            0 => CLKOUTSEL0_A::HFRCO,
459            1 => CLKOUTSEL0_A::HFXO,
460            2 => CLKOUTSEL0_A::HFCLK2,
461            3 => CLKOUTSEL0_A::HFCLK4,
462            4 => CLKOUTSEL0_A::HFCLK8,
463            5 => CLKOUTSEL0_A::HFCLK16,
464            6 => CLKOUTSEL0_A::ULFRCO,
465            7 => CLKOUTSEL0_A::AUXHFRCO,
466            _ => unreachable!(),
467        }
468    }
469    #[doc = "Checks if the value of the field is `HFRCO`"]
470    #[inline(always)]
471    pub fn is_hfrco(&self) -> bool {
472        *self == CLKOUTSEL0_A::HFRCO
473    }
474    #[doc = "Checks if the value of the field is `HFXO`"]
475    #[inline(always)]
476    pub fn is_hfxo(&self) -> bool {
477        *self == CLKOUTSEL0_A::HFXO
478    }
479    #[doc = "Checks if the value of the field is `HFCLK2`"]
480    #[inline(always)]
481    pub fn is_hfclk2(&self) -> bool {
482        *self == CLKOUTSEL0_A::HFCLK2
483    }
484    #[doc = "Checks if the value of the field is `HFCLK4`"]
485    #[inline(always)]
486    pub fn is_hfclk4(&self) -> bool {
487        *self == CLKOUTSEL0_A::HFCLK4
488    }
489    #[doc = "Checks if the value of the field is `HFCLK8`"]
490    #[inline(always)]
491    pub fn is_hfclk8(&self) -> bool {
492        *self == CLKOUTSEL0_A::HFCLK8
493    }
494    #[doc = "Checks if the value of the field is `HFCLK16`"]
495    #[inline(always)]
496    pub fn is_hfclk16(&self) -> bool {
497        *self == CLKOUTSEL0_A::HFCLK16
498    }
499    #[doc = "Checks if the value of the field is `ULFRCO`"]
500    #[inline(always)]
501    pub fn is_ulfrco(&self) -> bool {
502        *self == CLKOUTSEL0_A::ULFRCO
503    }
504    #[doc = "Checks if the value of the field is `AUXHFRCO`"]
505    #[inline(always)]
506    pub fn is_auxhfrco(&self) -> bool {
507        *self == CLKOUTSEL0_A::AUXHFRCO
508    }
509}
510#[doc = "Field `CLKOUTSEL0` writer - Clock Output Select 0"]
511pub type CLKOUTSEL0_W<'a, const O: u8> =
512    crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, CLKOUTSEL0_A, 3, O>;
513impl<'a, const O: u8> CLKOUTSEL0_W<'a, O> {
514    #[doc = "HFRCO (directly from oscillator)."]
515    #[inline(always)]
516    pub fn hfrco(self) -> &'a mut W {
517        self.variant(CLKOUTSEL0_A::HFRCO)
518    }
519    #[doc = "HFXO (directly from oscillator)."]
520    #[inline(always)]
521    pub fn hfxo(self) -> &'a mut W {
522        self.variant(CLKOUTSEL0_A::HFXO)
523    }
524    #[doc = "HFCLK/2."]
525    #[inline(always)]
526    pub fn hfclk2(self) -> &'a mut W {
527        self.variant(CLKOUTSEL0_A::HFCLK2)
528    }
529    #[doc = "HFCLK/4."]
530    #[inline(always)]
531    pub fn hfclk4(self) -> &'a mut W {
532        self.variant(CLKOUTSEL0_A::HFCLK4)
533    }
534    #[doc = "HFCLK/8."]
535    #[inline(always)]
536    pub fn hfclk8(self) -> &'a mut W {
537        self.variant(CLKOUTSEL0_A::HFCLK8)
538    }
539    #[doc = "HFCLK/16."]
540    #[inline(always)]
541    pub fn hfclk16(self) -> &'a mut W {
542        self.variant(CLKOUTSEL0_A::HFCLK16)
543    }
544    #[doc = "ULFRCO (directly from oscillator)."]
545    #[inline(always)]
546    pub fn ulfrco(self) -> &'a mut W {
547        self.variant(CLKOUTSEL0_A::ULFRCO)
548    }
549    #[doc = "AUXHFRCO (directly from oscillator)."]
550    #[inline(always)]
551    pub fn auxhfrco(self) -> &'a mut W {
552        self.variant(CLKOUTSEL0_A::AUXHFRCO)
553    }
554}
555#[doc = "Field `CLKOUTSEL1` reader - Clock Output Select 1"]
556pub type CLKOUTSEL1_R = crate::FieldReader<u8, CLKOUTSEL1_A>;
557#[doc = "Clock Output Select 1\n\nValue on reset: 0"]
558#[derive(Clone, Copy, Debug, PartialEq, Eq)]
559#[repr(u8)]
560pub enum CLKOUTSEL1_A {
561    #[doc = "0: LFRCO (directly from oscillator)."]
562    LFRCO = 0,
563    #[doc = "1: LFXO (directly from oscillator)."]
564    LFXO = 1,
565    #[doc = "2: HFCLK (undivided)."]
566    HFCLK = 2,
567    #[doc = "3: LFXO (qualified)."]
568    LFXOQ = 3,
569    #[doc = "4: HFXO (qualified)."]
570    HFXOQ = 4,
571    #[doc = "5: LFRCO (qualified)."]
572    LFRCOQ = 5,
573    #[doc = "6: HFRCO (qualified)."]
574    HFRCOQ = 6,
575    #[doc = "7: AUXHFRCO (qualified)."]
576    AUXHFRCOQ = 7,
577    #[doc = "8: USHFRCO"]
578    USHFRCO = 8,
579}
580impl From<CLKOUTSEL1_A> for u8 {
581    #[inline(always)]
582    fn from(variant: CLKOUTSEL1_A) -> Self {
583        variant as _
584    }
585}
586impl CLKOUTSEL1_R {
587    #[doc = "Get enumerated values variant"]
588    #[inline(always)]
589    pub fn variant(&self) -> Option<CLKOUTSEL1_A> {
590        match self.bits {
591            0 => Some(CLKOUTSEL1_A::LFRCO),
592            1 => Some(CLKOUTSEL1_A::LFXO),
593            2 => Some(CLKOUTSEL1_A::HFCLK),
594            3 => Some(CLKOUTSEL1_A::LFXOQ),
595            4 => Some(CLKOUTSEL1_A::HFXOQ),
596            5 => Some(CLKOUTSEL1_A::LFRCOQ),
597            6 => Some(CLKOUTSEL1_A::HFRCOQ),
598            7 => Some(CLKOUTSEL1_A::AUXHFRCOQ),
599            8 => Some(CLKOUTSEL1_A::USHFRCO),
600            _ => None,
601        }
602    }
603    #[doc = "Checks if the value of the field is `LFRCO`"]
604    #[inline(always)]
605    pub fn is_lfrco(&self) -> bool {
606        *self == CLKOUTSEL1_A::LFRCO
607    }
608    #[doc = "Checks if the value of the field is `LFXO`"]
609    #[inline(always)]
610    pub fn is_lfxo(&self) -> bool {
611        *self == CLKOUTSEL1_A::LFXO
612    }
613    #[doc = "Checks if the value of the field is `HFCLK`"]
614    #[inline(always)]
615    pub fn is_hfclk(&self) -> bool {
616        *self == CLKOUTSEL1_A::HFCLK
617    }
618    #[doc = "Checks if the value of the field is `LFXOQ`"]
619    #[inline(always)]
620    pub fn is_lfxoq(&self) -> bool {
621        *self == CLKOUTSEL1_A::LFXOQ
622    }
623    #[doc = "Checks if the value of the field is `HFXOQ`"]
624    #[inline(always)]
625    pub fn is_hfxoq(&self) -> bool {
626        *self == CLKOUTSEL1_A::HFXOQ
627    }
628    #[doc = "Checks if the value of the field is `LFRCOQ`"]
629    #[inline(always)]
630    pub fn is_lfrcoq(&self) -> bool {
631        *self == CLKOUTSEL1_A::LFRCOQ
632    }
633    #[doc = "Checks if the value of the field is `HFRCOQ`"]
634    #[inline(always)]
635    pub fn is_hfrcoq(&self) -> bool {
636        *self == CLKOUTSEL1_A::HFRCOQ
637    }
638    #[doc = "Checks if the value of the field is `AUXHFRCOQ`"]
639    #[inline(always)]
640    pub fn is_auxhfrcoq(&self) -> bool {
641        *self == CLKOUTSEL1_A::AUXHFRCOQ
642    }
643    #[doc = "Checks if the value of the field is `USHFRCO`"]
644    #[inline(always)]
645    pub fn is_ushfrco(&self) -> bool {
646        *self == CLKOUTSEL1_A::USHFRCO
647    }
648}
649#[doc = "Field `CLKOUTSEL1` writer - Clock Output Select 1"]
650pub type CLKOUTSEL1_W<'a, const O: u8> =
651    crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKOUTSEL1_A, 4, O>;
652impl<'a, const O: u8> CLKOUTSEL1_W<'a, O> {
653    #[doc = "LFRCO (directly from oscillator)."]
654    #[inline(always)]
655    pub fn lfrco(self) -> &'a mut W {
656        self.variant(CLKOUTSEL1_A::LFRCO)
657    }
658    #[doc = "LFXO (directly from oscillator)."]
659    #[inline(always)]
660    pub fn lfxo(self) -> &'a mut W {
661        self.variant(CLKOUTSEL1_A::LFXO)
662    }
663    #[doc = "HFCLK (undivided)."]
664    #[inline(always)]
665    pub fn hfclk(self) -> &'a mut W {
666        self.variant(CLKOUTSEL1_A::HFCLK)
667    }
668    #[doc = "LFXO (qualified)."]
669    #[inline(always)]
670    pub fn lfxoq(self) -> &'a mut W {
671        self.variant(CLKOUTSEL1_A::LFXOQ)
672    }
673    #[doc = "HFXO (qualified)."]
674    #[inline(always)]
675    pub fn hfxoq(self) -> &'a mut W {
676        self.variant(CLKOUTSEL1_A::HFXOQ)
677    }
678    #[doc = "LFRCO (qualified)."]
679    #[inline(always)]
680    pub fn lfrcoq(self) -> &'a mut W {
681        self.variant(CLKOUTSEL1_A::LFRCOQ)
682    }
683    #[doc = "HFRCO (qualified)."]
684    #[inline(always)]
685    pub fn hfrcoq(self) -> &'a mut W {
686        self.variant(CLKOUTSEL1_A::HFRCOQ)
687    }
688    #[doc = "AUXHFRCO (qualified)."]
689    #[inline(always)]
690    pub fn auxhfrcoq(self) -> &'a mut W {
691        self.variant(CLKOUTSEL1_A::AUXHFRCOQ)
692    }
693    #[doc = "USHFRCO"]
694    #[inline(always)]
695    pub fn ushfrco(self) -> &'a mut W {
696        self.variant(CLKOUTSEL1_A::USHFRCO)
697    }
698}
699impl R {
700    #[doc = "Bits 0:1 - HFXO Mode"]
701    #[inline(always)]
702    pub fn hfxomode(&self) -> HFXOMODE_R {
703        HFXOMODE_R::new((self.bits & 3) as u8)
704    }
705    #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
706    #[inline(always)]
707    pub fn hfxoboost(&self) -> HFXOBOOST_R {
708        HFXOBOOST_R::new(((self.bits >> 2) & 3) as u8)
709    }
710    #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
711    #[inline(always)]
712    pub fn hfxobufcur(&self) -> HFXOBUFCUR_R {
713        HFXOBUFCUR_R::new(((self.bits >> 5) & 3) as u8)
714    }
715    #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
716    #[inline(always)]
717    pub fn hfxoglitchdeten(&self) -> HFXOGLITCHDETEN_R {
718        HFXOGLITCHDETEN_R::new(((self.bits >> 7) & 1) != 0)
719    }
720    #[doc = "Bits 9:10 - HFXO Timeout"]
721    #[inline(always)]
722    pub fn hfxotimeout(&self) -> HFXOTIMEOUT_R {
723        HFXOTIMEOUT_R::new(((self.bits >> 9) & 3) as u8)
724    }
725    #[doc = "Bits 11:12 - LFXO Mode"]
726    #[inline(always)]
727    pub fn lfxomode(&self) -> LFXOMODE_R {
728        LFXOMODE_R::new(((self.bits >> 11) & 3) as u8)
729    }
730    #[doc = "Bit 13 - LFXO Start-up Boost Current"]
731    #[inline(always)]
732    pub fn lfxoboost(&self) -> LFXOBOOST_R {
733        LFXOBOOST_R::new(((self.bits >> 13) & 1) != 0)
734    }
735    #[doc = "Bits 14:16 - HFCLK Division"]
736    #[inline(always)]
737    pub fn hfclkdiv(&self) -> HFCLKDIV_R {
738        HFCLKDIV_R::new(((self.bits >> 14) & 7) as u8)
739    }
740    #[doc = "Bit 17 - LFXO Boost Buffer Current"]
741    #[inline(always)]
742    pub fn lfxobufcur(&self) -> LFXOBUFCUR_R {
743        LFXOBUFCUR_R::new(((self.bits >> 17) & 1) != 0)
744    }
745    #[doc = "Bits 18:19 - LFXO Timeout"]
746    #[inline(always)]
747    pub fn lfxotimeout(&self) -> LFXOTIMEOUT_R {
748        LFXOTIMEOUT_R::new(((self.bits >> 18) & 3) as u8)
749    }
750    #[doc = "Bits 20:22 - Clock Output Select 0"]
751    #[inline(always)]
752    pub fn clkoutsel0(&self) -> CLKOUTSEL0_R {
753        CLKOUTSEL0_R::new(((self.bits >> 20) & 7) as u8)
754    }
755    #[doc = "Bits 23:26 - Clock Output Select 1"]
756    #[inline(always)]
757    pub fn clkoutsel1(&self) -> CLKOUTSEL1_R {
758        CLKOUTSEL1_R::new(((self.bits >> 23) & 0x0f) as u8)
759    }
760}
761impl W {
762    #[doc = "Bits 0:1 - HFXO Mode"]
763    #[inline(always)]
764    #[must_use]
765    pub fn hfxomode(&mut self) -> HFXOMODE_W<0> {
766        HFXOMODE_W::new(self)
767    }
768    #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
769    #[inline(always)]
770    #[must_use]
771    pub fn hfxoboost(&mut self) -> HFXOBOOST_W<2> {
772        HFXOBOOST_W::new(self)
773    }
774    #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
775    #[inline(always)]
776    #[must_use]
777    pub fn hfxobufcur(&mut self) -> HFXOBUFCUR_W<5> {
778        HFXOBUFCUR_W::new(self)
779    }
780    #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
781    #[inline(always)]
782    #[must_use]
783    pub fn hfxoglitchdeten(&mut self) -> HFXOGLITCHDETEN_W<7> {
784        HFXOGLITCHDETEN_W::new(self)
785    }
786    #[doc = "Bits 9:10 - HFXO Timeout"]
787    #[inline(always)]
788    #[must_use]
789    pub fn hfxotimeout(&mut self) -> HFXOTIMEOUT_W<9> {
790        HFXOTIMEOUT_W::new(self)
791    }
792    #[doc = "Bits 11:12 - LFXO Mode"]
793    #[inline(always)]
794    #[must_use]
795    pub fn lfxomode(&mut self) -> LFXOMODE_W<11> {
796        LFXOMODE_W::new(self)
797    }
798    #[doc = "Bit 13 - LFXO Start-up Boost Current"]
799    #[inline(always)]
800    #[must_use]
801    pub fn lfxoboost(&mut self) -> LFXOBOOST_W<13> {
802        LFXOBOOST_W::new(self)
803    }
804    #[doc = "Bits 14:16 - HFCLK Division"]
805    #[inline(always)]
806    #[must_use]
807    pub fn hfclkdiv(&mut self) -> HFCLKDIV_W<14> {
808        HFCLKDIV_W::new(self)
809    }
810    #[doc = "Bit 17 - LFXO Boost Buffer Current"]
811    #[inline(always)]
812    #[must_use]
813    pub fn lfxobufcur(&mut self) -> LFXOBUFCUR_W<17> {
814        LFXOBUFCUR_W::new(self)
815    }
816    #[doc = "Bits 18:19 - LFXO Timeout"]
817    #[inline(always)]
818    #[must_use]
819    pub fn lfxotimeout(&mut self) -> LFXOTIMEOUT_W<18> {
820        LFXOTIMEOUT_W::new(self)
821    }
822    #[doc = "Bits 20:22 - Clock Output Select 0"]
823    #[inline(always)]
824    #[must_use]
825    pub fn clkoutsel0(&mut self) -> CLKOUTSEL0_W<20> {
826        CLKOUTSEL0_W::new(self)
827    }
828    #[doc = "Bits 23:26 - Clock Output Select 1"]
829    #[inline(always)]
830    #[must_use]
831    pub fn clkoutsel1(&mut self) -> CLKOUTSEL1_W<23> {
832        CLKOUTSEL1_W::new(self)
833    }
834    #[doc = "Writes raw bits to the register."]
835    #[inline(always)]
836    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
837        self.0.bits(bits);
838        self
839    }
840}
841#[doc = "CMU Control Register\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 [ctrl](index.html) module"]
842pub struct CTRL_SPEC;
843impl crate::RegisterSpec for CTRL_SPEC {
844    type Ux = u32;
845}
846#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
847impl crate::Readable for CTRL_SPEC {
848    type Reader = R;
849}
850#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
851impl crate::Writable for CTRL_SPEC {
852    type Writer = W;
853    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
854    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
855}
856#[doc = "`reset()` method sets CTRL to value 0x000c_262c"]
857impl crate::Resettable for CTRL_SPEC {
858    const RESET_VALUE: Self::Ux = 0x000c_262c;
859}