Skip to main content

mcxa_pac/mbc0/
mbc0_memn_glbac3.rs

1#[doc = "Register `MBC0_MEMN_GLBAC3` reader"]
2pub type R = crate::R<Mbc0MemnGlbac3Spec>;
3#[doc = "Register `MBC0_MEMN_GLBAC3` writer"]
4pub type W = crate::W<Mbc0MemnGlbac3Spec>;
5#[doc = "NonsecureUser Execute\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Nux {
9    #[doc = "0: Execute access is not allowed in Nonsecure User mode."]
10    Notallowed = 0,
11    #[doc = "1: Execute access is allowed in Nonsecure User mode."]
12    Allowed = 1,
13}
14impl From<Nux> for bool {
15    #[inline(always)]
16    fn from(variant: Nux) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `NUX` reader - NonsecureUser Execute"]
21pub type NuxR = crate::BitReader<Nux>;
22impl NuxR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Nux {
26        match self.bits {
27            false => Nux::Notallowed,
28            true => Nux::Allowed,
29        }
30    }
31    #[doc = "Execute access is not allowed in Nonsecure User mode."]
32    #[inline(always)]
33    pub fn is_notallowed(&self) -> bool {
34        *self == Nux::Notallowed
35    }
36    #[doc = "Execute access is allowed in Nonsecure User mode."]
37    #[inline(always)]
38    pub fn is_allowed(&self) -> bool {
39        *self == Nux::Allowed
40    }
41}
42#[doc = "Field `NUX` writer - NonsecureUser Execute"]
43pub type NuxW<'a, REG> = crate::BitWriter<'a, REG, Nux>;
44impl<'a, REG> NuxW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Execute access is not allowed in Nonsecure User mode."]
49    #[inline(always)]
50    pub fn notallowed(self) -> &'a mut crate::W<REG> {
51        self.variant(Nux::Notallowed)
52    }
53    #[doc = "Execute access is allowed in Nonsecure User mode."]
54    #[inline(always)]
55    pub fn allowed(self) -> &'a mut crate::W<REG> {
56        self.variant(Nux::Allowed)
57    }
58}
59#[doc = "NonsecureUser Write\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Nuw {
63    #[doc = "0: Write access is not allowed in Nonsecure User mode."]
64    Notallowed = 0,
65    #[doc = "1: Write access is allowed in Nonsecure User mode."]
66    Allowed = 1,
67}
68impl From<Nuw> for bool {
69    #[inline(always)]
70    fn from(variant: Nuw) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `NUW` reader - NonsecureUser Write"]
75pub type NuwR = crate::BitReader<Nuw>;
76impl NuwR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Nuw {
80        match self.bits {
81            false => Nuw::Notallowed,
82            true => Nuw::Allowed,
83        }
84    }
85    #[doc = "Write access is not allowed in Nonsecure User mode."]
86    #[inline(always)]
87    pub fn is_notallowed(&self) -> bool {
88        *self == Nuw::Notallowed
89    }
90    #[doc = "Write access is allowed in Nonsecure User mode."]
91    #[inline(always)]
92    pub fn is_allowed(&self) -> bool {
93        *self == Nuw::Allowed
94    }
95}
96#[doc = "Field `NUW` writer - NonsecureUser Write"]
97pub type NuwW<'a, REG> = crate::BitWriter<'a, REG, Nuw>;
98impl<'a, REG> NuwW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Write access is not allowed in Nonsecure User mode."]
103    #[inline(always)]
104    pub fn notallowed(self) -> &'a mut crate::W<REG> {
105        self.variant(Nuw::Notallowed)
106    }
107    #[doc = "Write access is allowed in Nonsecure User mode."]
108    #[inline(always)]
109    pub fn allowed(self) -> &'a mut crate::W<REG> {
110        self.variant(Nuw::Allowed)
111    }
112}
113#[doc = "NonsecureUser Read\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Nur {
117    #[doc = "0: Read access is not allowed in Nonsecure User mode."]
118    Notallowed = 0,
119    #[doc = "1: Read access is allowed in Nonsecure User mode."]
120    Allowed = 1,
121}
122impl From<Nur> for bool {
123    #[inline(always)]
124    fn from(variant: Nur) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `NUR` reader - NonsecureUser Read"]
129pub type NurR = crate::BitReader<Nur>;
130impl NurR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Nur {
134        match self.bits {
135            false => Nur::Notallowed,
136            true => Nur::Allowed,
137        }
138    }
139    #[doc = "Read access is not allowed in Nonsecure User mode."]
140    #[inline(always)]
141    pub fn is_notallowed(&self) -> bool {
142        *self == Nur::Notallowed
143    }
144    #[doc = "Read access is allowed in Nonsecure User mode."]
145    #[inline(always)]
146    pub fn is_allowed(&self) -> bool {
147        *self == Nur::Allowed
148    }
149}
150#[doc = "Field `NUR` writer - NonsecureUser Read"]
151pub type NurW<'a, REG> = crate::BitWriter<'a, REG, Nur>;
152impl<'a, REG> NurW<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "Read access is not allowed in Nonsecure User mode."]
157    #[inline(always)]
158    pub fn notallowed(self) -> &'a mut crate::W<REG> {
159        self.variant(Nur::Notallowed)
160    }
161    #[doc = "Read access is allowed in Nonsecure User mode."]
162    #[inline(always)]
163    pub fn allowed(self) -> &'a mut crate::W<REG> {
164        self.variant(Nur::Allowed)
165    }
166}
167#[doc = "NonsecurePriv Execute\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Npx {
171    #[doc = "0: Execute access is not allowed in Nonsecure Privilege mode."]
172    Notallowed = 0,
173    #[doc = "1: Execute access is allowed in Nonsecure Privilege mode."]
174    Allowed = 1,
175}
176impl From<Npx> for bool {
177    #[inline(always)]
178    fn from(variant: Npx) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `NPX` reader - NonsecurePriv Execute"]
183pub type NpxR = crate::BitReader<Npx>;
184impl NpxR {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Npx {
188        match self.bits {
189            false => Npx::Notallowed,
190            true => Npx::Allowed,
191        }
192    }
193    #[doc = "Execute access is not allowed in Nonsecure Privilege mode."]
194    #[inline(always)]
195    pub fn is_notallowed(&self) -> bool {
196        *self == Npx::Notallowed
197    }
198    #[doc = "Execute access is allowed in Nonsecure Privilege mode."]
199    #[inline(always)]
200    pub fn is_allowed(&self) -> bool {
201        *self == Npx::Allowed
202    }
203}
204#[doc = "Field `NPX` writer - NonsecurePriv Execute"]
205pub type NpxW<'a, REG> = crate::BitWriter<'a, REG, Npx>;
206impl<'a, REG> NpxW<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "Execute access is not allowed in Nonsecure Privilege mode."]
211    #[inline(always)]
212    pub fn notallowed(self) -> &'a mut crate::W<REG> {
213        self.variant(Npx::Notallowed)
214    }
215    #[doc = "Execute access is allowed in Nonsecure Privilege mode."]
216    #[inline(always)]
217    pub fn allowed(self) -> &'a mut crate::W<REG> {
218        self.variant(Npx::Allowed)
219    }
220}
221#[doc = "NonsecurePriv Write\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Npw {
225    #[doc = "0: Write access is not allowed in Nonsecure Privilege mode."]
226    Notallowed = 0,
227    #[doc = "1: Write access is allowed in Nonsecure Privilege mode."]
228    Allowed = 1,
229}
230impl From<Npw> for bool {
231    #[inline(always)]
232    fn from(variant: Npw) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `NPW` reader - NonsecurePriv Write"]
237pub type NpwR = crate::BitReader<Npw>;
238impl NpwR {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> Npw {
242        match self.bits {
243            false => Npw::Notallowed,
244            true => Npw::Allowed,
245        }
246    }
247    #[doc = "Write access is not allowed in Nonsecure Privilege mode."]
248    #[inline(always)]
249    pub fn is_notallowed(&self) -> bool {
250        *self == Npw::Notallowed
251    }
252    #[doc = "Write access is allowed in Nonsecure Privilege mode."]
253    #[inline(always)]
254    pub fn is_allowed(&self) -> bool {
255        *self == Npw::Allowed
256    }
257}
258#[doc = "Field `NPW` writer - NonsecurePriv Write"]
259pub type NpwW<'a, REG> = crate::BitWriter<'a, REG, Npw>;
260impl<'a, REG> NpwW<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "Write access is not allowed in Nonsecure Privilege mode."]
265    #[inline(always)]
266    pub fn notallowed(self) -> &'a mut crate::W<REG> {
267        self.variant(Npw::Notallowed)
268    }
269    #[doc = "Write access is allowed in Nonsecure Privilege mode."]
270    #[inline(always)]
271    pub fn allowed(self) -> &'a mut crate::W<REG> {
272        self.variant(Npw::Allowed)
273    }
274}
275#[doc = "NonsecurePriv Read\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Npr {
279    #[doc = "0: Read access is not allowed in Nonsecure Privilege mode."]
280    Notallowed = 0,
281    #[doc = "1: Read access is allowed in Nonsecure Privilege mode."]
282    Allowed = 1,
283}
284impl From<Npr> for bool {
285    #[inline(always)]
286    fn from(variant: Npr) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `NPR` reader - NonsecurePriv Read"]
291pub type NprR = crate::BitReader<Npr>;
292impl NprR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Npr {
296        match self.bits {
297            false => Npr::Notallowed,
298            true => Npr::Allowed,
299        }
300    }
301    #[doc = "Read access is not allowed in Nonsecure Privilege mode."]
302    #[inline(always)]
303    pub fn is_notallowed(&self) -> bool {
304        *self == Npr::Notallowed
305    }
306    #[doc = "Read access is allowed in Nonsecure Privilege mode."]
307    #[inline(always)]
308    pub fn is_allowed(&self) -> bool {
309        *self == Npr::Allowed
310    }
311}
312#[doc = "Field `NPR` writer - NonsecurePriv Read"]
313pub type NprW<'a, REG> = crate::BitWriter<'a, REG, Npr>;
314impl<'a, REG> NprW<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "Read access is not allowed in Nonsecure Privilege mode."]
319    #[inline(always)]
320    pub fn notallowed(self) -> &'a mut crate::W<REG> {
321        self.variant(Npr::Notallowed)
322    }
323    #[doc = "Read access is allowed in Nonsecure Privilege mode."]
324    #[inline(always)]
325    pub fn allowed(self) -> &'a mut crate::W<REG> {
326        self.variant(Npr::Allowed)
327    }
328}
329#[doc = "SecureUser Execute\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Sux {
333    #[doc = "0: Execute access is not allowed in Secure User mode."]
334    Notallowed = 0,
335    #[doc = "1: Execute access is allowed in Secure User mode."]
336    Allowed = 1,
337}
338impl From<Sux> for bool {
339    #[inline(always)]
340    fn from(variant: Sux) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `SUX` reader - SecureUser Execute"]
345pub type SuxR = crate::BitReader<Sux>;
346impl SuxR {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub const fn variant(&self) -> Sux {
350        match self.bits {
351            false => Sux::Notallowed,
352            true => Sux::Allowed,
353        }
354    }
355    #[doc = "Execute access is not allowed in Secure User mode."]
356    #[inline(always)]
357    pub fn is_notallowed(&self) -> bool {
358        *self == Sux::Notallowed
359    }
360    #[doc = "Execute access is allowed in Secure User mode."]
361    #[inline(always)]
362    pub fn is_allowed(&self) -> bool {
363        *self == Sux::Allowed
364    }
365}
366#[doc = "Field `SUX` writer - SecureUser Execute"]
367pub type SuxW<'a, REG> = crate::BitWriter<'a, REG, Sux>;
368impl<'a, REG> SuxW<'a, REG>
369where
370    REG: crate::Writable + crate::RegisterSpec,
371{
372    #[doc = "Execute access is not allowed in Secure User mode."]
373    #[inline(always)]
374    pub fn notallowed(self) -> &'a mut crate::W<REG> {
375        self.variant(Sux::Notallowed)
376    }
377    #[doc = "Execute access is allowed in Secure User mode."]
378    #[inline(always)]
379    pub fn allowed(self) -> &'a mut crate::W<REG> {
380        self.variant(Sux::Allowed)
381    }
382}
383#[doc = "SecureUser Write\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Suw {
387    #[doc = "0: Write access is not allowed in Secure User mode."]
388    Notallowed = 0,
389    #[doc = "1: Write access is allowed in Secure User mode."]
390    Allowed = 1,
391}
392impl From<Suw> for bool {
393    #[inline(always)]
394    fn from(variant: Suw) -> Self {
395        variant as u8 != 0
396    }
397}
398#[doc = "Field `SUW` reader - SecureUser Write"]
399pub type SuwR = crate::BitReader<Suw>;
400impl SuwR {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub const fn variant(&self) -> Suw {
404        match self.bits {
405            false => Suw::Notallowed,
406            true => Suw::Allowed,
407        }
408    }
409    #[doc = "Write access is not allowed in Secure User mode."]
410    #[inline(always)]
411    pub fn is_notallowed(&self) -> bool {
412        *self == Suw::Notallowed
413    }
414    #[doc = "Write access is allowed in Secure User mode."]
415    #[inline(always)]
416    pub fn is_allowed(&self) -> bool {
417        *self == Suw::Allowed
418    }
419}
420#[doc = "Field `SUW` writer - SecureUser Write"]
421pub type SuwW<'a, REG> = crate::BitWriter<'a, REG, Suw>;
422impl<'a, REG> SuwW<'a, REG>
423where
424    REG: crate::Writable + crate::RegisterSpec,
425{
426    #[doc = "Write access is not allowed in Secure User mode."]
427    #[inline(always)]
428    pub fn notallowed(self) -> &'a mut crate::W<REG> {
429        self.variant(Suw::Notallowed)
430    }
431    #[doc = "Write access is allowed in Secure User mode."]
432    #[inline(always)]
433    pub fn allowed(self) -> &'a mut crate::W<REG> {
434        self.variant(Suw::Allowed)
435    }
436}
437#[doc = "SecureUser Read\n\nValue on reset: 1"]
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum Sur {
441    #[doc = "0: Read access is not allowed in Secure User mode."]
442    Notallowed = 0,
443    #[doc = "1: Read access is allowed in Secure User mode."]
444    Allowed = 1,
445}
446impl From<Sur> for bool {
447    #[inline(always)]
448    fn from(variant: Sur) -> Self {
449        variant as u8 != 0
450    }
451}
452#[doc = "Field `SUR` reader - SecureUser Read"]
453pub type SurR = crate::BitReader<Sur>;
454impl SurR {
455    #[doc = "Get enumerated values variant"]
456    #[inline(always)]
457    pub const fn variant(&self) -> Sur {
458        match self.bits {
459            false => Sur::Notallowed,
460            true => Sur::Allowed,
461        }
462    }
463    #[doc = "Read access is not allowed in Secure User mode."]
464    #[inline(always)]
465    pub fn is_notallowed(&self) -> bool {
466        *self == Sur::Notallowed
467    }
468    #[doc = "Read access is allowed in Secure User mode."]
469    #[inline(always)]
470    pub fn is_allowed(&self) -> bool {
471        *self == Sur::Allowed
472    }
473}
474#[doc = "Field `SUR` writer - SecureUser Read"]
475pub type SurW<'a, REG> = crate::BitWriter<'a, REG, Sur>;
476impl<'a, REG> SurW<'a, REG>
477where
478    REG: crate::Writable + crate::RegisterSpec,
479{
480    #[doc = "Read access is not allowed in Secure User mode."]
481    #[inline(always)]
482    pub fn notallowed(self) -> &'a mut crate::W<REG> {
483        self.variant(Sur::Notallowed)
484    }
485    #[doc = "Read access is allowed in Secure User mode."]
486    #[inline(always)]
487    pub fn allowed(self) -> &'a mut crate::W<REG> {
488        self.variant(Sur::Allowed)
489    }
490}
491#[doc = "SecurePriv Execute\n\nValue on reset: 0"]
492#[cfg_attr(feature = "defmt", derive(defmt::Format))]
493#[derive(Clone, Copy, Debug, PartialEq, Eq)]
494pub enum Spx {
495    #[doc = "0: Execute access is not allowed in Secure Privilege mode."]
496    Notallowed = 0,
497    #[doc = "1: Execute access is allowed in Secure Privilege mode."]
498    Allowed = 1,
499}
500impl From<Spx> for bool {
501    #[inline(always)]
502    fn from(variant: Spx) -> Self {
503        variant as u8 != 0
504    }
505}
506#[doc = "Field `SPX` reader - SecurePriv Execute"]
507pub type SpxR = crate::BitReader<Spx>;
508impl SpxR {
509    #[doc = "Get enumerated values variant"]
510    #[inline(always)]
511    pub const fn variant(&self) -> Spx {
512        match self.bits {
513            false => Spx::Notallowed,
514            true => Spx::Allowed,
515        }
516    }
517    #[doc = "Execute access is not allowed in Secure Privilege mode."]
518    #[inline(always)]
519    pub fn is_notallowed(&self) -> bool {
520        *self == Spx::Notallowed
521    }
522    #[doc = "Execute access is allowed in Secure Privilege mode."]
523    #[inline(always)]
524    pub fn is_allowed(&self) -> bool {
525        *self == Spx::Allowed
526    }
527}
528#[doc = "Field `SPX` writer - SecurePriv Execute"]
529pub type SpxW<'a, REG> = crate::BitWriter<'a, REG, Spx>;
530impl<'a, REG> SpxW<'a, REG>
531where
532    REG: crate::Writable + crate::RegisterSpec,
533{
534    #[doc = "Execute access is not allowed in Secure Privilege mode."]
535    #[inline(always)]
536    pub fn notallowed(self) -> &'a mut crate::W<REG> {
537        self.variant(Spx::Notallowed)
538    }
539    #[doc = "Execute access is allowed in Secure Privilege mode."]
540    #[inline(always)]
541    pub fn allowed(self) -> &'a mut crate::W<REG> {
542        self.variant(Spx::Allowed)
543    }
544}
545#[doc = "SecurePriv Write\n\nValue on reset: 0"]
546#[cfg_attr(feature = "defmt", derive(defmt::Format))]
547#[derive(Clone, Copy, Debug, PartialEq, Eq)]
548pub enum Spw {
549    #[doc = "0: Write access is not allowed in Secure Privilege mode."]
550    Notallowed = 0,
551    #[doc = "1: Write access is allowed in Secure Privilege mode."]
552    Allowed = 1,
553}
554impl From<Spw> for bool {
555    #[inline(always)]
556    fn from(variant: Spw) -> Self {
557        variant as u8 != 0
558    }
559}
560#[doc = "Field `SPW` reader - SecurePriv Write"]
561pub type SpwR = crate::BitReader<Spw>;
562impl SpwR {
563    #[doc = "Get enumerated values variant"]
564    #[inline(always)]
565    pub const fn variant(&self) -> Spw {
566        match self.bits {
567            false => Spw::Notallowed,
568            true => Spw::Allowed,
569        }
570    }
571    #[doc = "Write access is not allowed in Secure Privilege mode."]
572    #[inline(always)]
573    pub fn is_notallowed(&self) -> bool {
574        *self == Spw::Notallowed
575    }
576    #[doc = "Write access is allowed in Secure Privilege mode."]
577    #[inline(always)]
578    pub fn is_allowed(&self) -> bool {
579        *self == Spw::Allowed
580    }
581}
582#[doc = "Field `SPW` writer - SecurePriv Write"]
583pub type SpwW<'a, REG> = crate::BitWriter<'a, REG, Spw>;
584impl<'a, REG> SpwW<'a, REG>
585where
586    REG: crate::Writable + crate::RegisterSpec,
587{
588    #[doc = "Write access is not allowed in Secure Privilege mode."]
589    #[inline(always)]
590    pub fn notallowed(self) -> &'a mut crate::W<REG> {
591        self.variant(Spw::Notallowed)
592    }
593    #[doc = "Write access is allowed in Secure Privilege mode."]
594    #[inline(always)]
595    pub fn allowed(self) -> &'a mut crate::W<REG> {
596        self.variant(Spw::Allowed)
597    }
598}
599#[doc = "SecurePriv Read\n\nValue on reset: 1"]
600#[cfg_attr(feature = "defmt", derive(defmt::Format))]
601#[derive(Clone, Copy, Debug, PartialEq, Eq)]
602pub enum Spr {
603    #[doc = "0: Read access is not allowed in Secure Privilege mode."]
604    Notallowed = 0,
605    #[doc = "1: Read access is allowed in Secure Privilege mode."]
606    Allowed = 1,
607}
608impl From<Spr> for bool {
609    #[inline(always)]
610    fn from(variant: Spr) -> Self {
611        variant as u8 != 0
612    }
613}
614#[doc = "Field `SPR` reader - SecurePriv Read"]
615pub type SprR = crate::BitReader<Spr>;
616impl SprR {
617    #[doc = "Get enumerated values variant"]
618    #[inline(always)]
619    pub const fn variant(&self) -> Spr {
620        match self.bits {
621            false => Spr::Notallowed,
622            true => Spr::Allowed,
623        }
624    }
625    #[doc = "Read access is not allowed in Secure Privilege mode."]
626    #[inline(always)]
627    pub fn is_notallowed(&self) -> bool {
628        *self == Spr::Notallowed
629    }
630    #[doc = "Read access is allowed in Secure Privilege mode."]
631    #[inline(always)]
632    pub fn is_allowed(&self) -> bool {
633        *self == Spr::Allowed
634    }
635}
636#[doc = "Field `SPR` writer - SecurePriv Read"]
637pub type SprW<'a, REG> = crate::BitWriter<'a, REG, Spr>;
638impl<'a, REG> SprW<'a, REG>
639where
640    REG: crate::Writable + crate::RegisterSpec,
641{
642    #[doc = "Read access is not allowed in Secure Privilege mode."]
643    #[inline(always)]
644    pub fn notallowed(self) -> &'a mut crate::W<REG> {
645        self.variant(Spr::Notallowed)
646    }
647    #[doc = "Read access is allowed in Secure Privilege mode."]
648    #[inline(always)]
649    pub fn allowed(self) -> &'a mut crate::W<REG> {
650        self.variant(Spr::Allowed)
651    }
652}
653#[doc = "LOCK\n\nValue on reset: 1"]
654#[cfg_attr(feature = "defmt", derive(defmt::Format))]
655#[derive(Clone, Copy, Debug, PartialEq, Eq)]
656pub enum Lk {
657    #[doc = "0: This register is not locked and can be altered."]
658    Unlocked = 0,
659    #[doc = "1: This register is locked and cannot be altered."]
660    Locked = 1,
661}
662impl From<Lk> for bool {
663    #[inline(always)]
664    fn from(variant: Lk) -> Self {
665        variant as u8 != 0
666    }
667}
668#[doc = "Field `LK` reader - LOCK"]
669pub type LkR = crate::BitReader<Lk>;
670impl LkR {
671    #[doc = "Get enumerated values variant"]
672    #[inline(always)]
673    pub const fn variant(&self) -> Lk {
674        match self.bits {
675            false => Lk::Unlocked,
676            true => Lk::Locked,
677        }
678    }
679    #[doc = "This register is not locked and can be altered."]
680    #[inline(always)]
681    pub fn is_unlocked(&self) -> bool {
682        *self == Lk::Unlocked
683    }
684    #[doc = "This register is locked and cannot be altered."]
685    #[inline(always)]
686    pub fn is_locked(&self) -> bool {
687        *self == Lk::Locked
688    }
689}
690#[doc = "Field `LK` writer - LOCK"]
691pub type LkW<'a, REG> = crate::BitWriter<'a, REG, Lk>;
692impl<'a, REG> LkW<'a, REG>
693where
694    REG: crate::Writable + crate::RegisterSpec,
695{
696    #[doc = "This register is not locked and can be altered."]
697    #[inline(always)]
698    pub fn unlocked(self) -> &'a mut crate::W<REG> {
699        self.variant(Lk::Unlocked)
700    }
701    #[doc = "This register is locked and cannot be altered."]
702    #[inline(always)]
703    pub fn locked(self) -> &'a mut crate::W<REG> {
704        self.variant(Lk::Locked)
705    }
706}
707impl R {
708    #[doc = "Bit 0 - NonsecureUser Execute"]
709    #[inline(always)]
710    pub fn nux(&self) -> NuxR {
711        NuxR::new((self.bits & 1) != 0)
712    }
713    #[doc = "Bit 1 - NonsecureUser Write"]
714    #[inline(always)]
715    pub fn nuw(&self) -> NuwR {
716        NuwR::new(((self.bits >> 1) & 1) != 0)
717    }
718    #[doc = "Bit 2 - NonsecureUser Read"]
719    #[inline(always)]
720    pub fn nur(&self) -> NurR {
721        NurR::new(((self.bits >> 2) & 1) != 0)
722    }
723    #[doc = "Bit 4 - NonsecurePriv Execute"]
724    #[inline(always)]
725    pub fn npx(&self) -> NpxR {
726        NpxR::new(((self.bits >> 4) & 1) != 0)
727    }
728    #[doc = "Bit 5 - NonsecurePriv Write"]
729    #[inline(always)]
730    pub fn npw(&self) -> NpwR {
731        NpwR::new(((self.bits >> 5) & 1) != 0)
732    }
733    #[doc = "Bit 6 - NonsecurePriv Read"]
734    #[inline(always)]
735    pub fn npr(&self) -> NprR {
736        NprR::new(((self.bits >> 6) & 1) != 0)
737    }
738    #[doc = "Bit 8 - SecureUser Execute"]
739    #[inline(always)]
740    pub fn sux(&self) -> SuxR {
741        SuxR::new(((self.bits >> 8) & 1) != 0)
742    }
743    #[doc = "Bit 9 - SecureUser Write"]
744    #[inline(always)]
745    pub fn suw(&self) -> SuwR {
746        SuwR::new(((self.bits >> 9) & 1) != 0)
747    }
748    #[doc = "Bit 10 - SecureUser Read"]
749    #[inline(always)]
750    pub fn sur(&self) -> SurR {
751        SurR::new(((self.bits >> 10) & 1) != 0)
752    }
753    #[doc = "Bit 12 - SecurePriv Execute"]
754    #[inline(always)]
755    pub fn spx(&self) -> SpxR {
756        SpxR::new(((self.bits >> 12) & 1) != 0)
757    }
758    #[doc = "Bit 13 - SecurePriv Write"]
759    #[inline(always)]
760    pub fn spw(&self) -> SpwR {
761        SpwR::new(((self.bits >> 13) & 1) != 0)
762    }
763    #[doc = "Bit 14 - SecurePriv Read"]
764    #[inline(always)]
765    pub fn spr(&self) -> SprR {
766        SprR::new(((self.bits >> 14) & 1) != 0)
767    }
768    #[doc = "Bit 31 - LOCK"]
769    #[inline(always)]
770    pub fn lk(&self) -> LkR {
771        LkR::new(((self.bits >> 31) & 1) != 0)
772    }
773}
774#[cfg(feature = "debug")]
775impl core::fmt::Debug for R {
776    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
777        f.debug_struct("MBC0_MEMN_GLBAC3")
778            .field("nux", &self.nux())
779            .field("nuw", &self.nuw())
780            .field("nur", &self.nur())
781            .field("npx", &self.npx())
782            .field("npw", &self.npw())
783            .field("npr", &self.npr())
784            .field("sux", &self.sux())
785            .field("suw", &self.suw())
786            .field("sur", &self.sur())
787            .field("spx", &self.spx())
788            .field("spw", &self.spw())
789            .field("spr", &self.spr())
790            .field("lk", &self.lk())
791            .finish()
792    }
793}
794impl W {
795    #[doc = "Bit 0 - NonsecureUser Execute"]
796    #[inline(always)]
797    pub fn nux(&mut self) -> NuxW<'_, Mbc0MemnGlbac3Spec> {
798        NuxW::new(self, 0)
799    }
800    #[doc = "Bit 1 - NonsecureUser Write"]
801    #[inline(always)]
802    pub fn nuw(&mut self) -> NuwW<'_, Mbc0MemnGlbac3Spec> {
803        NuwW::new(self, 1)
804    }
805    #[doc = "Bit 2 - NonsecureUser Read"]
806    #[inline(always)]
807    pub fn nur(&mut self) -> NurW<'_, Mbc0MemnGlbac3Spec> {
808        NurW::new(self, 2)
809    }
810    #[doc = "Bit 4 - NonsecurePriv Execute"]
811    #[inline(always)]
812    pub fn npx(&mut self) -> NpxW<'_, Mbc0MemnGlbac3Spec> {
813        NpxW::new(self, 4)
814    }
815    #[doc = "Bit 5 - NonsecurePriv Write"]
816    #[inline(always)]
817    pub fn npw(&mut self) -> NpwW<'_, Mbc0MemnGlbac3Spec> {
818        NpwW::new(self, 5)
819    }
820    #[doc = "Bit 6 - NonsecurePriv Read"]
821    #[inline(always)]
822    pub fn npr(&mut self) -> NprW<'_, Mbc0MemnGlbac3Spec> {
823        NprW::new(self, 6)
824    }
825    #[doc = "Bit 8 - SecureUser Execute"]
826    #[inline(always)]
827    pub fn sux(&mut self) -> SuxW<'_, Mbc0MemnGlbac3Spec> {
828        SuxW::new(self, 8)
829    }
830    #[doc = "Bit 9 - SecureUser Write"]
831    #[inline(always)]
832    pub fn suw(&mut self) -> SuwW<'_, Mbc0MemnGlbac3Spec> {
833        SuwW::new(self, 9)
834    }
835    #[doc = "Bit 10 - SecureUser Read"]
836    #[inline(always)]
837    pub fn sur(&mut self) -> SurW<'_, Mbc0MemnGlbac3Spec> {
838        SurW::new(self, 10)
839    }
840    #[doc = "Bit 12 - SecurePriv Execute"]
841    #[inline(always)]
842    pub fn spx(&mut self) -> SpxW<'_, Mbc0MemnGlbac3Spec> {
843        SpxW::new(self, 12)
844    }
845    #[doc = "Bit 13 - SecurePriv Write"]
846    #[inline(always)]
847    pub fn spw(&mut self) -> SpwW<'_, Mbc0MemnGlbac3Spec> {
848        SpwW::new(self, 13)
849    }
850    #[doc = "Bit 14 - SecurePriv Read"]
851    #[inline(always)]
852    pub fn spr(&mut self) -> SprW<'_, Mbc0MemnGlbac3Spec> {
853        SprW::new(self, 14)
854    }
855    #[doc = "Bit 31 - LOCK"]
856    #[inline(always)]
857    pub fn lk(&mut self) -> LkW<'_, Mbc0MemnGlbac3Spec> {
858        LkW::new(self, 31)
859    }
860}
861#[doc = "MBC Global Access Control\n\nYou can [`read`](crate::Reg::read) this register and get [`mbc0_memn_glbac3::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_glbac3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
862pub struct Mbc0MemnGlbac3Spec;
863impl crate::RegisterSpec for Mbc0MemnGlbac3Spec {
864    type Ux = u32;
865}
866#[doc = "`read()` method returns [`mbc0_memn_glbac3::R`](R) reader structure"]
867impl crate::Readable for Mbc0MemnGlbac3Spec {}
868#[doc = "`write(|w| ..)` method takes [`mbc0_memn_glbac3::W`](W) writer structure"]
869impl crate::Writable for Mbc0MemnGlbac3Spec {
870    type Safety = crate::Unsafe;
871}
872#[doc = "`reset()` method sets MBC0_MEMN_GLBAC3 to value 0x8000_4400"]
873impl crate::Resettable for Mbc0MemnGlbac3Spec {
874    const RESET_VALUE: u32 = 0x8000_4400;
875}