efm32g280-pac 0.1.0

Peripheral access API for EFM32G280 MCU (generated using svd2rust)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
#[doc = "Register `CTRL` reader"]
pub struct R(crate::R<CTRL_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<CTRL_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CTRL` writer"]
pub struct W(crate::W<CTRL_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<CTRL_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "HFXO Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum HFXOMODE_A {
    #[doc = "0: 4-32 MHz crystal oscillator."]
    XTAL = 0,
    #[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."]
    BUFEXTCLK = 1,
    #[doc = "2: Digital external clock on HFXTAL_N pin. Oscillator is effectively bypassed."]
    DIGEXTCLK = 2,
}
impl From<HFXOMODE_A> for u8 {
    #[inline(always)]
    fn from(variant: HFXOMODE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `HFXOMODE` reader - HFXO Mode"]
pub type HFXOMODE_R = crate::FieldReader<u8, HFXOMODE_A>;
impl HFXOMODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<HFXOMODE_A> {
        match self.bits {
            0 => Some(HFXOMODE_A::XTAL),
            1 => Some(HFXOMODE_A::BUFEXTCLK),
            2 => Some(HFXOMODE_A::DIGEXTCLK),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `XTAL`"]
    #[inline(always)]
    pub fn is_xtal(&self) -> bool {
        *self == HFXOMODE_A::XTAL
    }
    #[doc = "Checks if the value of the field is `BUFEXTCLK`"]
    #[inline(always)]
    pub fn is_bufextclk(&self) -> bool {
        *self == HFXOMODE_A::BUFEXTCLK
    }
    #[doc = "Checks if the value of the field is `DIGEXTCLK`"]
    #[inline(always)]
    pub fn is_digextclk(&self) -> bool {
        *self == HFXOMODE_A::DIGEXTCLK
    }
}
#[doc = "Field `HFXOMODE` writer - HFXO Mode"]
pub type HFXOMODE_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, HFXOMODE_A, 2, 0>;
impl<'a> HFXOMODE_W<'a> {
    #[doc = "4-32 MHz crystal oscillator."]
    #[inline(always)]
    pub fn xtal(self) -> &'a mut W {
        self.variant(HFXOMODE_A::XTAL)
    }
    #[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."]
    #[inline(always)]
    pub fn bufextclk(self) -> &'a mut W {
        self.variant(HFXOMODE_A::BUFEXTCLK)
    }
    #[doc = "Digital external clock on HFXTAL_N pin. Oscillator is effectively bypassed."]
    #[inline(always)]
    pub fn digextclk(self) -> &'a mut W {
        self.variant(HFXOMODE_A::DIGEXTCLK)
    }
}
#[doc = "HFXO Start-up Boost Current\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum HFXOBOOST_A {
    #[doc = "0: 50 %."]
    _50PCENT = 0,
    #[doc = "1: 70 %."]
    _70PCENT = 1,
    #[doc = "2: 80 %."]
    _80PCENT = 2,
    #[doc = "3: 100 % (default)."]
    _100PCENT = 3,
}
impl From<HFXOBOOST_A> for u8 {
    #[inline(always)]
    fn from(variant: HFXOBOOST_A) -> Self {
        variant as _
    }
}
#[doc = "Field `HFXOBOOST` reader - HFXO Start-up Boost Current"]
pub type HFXOBOOST_R = crate::FieldReader<u8, HFXOBOOST_A>;
impl HFXOBOOST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HFXOBOOST_A {
        match self.bits {
            0 => HFXOBOOST_A::_50PCENT,
            1 => HFXOBOOST_A::_70PCENT,
            2 => HFXOBOOST_A::_80PCENT,
            3 => HFXOBOOST_A::_100PCENT,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_50PCENT`"]
    #[inline(always)]
    pub fn is_50pcent(&self) -> bool {
        *self == HFXOBOOST_A::_50PCENT
    }
    #[doc = "Checks if the value of the field is `_70PCENT`"]
    #[inline(always)]
    pub fn is_70pcent(&self) -> bool {
        *self == HFXOBOOST_A::_70PCENT
    }
    #[doc = "Checks if the value of the field is `_80PCENT`"]
    #[inline(always)]
    pub fn is_80pcent(&self) -> bool {
        *self == HFXOBOOST_A::_80PCENT
    }
    #[doc = "Checks if the value of the field is `_100PCENT`"]
    #[inline(always)]
    pub fn is_100pcent(&self) -> bool {
        *self == HFXOBOOST_A::_100PCENT
    }
}
#[doc = "Field `HFXOBOOST` writer - HFXO Start-up Boost Current"]
pub type HFXOBOOST_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, HFXOBOOST_A, 2, 2>;
impl<'a> HFXOBOOST_W<'a> {
    #[doc = "50 %."]
    #[inline(always)]
    pub fn _50pcent(self) -> &'a mut W {
        self.variant(HFXOBOOST_A::_50PCENT)
    }
    #[doc = "70 %."]
    #[inline(always)]
    pub fn _70pcent(self) -> &'a mut W {
        self.variant(HFXOBOOST_A::_70PCENT)
    }
    #[doc = "80 %."]
    #[inline(always)]
    pub fn _80pcent(self) -> &'a mut W {
        self.variant(HFXOBOOST_A::_80PCENT)
    }
    #[doc = "100 % (default)."]
    #[inline(always)]
    pub fn _100pcent(self) -> &'a mut W {
        self.variant(HFXOBOOST_A::_100PCENT)
    }
}
#[doc = "Field `HFXOBUFCUR` reader - HFXO Boost Buffer Current"]
pub type HFXOBUFCUR_R = crate::FieldReader<u8, u8>;
#[doc = "Field `HFXOBUFCUR` writer - HFXO Boost Buffer Current"]
pub type HFXOBUFCUR_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, u8, 2, 5>;
#[doc = "Field `HFXOGLITCHDETEN` reader - HFXO Glitch Detector Enable"]
pub type HFXOGLITCHDETEN_R = crate::BitReader<bool>;
#[doc = "Field `HFXOGLITCHDETEN` writer - HFXO Glitch Detector Enable"]
pub type HFXOGLITCHDETEN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 7>;
#[doc = "HFXO Timeout\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum HFXOTIMEOUT_A {
    #[doc = "0: Timeout period of 8 cycles."]
    _8CYCLES = 0,
    #[doc = "1: Timeout period of 256 cycles."]
    _256CYCLES = 1,
    #[doc = "2: Timeout period of 1024 cycles."]
    _1KCYCLES = 2,
    #[doc = "3: Timeout period of 16384 cycles."]
    _16KCYCLES = 3,
}
impl From<HFXOTIMEOUT_A> for u8 {
    #[inline(always)]
    fn from(variant: HFXOTIMEOUT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `HFXOTIMEOUT` reader - HFXO Timeout"]
pub type HFXOTIMEOUT_R = crate::FieldReader<u8, HFXOTIMEOUT_A>;
impl HFXOTIMEOUT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HFXOTIMEOUT_A {
        match self.bits {
            0 => HFXOTIMEOUT_A::_8CYCLES,
            1 => HFXOTIMEOUT_A::_256CYCLES,
            2 => HFXOTIMEOUT_A::_1KCYCLES,
            3 => HFXOTIMEOUT_A::_16KCYCLES,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_8CYCLES`"]
    #[inline(always)]
    pub fn is_8cycles(&self) -> bool {
        *self == HFXOTIMEOUT_A::_8CYCLES
    }
    #[doc = "Checks if the value of the field is `_256CYCLES`"]
    #[inline(always)]
    pub fn is_256cycles(&self) -> bool {
        *self == HFXOTIMEOUT_A::_256CYCLES
    }
    #[doc = "Checks if the value of the field is `_1KCYCLES`"]
    #[inline(always)]
    pub fn is_1kcycles(&self) -> bool {
        *self == HFXOTIMEOUT_A::_1KCYCLES
    }
    #[doc = "Checks if the value of the field is `_16KCYCLES`"]
    #[inline(always)]
    pub fn is_16kcycles(&self) -> bool {
        *self == HFXOTIMEOUT_A::_16KCYCLES
    }
}
#[doc = "Field `HFXOTIMEOUT` writer - HFXO Timeout"]
pub type HFXOTIMEOUT_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, HFXOTIMEOUT_A, 2, 9>;
impl<'a> HFXOTIMEOUT_W<'a> {
    #[doc = "Timeout period of 8 cycles."]
    #[inline(always)]
    pub fn _8cycles(self) -> &'a mut W {
        self.variant(HFXOTIMEOUT_A::_8CYCLES)
    }
    #[doc = "Timeout period of 256 cycles."]
    #[inline(always)]
    pub fn _256cycles(self) -> &'a mut W {
        self.variant(HFXOTIMEOUT_A::_256CYCLES)
    }
    #[doc = "Timeout period of 1024 cycles."]
    #[inline(always)]
    pub fn _1kcycles(self) -> &'a mut W {
        self.variant(HFXOTIMEOUT_A::_1KCYCLES)
    }
    #[doc = "Timeout period of 16384 cycles."]
    #[inline(always)]
    pub fn _16kcycles(self) -> &'a mut W {
        self.variant(HFXOTIMEOUT_A::_16KCYCLES)
    }
}
#[doc = "LFXO Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum LFXOMODE_A {
    #[doc = "0: 32.768 kHz crystal oscillator."]
    XTAL = 0,
    #[doc = "1: An AC coupled buffer is coupled in series with LFXTAL_N pin, suitable for external sinus wave (32.768 kHz)."]
    BUFEXTCLK = 1,
    #[doc = "2: Digital external clock on LFXTAL_N pin. Oscillator is effectively bypassed."]
    DIGEXTCLK = 2,
}
impl From<LFXOMODE_A> for u8 {
    #[inline(always)]
    fn from(variant: LFXOMODE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `LFXOMODE` reader - LFXO Mode"]
pub type LFXOMODE_R = crate::FieldReader<u8, LFXOMODE_A>;
impl LFXOMODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<LFXOMODE_A> {
        match self.bits {
            0 => Some(LFXOMODE_A::XTAL),
            1 => Some(LFXOMODE_A::BUFEXTCLK),
            2 => Some(LFXOMODE_A::DIGEXTCLK),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `XTAL`"]
    #[inline(always)]
    pub fn is_xtal(&self) -> bool {
        *self == LFXOMODE_A::XTAL
    }
    #[doc = "Checks if the value of the field is `BUFEXTCLK`"]
    #[inline(always)]
    pub fn is_bufextclk(&self) -> bool {
        *self == LFXOMODE_A::BUFEXTCLK
    }
    #[doc = "Checks if the value of the field is `DIGEXTCLK`"]
    #[inline(always)]
    pub fn is_digextclk(&self) -> bool {
        *self == LFXOMODE_A::DIGEXTCLK
    }
}
#[doc = "Field `LFXOMODE` writer - LFXO Mode"]
pub type LFXOMODE_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, LFXOMODE_A, 2, 11>;
impl<'a> LFXOMODE_W<'a> {
    #[doc = "32.768 kHz crystal oscillator."]
    #[inline(always)]
    pub fn xtal(self) -> &'a mut W {
        self.variant(LFXOMODE_A::XTAL)
    }
    #[doc = "An AC coupled buffer is coupled in series with LFXTAL_N pin, suitable for external sinus wave (32.768 kHz)."]
    #[inline(always)]
    pub fn bufextclk(self) -> &'a mut W {
        self.variant(LFXOMODE_A::BUFEXTCLK)
    }
    #[doc = "Digital external clock on LFXTAL_N pin. Oscillator is effectively bypassed."]
    #[inline(always)]
    pub fn digextclk(self) -> &'a mut W {
        self.variant(LFXOMODE_A::DIGEXTCLK)
    }
}
#[doc = "Field `LFXOBOOST` reader - LFXO Start-up Boost Current"]
pub type LFXOBOOST_R = crate::BitReader<bool>;
#[doc = "Field `LFXOBOOST` writer - LFXO Start-up Boost Current"]
pub type LFXOBOOST_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 13>;
#[doc = "Field `LFXOBUFCUR` reader - LFXO Boost Buffer Current"]
pub type LFXOBUFCUR_R = crate::BitReader<bool>;
#[doc = "Field `LFXOBUFCUR` writer - LFXO Boost Buffer Current"]
pub type LFXOBUFCUR_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 17>;
#[doc = "LFXO Timeout\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum LFXOTIMEOUT_A {
    #[doc = "0: Timeout period of 8 cycles."]
    _8CYCLES = 0,
    #[doc = "1: Timeout period of 1024 cycles."]
    _1KCYCLES = 1,
    #[doc = "2: Timeout period of 16384 cycles."]
    _16KCYCLES = 2,
    #[doc = "3: Timeout period of 32768 cycles."]
    _32KCYCLES = 3,
}
impl From<LFXOTIMEOUT_A> for u8 {
    #[inline(always)]
    fn from(variant: LFXOTIMEOUT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `LFXOTIMEOUT` reader - LFXO Timeout"]
pub type LFXOTIMEOUT_R = crate::FieldReader<u8, LFXOTIMEOUT_A>;
impl LFXOTIMEOUT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> LFXOTIMEOUT_A {
        match self.bits {
            0 => LFXOTIMEOUT_A::_8CYCLES,
            1 => LFXOTIMEOUT_A::_1KCYCLES,
            2 => LFXOTIMEOUT_A::_16KCYCLES,
            3 => LFXOTIMEOUT_A::_32KCYCLES,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_8CYCLES`"]
    #[inline(always)]
    pub fn is_8cycles(&self) -> bool {
        *self == LFXOTIMEOUT_A::_8CYCLES
    }
    #[doc = "Checks if the value of the field is `_1KCYCLES`"]
    #[inline(always)]
    pub fn is_1kcycles(&self) -> bool {
        *self == LFXOTIMEOUT_A::_1KCYCLES
    }
    #[doc = "Checks if the value of the field is `_16KCYCLES`"]
    #[inline(always)]
    pub fn is_16kcycles(&self) -> bool {
        *self == LFXOTIMEOUT_A::_16KCYCLES
    }
    #[doc = "Checks if the value of the field is `_32KCYCLES`"]
    #[inline(always)]
    pub fn is_32kcycles(&self) -> bool {
        *self == LFXOTIMEOUT_A::_32KCYCLES
    }
}
#[doc = "Field `LFXOTIMEOUT` writer - LFXO Timeout"]
pub type LFXOTIMEOUT_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, LFXOTIMEOUT_A, 2, 18>;
impl<'a> LFXOTIMEOUT_W<'a> {
    #[doc = "Timeout period of 8 cycles."]
    #[inline(always)]
    pub fn _8cycles(self) -> &'a mut W {
        self.variant(LFXOTIMEOUT_A::_8CYCLES)
    }
    #[doc = "Timeout period of 1024 cycles."]
    #[inline(always)]
    pub fn _1kcycles(self) -> &'a mut W {
        self.variant(LFXOTIMEOUT_A::_1KCYCLES)
    }
    #[doc = "Timeout period of 16384 cycles."]
    #[inline(always)]
    pub fn _16kcycles(self) -> &'a mut W {
        self.variant(LFXOTIMEOUT_A::_16KCYCLES)
    }
    #[doc = "Timeout period of 32768 cycles."]
    #[inline(always)]
    pub fn _32kcycles(self) -> &'a mut W {
        self.variant(LFXOTIMEOUT_A::_32KCYCLES)
    }
}
#[doc = "Clock Output Select 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CLKOUTSEL0_A {
    #[doc = "0: HFRCO (directly from oscillator)."]
    HFRCO = 0,
    #[doc = "1: HFXO (directly from oscillator)."]
    HFXO = 1,
    #[doc = "2: HFCLK/2."]
    HFCLK2 = 2,
    #[doc = "3: HFCLK/4."]
    HFCLK4 = 3,
    #[doc = "4: HFCLK/8."]
    HFCLK8 = 4,
    #[doc = "5: HFCLK/16."]
    HFCLK16 = 5,
    #[doc = "6: ULFRCO (directly from oscillator)."]
    ULFRCO = 6,
}
impl From<CLKOUTSEL0_A> for u8 {
    #[inline(always)]
    fn from(variant: CLKOUTSEL0_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CLKOUTSEL0` reader - Clock Output Select 0"]
pub type CLKOUTSEL0_R = crate::FieldReader<u8, CLKOUTSEL0_A>;
impl CLKOUTSEL0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<CLKOUTSEL0_A> {
        match self.bits {
            0 => Some(CLKOUTSEL0_A::HFRCO),
            1 => Some(CLKOUTSEL0_A::HFXO),
            2 => Some(CLKOUTSEL0_A::HFCLK2),
            3 => Some(CLKOUTSEL0_A::HFCLK4),
            4 => Some(CLKOUTSEL0_A::HFCLK8),
            5 => Some(CLKOUTSEL0_A::HFCLK16),
            6 => Some(CLKOUTSEL0_A::ULFRCO),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `HFRCO`"]
    #[inline(always)]
    pub fn is_hfrco(&self) -> bool {
        *self == CLKOUTSEL0_A::HFRCO
    }
    #[doc = "Checks if the value of the field is `HFXO`"]
    #[inline(always)]
    pub fn is_hfxo(&self) -> bool {
        *self == CLKOUTSEL0_A::HFXO
    }
    #[doc = "Checks if the value of the field is `HFCLK2`"]
    #[inline(always)]
    pub fn is_hfclk2(&self) -> bool {
        *self == CLKOUTSEL0_A::HFCLK2
    }
    #[doc = "Checks if the value of the field is `HFCLK4`"]
    #[inline(always)]
    pub fn is_hfclk4(&self) -> bool {
        *self == CLKOUTSEL0_A::HFCLK4
    }
    #[doc = "Checks if the value of the field is `HFCLK8`"]
    #[inline(always)]
    pub fn is_hfclk8(&self) -> bool {
        *self == CLKOUTSEL0_A::HFCLK8
    }
    #[doc = "Checks if the value of the field is `HFCLK16`"]
    #[inline(always)]
    pub fn is_hfclk16(&self) -> bool {
        *self == CLKOUTSEL0_A::HFCLK16
    }
    #[doc = "Checks if the value of the field is `ULFRCO`"]
    #[inline(always)]
    pub fn is_ulfrco(&self) -> bool {
        *self == CLKOUTSEL0_A::ULFRCO
    }
}
#[doc = "Field `CLKOUTSEL0` writer - Clock Output Select 0"]
pub type CLKOUTSEL0_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKOUTSEL0_A, 3, 20>;
impl<'a> CLKOUTSEL0_W<'a> {
    #[doc = "HFRCO (directly from oscillator)."]
    #[inline(always)]
    pub fn hfrco(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFRCO)
    }
    #[doc = "HFXO (directly from oscillator)."]
    #[inline(always)]
    pub fn hfxo(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFXO)
    }
    #[doc = "HFCLK/2."]
    #[inline(always)]
    pub fn hfclk2(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFCLK2)
    }
    #[doc = "HFCLK/4."]
    #[inline(always)]
    pub fn hfclk4(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFCLK4)
    }
    #[doc = "HFCLK/8."]
    #[inline(always)]
    pub fn hfclk8(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFCLK8)
    }
    #[doc = "HFCLK/16."]
    #[inline(always)]
    pub fn hfclk16(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::HFCLK16)
    }
    #[doc = "ULFRCO (directly from oscillator)."]
    #[inline(always)]
    pub fn ulfrco(self) -> &'a mut W {
        self.variant(CLKOUTSEL0_A::ULFRCO)
    }
}
#[doc = "Field `CLKOUTSEL1` reader - Clock Output Select 1"]
pub type CLKOUTSEL1_R = crate::BitReader<bool>;
#[doc = "Field `CLKOUTSEL1` writer - Clock Output Select 1"]
pub type CLKOUTSEL1_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 23>;
impl R {
    #[doc = "Bits 0:1 - HFXO Mode"]
    #[inline(always)]
    pub fn hfxomode(&self) -> HFXOMODE_R {
        HFXOMODE_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
    #[inline(always)]
    pub fn hfxoboost(&self) -> HFXOBOOST_R {
        HFXOBOOST_R::new(((self.bits >> 2) & 3) as u8)
    }
    #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
    #[inline(always)]
    pub fn hfxobufcur(&self) -> HFXOBUFCUR_R {
        HFXOBUFCUR_R::new(((self.bits >> 5) & 3) as u8)
    }
    #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
    #[inline(always)]
    pub fn hfxoglitchdeten(&self) -> HFXOGLITCHDETEN_R {
        HFXOGLITCHDETEN_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 9:10 - HFXO Timeout"]
    #[inline(always)]
    pub fn hfxotimeout(&self) -> HFXOTIMEOUT_R {
        HFXOTIMEOUT_R::new(((self.bits >> 9) & 3) as u8)
    }
    #[doc = "Bits 11:12 - LFXO Mode"]
    #[inline(always)]
    pub fn lfxomode(&self) -> LFXOMODE_R {
        LFXOMODE_R::new(((self.bits >> 11) & 3) as u8)
    }
    #[doc = "Bit 13 - LFXO Start-up Boost Current"]
    #[inline(always)]
    pub fn lfxoboost(&self) -> LFXOBOOST_R {
        LFXOBOOST_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 17 - LFXO Boost Buffer Current"]
    #[inline(always)]
    pub fn lfxobufcur(&self) -> LFXOBUFCUR_R {
        LFXOBUFCUR_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bits 18:19 - LFXO Timeout"]
    #[inline(always)]
    pub fn lfxotimeout(&self) -> LFXOTIMEOUT_R {
        LFXOTIMEOUT_R::new(((self.bits >> 18) & 3) as u8)
    }
    #[doc = "Bits 20:22 - Clock Output Select 0"]
    #[inline(always)]
    pub fn clkoutsel0(&self) -> CLKOUTSEL0_R {
        CLKOUTSEL0_R::new(((self.bits >> 20) & 7) as u8)
    }
    #[doc = "Bit 23 - Clock Output Select 1"]
    #[inline(always)]
    pub fn clkoutsel1(&self) -> CLKOUTSEL1_R {
        CLKOUTSEL1_R::new(((self.bits >> 23) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - HFXO Mode"]
    #[inline(always)]
    pub fn hfxomode(&mut self) -> HFXOMODE_W {
        HFXOMODE_W::new(self)
    }
    #[doc = "Bits 2:3 - HFXO Start-up Boost Current"]
    #[inline(always)]
    pub fn hfxoboost(&mut self) -> HFXOBOOST_W {
        HFXOBOOST_W::new(self)
    }
    #[doc = "Bits 5:6 - HFXO Boost Buffer Current"]
    #[inline(always)]
    pub fn hfxobufcur(&mut self) -> HFXOBUFCUR_W {
        HFXOBUFCUR_W::new(self)
    }
    #[doc = "Bit 7 - HFXO Glitch Detector Enable"]
    #[inline(always)]
    pub fn hfxoglitchdeten(&mut self) -> HFXOGLITCHDETEN_W {
        HFXOGLITCHDETEN_W::new(self)
    }
    #[doc = "Bits 9:10 - HFXO Timeout"]
    #[inline(always)]
    pub fn hfxotimeout(&mut self) -> HFXOTIMEOUT_W {
        HFXOTIMEOUT_W::new(self)
    }
    #[doc = "Bits 11:12 - LFXO Mode"]
    #[inline(always)]
    pub fn lfxomode(&mut self) -> LFXOMODE_W {
        LFXOMODE_W::new(self)
    }
    #[doc = "Bit 13 - LFXO Start-up Boost Current"]
    #[inline(always)]
    pub fn lfxoboost(&mut self) -> LFXOBOOST_W {
        LFXOBOOST_W::new(self)
    }
    #[doc = "Bit 17 - LFXO Boost Buffer Current"]
    #[inline(always)]
    pub fn lfxobufcur(&mut self) -> LFXOBUFCUR_W {
        LFXOBUFCUR_W::new(self)
    }
    #[doc = "Bits 18:19 - LFXO Timeout"]
    #[inline(always)]
    pub fn lfxotimeout(&mut self) -> LFXOTIMEOUT_W {
        LFXOTIMEOUT_W::new(self)
    }
    #[doc = "Bits 20:22 - Clock Output Select 0"]
    #[inline(always)]
    pub fn clkoutsel0(&mut self) -> CLKOUTSEL0_W {
        CLKOUTSEL0_W::new(self)
    }
    #[doc = "Bit 23 - Clock Output Select 1"]
    #[inline(always)]
    pub fn clkoutsel1(&mut self) -> CLKOUTSEL1_W {
        CLKOUTSEL1_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[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"]
pub struct CTRL_SPEC;
impl crate::RegisterSpec for CTRL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
impl crate::Readable for CTRL_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
impl crate::Writable for CTRL_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CTRL to value 0x000c_262c"]
impl crate::Resettable for CTRL_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x000c_262c
    }
}