mimxrt595s/ahb_secure_ctrl/
ram19_rule.rs

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