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