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-32 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-32 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-32 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-32 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 `LFXOBUFCUR` reader - LFXO Boost Buffer Current"]
336pub type LFXOBUFCUR_R = crate::BitReader<bool>;
337#[doc = "Field `LFXOBUFCUR` writer - LFXO Boost Buffer Current"]
338pub type LFXOBUFCUR_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 17>;
339#[doc = "LFXO Timeout\n\nValue on reset: 3"]
340#[derive(Clone, Copy, Debug, PartialEq)]
341#[repr(u8)]
342pub enum LFXOTIMEOUT_A {
343 #[doc = "0: Timeout period of 8 cycles."]
344 _8CYCLES = 0,
345 #[doc = "1: Timeout period of 1024 cycles."]
346 _1KCYCLES = 1,
347 #[doc = "2: Timeout period of 16384 cycles."]
348 _16KCYCLES = 2,
349 #[doc = "3: Timeout period of 32768 cycles."]
350 _32KCYCLES = 3,
351}
352impl From<LFXOTIMEOUT_A> for u8 {
353 #[inline(always)]
354 fn from(variant: LFXOTIMEOUT_A) -> Self {
355 variant as _
356 }
357}
358#[doc = "Field `LFXOTIMEOUT` reader - LFXO Timeout"]
359pub type LFXOTIMEOUT_R = crate::FieldReader<u8, LFXOTIMEOUT_A>;
360impl LFXOTIMEOUT_R {
361 #[doc = "Get enumerated values variant"]
362 #[inline(always)]
363 pub fn variant(&self) -> LFXOTIMEOUT_A {
364 match self.bits {
365 0 => LFXOTIMEOUT_A::_8CYCLES,
366 1 => LFXOTIMEOUT_A::_1KCYCLES,
367 2 => LFXOTIMEOUT_A::_16KCYCLES,
368 3 => LFXOTIMEOUT_A::_32KCYCLES,
369 _ => unreachable!(),
370 }
371 }
372 #[doc = "Checks if the value of the field is `_8CYCLES`"]
373 #[inline(always)]
374 pub fn is_8cycles(&self) -> bool {
375 *self == LFXOTIMEOUT_A::_8CYCLES
376 }
377 #[doc = "Checks if the value of the field is `_1KCYCLES`"]
378 #[inline(always)]
379 pub fn is_1kcycles(&self) -> bool {
380 *self == LFXOTIMEOUT_A::_1KCYCLES
381 }
382 #[doc = "Checks if the value of the field is `_16KCYCLES`"]
383 #[inline(always)]
384 pub fn is_16kcycles(&self) -> bool {
385 *self == LFXOTIMEOUT_A::_16KCYCLES
386 }
387 #[doc = "Checks if the value of the field is `_32KCYCLES`"]
388 #[inline(always)]
389 pub fn is_32kcycles(&self) -> bool {
390 *self == LFXOTIMEOUT_A::_32KCYCLES
391 }
392}
393#[doc = "Field `LFXOTIMEOUT` writer - LFXO Timeout"]
394pub type LFXOTIMEOUT_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, LFXOTIMEOUT_A, 2, 18>;
395impl<'a> LFXOTIMEOUT_W<'a> {
396 #[doc = "Timeout period of 8 cycles."]
397 #[inline(always)]
398 pub fn _8cycles(self) -> &'a mut W {
399 self.variant(LFXOTIMEOUT_A::_8CYCLES)
400 }
401 #[doc = "Timeout period of 1024 cycles."]
402 #[inline(always)]
403 pub fn _1kcycles(self) -> &'a mut W {
404 self.variant(LFXOTIMEOUT_A::_1KCYCLES)
405 }
406 #[doc = "Timeout period of 16384 cycles."]
407 #[inline(always)]
408 pub fn _16kcycles(self) -> &'a mut W {
409 self.variant(LFXOTIMEOUT_A::_16KCYCLES)
410 }
411 #[doc = "Timeout period of 32768 cycles."]
412 #[inline(always)]
413 pub fn _32kcycles(self) -> &'a mut W {
414 self.variant(LFXOTIMEOUT_A::_32KCYCLES)
415 }
416}
417#[doc = "Clock Output Select 0\n\nValue on reset: 0"]
418#[derive(Clone, Copy, Debug, PartialEq)]
419#[repr(u8)]
420pub enum CLKOUTSEL0_A {
421 #[doc = "0: HFRCO (directly from oscillator)."]
422 HFRCO = 0,
423 #[doc = "1: HFXO (directly from oscillator)."]
424 HFXO = 1,
425 #[doc = "2: HFCLK/2."]
426 HFCLK2 = 2,
427 #[doc = "3: HFCLK/4."]
428 HFCLK4 = 3,
429 #[doc = "4: HFCLK/8."]
430 HFCLK8 = 4,
431 #[doc = "5: HFCLK/16."]
432 HFCLK16 = 5,
433 #[doc = "6: ULFRCO (directly from oscillator)."]
434 ULFRCO = 6,
435}
436impl From<CLKOUTSEL0_A> for u8 {
437 #[inline(always)]
438 fn from(variant: CLKOUTSEL0_A) -> Self {
439 variant as _
440 }
441}
442#[doc = "Field `CLKOUTSEL0` reader - Clock Output Select 0"]
443pub type CLKOUTSEL0_R = crate::FieldReader<u8, CLKOUTSEL0_A>;
444impl CLKOUTSEL0_R {
445 #[doc = "Get enumerated values variant"]
446 #[inline(always)]
447 pub fn variant(&self) -> Option<CLKOUTSEL0_A> {
448 match self.bits {
449 0 => Some(CLKOUTSEL0_A::HFRCO),
450 1 => Some(CLKOUTSEL0_A::HFXO),
451 2 => Some(CLKOUTSEL0_A::HFCLK2),
452 3 => Some(CLKOUTSEL0_A::HFCLK4),
453 4 => Some(CLKOUTSEL0_A::HFCLK8),
454 5 => Some(CLKOUTSEL0_A::HFCLK16),
455 6 => Some(CLKOUTSEL0_A::ULFRCO),
456 _ => None,
457 }
458 }
459 #[doc = "Checks if the value of the field is `HFRCO`"]
460 #[inline(always)]
461 pub fn is_hfrco(&self) -> bool {
462 *self == CLKOUTSEL0_A::HFRCO
463 }
464 #[doc = "Checks if the value of the field is `HFXO`"]
465 #[inline(always)]
466 pub fn is_hfxo(&self) -> bool {
467 *self == CLKOUTSEL0_A::HFXO
468 }
469 #[doc = "Checks if the value of the field is `HFCLK2`"]
470 #[inline(always)]
471 pub fn is_hfclk2(&self) -> bool {
472 *self == CLKOUTSEL0_A::HFCLK2
473 }
474 #[doc = "Checks if the value of the field is `HFCLK4`"]
475 #[inline(always)]
476 pub fn is_hfclk4(&self) -> bool {
477 *self == CLKOUTSEL0_A::HFCLK4
478 }
479 #[doc = "Checks if the value of the field is `HFCLK8`"]
480 #[inline(always)]
481 pub fn is_hfclk8(&self) -> bool {
482 *self == CLKOUTSEL0_A::HFCLK8
483 }
484 #[doc = "Checks if the value of the field is `HFCLK16`"]
485 #[inline(always)]
486 pub fn is_hfclk16(&self) -> bool {
487 *self == CLKOUTSEL0_A::HFCLK16
488 }
489 #[doc = "Checks if the value of the field is `ULFRCO`"]
490 #[inline(always)]
491 pub fn is_ulfrco(&self) -> bool {
492 *self == CLKOUTSEL0_A::ULFRCO
493 }
494}
495#[doc = "Field `CLKOUTSEL0` writer - Clock Output Select 0"]
496pub type CLKOUTSEL0_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKOUTSEL0_A, 3, 20>;
497impl<'a> CLKOUTSEL0_W<'a> {
498 #[doc = "HFRCO (directly from oscillator)."]
499 #[inline(always)]
500 pub fn hfrco(self) -> &'a mut W {
501 self.variant(CLKOUTSEL0_A::HFRCO)
502 }
503 #[doc = "HFXO (directly from oscillator)."]
504 #[inline(always)]
505 pub fn hfxo(self) -> &'a mut W {
506 self.variant(CLKOUTSEL0_A::HFXO)
507 }
508 #[doc = "HFCLK/2."]
509 #[inline(always)]
510 pub fn hfclk2(self) -> &'a mut W {
511 self.variant(CLKOUTSEL0_A::HFCLK2)
512 }
513 #[doc = "HFCLK/4."]
514 #[inline(always)]
515 pub fn hfclk4(self) -> &'a mut W {
516 self.variant(CLKOUTSEL0_A::HFCLK4)
517 }
518 #[doc = "HFCLK/8."]
519 #[inline(always)]
520 pub fn hfclk8(self) -> &'a mut W {
521 self.variant(CLKOUTSEL0_A::HFCLK8)
522 }
523 #[doc = "HFCLK/16."]
524 #[inline(always)]
525 pub fn hfclk16(self) -> &'a mut W {
526 self.variant(CLKOUTSEL0_A::HFCLK16)
527 }
528 #[doc = "ULFRCO (directly from oscillator)."]
529 #[inline(always)]
530 pub fn ulfrco(self) -> &'a mut W {
531 self.variant(CLKOUTSEL0_A::ULFRCO)
532 }
533}
534#[doc = "Field `CLKOUTSEL1` reader - Clock Output Select 1"]
535pub type CLKOUTSEL1_R = crate::BitReader<bool>;
536#[doc = "Field `CLKOUTSEL1` writer - Clock Output Select 1"]
537pub type CLKOUTSEL1_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 23>;
538impl R {
539 #[doc = "Bits 0:1 - HFXO Mode"]
540 #[inline(always)]
541 pub fn hfxomode(&self) -> HFXOMODE_R {
542 HFXOMODE_R::new((self.bits & 3) as u8)
543 }
544 #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
545 #[inline(always)]
546 pub fn hfxoboost(&self) -> HFXOBOOST_R {
547 HFXOBOOST_R::new(((self.bits >> 2) & 3) as u8)
548 }
549 #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
550 #[inline(always)]
551 pub fn hfxobufcur(&self) -> HFXOBUFCUR_R {
552 HFXOBUFCUR_R::new(((self.bits >> 5) & 3) as u8)
553 }
554 #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
555 #[inline(always)]
556 pub fn hfxoglitchdeten(&self) -> HFXOGLITCHDETEN_R {
557 HFXOGLITCHDETEN_R::new(((self.bits >> 7) & 1) != 0)
558 }
559 #[doc = "Bits 9:10 - HFXO Timeout"]
560 #[inline(always)]
561 pub fn hfxotimeout(&self) -> HFXOTIMEOUT_R {
562 HFXOTIMEOUT_R::new(((self.bits >> 9) & 3) as u8)
563 }
564 #[doc = "Bits 11:12 - LFXO Mode"]
565 #[inline(always)]
566 pub fn lfxomode(&self) -> LFXOMODE_R {
567 LFXOMODE_R::new(((self.bits >> 11) & 3) as u8)
568 }
569 #[doc = "Bit 13 - LFXO Start-up Boost Current"]
570 #[inline(always)]
571 pub fn lfxoboost(&self) -> LFXOBOOST_R {
572 LFXOBOOST_R::new(((self.bits >> 13) & 1) != 0)
573 }
574 #[doc = "Bit 17 - LFXO Boost Buffer Current"]
575 #[inline(always)]
576 pub fn lfxobufcur(&self) -> LFXOBUFCUR_R {
577 LFXOBUFCUR_R::new(((self.bits >> 17) & 1) != 0)
578 }
579 #[doc = "Bits 18:19 - LFXO Timeout"]
580 #[inline(always)]
581 pub fn lfxotimeout(&self) -> LFXOTIMEOUT_R {
582 LFXOTIMEOUT_R::new(((self.bits >> 18) & 3) as u8)
583 }
584 #[doc = "Bits 20:22 - Clock Output Select 0"]
585 #[inline(always)]
586 pub fn clkoutsel0(&self) -> CLKOUTSEL0_R {
587 CLKOUTSEL0_R::new(((self.bits >> 20) & 7) as u8)
588 }
589 #[doc = "Bit 23 - Clock Output Select 1"]
590 #[inline(always)]
591 pub fn clkoutsel1(&self) -> CLKOUTSEL1_R {
592 CLKOUTSEL1_R::new(((self.bits >> 23) & 1) != 0)
593 }
594}
595impl W {
596 #[doc = "Bits 0:1 - HFXO Mode"]
597 #[inline(always)]
598 pub fn hfxomode(&mut self) -> HFXOMODE_W {
599 HFXOMODE_W::new(self)
600 }
601 #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
602 #[inline(always)]
603 pub fn hfxoboost(&mut self) -> HFXOBOOST_W {
604 HFXOBOOST_W::new(self)
605 }
606 #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
607 #[inline(always)]
608 pub fn hfxobufcur(&mut self) -> HFXOBUFCUR_W {
609 HFXOBUFCUR_W::new(self)
610 }
611 #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
612 #[inline(always)]
613 pub fn hfxoglitchdeten(&mut self) -> HFXOGLITCHDETEN_W {
614 HFXOGLITCHDETEN_W::new(self)
615 }
616 #[doc = "Bits 9:10 - HFXO Timeout"]
617 #[inline(always)]
618 pub fn hfxotimeout(&mut self) -> HFXOTIMEOUT_W {
619 HFXOTIMEOUT_W::new(self)
620 }
621 #[doc = "Bits 11:12 - LFXO Mode"]
622 #[inline(always)]
623 pub fn lfxomode(&mut self) -> LFXOMODE_W {
624 LFXOMODE_W::new(self)
625 }
626 #[doc = "Bit 13 - LFXO Start-up Boost Current"]
627 #[inline(always)]
628 pub fn lfxoboost(&mut self) -> LFXOBOOST_W {
629 LFXOBOOST_W::new(self)
630 }
631 #[doc = "Bit 17 - LFXO Boost Buffer Current"]
632 #[inline(always)]
633 pub fn lfxobufcur(&mut self) -> LFXOBUFCUR_W {
634 LFXOBUFCUR_W::new(self)
635 }
636 #[doc = "Bits 18:19 - LFXO Timeout"]
637 #[inline(always)]
638 pub fn lfxotimeout(&mut self) -> LFXOTIMEOUT_W {
639 LFXOTIMEOUT_W::new(self)
640 }
641 #[doc = "Bits 20:22 - Clock Output Select 0"]
642 #[inline(always)]
643 pub fn clkoutsel0(&mut self) -> CLKOUTSEL0_W {
644 CLKOUTSEL0_W::new(self)
645 }
646 #[doc = "Bit 23 - Clock Output Select 1"]
647 #[inline(always)]
648 pub fn clkoutsel1(&mut self) -> CLKOUTSEL1_W {
649 CLKOUTSEL1_W::new(self)
650 }
651 #[doc = "Writes raw bits to the register."]
652 #[inline(always)]
653 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
654 self.0.bits(bits);
655 self
656 }
657}
658#[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"]
659pub struct CTRL_SPEC;
660impl crate::RegisterSpec for CTRL_SPEC {
661 type Ux = u32;
662}
663#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
664impl crate::Readable for CTRL_SPEC {
665 type Reader = R;
666}
667#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
668impl crate::Writable for CTRL_SPEC {
669 type Writer = W;
670}
671#[doc = "`reset()` method sets CTRL to value 0x000c_262c"]
672impl crate::Resettable for CTRL_SPEC {
673 #[inline(always)]
674 fn reset_value() -> Self::Ux {
675 0x000c_262c
676 }
677}