mcxa-pac 0.3.0

Peripheral Access Crate for MCXA256 devices
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
678
679
680
#[doc = "Register `FIRCCSR` reader"]
pub type R = crate::R<FirccsrSpec>;
#[doc = "Register `FIRCCSR` writer"]
pub type W = crate::W<FirccsrSpec>;
#[doc = "FIRC Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircen {
    #[doc = "0: FIRC is disabled"]
    Disabled = 0,
    #[doc = "1: FIRC is enabled"]
    Enabled = 1,
}
impl From<Fircen> for bool {
    #[inline(always)]
    fn from(variant: Fircen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCEN` reader - FIRC Enable"]
pub type FircenR = crate::BitReader<Fircen>;
impl FircenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircen {
        match self.bits {
            false => Fircen::Disabled,
            true => Fircen::Enabled,
        }
    }
    #[doc = "FIRC is disabled"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == Fircen::Disabled
    }
    #[doc = "FIRC is enabled"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == Fircen::Enabled
    }
}
#[doc = "Field `FIRCEN` writer - FIRC Enable"]
pub type FircenW<'a, REG> = crate::BitWriter<'a, REG, Fircen>;
impl<'a, REG> FircenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIRC is disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fircen::Disabled)
    }
    #[doc = "FIRC is enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fircen::Enabled)
    }
}
#[doc = "FIRC Stop Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircsten {
    #[doc = "0: FIRC is disabled in Deep Sleep mode"]
    DisabledInStopModes = 0,
    #[doc = "1: FIRC is enabled in Deep Sleep mode"]
    EnabledInStopModes = 1,
}
impl From<Fircsten> for bool {
    #[inline(always)]
    fn from(variant: Fircsten) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCSTEN` reader - FIRC Stop Enable"]
pub type FircstenR = crate::BitReader<Fircsten>;
impl FircstenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircsten {
        match self.bits {
            false => Fircsten::DisabledInStopModes,
            true => Fircsten::EnabledInStopModes,
        }
    }
    #[doc = "FIRC is disabled in Deep Sleep mode"]
    #[inline(always)]
    pub fn is_disabled_in_stop_modes(&self) -> bool {
        *self == Fircsten::DisabledInStopModes
    }
    #[doc = "FIRC is enabled in Deep Sleep mode"]
    #[inline(always)]
    pub fn is_enabled_in_stop_modes(&self) -> bool {
        *self == Fircsten::EnabledInStopModes
    }
}
#[doc = "Field `FIRCSTEN` writer - FIRC Stop Enable"]
pub type FircstenW<'a, REG> = crate::BitWriter<'a, REG, Fircsten>;
impl<'a, REG> FircstenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIRC is disabled in Deep Sleep mode"]
    #[inline(always)]
    pub fn disabled_in_stop_modes(self) -> &'a mut crate::W<REG> {
        self.variant(Fircsten::DisabledInStopModes)
    }
    #[doc = "FIRC is enabled in Deep Sleep mode"]
    #[inline(always)]
    pub fn enabled_in_stop_modes(self) -> &'a mut crate::W<REG> {
        self.variant(Fircsten::EnabledInStopModes)
    }
}
#[doc = "FIRC 45 MHz Clock to peripherals Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FircSclkPeriphEn {
    #[doc = "0: FIRC 45 MHz to peripherals is disabled"]
    Disabled = 0,
    #[doc = "1: FIRC 45 MHz to peripherals is enabled"]
    Enabled = 1,
}
impl From<FircSclkPeriphEn> for bool {
    #[inline(always)]
    fn from(variant: FircSclkPeriphEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRC_SCLK_PERIPH_EN` reader - FIRC 45 MHz Clock to peripherals Enable"]
pub type FircSclkPeriphEnR = crate::BitReader<FircSclkPeriphEn>;
impl FircSclkPeriphEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> FircSclkPeriphEn {
        match self.bits {
            false => FircSclkPeriphEn::Disabled,
            true => FircSclkPeriphEn::Enabled,
        }
    }
    #[doc = "FIRC 45 MHz to peripherals is disabled"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == FircSclkPeriphEn::Disabled
    }
    #[doc = "FIRC 45 MHz to peripherals is enabled"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == FircSclkPeriphEn::Enabled
    }
}
#[doc = "Field `FIRC_SCLK_PERIPH_EN` writer - FIRC 45 MHz Clock to peripherals Enable"]
pub type FircSclkPeriphEnW<'a, REG> = crate::BitWriter<'a, REG, FircSclkPeriphEn>;
impl<'a, REG> FircSclkPeriphEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIRC 45 MHz to peripherals is disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(FircSclkPeriphEn::Disabled)
    }
    #[doc = "FIRC 45 MHz to peripherals is enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(FircSclkPeriphEn::Enabled)
    }
}
#[doc = "FRO_HF Clock to peripherals Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FircFclkPeriphEn {
    #[doc = "0: FRO_HF to peripherals is disabled"]
    Disabled = 0,
    #[doc = "1: FRO_HF to peripherals is enabled"]
    Enabled = 1,
}
impl From<FircFclkPeriphEn> for bool {
    #[inline(always)]
    fn from(variant: FircFclkPeriphEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRC_FCLK_PERIPH_EN` reader - FRO_HF Clock to peripherals Enable"]
pub type FircFclkPeriphEnR = crate::BitReader<FircFclkPeriphEn>;
impl FircFclkPeriphEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> FircFclkPeriphEn {
        match self.bits {
            false => FircFclkPeriphEn::Disabled,
            true => FircFclkPeriphEn::Enabled,
        }
    }
    #[doc = "FRO_HF to peripherals is disabled"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == FircFclkPeriphEn::Disabled
    }
    #[doc = "FRO_HF to peripherals is enabled"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == FircFclkPeriphEn::Enabled
    }
}
#[doc = "Field `FIRC_FCLK_PERIPH_EN` writer - FRO_HF Clock to peripherals Enable"]
pub type FircFclkPeriphEnW<'a, REG> = crate::BitWriter<'a, REG, FircFclkPeriphEn>;
impl<'a, REG> FircFclkPeriphEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FRO_HF to peripherals is disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(FircFclkPeriphEn::Disabled)
    }
    #[doc = "FRO_HF to peripherals is enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(FircFclkPeriphEn::Enabled)
    }
}
#[doc = "Lock Register\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lk {
    #[doc = "0: Control Status Register can be written"]
    WriteEnabled = 0,
    #[doc = "1: Control Status Register cannot be written"]
    WriteDisabled = 1,
}
impl From<Lk> for bool {
    #[inline(always)]
    fn from(variant: Lk) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LK` reader - Lock Register"]
pub type LkR = crate::BitReader<Lk>;
impl LkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lk {
        match self.bits {
            false => Lk::WriteEnabled,
            true => Lk::WriteDisabled,
        }
    }
    #[doc = "Control Status Register can be written"]
    #[inline(always)]
    pub fn is_write_enabled(&self) -> bool {
        *self == Lk::WriteEnabled
    }
    #[doc = "Control Status Register cannot be written"]
    #[inline(always)]
    pub fn is_write_disabled(&self) -> bool {
        *self == Lk::WriteDisabled
    }
}
#[doc = "Field `LK` writer - Lock Register"]
pub type LkW<'a, REG> = crate::BitWriter<'a, REG, Lk>;
impl<'a, REG> LkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Control Status Register can be written"]
    #[inline(always)]
    pub fn write_enabled(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::WriteEnabled)
    }
    #[doc = "Control Status Register cannot be written"]
    #[inline(always)]
    pub fn write_disabled(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::WriteDisabled)
    }
}
#[doc = "FIRC Valid status\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircvld {
    #[doc = "0: FIRC is not enabled or clock is not valid."]
    NotEnabledOrNotValid = 0,
    #[doc = "1: FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog."]
    EnabledAndValid = 1,
}
impl From<Fircvld> for bool {
    #[inline(always)]
    fn from(variant: Fircvld) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCVLD` reader - FIRC Valid status"]
pub type FircvldR = crate::BitReader<Fircvld>;
impl FircvldR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircvld {
        match self.bits {
            false => Fircvld::NotEnabledOrNotValid,
            true => Fircvld::EnabledAndValid,
        }
    }
    #[doc = "FIRC is not enabled or clock is not valid."]
    #[inline(always)]
    pub fn is_not_enabled_or_not_valid(&self) -> bool {
        *self == Fircvld::NotEnabledOrNotValid
    }
    #[doc = "FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog."]
    #[inline(always)]
    pub fn is_enabled_and_valid(&self) -> bool {
        *self == Fircvld::EnabledAndValid
    }
}
#[doc = "FIRC Selected\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircsel {
    #[doc = "0: FIRC is not the system clock source"]
    NotFirc = 0,
    #[doc = "1: FIRC is the system clock source"]
    Firc = 1,
}
impl From<Fircsel> for bool {
    #[inline(always)]
    fn from(variant: Fircsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCSEL` reader - FIRC Selected"]
pub type FircselR = crate::BitReader<Fircsel>;
impl FircselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircsel {
        match self.bits {
            false => Fircsel::NotFirc,
            true => Fircsel::Firc,
        }
    }
    #[doc = "FIRC is not the system clock source"]
    #[inline(always)]
    pub fn is_not_firc(&self) -> bool {
        *self == Fircsel::NotFirc
    }
    #[doc = "FIRC is the system clock source"]
    #[inline(always)]
    pub fn is_firc(&self) -> bool {
        *self == Fircsel::Firc
    }
}
#[doc = "FIRC Clock Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircerr {
    #[doc = "0: Error not detected with the FIRC trimming"]
    ErrorNotDetected = 0,
    #[doc = "1: Error detected with the FIRC trimming"]
    ErrorDetected = 1,
}
impl From<Fircerr> for bool {
    #[inline(always)]
    fn from(variant: Fircerr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCERR` reader - FIRC Clock Error"]
pub type FircerrR = crate::BitReader<Fircerr>;
impl FircerrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircerr {
        match self.bits {
            false => Fircerr::ErrorNotDetected,
            true => Fircerr::ErrorDetected,
        }
    }
    #[doc = "Error not detected with the FIRC trimming"]
    #[inline(always)]
    pub fn is_error_not_detected(&self) -> bool {
        *self == Fircerr::ErrorNotDetected
    }
    #[doc = "Error detected with the FIRC trimming"]
    #[inline(always)]
    pub fn is_error_detected(&self) -> bool {
        *self == Fircerr::ErrorDetected
    }
}
#[doc = "Field `FIRCERR` writer - FIRC Clock Error"]
pub type FircerrW<'a, REG> = crate::BitWriter1C<'a, REG, Fircerr>;
impl<'a, REG> FircerrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error not detected with the FIRC trimming"]
    #[inline(always)]
    pub fn error_not_detected(self) -> &'a mut crate::W<REG> {
        self.variant(Fircerr::ErrorNotDetected)
    }
    #[doc = "Error detected with the FIRC trimming"]
    #[inline(always)]
    pub fn error_detected(self) -> &'a mut crate::W<REG> {
        self.variant(Fircerr::ErrorDetected)
    }
}
#[doc = "FIRC Clock Error Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FircerrIe {
    #[doc = "0: FIRCERR interrupt is not enabled"]
    ErrorNotDetected = 0,
    #[doc = "1: FIRCERR interrupt is enabled"]
    ErrorDetected = 1,
}
impl From<FircerrIe> for bool {
    #[inline(always)]
    fn from(variant: FircerrIe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCERR_IE` reader - FIRC Clock Error Interrupt Enable"]
pub type FircerrIeR = crate::BitReader<FircerrIe>;
impl FircerrIeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> FircerrIe {
        match self.bits {
            false => FircerrIe::ErrorNotDetected,
            true => FircerrIe::ErrorDetected,
        }
    }
    #[doc = "FIRCERR interrupt is not enabled"]
    #[inline(always)]
    pub fn is_error_not_detected(&self) -> bool {
        *self == FircerrIe::ErrorNotDetected
    }
    #[doc = "FIRCERR interrupt is enabled"]
    #[inline(always)]
    pub fn is_error_detected(&self) -> bool {
        *self == FircerrIe::ErrorDetected
    }
}
#[doc = "Field `FIRCERR_IE` writer - FIRC Clock Error Interrupt Enable"]
pub type FircerrIeW<'a, REG> = crate::BitWriter<'a, REG, FircerrIe>;
impl<'a, REG> FircerrIeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIRCERR interrupt is not enabled"]
    #[inline(always)]
    pub fn error_not_detected(self) -> &'a mut crate::W<REG> {
        self.variant(FircerrIe::ErrorNotDetected)
    }
    #[doc = "FIRCERR interrupt is enabled"]
    #[inline(always)]
    pub fn error_detected(self) -> &'a mut crate::W<REG> {
        self.variant(FircerrIe::ErrorDetected)
    }
}
#[doc = "FIRC Accurate Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FircaccIe {
    #[doc = "0: FIRCACC interrupt is not enabled"]
    Fircaccnot = 0,
    #[doc = "1: FIRCACC interrupt is enabled"]
    Fircaccyes = 1,
}
impl From<FircaccIe> for bool {
    #[inline(always)]
    fn from(variant: FircaccIe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCACC_IE` reader - FIRC Accurate Interrupt Enable"]
pub type FircaccIeR = crate::BitReader<FircaccIe>;
impl FircaccIeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> FircaccIe {
        match self.bits {
            false => FircaccIe::Fircaccnot,
            true => FircaccIe::Fircaccyes,
        }
    }
    #[doc = "FIRCACC interrupt is not enabled"]
    #[inline(always)]
    pub fn is_fircaccnot(&self) -> bool {
        *self == FircaccIe::Fircaccnot
    }
    #[doc = "FIRCACC interrupt is enabled"]
    #[inline(always)]
    pub fn is_fircaccyes(&self) -> bool {
        *self == FircaccIe::Fircaccyes
    }
}
#[doc = "Field `FIRCACC_IE` writer - FIRC Accurate Interrupt Enable"]
pub type FircaccIeW<'a, REG> = crate::BitWriter<'a, REG, FircaccIe>;
impl<'a, REG> FircaccIeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIRCACC interrupt is not enabled"]
    #[inline(always)]
    pub fn fircaccnot(self) -> &'a mut crate::W<REG> {
        self.variant(FircaccIe::Fircaccnot)
    }
    #[doc = "FIRCACC interrupt is enabled"]
    #[inline(always)]
    pub fn fircaccyes(self) -> &'a mut crate::W<REG> {
        self.variant(FircaccIe::Fircaccyes)
    }
}
#[doc = "FIRC Frequency Accurate\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fircacc {
    #[doc = "0: FIRC is not enabled or clock is not accurate."]
    NotEnabledOrNotValid = 0,
    #[doc = "1: FIRC is enabled and output clock is accurate after some preparation time which is obtained by counting FRO_HF clock."]
    EnabledAndValid = 1,
}
impl From<Fircacc> for bool {
    #[inline(always)]
    fn from(variant: Fircacc) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIRCACC` reader - FIRC Frequency Accurate"]
pub type FircaccR = crate::BitReader<Fircacc>;
impl FircaccR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fircacc {
        match self.bits {
            false => Fircacc::NotEnabledOrNotValid,
            true => Fircacc::EnabledAndValid,
        }
    }
    #[doc = "FIRC is not enabled or clock is not accurate."]
    #[inline(always)]
    pub fn is_not_enabled_or_not_valid(&self) -> bool {
        *self == Fircacc::NotEnabledOrNotValid
    }
    #[doc = "FIRC is enabled and output clock is accurate after some preparation time which is obtained by counting FRO_HF clock."]
    #[inline(always)]
    pub fn is_enabled_and_valid(&self) -> bool {
        *self == Fircacc::EnabledAndValid
    }
}
impl R {
    #[doc = "Bit 0 - FIRC Enable"]
    #[inline(always)]
    pub fn fircen(&self) -> FircenR {
        FircenR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - FIRC Stop Enable"]
    #[inline(always)]
    pub fn fircsten(&self) -> FircstenR {
        FircstenR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 4 - FIRC 45 MHz Clock to peripherals Enable"]
    #[inline(always)]
    pub fn firc_sclk_periph_en(&self) -> FircSclkPeriphEnR {
        FircSclkPeriphEnR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - FRO_HF Clock to peripherals Enable"]
    #[inline(always)]
    pub fn firc_fclk_periph_en(&self) -> FircFclkPeriphEnR {
        FircFclkPeriphEnR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 23 - Lock Register"]
    #[inline(always)]
    pub fn lk(&self) -> LkR {
        LkR::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - FIRC Valid status"]
    #[inline(always)]
    pub fn fircvld(&self) -> FircvldR {
        FircvldR::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - FIRC Selected"]
    #[inline(always)]
    pub fn fircsel(&self) -> FircselR {
        FircselR::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - FIRC Clock Error"]
    #[inline(always)]
    pub fn fircerr(&self) -> FircerrR {
        FircerrR::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 27 - FIRC Clock Error Interrupt Enable"]
    #[inline(always)]
    pub fn fircerr_ie(&self) -> FircerrIeR {
        FircerrIeR::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 30 - FIRC Accurate Interrupt Enable"]
    #[inline(always)]
    pub fn fircacc_ie(&self) -> FircaccIeR {
        FircaccIeR::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - FIRC Frequency Accurate"]
    #[inline(always)]
    pub fn fircacc(&self) -> FircaccR {
        FircaccR::new(((self.bits >> 31) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("FIRCCSR")
            .field("fircen", &self.fircen())
            .field("fircsten", &self.fircsten())
            .field("firc_sclk_periph_en", &self.firc_sclk_periph_en())
            .field("firc_fclk_periph_en", &self.firc_fclk_periph_en())
            .field("lk", &self.lk())
            .field("fircvld", &self.fircvld())
            .field("fircsel", &self.fircsel())
            .field("fircerr", &self.fircerr())
            .field("fircerr_ie", &self.fircerr_ie())
            .field("fircacc_ie", &self.fircacc_ie())
            .field("fircacc", &self.fircacc())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - FIRC Enable"]
    #[inline(always)]
    pub fn fircen(&mut self) -> FircenW<'_, FirccsrSpec> {
        FircenW::new(self, 0)
    }
    #[doc = "Bit 1 - FIRC Stop Enable"]
    #[inline(always)]
    pub fn fircsten(&mut self) -> FircstenW<'_, FirccsrSpec> {
        FircstenW::new(self, 1)
    }
    #[doc = "Bit 4 - FIRC 45 MHz Clock to peripherals Enable"]
    #[inline(always)]
    pub fn firc_sclk_periph_en(&mut self) -> FircSclkPeriphEnW<'_, FirccsrSpec> {
        FircSclkPeriphEnW::new(self, 4)
    }
    #[doc = "Bit 5 - FRO_HF Clock to peripherals Enable"]
    #[inline(always)]
    pub fn firc_fclk_periph_en(&mut self) -> FircFclkPeriphEnW<'_, FirccsrSpec> {
        FircFclkPeriphEnW::new(self, 5)
    }
    #[doc = "Bit 23 - Lock Register"]
    #[inline(always)]
    pub fn lk(&mut self) -> LkW<'_, FirccsrSpec> {
        LkW::new(self, 23)
    }
    #[doc = "Bit 26 - FIRC Clock Error"]
    #[inline(always)]
    pub fn fircerr(&mut self) -> FircerrW<'_, FirccsrSpec> {
        FircerrW::new(self, 26)
    }
    #[doc = "Bit 27 - FIRC Clock Error Interrupt Enable"]
    #[inline(always)]
    pub fn fircerr_ie(&mut self) -> FircerrIeW<'_, FirccsrSpec> {
        FircerrIeW::new(self, 27)
    }
    #[doc = "Bit 30 - FIRC Accurate Interrupt Enable"]
    #[inline(always)]
    pub fn fircacc_ie(&mut self) -> FircaccIeW<'_, FirccsrSpec> {
        FircaccIeW::new(self, 30)
    }
}
#[doc = "FIRC Control Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`firccsr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`firccsr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct FirccsrSpec;
impl crate::RegisterSpec for FirccsrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`firccsr::R`](R) reader structure"]
impl crate::Readable for FirccsrSpec {}
#[doc = "`write(|w| ..)` method takes [`firccsr::W`](W) writer structure"]
impl crate::Writable for FirccsrSpec {
    type Safety = crate::Unsafe;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0400_0000;
}
#[doc = "`reset()` method sets FIRCCSR to value 0x0300_0031"]
impl crate::Resettable for FirccsrSpec {
    const RESET_VALUE: u32 = 0x0300_0031;
}