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