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
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
#[doc = "Register `MBC0_MEMN_GLBAC2` reader"]
pub type R = crate::R<Mbc0MemnGlbac2Spec>;
#[doc = "Register `MBC0_MEMN_GLBAC2` writer"]
pub type W = crate::W<Mbc0MemnGlbac2Spec>;
#[doc = "NonsecureUser Execute\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nux {
    #[doc = "0: Execute access is not allowed in Nonsecure User mode."]
    Notallowed = 0,
    #[doc = "1: Execute access is allowed in Nonsecure User mode."]
    Allowed = 1,
}
impl From<Nux> for bool {
    #[inline(always)]
    fn from(variant: Nux) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NUX` reader - NonsecureUser Execute"]
pub type NuxR = crate::BitReader<Nux>;
impl NuxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nux {
        match self.bits {
            false => Nux::Notallowed,
            true => Nux::Allowed,
        }
    }
    #[doc = "Execute access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Nux::Notallowed
    }
    #[doc = "Execute access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Nux::Allowed
    }
}
#[doc = "Field `NUX` writer - NonsecureUser Execute"]
pub type NuxW<'a, REG> = crate::BitWriter<'a, REG, Nux>;
impl<'a, REG> NuxW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Execute access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nux::Notallowed)
    }
    #[doc = "Execute access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nux::Allowed)
    }
}
#[doc = "NonsecureUser Write\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nuw {
    #[doc = "0: Write access is not allowed in Nonsecure User mode."]
    Notallowed = 0,
    #[doc = "1: Write access is allowed in Nonsecure User mode."]
    Allowed = 1,
}
impl From<Nuw> for bool {
    #[inline(always)]
    fn from(variant: Nuw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NUW` reader - NonsecureUser Write"]
pub type NuwR = crate::BitReader<Nuw>;
impl NuwR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nuw {
        match self.bits {
            false => Nuw::Notallowed,
            true => Nuw::Allowed,
        }
    }
    #[doc = "Write access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Nuw::Notallowed
    }
    #[doc = "Write access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Nuw::Allowed
    }
}
#[doc = "Field `NUW` writer - NonsecureUser Write"]
pub type NuwW<'a, REG> = crate::BitWriter<'a, REG, Nuw>;
impl<'a, REG> NuwW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Write access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nuw::Notallowed)
    }
    #[doc = "Write access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nuw::Allowed)
    }
}
#[doc = "NonsecureUser Read\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nur {
    #[doc = "0: Read access is not allowed in Nonsecure User mode."]
    Notallowed = 0,
    #[doc = "1: Read access is allowed in Nonsecure User mode."]
    Allowed = 1,
}
impl From<Nur> for bool {
    #[inline(always)]
    fn from(variant: Nur) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NUR` reader - NonsecureUser Read"]
pub type NurR = crate::BitReader<Nur>;
impl NurR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nur {
        match self.bits {
            false => Nur::Notallowed,
            true => Nur::Allowed,
        }
    }
    #[doc = "Read access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Nur::Notallowed
    }
    #[doc = "Read access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Nur::Allowed
    }
}
#[doc = "Field `NUR` writer - NonsecureUser Read"]
pub type NurW<'a, REG> = crate::BitWriter<'a, REG, Nur>;
impl<'a, REG> NurW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Read access is not allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nur::Notallowed)
    }
    #[doc = "Read access is allowed in Nonsecure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Nur::Allowed)
    }
}
#[doc = "NonsecurePriv Execute\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Npx {
    #[doc = "0: Execute access is not allowed in Nonsecure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Execute access is allowed in Nonsecure Privilege mode."]
    Allowed = 1,
}
impl From<Npx> for bool {
    #[inline(always)]
    fn from(variant: Npx) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NPX` reader - NonsecurePriv Execute"]
pub type NpxR = crate::BitReader<Npx>;
impl NpxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Npx {
        match self.bits {
            false => Npx::Notallowed,
            true => Npx::Allowed,
        }
    }
    #[doc = "Execute access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Npx::Notallowed
    }
    #[doc = "Execute access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Npx::Allowed
    }
}
#[doc = "Field `NPX` writer - NonsecurePriv Execute"]
pub type NpxW<'a, REG> = crate::BitWriter<'a, REG, Npx>;
impl<'a, REG> NpxW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Execute access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npx::Notallowed)
    }
    #[doc = "Execute access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npx::Allowed)
    }
}
#[doc = "NonsecurePriv Write\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Npw {
    #[doc = "0: Write access is not allowed in Nonsecure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Write access is allowed in Nonsecure Privilege mode."]
    Allowed = 1,
}
impl From<Npw> for bool {
    #[inline(always)]
    fn from(variant: Npw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NPW` reader - NonsecurePriv Write"]
pub type NpwR = crate::BitReader<Npw>;
impl NpwR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Npw {
        match self.bits {
            false => Npw::Notallowed,
            true => Npw::Allowed,
        }
    }
    #[doc = "Write access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Npw::Notallowed
    }
    #[doc = "Write access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Npw::Allowed
    }
}
#[doc = "Field `NPW` writer - NonsecurePriv Write"]
pub type NpwW<'a, REG> = crate::BitWriter<'a, REG, Npw>;
impl<'a, REG> NpwW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Write access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npw::Notallowed)
    }
    #[doc = "Write access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npw::Allowed)
    }
}
#[doc = "NonsecurePriv Read\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Npr {
    #[doc = "0: Read access is not allowed in Nonsecure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Read access is allowed in Nonsecure Privilege mode."]
    Allowed = 1,
}
impl From<Npr> for bool {
    #[inline(always)]
    fn from(variant: Npr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NPR` reader - NonsecurePriv Read"]
pub type NprR = crate::BitReader<Npr>;
impl NprR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Npr {
        match self.bits {
            false => Npr::Notallowed,
            true => Npr::Allowed,
        }
    }
    #[doc = "Read access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Npr::Notallowed
    }
    #[doc = "Read access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Npr::Allowed
    }
}
#[doc = "Field `NPR` writer - NonsecurePriv Read"]
pub type NprW<'a, REG> = crate::BitWriter<'a, REG, Npr>;
impl<'a, REG> NprW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Read access is not allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npr::Notallowed)
    }
    #[doc = "Read access is allowed in Nonsecure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Npr::Allowed)
    }
}
#[doc = "SecureUser Execute\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sux {
    #[doc = "0: Execute access is not allowed in Secure User mode."]
    Notallowed = 0,
    #[doc = "1: Execute access is allowed in Secure User mode."]
    Allowed = 1,
}
impl From<Sux> for bool {
    #[inline(always)]
    fn from(variant: Sux) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SUX` reader - SecureUser Execute"]
pub type SuxR = crate::BitReader<Sux>;
impl SuxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sux {
        match self.bits {
            false => Sux::Notallowed,
            true => Sux::Allowed,
        }
    }
    #[doc = "Execute access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Sux::Notallowed
    }
    #[doc = "Execute access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Sux::Allowed
    }
}
#[doc = "Field `SUX` writer - SecureUser Execute"]
pub type SuxW<'a, REG> = crate::BitWriter<'a, REG, Sux>;
impl<'a, REG> SuxW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Execute access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Sux::Notallowed)
    }
    #[doc = "Execute access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Sux::Allowed)
    }
}
#[doc = "SecureUser Write\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Suw {
    #[doc = "0: Write access is not allowed in Secure User mode."]
    Notallowed = 0,
    #[doc = "1: Write access is allowed in Secure User mode."]
    Allowed = 1,
}
impl From<Suw> for bool {
    #[inline(always)]
    fn from(variant: Suw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SUW` reader - SecureUser Write"]
pub type SuwR = crate::BitReader<Suw>;
impl SuwR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Suw {
        match self.bits {
            false => Suw::Notallowed,
            true => Suw::Allowed,
        }
    }
    #[doc = "Write access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Suw::Notallowed
    }
    #[doc = "Write access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Suw::Allowed
    }
}
#[doc = "Field `SUW` writer - SecureUser Write"]
pub type SuwW<'a, REG> = crate::BitWriter<'a, REG, Suw>;
impl<'a, REG> SuwW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Write access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Suw::Notallowed)
    }
    #[doc = "Write access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Suw::Allowed)
    }
}
#[doc = "SecureUser Read\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sur {
    #[doc = "0: Read access is not allowed in Secure User mode."]
    Notallowed = 0,
    #[doc = "1: Read access is allowed in Secure User mode."]
    Allowed = 1,
}
impl From<Sur> for bool {
    #[inline(always)]
    fn from(variant: Sur) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SUR` reader - SecureUser Read"]
pub type SurR = crate::BitReader<Sur>;
impl SurR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sur {
        match self.bits {
            false => Sur::Notallowed,
            true => Sur::Allowed,
        }
    }
    #[doc = "Read access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Sur::Notallowed
    }
    #[doc = "Read access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Sur::Allowed
    }
}
#[doc = "Field `SUR` writer - SecureUser Read"]
pub type SurW<'a, REG> = crate::BitWriter<'a, REG, Sur>;
impl<'a, REG> SurW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Read access is not allowed in Secure User mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Sur::Notallowed)
    }
    #[doc = "Read access is allowed in Secure User mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Sur::Allowed)
    }
}
#[doc = "SecurePriv Execute\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Spx {
    #[doc = "0: Execute access is not allowed in Secure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Execute access is allowed in Secure Privilege mode."]
    Allowed = 1,
}
impl From<Spx> for bool {
    #[inline(always)]
    fn from(variant: Spx) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SPX` reader - SecurePriv Execute"]
pub type SpxR = crate::BitReader<Spx>;
impl SpxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Spx {
        match self.bits {
            false => Spx::Notallowed,
            true => Spx::Allowed,
        }
    }
    #[doc = "Execute access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Spx::Notallowed
    }
    #[doc = "Execute access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Spx::Allowed
    }
}
#[doc = "Field `SPX` writer - SecurePriv Execute"]
pub type SpxW<'a, REG> = crate::BitWriter<'a, REG, Spx>;
impl<'a, REG> SpxW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Execute access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spx::Notallowed)
    }
    #[doc = "Execute access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spx::Allowed)
    }
}
#[doc = "SecurePriv Write\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Spw {
    #[doc = "0: Write access is not allowed in Secure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Write access is allowed in Secure Privilege mode."]
    Allowed = 1,
}
impl From<Spw> for bool {
    #[inline(always)]
    fn from(variant: Spw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SPW` reader - SecurePriv Write"]
pub type SpwR = crate::BitReader<Spw>;
impl SpwR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Spw {
        match self.bits {
            false => Spw::Notallowed,
            true => Spw::Allowed,
        }
    }
    #[doc = "Write access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Spw::Notallowed
    }
    #[doc = "Write access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Spw::Allowed
    }
}
#[doc = "Field `SPW` writer - SecurePriv Write"]
pub type SpwW<'a, REG> = crate::BitWriter<'a, REG, Spw>;
impl<'a, REG> SpwW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Write access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spw::Notallowed)
    }
    #[doc = "Write access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spw::Allowed)
    }
}
#[doc = "SecurePriv Read\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Spr {
    #[doc = "0: Read access is not allowed in Secure Privilege mode."]
    Notallowed = 0,
    #[doc = "1: Read access is allowed in Secure Privilege mode."]
    Allowed = 1,
}
impl From<Spr> for bool {
    #[inline(always)]
    fn from(variant: Spr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SPR` reader - SecurePriv Read"]
pub type SprR = crate::BitReader<Spr>;
impl SprR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Spr {
        match self.bits {
            false => Spr::Notallowed,
            true => Spr::Allowed,
        }
    }
    #[doc = "Read access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_notallowed(&self) -> bool {
        *self == Spr::Notallowed
    }
    #[doc = "Read access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn is_allowed(&self) -> bool {
        *self == Spr::Allowed
    }
}
#[doc = "Field `SPR` writer - SecurePriv Read"]
pub type SprW<'a, REG> = crate::BitWriter<'a, REG, Spr>;
impl<'a, REG> SprW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Read access is not allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn notallowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spr::Notallowed)
    }
    #[doc = "Read access is allowed in Secure Privilege mode."]
    #[inline(always)]
    pub fn allowed(self) -> &'a mut crate::W<REG> {
        self.variant(Spr::Allowed)
    }
}
#[doc = "LOCK\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lk {
    #[doc = "0: This register is not locked and can be altered."]
    Unlocked = 0,
    #[doc = "1: This register is locked and cannot be altered."]
    Locked = 1,
}
impl From<Lk> for bool {
    #[inline(always)]
    fn from(variant: Lk) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LK` reader - LOCK"]
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::Unlocked,
            true => Lk::Locked,
        }
    }
    #[doc = "This register is not locked and can be altered."]
    #[inline(always)]
    pub fn is_unlocked(&self) -> bool {
        *self == Lk::Unlocked
    }
    #[doc = "This register is locked and cannot be altered."]
    #[inline(always)]
    pub fn is_locked(&self) -> bool {
        *self == Lk::Locked
    }
}
#[doc = "Field `LK` writer - LOCK"]
pub type LkW<'a, REG> = crate::BitWriter<'a, REG, Lk>;
impl<'a, REG> LkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "This register is not locked and can be altered."]
    #[inline(always)]
    pub fn unlocked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::Unlocked)
    }
    #[doc = "This register is locked and cannot be altered."]
    #[inline(always)]
    pub fn locked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::Locked)
    }
}
impl R {
    #[doc = "Bit 0 - NonsecureUser Execute"]
    #[inline(always)]
    pub fn nux(&self) -> NuxR {
        NuxR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - NonsecureUser Write"]
    #[inline(always)]
    pub fn nuw(&self) -> NuwR {
        NuwR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - NonsecureUser Read"]
    #[inline(always)]
    pub fn nur(&self) -> NurR {
        NurR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 4 - NonsecurePriv Execute"]
    #[inline(always)]
    pub fn npx(&self) -> NpxR {
        NpxR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - NonsecurePriv Write"]
    #[inline(always)]
    pub fn npw(&self) -> NpwR {
        NpwR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - NonsecurePriv Read"]
    #[inline(always)]
    pub fn npr(&self) -> NprR {
        NprR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 8 - SecureUser Execute"]
    #[inline(always)]
    pub fn sux(&self) -> SuxR {
        SuxR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - SecureUser Write"]
    #[inline(always)]
    pub fn suw(&self) -> SuwR {
        SuwR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - SecureUser Read"]
    #[inline(always)]
    pub fn sur(&self) -> SurR {
        SurR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 12 - SecurePriv Execute"]
    #[inline(always)]
    pub fn spx(&self) -> SpxR {
        SpxR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - SecurePriv Write"]
    #[inline(always)]
    pub fn spw(&self) -> SpwR {
        SpwR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - SecurePriv Read"]
    #[inline(always)]
    pub fn spr(&self) -> SprR {
        SprR::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 31 - LOCK"]
    #[inline(always)]
    pub fn lk(&self) -> LkR {
        LkR::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("MBC0_MEMN_GLBAC2")
            .field("nux", &self.nux())
            .field("nuw", &self.nuw())
            .field("nur", &self.nur())
            .field("npx", &self.npx())
            .field("npw", &self.npw())
            .field("npr", &self.npr())
            .field("sux", &self.sux())
            .field("suw", &self.suw())
            .field("sur", &self.sur())
            .field("spx", &self.spx())
            .field("spw", &self.spw())
            .field("spr", &self.spr())
            .field("lk", &self.lk())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - NonsecureUser Execute"]
    #[inline(always)]
    pub fn nux(&mut self) -> NuxW<'_, Mbc0MemnGlbac2Spec> {
        NuxW::new(self, 0)
    }
    #[doc = "Bit 1 - NonsecureUser Write"]
    #[inline(always)]
    pub fn nuw(&mut self) -> NuwW<'_, Mbc0MemnGlbac2Spec> {
        NuwW::new(self, 1)
    }
    #[doc = "Bit 2 - NonsecureUser Read"]
    #[inline(always)]
    pub fn nur(&mut self) -> NurW<'_, Mbc0MemnGlbac2Spec> {
        NurW::new(self, 2)
    }
    #[doc = "Bit 4 - NonsecurePriv Execute"]
    #[inline(always)]
    pub fn npx(&mut self) -> NpxW<'_, Mbc0MemnGlbac2Spec> {
        NpxW::new(self, 4)
    }
    #[doc = "Bit 5 - NonsecurePriv Write"]
    #[inline(always)]
    pub fn npw(&mut self) -> NpwW<'_, Mbc0MemnGlbac2Spec> {
        NpwW::new(self, 5)
    }
    #[doc = "Bit 6 - NonsecurePriv Read"]
    #[inline(always)]
    pub fn npr(&mut self) -> NprW<'_, Mbc0MemnGlbac2Spec> {
        NprW::new(self, 6)
    }
    #[doc = "Bit 8 - SecureUser Execute"]
    #[inline(always)]
    pub fn sux(&mut self) -> SuxW<'_, Mbc0MemnGlbac2Spec> {
        SuxW::new(self, 8)
    }
    #[doc = "Bit 9 - SecureUser Write"]
    #[inline(always)]
    pub fn suw(&mut self) -> SuwW<'_, Mbc0MemnGlbac2Spec> {
        SuwW::new(self, 9)
    }
    #[doc = "Bit 10 - SecureUser Read"]
    #[inline(always)]
    pub fn sur(&mut self) -> SurW<'_, Mbc0MemnGlbac2Spec> {
        SurW::new(self, 10)
    }
    #[doc = "Bit 12 - SecurePriv Execute"]
    #[inline(always)]
    pub fn spx(&mut self) -> SpxW<'_, Mbc0MemnGlbac2Spec> {
        SpxW::new(self, 12)
    }
    #[doc = "Bit 13 - SecurePriv Write"]
    #[inline(always)]
    pub fn spw(&mut self) -> SpwW<'_, Mbc0MemnGlbac2Spec> {
        SpwW::new(self, 13)
    }
    #[doc = "Bit 14 - SecurePriv Read"]
    #[inline(always)]
    pub fn spr(&mut self) -> SprW<'_, Mbc0MemnGlbac2Spec> {
        SprW::new(self, 14)
    }
    #[doc = "Bit 31 - LOCK"]
    #[inline(always)]
    pub fn lk(&mut self) -> LkW<'_, Mbc0MemnGlbac2Spec> {
        LkW::new(self, 31)
    }
}
#[doc = "MBC Global Access Control\n\nYou can [`read`](crate::Reg::read) this register and get [`mbc0_memn_glbac2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mbc0_memn_glbac2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Mbc0MemnGlbac2Spec;
impl crate::RegisterSpec for Mbc0MemnGlbac2Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`mbc0_memn_glbac2::R`](R) reader structure"]
impl crate::Readable for Mbc0MemnGlbac2Spec {}
#[doc = "`write(|w| ..)` method takes [`mbc0_memn_glbac2::W`](W) writer structure"]
impl crate::Writable for Mbc0MemnGlbac2Spec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets MBC0_MEMN_GLBAC2 to value 0x8000_5500"]
impl crate::Resettable for Mbc0MemnGlbac2Spec {
    const RESET_VALUE: u32 = 0x8000_5500;
}