mimxrt685s_pac/ahb_secure_ctrl/
cm33_lock_reg.rs

1#[doc = "Register `CM33_LOCK_REG` reader"]
2pub type R = crate::R<Cm33LockRegSpec>;
3#[doc = "Register `CM33_LOCK_REG` writer"]
4pub type W = crate::W<Cm33LockRegSpec>;
5#[doc = "m33 LOCKNSVTOR write-lock.\n\nValue on reset: 2"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum LockNsVtor {
10    #[doc = "1: Restrictive mode."]
11    Blocked = 1,
12    #[doc = "2: Writable."]
13    Writable = 2,
14}
15impl From<LockNsVtor> for u8 {
16    #[inline(always)]
17    fn from(variant: LockNsVtor) -> Self {
18        variant as _
19    }
20}
21impl crate::FieldSpec for LockNsVtor {
22    type Ux = u8;
23}
24impl crate::IsEnum for LockNsVtor {}
25#[doc = "Field `LOCK_NS_VTOR` reader - m33 LOCKNSVTOR write-lock."]
26pub type LockNsVtorR = crate::FieldReader<LockNsVtor>;
27impl LockNsVtorR {
28    #[doc = "Get enumerated values variant"]
29    #[inline(always)]
30    pub const fn variant(&self) -> Option<LockNsVtor> {
31        match self.bits {
32            1 => Some(LockNsVtor::Blocked),
33            2 => Some(LockNsVtor::Writable),
34            _ => None,
35        }
36    }
37    #[doc = "Restrictive mode."]
38    #[inline(always)]
39    pub fn is_blocked(&self) -> bool {
40        *self == LockNsVtor::Blocked
41    }
42    #[doc = "Writable."]
43    #[inline(always)]
44    pub fn is_writable(&self) -> bool {
45        *self == LockNsVtor::Writable
46    }
47}
48#[doc = "Field `LOCK_NS_VTOR` writer - m33 LOCKNSVTOR write-lock."]
49pub type LockNsVtorW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockNsVtor>;
50impl<'a, REG> LockNsVtorW<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53    REG::Ux: From<u8>,
54{
55    #[doc = "Restrictive mode."]
56    #[inline(always)]
57    pub fn blocked(self) -> &'a mut crate::W<REG> {
58        self.variant(LockNsVtor::Blocked)
59    }
60    #[doc = "Writable."]
61    #[inline(always)]
62    pub fn writable(self) -> &'a mut crate::W<REG> {
63        self.variant(LockNsVtor::Writable)
64    }
65}
66#[doc = "m33 LOCKNSMPU write-lock.\n\nValue on reset: 2"]
67#[cfg_attr(feature = "defmt", derive(defmt::Format))]
68#[derive(Clone, Copy, Debug, PartialEq, Eq)]
69#[repr(u8)]
70pub enum LockNsMpu {
71    #[doc = "1: Restricted mode."]
72    Blocked = 1,
73    #[doc = "2: Writable."]
74    Writable = 2,
75}
76impl From<LockNsMpu> for u8 {
77    #[inline(always)]
78    fn from(variant: LockNsMpu) -> Self {
79        variant as _
80    }
81}
82impl crate::FieldSpec for LockNsMpu {
83    type Ux = u8;
84}
85impl crate::IsEnum for LockNsMpu {}
86#[doc = "Field `LOCK_NS_MPU` reader - m33 LOCKNSMPU write-lock."]
87pub type LockNsMpuR = crate::FieldReader<LockNsMpu>;
88impl LockNsMpuR {
89    #[doc = "Get enumerated values variant"]
90    #[inline(always)]
91    pub const fn variant(&self) -> Option<LockNsMpu> {
92        match self.bits {
93            1 => Some(LockNsMpu::Blocked),
94            2 => Some(LockNsMpu::Writable),
95            _ => None,
96        }
97    }
98    #[doc = "Restricted mode."]
99    #[inline(always)]
100    pub fn is_blocked(&self) -> bool {
101        *self == LockNsMpu::Blocked
102    }
103    #[doc = "Writable."]
104    #[inline(always)]
105    pub fn is_writable(&self) -> bool {
106        *self == LockNsMpu::Writable
107    }
108}
109#[doc = "Field `LOCK_NS_MPU` writer - m33 LOCKNSMPU write-lock."]
110pub type LockNsMpuW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockNsMpu>;
111impl<'a, REG> LockNsMpuW<'a, REG>
112where
113    REG: crate::Writable + crate::RegisterSpec,
114    REG::Ux: From<u8>,
115{
116    #[doc = "Restricted mode."]
117    #[inline(always)]
118    pub fn blocked(self) -> &'a mut crate::W<REG> {
119        self.variant(LockNsMpu::Blocked)
120    }
121    #[doc = "Writable."]
122    #[inline(always)]
123    pub fn writable(self) -> &'a mut crate::W<REG> {
124        self.variant(LockNsMpu::Writable)
125    }
126}
127#[doc = "m33 LOCKSVTOR write-lock.\n\nValue on reset: 2"]
128#[cfg_attr(feature = "defmt", derive(defmt::Format))]
129#[derive(Clone, Copy, Debug, PartialEq, Eq)]
130#[repr(u8)]
131pub enum LockSVtor {
132    #[doc = "1: Restricted mode."]
133    Blocked = 1,
134    #[doc = "2: Writable."]
135    Writable = 2,
136}
137impl From<LockSVtor> for u8 {
138    #[inline(always)]
139    fn from(variant: LockSVtor) -> Self {
140        variant as _
141    }
142}
143impl crate::FieldSpec for LockSVtor {
144    type Ux = u8;
145}
146impl crate::IsEnum for LockSVtor {}
147#[doc = "Field `LOCK_S_VTOR` reader - m33 LOCKSVTOR write-lock."]
148pub type LockSVtorR = crate::FieldReader<LockSVtor>;
149impl LockSVtorR {
150    #[doc = "Get enumerated values variant"]
151    #[inline(always)]
152    pub const fn variant(&self) -> Option<LockSVtor> {
153        match self.bits {
154            1 => Some(LockSVtor::Blocked),
155            2 => Some(LockSVtor::Writable),
156            _ => None,
157        }
158    }
159    #[doc = "Restricted mode."]
160    #[inline(always)]
161    pub fn is_blocked(&self) -> bool {
162        *self == LockSVtor::Blocked
163    }
164    #[doc = "Writable."]
165    #[inline(always)]
166    pub fn is_writable(&self) -> bool {
167        *self == LockSVtor::Writable
168    }
169}
170#[doc = "Field `LOCK_S_VTOR` writer - m33 LOCKSVTOR write-lock."]
171pub type LockSVtorW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockSVtor>;
172impl<'a, REG> LockSVtorW<'a, REG>
173where
174    REG: crate::Writable + crate::RegisterSpec,
175    REG::Ux: From<u8>,
176{
177    #[doc = "Restricted mode."]
178    #[inline(always)]
179    pub fn blocked(self) -> &'a mut crate::W<REG> {
180        self.variant(LockSVtor::Blocked)
181    }
182    #[doc = "Writable."]
183    #[inline(always)]
184    pub fn writable(self) -> &'a mut crate::W<REG> {
185        self.variant(LockSVtor::Writable)
186    }
187}
188#[doc = "m33 LOCKSMPU write-lock.\n\nValue on reset: 2"]
189#[cfg_attr(feature = "defmt", derive(defmt::Format))]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191#[repr(u8)]
192pub enum LockSMpu {
193    #[doc = "1: Restricted mode."]
194    Blocked = 1,
195    #[doc = "2: Writable."]
196    Writable = 2,
197}
198impl From<LockSMpu> for u8 {
199    #[inline(always)]
200    fn from(variant: LockSMpu) -> Self {
201        variant as _
202    }
203}
204impl crate::FieldSpec for LockSMpu {
205    type Ux = u8;
206}
207impl crate::IsEnum for LockSMpu {}
208#[doc = "Field `LOCK_S_MPU` reader - m33 LOCKSMPU write-lock."]
209pub type LockSMpuR = crate::FieldReader<LockSMpu>;
210impl LockSMpuR {
211    #[doc = "Get enumerated values variant"]
212    #[inline(always)]
213    pub const fn variant(&self) -> Option<LockSMpu> {
214        match self.bits {
215            1 => Some(LockSMpu::Blocked),
216            2 => Some(LockSMpu::Writable),
217            _ => None,
218        }
219    }
220    #[doc = "Restricted mode."]
221    #[inline(always)]
222    pub fn is_blocked(&self) -> bool {
223        *self == LockSMpu::Blocked
224    }
225    #[doc = "Writable."]
226    #[inline(always)]
227    pub fn is_writable(&self) -> bool {
228        *self == LockSMpu::Writable
229    }
230}
231#[doc = "Field `LOCK_S_MPU` writer - m33 LOCKSMPU write-lock."]
232pub type LockSMpuW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockSMpu>;
233impl<'a, REG> LockSMpuW<'a, REG>
234where
235    REG: crate::Writable + crate::RegisterSpec,
236    REG::Ux: From<u8>,
237{
238    #[doc = "Restricted mode."]
239    #[inline(always)]
240    pub fn blocked(self) -> &'a mut crate::W<REG> {
241        self.variant(LockSMpu::Blocked)
242    }
243    #[doc = "Writable."]
244    #[inline(always)]
245    pub fn writable(self) -> &'a mut crate::W<REG> {
246        self.variant(LockSMpu::Writable)
247    }
248}
249#[doc = "m33 LOCKSAU write-lock.\n\nValue on reset: 2"]
250#[cfg_attr(feature = "defmt", derive(defmt::Format))]
251#[derive(Clone, Copy, Debug, PartialEq, Eq)]
252#[repr(u8)]
253pub enum LockSau {
254    #[doc = "1: Restricted mode."]
255    Blocked = 1,
256    #[doc = "2: Writable."]
257    Writable = 2,
258}
259impl From<LockSau> for u8 {
260    #[inline(always)]
261    fn from(variant: LockSau) -> Self {
262        variant as _
263    }
264}
265impl crate::FieldSpec for LockSau {
266    type Ux = u8;
267}
268impl crate::IsEnum for LockSau {}
269#[doc = "Field `LOCK_SAU` reader - m33 LOCKSAU write-lock."]
270pub type LockSauR = crate::FieldReader<LockSau>;
271impl LockSauR {
272    #[doc = "Get enumerated values variant"]
273    #[inline(always)]
274    pub const fn variant(&self) -> Option<LockSau> {
275        match self.bits {
276            1 => Some(LockSau::Blocked),
277            2 => Some(LockSau::Writable),
278            _ => None,
279        }
280    }
281    #[doc = "Restricted mode."]
282    #[inline(always)]
283    pub fn is_blocked(&self) -> bool {
284        *self == LockSau::Blocked
285    }
286    #[doc = "Writable."]
287    #[inline(always)]
288    pub fn is_writable(&self) -> bool {
289        *self == LockSau::Writable
290    }
291}
292#[doc = "Field `LOCK_SAU` writer - m33 LOCKSAU write-lock."]
293pub type LockSauW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockSau>;
294impl<'a, REG> LockSauW<'a, REG>
295where
296    REG: crate::Writable + crate::RegisterSpec,
297    REG::Ux: From<u8>,
298{
299    #[doc = "Restricted mode."]
300    #[inline(always)]
301    pub fn blocked(self) -> &'a mut crate::W<REG> {
302        self.variant(LockSau::Blocked)
303    }
304    #[doc = "Writable."]
305    #[inline(always)]
306    pub fn writable(self) -> &'a mut crate::W<REG> {
307        self.variant(LockSau::Writable)
308    }
309}
310#[doc = "CM33_LOCK_REG_LOCK write-lock.\n\nValue on reset: 2"]
311#[cfg_attr(feature = "defmt", derive(defmt::Format))]
312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
313#[repr(u8)]
314pub enum Cm33LockRegLock {
315    #[doc = "1: Restricted mode."]
316    Blocked = 1,
317    #[doc = "2: Writable."]
318    Writable = 2,
319}
320impl From<Cm33LockRegLock> for u8 {
321    #[inline(always)]
322    fn from(variant: Cm33LockRegLock) -> Self {
323        variant as _
324    }
325}
326impl crate::FieldSpec for Cm33LockRegLock {
327    type Ux = u8;
328}
329impl crate::IsEnum for Cm33LockRegLock {}
330#[doc = "Field `CM33_LOCK_REG_LOCK` reader - CM33_LOCK_REG_LOCK write-lock."]
331pub type Cm33LockRegLockR = crate::FieldReader<Cm33LockRegLock>;
332impl Cm33LockRegLockR {
333    #[doc = "Get enumerated values variant"]
334    #[inline(always)]
335    pub const fn variant(&self) -> Option<Cm33LockRegLock> {
336        match self.bits {
337            1 => Some(Cm33LockRegLock::Blocked),
338            2 => Some(Cm33LockRegLock::Writable),
339            _ => None,
340        }
341    }
342    #[doc = "Restricted mode."]
343    #[inline(always)]
344    pub fn is_blocked(&self) -> bool {
345        *self == Cm33LockRegLock::Blocked
346    }
347    #[doc = "Writable."]
348    #[inline(always)]
349    pub fn is_writable(&self) -> bool {
350        *self == Cm33LockRegLock::Writable
351    }
352}
353#[doc = "Field `CM33_LOCK_REG_LOCK` writer - CM33_LOCK_REG_LOCK write-lock."]
354pub type Cm33LockRegLockW<'a, REG> = crate::FieldWriter<'a, REG, 2, Cm33LockRegLock>;
355impl<'a, REG> Cm33LockRegLockW<'a, REG>
356where
357    REG: crate::Writable + crate::RegisterSpec,
358    REG::Ux: From<u8>,
359{
360    #[doc = "Restricted mode."]
361    #[inline(always)]
362    pub fn blocked(self) -> &'a mut crate::W<REG> {
363        self.variant(Cm33LockRegLock::Blocked)
364    }
365    #[doc = "Writable."]
366    #[inline(always)]
367    pub fn writable(self) -> &'a mut crate::W<REG> {
368        self.variant(Cm33LockRegLock::Writable)
369    }
370}
371impl R {
372    #[doc = "Bits 0:1 - m33 LOCKNSVTOR write-lock."]
373    #[inline(always)]
374    pub fn lock_ns_vtor(&self) -> LockNsVtorR {
375        LockNsVtorR::new((self.bits & 3) as u8)
376    }
377    #[doc = "Bits 2:3 - m33 LOCKNSMPU write-lock."]
378    #[inline(always)]
379    pub fn lock_ns_mpu(&self) -> LockNsMpuR {
380        LockNsMpuR::new(((self.bits >> 2) & 3) as u8)
381    }
382    #[doc = "Bits 4:5 - m33 LOCKSVTOR write-lock."]
383    #[inline(always)]
384    pub fn lock_s_vtor(&self) -> LockSVtorR {
385        LockSVtorR::new(((self.bits >> 4) & 3) as u8)
386    }
387    #[doc = "Bits 6:7 - m33 LOCKSMPU write-lock."]
388    #[inline(always)]
389    pub fn lock_s_mpu(&self) -> LockSMpuR {
390        LockSMpuR::new(((self.bits >> 6) & 3) as u8)
391    }
392    #[doc = "Bits 8:9 - m33 LOCKSAU write-lock."]
393    #[inline(always)]
394    pub fn lock_sau(&self) -> LockSauR {
395        LockSauR::new(((self.bits >> 8) & 3) as u8)
396    }
397    #[doc = "Bits 30:31 - CM33_LOCK_REG_LOCK write-lock."]
398    #[inline(always)]
399    pub fn cm33_lock_reg_lock(&self) -> Cm33LockRegLockR {
400        Cm33LockRegLockR::new(((self.bits >> 30) & 3) as u8)
401    }
402}
403#[cfg(feature = "debug")]
404impl core::fmt::Debug for R {
405    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
406        f.debug_struct("CM33_LOCK_REG")
407            .field("lock_ns_vtor", &self.lock_ns_vtor())
408            .field("lock_ns_mpu", &self.lock_ns_mpu())
409            .field("lock_s_vtor", &self.lock_s_vtor())
410            .field("lock_s_mpu", &self.lock_s_mpu())
411            .field("lock_sau", &self.lock_sau())
412            .field("cm33_lock_reg_lock", &self.cm33_lock_reg_lock())
413            .finish()
414    }
415}
416impl W {
417    #[doc = "Bits 0:1 - m33 LOCKNSVTOR write-lock."]
418    #[inline(always)]
419    pub fn lock_ns_vtor(&mut self) -> LockNsVtorW<Cm33LockRegSpec> {
420        LockNsVtorW::new(self, 0)
421    }
422    #[doc = "Bits 2:3 - m33 LOCKNSMPU write-lock."]
423    #[inline(always)]
424    pub fn lock_ns_mpu(&mut self) -> LockNsMpuW<Cm33LockRegSpec> {
425        LockNsMpuW::new(self, 2)
426    }
427    #[doc = "Bits 4:5 - m33 LOCKSVTOR write-lock."]
428    #[inline(always)]
429    pub fn lock_s_vtor(&mut self) -> LockSVtorW<Cm33LockRegSpec> {
430        LockSVtorW::new(self, 4)
431    }
432    #[doc = "Bits 6:7 - m33 LOCKSMPU write-lock."]
433    #[inline(always)]
434    pub fn lock_s_mpu(&mut self) -> LockSMpuW<Cm33LockRegSpec> {
435        LockSMpuW::new(self, 6)
436    }
437    #[doc = "Bits 8:9 - m33 LOCKSAU write-lock."]
438    #[inline(always)]
439    pub fn lock_sau(&mut self) -> LockSauW<Cm33LockRegSpec> {
440        LockSauW::new(self, 8)
441    }
442    #[doc = "Bits 30:31 - CM33_LOCK_REG_LOCK write-lock."]
443    #[inline(always)]
444    pub fn cm33_lock_reg_lock(&mut self) -> Cm33LockRegLockW<Cm33LockRegSpec> {
445        Cm33LockRegLockW::new(self, 30)
446    }
447}
448#[doc = "m33 lock control register\n\nYou can [`read`](crate::Reg::read) this register and get [`cm33_lock_reg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cm33_lock_reg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
449pub struct Cm33LockRegSpec;
450impl crate::RegisterSpec for Cm33LockRegSpec {
451    type Ux = u32;
452}
453#[doc = "`read()` method returns [`cm33_lock_reg::R`](R) reader structure"]
454impl crate::Readable for Cm33LockRegSpec {}
455#[doc = "`write(|w| ..)` method takes [`cm33_lock_reg::W`](W) writer structure"]
456impl crate::Writable for Cm33LockRegSpec {
457    type Safety = crate::Unsafe;
458    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
459    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
460}
461#[doc = "`reset()` method sets CM33_LOCK_REG to value 0x8000_02aa"]
462impl crate::Resettable for Cm33LockRegSpec {
463    const RESET_VALUE: u32 = 0x8000_02aa;
464}