mimxrt685s_pac/ahb_secure_ctrl/
ram06_rule.rs

1#[doc = "Register `RAM06_RULE[%s]` reader"]
2pub type R = crate::R<Ram06RuleSpec>;
3#[doc = "Register `RAM06_RULE[%s]` writer"]
4pub type W = crate::W<Ram06RuleSpec>;
5#[doc = "Rule 0\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Rule0 {
10    #[doc = "0: Non-secure and non-privilege user access allowed"]
11    NonsecureNonprivUserAllowed = 0,
12    #[doc = "1: Non-secure and privilege access allowed"]
13    NonsecurePrivUserAllowed = 1,
14    #[doc = "2: Secure and non-privilege user access allowed"]
15    SecureNonprivUserAllowed = 2,
16    #[doc = "3: Secure and privilege user access allowed"]
17    SecurePrivUserAllowed = 3,
18}
19impl From<Rule0> for u8 {
20    #[inline(always)]
21    fn from(variant: Rule0) -> Self {
22        variant as _
23    }
24}
25impl crate::FieldSpec for Rule0 {
26    type Ux = u8;
27}
28impl crate::IsEnum for Rule0 {}
29#[doc = "Field `RULE0` reader - Rule 0"]
30pub type Rule0R = crate::FieldReader<Rule0>;
31impl Rule0R {
32    #[doc = "Get enumerated values variant"]
33    #[inline(always)]
34    pub const fn variant(&self) -> Rule0 {
35        match self.bits {
36            0 => Rule0::NonsecureNonprivUserAllowed,
37            1 => Rule0::NonsecurePrivUserAllowed,
38            2 => Rule0::SecureNonprivUserAllowed,
39            3 => Rule0::SecurePrivUserAllowed,
40            _ => unreachable!(),
41        }
42    }
43    #[doc = "Non-secure and non-privilege user access allowed"]
44    #[inline(always)]
45    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
46        *self == Rule0::NonsecureNonprivUserAllowed
47    }
48    #[doc = "Non-secure and privilege access allowed"]
49    #[inline(always)]
50    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
51        *self == Rule0::NonsecurePrivUserAllowed
52    }
53    #[doc = "Secure and non-privilege user access allowed"]
54    #[inline(always)]
55    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
56        *self == Rule0::SecureNonprivUserAllowed
57    }
58    #[doc = "Secure and privilege user access allowed"]
59    #[inline(always)]
60    pub fn is_secure_priv_user_allowed(&self) -> bool {
61        *self == Rule0::SecurePrivUserAllowed
62    }
63}
64#[doc = "Field `RULE0` writer - Rule 0"]
65pub type Rule0W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule0, crate::Safe>;
66impl<'a, REG> Rule0W<'a, REG>
67where
68    REG: crate::Writable + crate::RegisterSpec,
69    REG::Ux: From<u8>,
70{
71    #[doc = "Non-secure and non-privilege user access allowed"]
72    #[inline(always)]
73    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
74        self.variant(Rule0::NonsecureNonprivUserAllowed)
75    }
76    #[doc = "Non-secure and privilege access allowed"]
77    #[inline(always)]
78    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
79        self.variant(Rule0::NonsecurePrivUserAllowed)
80    }
81    #[doc = "Secure and non-privilege user access allowed"]
82    #[inline(always)]
83    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
84        self.variant(Rule0::SecureNonprivUserAllowed)
85    }
86    #[doc = "Secure and privilege user access allowed"]
87    #[inline(always)]
88    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
89        self.variant(Rule0::SecurePrivUserAllowed)
90    }
91}
92#[doc = "Rule 1\n\nValue on reset: 0"]
93#[cfg_attr(feature = "defmt", derive(defmt::Format))]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95#[repr(u8)]
96pub enum Rule1 {
97    #[doc = "0: Non-secure and non-privilege user access allowed"]
98    NonsecureNonprivUserAllowed = 0,
99    #[doc = "1: Non-secure and privilege access allowed"]
100    NonsecurePrivUserAllowed = 1,
101    #[doc = "2: Secure and non-privilege user access allowed"]
102    SecureNonprivUserAllowed = 2,
103    #[doc = "3: Secure and privilege user access allowed"]
104    SecurePrivUserAllowed = 3,
105}
106impl From<Rule1> for u8 {
107    #[inline(always)]
108    fn from(variant: Rule1) -> Self {
109        variant as _
110    }
111}
112impl crate::FieldSpec for Rule1 {
113    type Ux = u8;
114}
115impl crate::IsEnum for Rule1 {}
116#[doc = "Field `RULE1` reader - Rule 1"]
117pub type Rule1R = crate::FieldReader<Rule1>;
118impl Rule1R {
119    #[doc = "Get enumerated values variant"]
120    #[inline(always)]
121    pub const fn variant(&self) -> Rule1 {
122        match self.bits {
123            0 => Rule1::NonsecureNonprivUserAllowed,
124            1 => Rule1::NonsecurePrivUserAllowed,
125            2 => Rule1::SecureNonprivUserAllowed,
126            3 => Rule1::SecurePrivUserAllowed,
127            _ => unreachable!(),
128        }
129    }
130    #[doc = "Non-secure and non-privilege user access allowed"]
131    #[inline(always)]
132    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
133        *self == Rule1::NonsecureNonprivUserAllowed
134    }
135    #[doc = "Non-secure and privilege access allowed"]
136    #[inline(always)]
137    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
138        *self == Rule1::NonsecurePrivUserAllowed
139    }
140    #[doc = "Secure and non-privilege user access allowed"]
141    #[inline(always)]
142    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
143        *self == Rule1::SecureNonprivUserAllowed
144    }
145    #[doc = "Secure and privilege user access allowed"]
146    #[inline(always)]
147    pub fn is_secure_priv_user_allowed(&self) -> bool {
148        *self == Rule1::SecurePrivUserAllowed
149    }
150}
151#[doc = "Field `RULE1` writer - Rule 1"]
152pub type Rule1W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule1, crate::Safe>;
153impl<'a, REG> Rule1W<'a, REG>
154where
155    REG: crate::Writable + crate::RegisterSpec,
156    REG::Ux: From<u8>,
157{
158    #[doc = "Non-secure and non-privilege user access allowed"]
159    #[inline(always)]
160    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
161        self.variant(Rule1::NonsecureNonprivUserAllowed)
162    }
163    #[doc = "Non-secure and privilege access allowed"]
164    #[inline(always)]
165    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
166        self.variant(Rule1::NonsecurePrivUserAllowed)
167    }
168    #[doc = "Secure and non-privilege user access allowed"]
169    #[inline(always)]
170    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
171        self.variant(Rule1::SecureNonprivUserAllowed)
172    }
173    #[doc = "Secure and privilege user access allowed"]
174    #[inline(always)]
175    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
176        self.variant(Rule1::SecurePrivUserAllowed)
177    }
178}
179#[doc = "Rule 2\n\nValue on reset: 0"]
180#[cfg_attr(feature = "defmt", derive(defmt::Format))]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182#[repr(u8)]
183pub enum Rule2 {
184    #[doc = "0: Non-secure and non-privilege user access allowed"]
185    NonsecureNonprivUserAllowed = 0,
186    #[doc = "1: Non-secure and privilege access allowed"]
187    NonsecurePrivUserAllowed = 1,
188    #[doc = "2: Secure and non-privilege user access allowed"]
189    SecureNonprivUserAllowed = 2,
190    #[doc = "3: Secure and privilege user access allowed"]
191    SecurePrivUserAllowed = 3,
192}
193impl From<Rule2> for u8 {
194    #[inline(always)]
195    fn from(variant: Rule2) -> Self {
196        variant as _
197    }
198}
199impl crate::FieldSpec for Rule2 {
200    type Ux = u8;
201}
202impl crate::IsEnum for Rule2 {}
203#[doc = "Field `RULE2` reader - Rule 2"]
204pub type Rule2R = crate::FieldReader<Rule2>;
205impl Rule2R {
206    #[doc = "Get enumerated values variant"]
207    #[inline(always)]
208    pub const fn variant(&self) -> Rule2 {
209        match self.bits {
210            0 => Rule2::NonsecureNonprivUserAllowed,
211            1 => Rule2::NonsecurePrivUserAllowed,
212            2 => Rule2::SecureNonprivUserAllowed,
213            3 => Rule2::SecurePrivUserAllowed,
214            _ => unreachable!(),
215        }
216    }
217    #[doc = "Non-secure and non-privilege user access allowed"]
218    #[inline(always)]
219    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
220        *self == Rule2::NonsecureNonprivUserAllowed
221    }
222    #[doc = "Non-secure and privilege access allowed"]
223    #[inline(always)]
224    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
225        *self == Rule2::NonsecurePrivUserAllowed
226    }
227    #[doc = "Secure and non-privilege user access allowed"]
228    #[inline(always)]
229    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
230        *self == Rule2::SecureNonprivUserAllowed
231    }
232    #[doc = "Secure and privilege user access allowed"]
233    #[inline(always)]
234    pub fn is_secure_priv_user_allowed(&self) -> bool {
235        *self == Rule2::SecurePrivUserAllowed
236    }
237}
238#[doc = "Field `RULE2` writer - Rule 2"]
239pub type Rule2W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule2, crate::Safe>;
240impl<'a, REG> Rule2W<'a, REG>
241where
242    REG: crate::Writable + crate::RegisterSpec,
243    REG::Ux: From<u8>,
244{
245    #[doc = "Non-secure and non-privilege user access allowed"]
246    #[inline(always)]
247    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
248        self.variant(Rule2::NonsecureNonprivUserAllowed)
249    }
250    #[doc = "Non-secure and privilege access allowed"]
251    #[inline(always)]
252    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
253        self.variant(Rule2::NonsecurePrivUserAllowed)
254    }
255    #[doc = "Secure and non-privilege user access allowed"]
256    #[inline(always)]
257    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
258        self.variant(Rule2::SecureNonprivUserAllowed)
259    }
260    #[doc = "Secure and privilege user access allowed"]
261    #[inline(always)]
262    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
263        self.variant(Rule2::SecurePrivUserAllowed)
264    }
265}
266#[doc = "Rule 3\n\nValue on reset: 0"]
267#[cfg_attr(feature = "defmt", derive(defmt::Format))]
268#[derive(Clone, Copy, Debug, PartialEq, Eq)]
269#[repr(u8)]
270pub enum Rule3 {
271    #[doc = "0: Non-secure and non-privilege user access allowed"]
272    NonsecureNonprivUserAllowed = 0,
273    #[doc = "1: Non-secure and privilege access allowed"]
274    NonsecurePrivUserAllowed = 1,
275    #[doc = "2: Secure and non-privilege user access allowed"]
276    SecureNonprivUserAllowed = 2,
277    #[doc = "3: Secure and privilege user access allowed"]
278    SecurePrivUserAllowed = 3,
279}
280impl From<Rule3> for u8 {
281    #[inline(always)]
282    fn from(variant: Rule3) -> Self {
283        variant as _
284    }
285}
286impl crate::FieldSpec for Rule3 {
287    type Ux = u8;
288}
289impl crate::IsEnum for Rule3 {}
290#[doc = "Field `RULE3` reader - Rule 3"]
291pub type Rule3R = crate::FieldReader<Rule3>;
292impl Rule3R {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Rule3 {
296        match self.bits {
297            0 => Rule3::NonsecureNonprivUserAllowed,
298            1 => Rule3::NonsecurePrivUserAllowed,
299            2 => Rule3::SecureNonprivUserAllowed,
300            3 => Rule3::SecurePrivUserAllowed,
301            _ => unreachable!(),
302        }
303    }
304    #[doc = "Non-secure and non-privilege user access allowed"]
305    #[inline(always)]
306    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
307        *self == Rule3::NonsecureNonprivUserAllowed
308    }
309    #[doc = "Non-secure and privilege access allowed"]
310    #[inline(always)]
311    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
312        *self == Rule3::NonsecurePrivUserAllowed
313    }
314    #[doc = "Secure and non-privilege user access allowed"]
315    #[inline(always)]
316    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
317        *self == Rule3::SecureNonprivUserAllowed
318    }
319    #[doc = "Secure and privilege user access allowed"]
320    #[inline(always)]
321    pub fn is_secure_priv_user_allowed(&self) -> bool {
322        *self == Rule3::SecurePrivUserAllowed
323    }
324}
325#[doc = "Field `RULE3` writer - Rule 3"]
326pub type Rule3W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule3, crate::Safe>;
327impl<'a, REG> Rule3W<'a, REG>
328where
329    REG: crate::Writable + crate::RegisterSpec,
330    REG::Ux: From<u8>,
331{
332    #[doc = "Non-secure and non-privilege user access allowed"]
333    #[inline(always)]
334    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
335        self.variant(Rule3::NonsecureNonprivUserAllowed)
336    }
337    #[doc = "Non-secure and privilege access allowed"]
338    #[inline(always)]
339    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
340        self.variant(Rule3::NonsecurePrivUserAllowed)
341    }
342    #[doc = "Secure and non-privilege user access allowed"]
343    #[inline(always)]
344    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
345        self.variant(Rule3::SecureNonprivUserAllowed)
346    }
347    #[doc = "Secure and privilege user access allowed"]
348    #[inline(always)]
349    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
350        self.variant(Rule3::SecurePrivUserAllowed)
351    }
352}
353#[doc = "Rule 4\n\nValue on reset: 0"]
354#[cfg_attr(feature = "defmt", derive(defmt::Format))]
355#[derive(Clone, Copy, Debug, PartialEq, Eq)]
356#[repr(u8)]
357pub enum Rule4 {
358    #[doc = "0: Non-secure and non-privilege user access allowed"]
359    NonsecureNonprivUserAllowed = 0,
360    #[doc = "1: Non-secure and privilege access allowed"]
361    NonsecurePrivUserAllowed = 1,
362    #[doc = "2: Secure and non-privilege user access allowed"]
363    SecureNonprivUserAllowed = 2,
364    #[doc = "3: Secure and privilege user access allowed"]
365    SecurePrivUserAllowed = 3,
366}
367impl From<Rule4> for u8 {
368    #[inline(always)]
369    fn from(variant: Rule4) -> Self {
370        variant as _
371    }
372}
373impl crate::FieldSpec for Rule4 {
374    type Ux = u8;
375}
376impl crate::IsEnum for Rule4 {}
377#[doc = "Field `RULE4` reader - Rule 4"]
378pub type Rule4R = crate::FieldReader<Rule4>;
379impl Rule4R {
380    #[doc = "Get enumerated values variant"]
381    #[inline(always)]
382    pub const fn variant(&self) -> Rule4 {
383        match self.bits {
384            0 => Rule4::NonsecureNonprivUserAllowed,
385            1 => Rule4::NonsecurePrivUserAllowed,
386            2 => Rule4::SecureNonprivUserAllowed,
387            3 => Rule4::SecurePrivUserAllowed,
388            _ => unreachable!(),
389        }
390    }
391    #[doc = "Non-secure and non-privilege user access allowed"]
392    #[inline(always)]
393    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
394        *self == Rule4::NonsecureNonprivUserAllowed
395    }
396    #[doc = "Non-secure and privilege access allowed"]
397    #[inline(always)]
398    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
399        *self == Rule4::NonsecurePrivUserAllowed
400    }
401    #[doc = "Secure and non-privilege user access allowed"]
402    #[inline(always)]
403    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
404        *self == Rule4::SecureNonprivUserAllowed
405    }
406    #[doc = "Secure and privilege user access allowed"]
407    #[inline(always)]
408    pub fn is_secure_priv_user_allowed(&self) -> bool {
409        *self == Rule4::SecurePrivUserAllowed
410    }
411}
412#[doc = "Field `RULE4` writer - Rule 4"]
413pub type Rule4W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule4, crate::Safe>;
414impl<'a, REG> Rule4W<'a, REG>
415where
416    REG: crate::Writable + crate::RegisterSpec,
417    REG::Ux: From<u8>,
418{
419    #[doc = "Non-secure and non-privilege user access allowed"]
420    #[inline(always)]
421    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
422        self.variant(Rule4::NonsecureNonprivUserAllowed)
423    }
424    #[doc = "Non-secure and privilege access allowed"]
425    #[inline(always)]
426    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
427        self.variant(Rule4::NonsecurePrivUserAllowed)
428    }
429    #[doc = "Secure and non-privilege user access allowed"]
430    #[inline(always)]
431    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
432        self.variant(Rule4::SecureNonprivUserAllowed)
433    }
434    #[doc = "Secure and privilege user access allowed"]
435    #[inline(always)]
436    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
437        self.variant(Rule4::SecurePrivUserAllowed)
438    }
439}
440#[doc = "Rule 5\n\nValue on reset: 0"]
441#[cfg_attr(feature = "defmt", derive(defmt::Format))]
442#[derive(Clone, Copy, Debug, PartialEq, Eq)]
443#[repr(u8)]
444pub enum Rule5 {
445    #[doc = "0: Non-secure and non-privilege user access allowed"]
446    NonsecureNonprivUserAllowed = 0,
447    #[doc = "1: Non-secure and privilege access allowed"]
448    NonsecurePrivUserAllowed = 1,
449    #[doc = "2: Secure and non-privilege user access allowed"]
450    SecureNonprivUserAllowed = 2,
451    #[doc = "3: Secure and privilege user access allowed"]
452    SecurePrivUserAllowed = 3,
453}
454impl From<Rule5> for u8 {
455    #[inline(always)]
456    fn from(variant: Rule5) -> Self {
457        variant as _
458    }
459}
460impl crate::FieldSpec for Rule5 {
461    type Ux = u8;
462}
463impl crate::IsEnum for Rule5 {}
464#[doc = "Field `RULE5` reader - Rule 5"]
465pub type Rule5R = crate::FieldReader<Rule5>;
466impl Rule5R {
467    #[doc = "Get enumerated values variant"]
468    #[inline(always)]
469    pub const fn variant(&self) -> Rule5 {
470        match self.bits {
471            0 => Rule5::NonsecureNonprivUserAllowed,
472            1 => Rule5::NonsecurePrivUserAllowed,
473            2 => Rule5::SecureNonprivUserAllowed,
474            3 => Rule5::SecurePrivUserAllowed,
475            _ => unreachable!(),
476        }
477    }
478    #[doc = "Non-secure and non-privilege user access allowed"]
479    #[inline(always)]
480    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
481        *self == Rule5::NonsecureNonprivUserAllowed
482    }
483    #[doc = "Non-secure and privilege access allowed"]
484    #[inline(always)]
485    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
486        *self == Rule5::NonsecurePrivUserAllowed
487    }
488    #[doc = "Secure and non-privilege user access allowed"]
489    #[inline(always)]
490    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
491        *self == Rule5::SecureNonprivUserAllowed
492    }
493    #[doc = "Secure and privilege user access allowed"]
494    #[inline(always)]
495    pub fn is_secure_priv_user_allowed(&self) -> bool {
496        *self == Rule5::SecurePrivUserAllowed
497    }
498}
499#[doc = "Field `RULE5` writer - Rule 5"]
500pub type Rule5W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule5, crate::Safe>;
501impl<'a, REG> Rule5W<'a, REG>
502where
503    REG: crate::Writable + crate::RegisterSpec,
504    REG::Ux: From<u8>,
505{
506    #[doc = "Non-secure and non-privilege user access allowed"]
507    #[inline(always)]
508    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
509        self.variant(Rule5::NonsecureNonprivUserAllowed)
510    }
511    #[doc = "Non-secure and privilege access allowed"]
512    #[inline(always)]
513    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
514        self.variant(Rule5::NonsecurePrivUserAllowed)
515    }
516    #[doc = "Secure and non-privilege user access allowed"]
517    #[inline(always)]
518    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
519        self.variant(Rule5::SecureNonprivUserAllowed)
520    }
521    #[doc = "Secure and privilege user access allowed"]
522    #[inline(always)]
523    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
524        self.variant(Rule5::SecurePrivUserAllowed)
525    }
526}
527#[doc = "Rule 6\n\nValue on reset: 0"]
528#[cfg_attr(feature = "defmt", derive(defmt::Format))]
529#[derive(Clone, Copy, Debug, PartialEq, Eq)]
530#[repr(u8)]
531pub enum Rule6 {
532    #[doc = "0: Non-secure and non-privilege user access allowed"]
533    NonsecureNonprivUserAllowed = 0,
534    #[doc = "1: Non-secure and privilege access allowed"]
535    NonsecurePrivUserAllowed = 1,
536    #[doc = "2: Secure and non-privilege user access allowed"]
537    SecureNonprivUserAllowed = 2,
538    #[doc = "3: Secure and privilege user access allowed"]
539    SecurePrivUserAllowed = 3,
540}
541impl From<Rule6> for u8 {
542    #[inline(always)]
543    fn from(variant: Rule6) -> Self {
544        variant as _
545    }
546}
547impl crate::FieldSpec for Rule6 {
548    type Ux = u8;
549}
550impl crate::IsEnum for Rule6 {}
551#[doc = "Field `RULE6` reader - Rule 6"]
552pub type Rule6R = crate::FieldReader<Rule6>;
553impl Rule6R {
554    #[doc = "Get enumerated values variant"]
555    #[inline(always)]
556    pub const fn variant(&self) -> Rule6 {
557        match self.bits {
558            0 => Rule6::NonsecureNonprivUserAllowed,
559            1 => Rule6::NonsecurePrivUserAllowed,
560            2 => Rule6::SecureNonprivUserAllowed,
561            3 => Rule6::SecurePrivUserAllowed,
562            _ => unreachable!(),
563        }
564    }
565    #[doc = "Non-secure and non-privilege user access allowed"]
566    #[inline(always)]
567    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
568        *self == Rule6::NonsecureNonprivUserAllowed
569    }
570    #[doc = "Non-secure and privilege access allowed"]
571    #[inline(always)]
572    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
573        *self == Rule6::NonsecurePrivUserAllowed
574    }
575    #[doc = "Secure and non-privilege user access allowed"]
576    #[inline(always)]
577    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
578        *self == Rule6::SecureNonprivUserAllowed
579    }
580    #[doc = "Secure and privilege user access allowed"]
581    #[inline(always)]
582    pub fn is_secure_priv_user_allowed(&self) -> bool {
583        *self == Rule6::SecurePrivUserAllowed
584    }
585}
586#[doc = "Field `RULE6` writer - Rule 6"]
587pub type Rule6W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule6, crate::Safe>;
588impl<'a, REG> Rule6W<'a, REG>
589where
590    REG: crate::Writable + crate::RegisterSpec,
591    REG::Ux: From<u8>,
592{
593    #[doc = "Non-secure and non-privilege user access allowed"]
594    #[inline(always)]
595    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
596        self.variant(Rule6::NonsecureNonprivUserAllowed)
597    }
598    #[doc = "Non-secure and privilege access allowed"]
599    #[inline(always)]
600    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
601        self.variant(Rule6::NonsecurePrivUserAllowed)
602    }
603    #[doc = "Secure and non-privilege user access allowed"]
604    #[inline(always)]
605    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
606        self.variant(Rule6::SecureNonprivUserAllowed)
607    }
608    #[doc = "Secure and privilege user access allowed"]
609    #[inline(always)]
610    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
611        self.variant(Rule6::SecurePrivUserAllowed)
612    }
613}
614#[doc = "Rule 7\n\nValue on reset: 0"]
615#[cfg_attr(feature = "defmt", derive(defmt::Format))]
616#[derive(Clone, Copy, Debug, PartialEq, Eq)]
617#[repr(u8)]
618pub enum Rule7 {
619    #[doc = "0: Non-secure and non-privilege user access allowed"]
620    NonsecureNonprivUserAllowed = 0,
621    #[doc = "1: Non-secure and privilege access allowed"]
622    NonsecurePrivUserAllowed = 1,
623    #[doc = "2: Secure and non-privilege user access allowed"]
624    SecureNonprivUserAllowed = 2,
625    #[doc = "3: Secure and privilege user access allowed"]
626    SecurePrivUserAllowed = 3,
627}
628impl From<Rule7> for u8 {
629    #[inline(always)]
630    fn from(variant: Rule7) -> Self {
631        variant as _
632    }
633}
634impl crate::FieldSpec for Rule7 {
635    type Ux = u8;
636}
637impl crate::IsEnum for Rule7 {}
638#[doc = "Field `RULE7` reader - Rule 7"]
639pub type Rule7R = crate::FieldReader<Rule7>;
640impl Rule7R {
641    #[doc = "Get enumerated values variant"]
642    #[inline(always)]
643    pub const fn variant(&self) -> Rule7 {
644        match self.bits {
645            0 => Rule7::NonsecureNonprivUserAllowed,
646            1 => Rule7::NonsecurePrivUserAllowed,
647            2 => Rule7::SecureNonprivUserAllowed,
648            3 => Rule7::SecurePrivUserAllowed,
649            _ => unreachable!(),
650        }
651    }
652    #[doc = "Non-secure and non-privilege user access allowed"]
653    #[inline(always)]
654    pub fn is_nonsecure_nonpriv_user_allowed(&self) -> bool {
655        *self == Rule7::NonsecureNonprivUserAllowed
656    }
657    #[doc = "Non-secure and privilege access allowed"]
658    #[inline(always)]
659    pub fn is_nonsecure_priv_user_allowed(&self) -> bool {
660        *self == Rule7::NonsecurePrivUserAllowed
661    }
662    #[doc = "Secure and non-privilege user access allowed"]
663    #[inline(always)]
664    pub fn is_secure_nonpriv_user_allowed(&self) -> bool {
665        *self == Rule7::SecureNonprivUserAllowed
666    }
667    #[doc = "Secure and privilege user access allowed"]
668    #[inline(always)]
669    pub fn is_secure_priv_user_allowed(&self) -> bool {
670        *self == Rule7::SecurePrivUserAllowed
671    }
672}
673#[doc = "Field `RULE7` writer - Rule 7"]
674pub type Rule7W<'a, REG> = crate::FieldWriter<'a, REG, 2, Rule7, crate::Safe>;
675impl<'a, REG> Rule7W<'a, REG>
676where
677    REG: crate::Writable + crate::RegisterSpec,
678    REG::Ux: From<u8>,
679{
680    #[doc = "Non-secure and non-privilege user access allowed"]
681    #[inline(always)]
682    pub fn nonsecure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
683        self.variant(Rule7::NonsecureNonprivUserAllowed)
684    }
685    #[doc = "Non-secure and privilege access allowed"]
686    #[inline(always)]
687    pub fn nonsecure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
688        self.variant(Rule7::NonsecurePrivUserAllowed)
689    }
690    #[doc = "Secure and non-privilege user access allowed"]
691    #[inline(always)]
692    pub fn secure_nonpriv_user_allowed(self) -> &'a mut crate::W<REG> {
693        self.variant(Rule7::SecureNonprivUserAllowed)
694    }
695    #[doc = "Secure and privilege user access allowed"]
696    #[inline(always)]
697    pub fn secure_priv_user_allowed(self) -> &'a mut crate::W<REG> {
698        self.variant(Rule7::SecurePrivUserAllowed)
699    }
700}
701impl R {
702    #[doc = "Bits 0:1 - Rule 0"]
703    #[inline(always)]
704    pub fn rule0(&self) -> Rule0R {
705        Rule0R::new((self.bits & 3) as u8)
706    }
707    #[doc = "Bits 4:5 - Rule 1"]
708    #[inline(always)]
709    pub fn rule1(&self) -> Rule1R {
710        Rule1R::new(((self.bits >> 4) & 3) as u8)
711    }
712    #[doc = "Bits 8:9 - Rule 2"]
713    #[inline(always)]
714    pub fn rule2(&self) -> Rule2R {
715        Rule2R::new(((self.bits >> 8) & 3) as u8)
716    }
717    #[doc = "Bits 12:13 - Rule 3"]
718    #[inline(always)]
719    pub fn rule3(&self) -> Rule3R {
720        Rule3R::new(((self.bits >> 12) & 3) as u8)
721    }
722    #[doc = "Bits 16:17 - Rule 4"]
723    #[inline(always)]
724    pub fn rule4(&self) -> Rule4R {
725        Rule4R::new(((self.bits >> 16) & 3) as u8)
726    }
727    #[doc = "Bits 20:21 - Rule 5"]
728    #[inline(always)]
729    pub fn rule5(&self) -> Rule5R {
730        Rule5R::new(((self.bits >> 20) & 3) as u8)
731    }
732    #[doc = "Bits 24:25 - Rule 6"]
733    #[inline(always)]
734    pub fn rule6(&self) -> Rule6R {
735        Rule6R::new(((self.bits >> 24) & 3) as u8)
736    }
737    #[doc = "Bits 28:29 - Rule 7"]
738    #[inline(always)]
739    pub fn rule7(&self) -> Rule7R {
740        Rule7R::new(((self.bits >> 28) & 3) as u8)
741    }
742}
743#[cfg(feature = "debug")]
744impl core::fmt::Debug for R {
745    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
746        f.debug_struct("RAM06_RULE")
747            .field("rule0", &self.rule0())
748            .field("rule1", &self.rule1())
749            .field("rule2", &self.rule2())
750            .field("rule3", &self.rule3())
751            .field("rule4", &self.rule4())
752            .field("rule5", &self.rule5())
753            .field("rule6", &self.rule6())
754            .field("rule7", &self.rule7())
755            .finish()
756    }
757}
758impl W {
759    #[doc = "Bits 0:1 - Rule 0"]
760    #[inline(always)]
761    pub fn rule0(&mut self) -> Rule0W<Ram06RuleSpec> {
762        Rule0W::new(self, 0)
763    }
764    #[doc = "Bits 4:5 - Rule 1"]
765    #[inline(always)]
766    pub fn rule1(&mut self) -> Rule1W<Ram06RuleSpec> {
767        Rule1W::new(self, 4)
768    }
769    #[doc = "Bits 8:9 - Rule 2"]
770    #[inline(always)]
771    pub fn rule2(&mut self) -> Rule2W<Ram06RuleSpec> {
772        Rule2W::new(self, 8)
773    }
774    #[doc = "Bits 12:13 - Rule 3"]
775    #[inline(always)]
776    pub fn rule3(&mut self) -> Rule3W<Ram06RuleSpec> {
777        Rule3W::new(self, 12)
778    }
779    #[doc = "Bits 16:17 - Rule 4"]
780    #[inline(always)]
781    pub fn rule4(&mut self) -> Rule4W<Ram06RuleSpec> {
782        Rule4W::new(self, 16)
783    }
784    #[doc = "Bits 20:21 - Rule 5"]
785    #[inline(always)]
786    pub fn rule5(&mut self) -> Rule5W<Ram06RuleSpec> {
787        Rule5W::new(self, 20)
788    }
789    #[doc = "Bits 24:25 - Rule 6"]
790    #[inline(always)]
791    pub fn rule6(&mut self) -> Rule6W<Ram06RuleSpec> {
792        Rule6W::new(self, 24)
793    }
794    #[doc = "Bits 28:29 - Rule 7"]
795    #[inline(always)]
796    pub fn rule7(&mut self) -> Rule7W<Ram06RuleSpec> {
797        Rule7W::new(self, 28)
798    }
799}
800#[doc = "SRAM Partition 06 Rule(n) Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ram06_rule::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ram06_rule::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
801pub struct Ram06RuleSpec;
802impl crate::RegisterSpec for Ram06RuleSpec {
803    type Ux = u32;
804}
805#[doc = "`read()` method returns [`ram06_rule::R`](R) reader structure"]
806impl crate::Readable for Ram06RuleSpec {}
807#[doc = "`write(|w| ..)` method takes [`ram06_rule::W`](W) writer structure"]
808impl crate::Writable for Ram06RuleSpec {
809    type Safety = crate::Unsafe;
810    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
811    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
812}
813#[doc = "`reset()` method sets RAM06_RULE[%s]
814to value 0"]
815impl crate::Resettable for Ram06RuleSpec {
816    const RESET_VALUE: u32 = 0;
817}