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