lpc550x/ahb_secure_ctrl/
sec_ctrl_rom_mem_rule0.rs

1#[doc = "Register `SEC_CTRL_ROM_MEM_RULE0` reader"]
2pub struct R(crate::R<SEC_CTRL_ROM_MEM_RULE0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SEC_CTRL_ROM_MEM_RULE0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SEC_CTRL_ROM_MEM_RULE0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SEC_CTRL_ROM_MEM_RULE0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SEC_CTRL_ROM_MEM_RULE0` writer"]
17pub struct W(crate::W<SEC_CTRL_ROM_MEM_RULE0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SEC_CTRL_ROM_MEM_RULE0_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<SEC_CTRL_ROM_MEM_RULE0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SEC_CTRL_ROM_MEM_RULE0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `RULE0` reader - secure control rule0. it can be set when check_reg's write_lock is '0'"]
38pub type RULE0_R = crate::FieldReader<u8, RULE0_A>;
39#[doc = "secure control rule0. it can be set when check_reg's write_lock is '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-priviledge user access allowed."]
44    ENUM_NS_NP = 0,
45    #[doc = "1: Non-secure and Privilege access allowed."]
46    ENUM_NS_P = 1,
47    #[doc = "2: Secure and Non-priviledge user access allowed."]
48    ENUM_S_NP = 2,
49    #[doc = "3: Secure and Priviledge user access allowed."]
50    ENUM_S_P = 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::ENUM_NS_NP,
64            1 => RULE0_A::ENUM_NS_P,
65            2 => RULE0_A::ENUM_S_NP,
66            3 => RULE0_A::ENUM_S_P,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
71    #[inline(always)]
72    pub fn is_enum_ns_np(&self) -> bool {
73        *self == RULE0_A::ENUM_NS_NP
74    }
75    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
76    #[inline(always)]
77    pub fn is_enum_ns_p(&self) -> bool {
78        *self == RULE0_A::ENUM_NS_P
79    }
80    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
81    #[inline(always)]
82    pub fn is_enum_s_np(&self) -> bool {
83        *self == RULE0_A::ENUM_S_NP
84    }
85    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
86    #[inline(always)]
87    pub fn is_enum_s_p(&self) -> bool {
88        *self == RULE0_A::ENUM_S_P
89    }
90}
91#[doc = "Field `RULE0` writer - secure control rule0. it can be set when check_reg's write_lock is '0'"]
92pub type RULE0_W<'a, const O: u8> =
93    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE0_A, 2, O>;
94impl<'a, const O: u8> RULE0_W<'a, O> {
95    #[doc = "Non-secure and Non-priviledge user access allowed."]
96    #[inline(always)]
97    pub fn enum_ns_np(self) -> &'a mut W {
98        self.variant(RULE0_A::ENUM_NS_NP)
99    }
100    #[doc = "Non-secure and Privilege access allowed."]
101    #[inline(always)]
102    pub fn enum_ns_p(self) -> &'a mut W {
103        self.variant(RULE0_A::ENUM_NS_P)
104    }
105    #[doc = "Secure and Non-priviledge user access allowed."]
106    #[inline(always)]
107    pub fn enum_s_np(self) -> &'a mut W {
108        self.variant(RULE0_A::ENUM_S_NP)
109    }
110    #[doc = "Secure and Priviledge user access allowed."]
111    #[inline(always)]
112    pub fn enum_s_p(self) -> &'a mut W {
113        self.variant(RULE0_A::ENUM_S_P)
114    }
115}
116#[doc = "Field `RULE1` reader - secure control rule1. it can be set when check_reg's write_lock is '0'"]
117pub type RULE1_R = crate::FieldReader<u8, RULE1_A>;
118#[doc = "secure control rule1. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
123    ENUM_NS_NP = 0,
124    #[doc = "1: Non-secure and Privilege access allowed."]
125    ENUM_NS_P = 1,
126    #[doc = "2: Secure and Non-priviledge user access allowed."]
127    ENUM_S_NP = 2,
128    #[doc = "3: Secure and Priviledge user access allowed."]
129    ENUM_S_P = 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::ENUM_NS_NP,
143            1 => RULE1_A::ENUM_NS_P,
144            2 => RULE1_A::ENUM_S_NP,
145            3 => RULE1_A::ENUM_S_P,
146            _ => unreachable!(),
147        }
148    }
149    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
150    #[inline(always)]
151    pub fn is_enum_ns_np(&self) -> bool {
152        *self == RULE1_A::ENUM_NS_NP
153    }
154    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
155    #[inline(always)]
156    pub fn is_enum_ns_p(&self) -> bool {
157        *self == RULE1_A::ENUM_NS_P
158    }
159    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
160    #[inline(always)]
161    pub fn is_enum_s_np(&self) -> bool {
162        *self == RULE1_A::ENUM_S_NP
163    }
164    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
165    #[inline(always)]
166    pub fn is_enum_s_p(&self) -> bool {
167        *self == RULE1_A::ENUM_S_P
168    }
169}
170#[doc = "Field `RULE1` writer - secure control rule1. it can be set when check_reg's write_lock is '0'"]
171pub type RULE1_W<'a, const O: u8> =
172    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE1_A, 2, O>;
173impl<'a, const O: u8> RULE1_W<'a, O> {
174    #[doc = "Non-secure and Non-priviledge user access allowed."]
175    #[inline(always)]
176    pub fn enum_ns_np(self) -> &'a mut W {
177        self.variant(RULE1_A::ENUM_NS_NP)
178    }
179    #[doc = "Non-secure and Privilege access allowed."]
180    #[inline(always)]
181    pub fn enum_ns_p(self) -> &'a mut W {
182        self.variant(RULE1_A::ENUM_NS_P)
183    }
184    #[doc = "Secure and Non-priviledge user access allowed."]
185    #[inline(always)]
186    pub fn enum_s_np(self) -> &'a mut W {
187        self.variant(RULE1_A::ENUM_S_NP)
188    }
189    #[doc = "Secure and Priviledge user access allowed."]
190    #[inline(always)]
191    pub fn enum_s_p(self) -> &'a mut W {
192        self.variant(RULE1_A::ENUM_S_P)
193    }
194}
195#[doc = "Field `RULE2` reader - secure control rule2. it can be set when check_reg's write_lock is '0'"]
196pub type RULE2_R = crate::FieldReader<u8, RULE2_A>;
197#[doc = "secure control rule2. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
202    ENUM_NS_NP = 0,
203    #[doc = "1: Non-secure and Privilege access allowed."]
204    ENUM_NS_P = 1,
205    #[doc = "2: Secure and Non-priviledge user access allowed."]
206    ENUM_S_NP = 2,
207    #[doc = "3: Secure and Priviledge user access allowed."]
208    ENUM_S_P = 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::ENUM_NS_NP,
222            1 => RULE2_A::ENUM_NS_P,
223            2 => RULE2_A::ENUM_S_NP,
224            3 => RULE2_A::ENUM_S_P,
225            _ => unreachable!(),
226        }
227    }
228    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
229    #[inline(always)]
230    pub fn is_enum_ns_np(&self) -> bool {
231        *self == RULE2_A::ENUM_NS_NP
232    }
233    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
234    #[inline(always)]
235    pub fn is_enum_ns_p(&self) -> bool {
236        *self == RULE2_A::ENUM_NS_P
237    }
238    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
239    #[inline(always)]
240    pub fn is_enum_s_np(&self) -> bool {
241        *self == RULE2_A::ENUM_S_NP
242    }
243    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
244    #[inline(always)]
245    pub fn is_enum_s_p(&self) -> bool {
246        *self == RULE2_A::ENUM_S_P
247    }
248}
249#[doc = "Field `RULE2` writer - secure control rule2. it can be set when check_reg's write_lock is '0'"]
250pub type RULE2_W<'a, const O: u8> =
251    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE2_A, 2, O>;
252impl<'a, const O: u8> RULE2_W<'a, O> {
253    #[doc = "Non-secure and Non-priviledge user access allowed."]
254    #[inline(always)]
255    pub fn enum_ns_np(self) -> &'a mut W {
256        self.variant(RULE2_A::ENUM_NS_NP)
257    }
258    #[doc = "Non-secure and Privilege access allowed."]
259    #[inline(always)]
260    pub fn enum_ns_p(self) -> &'a mut W {
261        self.variant(RULE2_A::ENUM_NS_P)
262    }
263    #[doc = "Secure and Non-priviledge user access allowed."]
264    #[inline(always)]
265    pub fn enum_s_np(self) -> &'a mut W {
266        self.variant(RULE2_A::ENUM_S_NP)
267    }
268    #[doc = "Secure and Priviledge user access allowed."]
269    #[inline(always)]
270    pub fn enum_s_p(self) -> &'a mut W {
271        self.variant(RULE2_A::ENUM_S_P)
272    }
273}
274#[doc = "Field `RULE3` reader - secure control rule3. it can be set when check_reg's write_lock is '0'"]
275pub type RULE3_R = crate::FieldReader<u8, RULE3_A>;
276#[doc = "secure control rule3. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
281    ENUM_NS_NP = 0,
282    #[doc = "1: Non-secure and Privilege access allowed."]
283    ENUM_NS_P = 1,
284    #[doc = "2: Secure and Non-priviledge user access allowed."]
285    ENUM_S_NP = 2,
286    #[doc = "3: Secure and Priviledge user access allowed."]
287    ENUM_S_P = 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::ENUM_NS_NP,
301            1 => RULE3_A::ENUM_NS_P,
302            2 => RULE3_A::ENUM_S_NP,
303            3 => RULE3_A::ENUM_S_P,
304            _ => unreachable!(),
305        }
306    }
307    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
308    #[inline(always)]
309    pub fn is_enum_ns_np(&self) -> bool {
310        *self == RULE3_A::ENUM_NS_NP
311    }
312    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
313    #[inline(always)]
314    pub fn is_enum_ns_p(&self) -> bool {
315        *self == RULE3_A::ENUM_NS_P
316    }
317    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
318    #[inline(always)]
319    pub fn is_enum_s_np(&self) -> bool {
320        *self == RULE3_A::ENUM_S_NP
321    }
322    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
323    #[inline(always)]
324    pub fn is_enum_s_p(&self) -> bool {
325        *self == RULE3_A::ENUM_S_P
326    }
327}
328#[doc = "Field `RULE3` writer - secure control rule3. it can be set when check_reg's write_lock is '0'"]
329pub type RULE3_W<'a, const O: u8> =
330    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE3_A, 2, O>;
331impl<'a, const O: u8> RULE3_W<'a, O> {
332    #[doc = "Non-secure and Non-priviledge user access allowed."]
333    #[inline(always)]
334    pub fn enum_ns_np(self) -> &'a mut W {
335        self.variant(RULE3_A::ENUM_NS_NP)
336    }
337    #[doc = "Non-secure and Privilege access allowed."]
338    #[inline(always)]
339    pub fn enum_ns_p(self) -> &'a mut W {
340        self.variant(RULE3_A::ENUM_NS_P)
341    }
342    #[doc = "Secure and Non-priviledge user access allowed."]
343    #[inline(always)]
344    pub fn enum_s_np(self) -> &'a mut W {
345        self.variant(RULE3_A::ENUM_S_NP)
346    }
347    #[doc = "Secure and Priviledge user access allowed."]
348    #[inline(always)]
349    pub fn enum_s_p(self) -> &'a mut W {
350        self.variant(RULE3_A::ENUM_S_P)
351    }
352}
353#[doc = "Field `RULE4` reader - secure control rule4. it can be set when check_reg's write_lock is '0'"]
354pub type RULE4_R = crate::FieldReader<u8, RULE4_A>;
355#[doc = "secure control rule4. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
360    ENUM_NS_NP = 0,
361    #[doc = "1: Non-secure and Privilege access allowed."]
362    ENUM_NS_P = 1,
363    #[doc = "2: Secure and Non-priviledge user access allowed."]
364    ENUM_S_NP = 2,
365    #[doc = "3: Secure and Priviledge user access allowed."]
366    ENUM_S_P = 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::ENUM_NS_NP,
380            1 => RULE4_A::ENUM_NS_P,
381            2 => RULE4_A::ENUM_S_NP,
382            3 => RULE4_A::ENUM_S_P,
383            _ => unreachable!(),
384        }
385    }
386    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
387    #[inline(always)]
388    pub fn is_enum_ns_np(&self) -> bool {
389        *self == RULE4_A::ENUM_NS_NP
390    }
391    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
392    #[inline(always)]
393    pub fn is_enum_ns_p(&self) -> bool {
394        *self == RULE4_A::ENUM_NS_P
395    }
396    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
397    #[inline(always)]
398    pub fn is_enum_s_np(&self) -> bool {
399        *self == RULE4_A::ENUM_S_NP
400    }
401    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
402    #[inline(always)]
403    pub fn is_enum_s_p(&self) -> bool {
404        *self == RULE4_A::ENUM_S_P
405    }
406}
407#[doc = "Field `RULE4` writer - secure control rule4. it can be set when check_reg's write_lock is '0'"]
408pub type RULE4_W<'a, const O: u8> =
409    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE4_A, 2, O>;
410impl<'a, const O: u8> RULE4_W<'a, O> {
411    #[doc = "Non-secure and Non-priviledge user access allowed."]
412    #[inline(always)]
413    pub fn enum_ns_np(self) -> &'a mut W {
414        self.variant(RULE4_A::ENUM_NS_NP)
415    }
416    #[doc = "Non-secure and Privilege access allowed."]
417    #[inline(always)]
418    pub fn enum_ns_p(self) -> &'a mut W {
419        self.variant(RULE4_A::ENUM_NS_P)
420    }
421    #[doc = "Secure and Non-priviledge user access allowed."]
422    #[inline(always)]
423    pub fn enum_s_np(self) -> &'a mut W {
424        self.variant(RULE4_A::ENUM_S_NP)
425    }
426    #[doc = "Secure and Priviledge user access allowed."]
427    #[inline(always)]
428    pub fn enum_s_p(self) -> &'a mut W {
429        self.variant(RULE4_A::ENUM_S_P)
430    }
431}
432#[doc = "Field `RULE5` reader - secure control rule5. it can be set when check_reg's write_lock is '0'"]
433pub type RULE5_R = crate::FieldReader<u8, RULE5_A>;
434#[doc = "secure control rule5. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
439    ENUM_NS_NP = 0,
440    #[doc = "1: Non-secure and Privilege access allowed."]
441    ENUM_NS_P = 1,
442    #[doc = "2: Secure and Non-priviledge user access allowed."]
443    ENUM_S_NP = 2,
444    #[doc = "3: Secure and Priviledge user access allowed."]
445    ENUM_S_P = 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::ENUM_NS_NP,
459            1 => RULE5_A::ENUM_NS_P,
460            2 => RULE5_A::ENUM_S_NP,
461            3 => RULE5_A::ENUM_S_P,
462            _ => unreachable!(),
463        }
464    }
465    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
466    #[inline(always)]
467    pub fn is_enum_ns_np(&self) -> bool {
468        *self == RULE5_A::ENUM_NS_NP
469    }
470    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
471    #[inline(always)]
472    pub fn is_enum_ns_p(&self) -> bool {
473        *self == RULE5_A::ENUM_NS_P
474    }
475    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
476    #[inline(always)]
477    pub fn is_enum_s_np(&self) -> bool {
478        *self == RULE5_A::ENUM_S_NP
479    }
480    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
481    #[inline(always)]
482    pub fn is_enum_s_p(&self) -> bool {
483        *self == RULE5_A::ENUM_S_P
484    }
485}
486#[doc = "Field `RULE5` writer - secure control rule5. it can be set when check_reg's write_lock is '0'"]
487pub type RULE5_W<'a, const O: u8> =
488    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE5_A, 2, O>;
489impl<'a, const O: u8> RULE5_W<'a, O> {
490    #[doc = "Non-secure and Non-priviledge user access allowed."]
491    #[inline(always)]
492    pub fn enum_ns_np(self) -> &'a mut W {
493        self.variant(RULE5_A::ENUM_NS_NP)
494    }
495    #[doc = "Non-secure and Privilege access allowed."]
496    #[inline(always)]
497    pub fn enum_ns_p(self) -> &'a mut W {
498        self.variant(RULE5_A::ENUM_NS_P)
499    }
500    #[doc = "Secure and Non-priviledge user access allowed."]
501    #[inline(always)]
502    pub fn enum_s_np(self) -> &'a mut W {
503        self.variant(RULE5_A::ENUM_S_NP)
504    }
505    #[doc = "Secure and Priviledge user access allowed."]
506    #[inline(always)]
507    pub fn enum_s_p(self) -> &'a mut W {
508        self.variant(RULE5_A::ENUM_S_P)
509    }
510}
511#[doc = "Field `RULE6` reader - secure control rule6. it can be set when check_reg's write_lock is '0'"]
512pub type RULE6_R = crate::FieldReader<u8, RULE6_A>;
513#[doc = "secure control rule6. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
518    ENUM_NS_NP = 0,
519    #[doc = "1: Non-secure and Privilege access allowed."]
520    ENUM_NS_P = 1,
521    #[doc = "2: Secure and Non-priviledge user access allowed."]
522    ENUM_S_NP = 2,
523    #[doc = "3: Secure and Priviledge user access allowed."]
524    ENUM_S_P = 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::ENUM_NS_NP,
538            1 => RULE6_A::ENUM_NS_P,
539            2 => RULE6_A::ENUM_S_NP,
540            3 => RULE6_A::ENUM_S_P,
541            _ => unreachable!(),
542        }
543    }
544    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
545    #[inline(always)]
546    pub fn is_enum_ns_np(&self) -> bool {
547        *self == RULE6_A::ENUM_NS_NP
548    }
549    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
550    #[inline(always)]
551    pub fn is_enum_ns_p(&self) -> bool {
552        *self == RULE6_A::ENUM_NS_P
553    }
554    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
555    #[inline(always)]
556    pub fn is_enum_s_np(&self) -> bool {
557        *self == RULE6_A::ENUM_S_NP
558    }
559    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
560    #[inline(always)]
561    pub fn is_enum_s_p(&self) -> bool {
562        *self == RULE6_A::ENUM_S_P
563    }
564}
565#[doc = "Field `RULE6` writer - secure control rule6. it can be set when check_reg's write_lock is '0'"]
566pub type RULE6_W<'a, const O: u8> =
567    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE6_A, 2, O>;
568impl<'a, const O: u8> RULE6_W<'a, O> {
569    #[doc = "Non-secure and Non-priviledge user access allowed."]
570    #[inline(always)]
571    pub fn enum_ns_np(self) -> &'a mut W {
572        self.variant(RULE6_A::ENUM_NS_NP)
573    }
574    #[doc = "Non-secure and Privilege access allowed."]
575    #[inline(always)]
576    pub fn enum_ns_p(self) -> &'a mut W {
577        self.variant(RULE6_A::ENUM_NS_P)
578    }
579    #[doc = "Secure and Non-priviledge user access allowed."]
580    #[inline(always)]
581    pub fn enum_s_np(self) -> &'a mut W {
582        self.variant(RULE6_A::ENUM_S_NP)
583    }
584    #[doc = "Secure and Priviledge user access allowed."]
585    #[inline(always)]
586    pub fn enum_s_p(self) -> &'a mut W {
587        self.variant(RULE6_A::ENUM_S_P)
588    }
589}
590#[doc = "Field `RULE7` reader - secure control rule7. it can be set when check_reg's write_lock is '0'"]
591pub type RULE7_R = crate::FieldReader<u8, RULE7_A>;
592#[doc = "secure control rule7. it can be set when check_reg's write_lock is '0'\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-priviledge user access allowed."]
597    ENUM_NS_NP = 0,
598    #[doc = "1: Non-secure and Privilege access allowed."]
599    ENUM_NS_P = 1,
600    #[doc = "2: Secure and Non-priviledge user access allowed."]
601    ENUM_S_NP = 2,
602    #[doc = "3: Secure and Priviledge user access allowed."]
603    ENUM_S_P = 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::ENUM_NS_NP,
617            1 => RULE7_A::ENUM_NS_P,
618            2 => RULE7_A::ENUM_S_NP,
619            3 => RULE7_A::ENUM_S_P,
620            _ => unreachable!(),
621        }
622    }
623    #[doc = "Checks if the value of the field is `ENUM_NS_NP`"]
624    #[inline(always)]
625    pub fn is_enum_ns_np(&self) -> bool {
626        *self == RULE7_A::ENUM_NS_NP
627    }
628    #[doc = "Checks if the value of the field is `ENUM_NS_P`"]
629    #[inline(always)]
630    pub fn is_enum_ns_p(&self) -> bool {
631        *self == RULE7_A::ENUM_NS_P
632    }
633    #[doc = "Checks if the value of the field is `ENUM_S_NP`"]
634    #[inline(always)]
635    pub fn is_enum_s_np(&self) -> bool {
636        *self == RULE7_A::ENUM_S_NP
637    }
638    #[doc = "Checks if the value of the field is `ENUM_S_P`"]
639    #[inline(always)]
640    pub fn is_enum_s_p(&self) -> bool {
641        *self == RULE7_A::ENUM_S_P
642    }
643}
644#[doc = "Field `RULE7` writer - secure control rule7. it can be set when check_reg's write_lock is '0'"]
645pub type RULE7_W<'a, const O: u8> =
646    crate::FieldWriterSafe<'a, u32, SEC_CTRL_ROM_MEM_RULE0_SPEC, u8, RULE7_A, 2, O>;
647impl<'a, const O: u8> RULE7_W<'a, O> {
648    #[doc = "Non-secure and Non-priviledge user access allowed."]
649    #[inline(always)]
650    pub fn enum_ns_np(self) -> &'a mut W {
651        self.variant(RULE7_A::ENUM_NS_NP)
652    }
653    #[doc = "Non-secure and Privilege access allowed."]
654    #[inline(always)]
655    pub fn enum_ns_p(self) -> &'a mut W {
656        self.variant(RULE7_A::ENUM_NS_P)
657    }
658    #[doc = "Secure and Non-priviledge user access allowed."]
659    #[inline(always)]
660    pub fn enum_s_np(self) -> &'a mut W {
661        self.variant(RULE7_A::ENUM_S_NP)
662    }
663    #[doc = "Secure and Priviledge user access allowed."]
664    #[inline(always)]
665    pub fn enum_s_p(self) -> &'a mut W {
666        self.variant(RULE7_A::ENUM_S_P)
667    }
668}
669impl R {
670    #[doc = "Bits 0:1 - secure control rule0. it can be set when check_reg's write_lock is '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 - secure control rule1. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule2. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule3. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule4. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule5. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule6. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule7. it can be set when check_reg's write_lock is '0'"]
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 - secure control rule0. it can be set when check_reg's write_lock is '0'"]
713    #[inline(always)]
714    pub fn rule0(&mut self) -> RULE0_W<0> {
715        RULE0_W::new(self)
716    }
717    #[doc = "Bits 4:5 - secure control rule1. it can be set when check_reg's write_lock is '0'"]
718    #[inline(always)]
719    pub fn rule1(&mut self) -> RULE1_W<4> {
720        RULE1_W::new(self)
721    }
722    #[doc = "Bits 8:9 - secure control rule2. it can be set when check_reg's write_lock is '0'"]
723    #[inline(always)]
724    pub fn rule2(&mut self) -> RULE2_W<8> {
725        RULE2_W::new(self)
726    }
727    #[doc = "Bits 12:13 - secure control rule3. it can be set when check_reg's write_lock is '0'"]
728    #[inline(always)]
729    pub fn rule3(&mut self) -> RULE3_W<12> {
730        RULE3_W::new(self)
731    }
732    #[doc = "Bits 16:17 - secure control rule4. it can be set when check_reg's write_lock is '0'"]
733    #[inline(always)]
734    pub fn rule4(&mut self) -> RULE4_W<16> {
735        RULE4_W::new(self)
736    }
737    #[doc = "Bits 20:21 - secure control rule5. it can be set when check_reg's write_lock is '0'"]
738    #[inline(always)]
739    pub fn rule5(&mut self) -> RULE5_W<20> {
740        RULE5_W::new(self)
741    }
742    #[doc = "Bits 24:25 - secure control rule6. it can be set when check_reg's write_lock is '0'"]
743    #[inline(always)]
744    pub fn rule6(&mut self) -> RULE6_W<24> {
745        RULE6_W::new(self)
746    }
747    #[doc = "Bits 28:29 - secure control rule7. it can be set when check_reg's write_lock is '0'"]
748    #[inline(always)]
749    pub fn rule7(&mut self) -> RULE7_W<28> {
750        RULE7_W::new(self)
751    }
752    #[doc = "Writes raw bits to the register."]
753    #[inline(always)]
754    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
755        self.0.bits(bits);
756        self
757    }
758}
759#[doc = "Security access rules for ROM sector 0 to sector 31. Each ROM sector is 4 Kbytes. There are 32 ROM sectors in total.\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 [sec_ctrl_rom_mem_rule0](index.html) module"]
760pub struct SEC_CTRL_ROM_MEM_RULE0_SPEC;
761impl crate::RegisterSpec for SEC_CTRL_ROM_MEM_RULE0_SPEC {
762    type Ux = u32;
763}
764#[doc = "`read()` method returns [sec_ctrl_rom_mem_rule0::R](R) reader structure"]
765impl crate::Readable for SEC_CTRL_ROM_MEM_RULE0_SPEC {
766    type Reader = R;
767}
768#[doc = "`write(|w| ..)` method takes [sec_ctrl_rom_mem_rule0::W](W) writer structure"]
769impl crate::Writable for SEC_CTRL_ROM_MEM_RULE0_SPEC {
770    type Writer = W;
771}
772#[doc = "`reset()` method sets SEC_CTRL_ROM_MEM_RULE0 to value 0"]
773impl crate::Resettable for SEC_CTRL_ROM_MEM_RULE0_SPEC {
774    #[inline(always)]
775    fn reset_value() -> Self::Ux {
776        0
777    }
778}