1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Security Attribution Unit"]
28unsafe impl ::core::marker::Send for super::Sau {}
29unsafe impl ::core::marker::Sync for super::Sau {}
30impl super::Sau {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "Control Register"]
38 #[inline(always)]
39 pub const fn ctrl(&self) -> &'static crate::common::Reg<self::Ctrl_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Ctrl_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46
47 #[doc = "Type Register"]
48 #[inline(always)]
49 pub const fn r#type(&self) -> &'static crate::common::Reg<self::Type_SPEC, crate::common::R> {
50 unsafe {
51 crate::common::Reg::<self::Type_SPEC, crate::common::R>::from_ptr(
52 self._svd2pac_as_ptr().add(4usize),
53 )
54 }
55 }
56
57 #[doc = "Region Number Register"]
58 #[inline(always)]
59 pub const fn rnr(&self) -> &'static crate::common::Reg<self::Rnr_SPEC, crate::common::RW> {
60 unsafe {
61 crate::common::Reg::<self::Rnr_SPEC, crate::common::RW>::from_ptr(
62 self._svd2pac_as_ptr().add(8usize),
63 )
64 }
65 }
66
67 #[doc = "Region Base Address Register"]
68 #[inline(always)]
69 pub const fn rbar(&self) -> &'static crate::common::Reg<self::Rbar_SPEC, crate::common::RW> {
70 unsafe {
71 crate::common::Reg::<self::Rbar_SPEC, crate::common::RW>::from_ptr(
72 self._svd2pac_as_ptr().add(12usize),
73 )
74 }
75 }
76
77 #[doc = "Region Limit Address Register"]
78 #[inline(always)]
79 pub const fn rlar(&self) -> &'static crate::common::Reg<self::Rlar_SPEC, crate::common::RW> {
80 unsafe {
81 crate::common::Reg::<self::Rlar_SPEC, crate::common::RW>::from_ptr(
82 self._svd2pac_as_ptr().add(16usize),
83 )
84 }
85 }
86}
87#[doc(hidden)]
88#[derive(Copy, Clone, Eq, PartialEq)]
89pub struct Ctrl_SPEC;
90impl crate::sealed::RegSpec for Ctrl_SPEC {
91 type DataType = u32;
92}
93
94#[doc = "Control Register"]
95pub type Ctrl = crate::RegValueT<Ctrl_SPEC>;
96
97impl Ctrl {
98 #[doc = "Enable"]
99 #[inline(always)]
100 pub fn enable(
101 self,
102 ) -> crate::common::RegisterField<
103 0,
104 0x1,
105 1,
106 0,
107 ctrl::Enable,
108 ctrl::Enable,
109 Ctrl_SPEC,
110 crate::common::RW,
111 > {
112 crate::common::RegisterField::<
113 0,
114 0x1,
115 1,
116 0,
117 ctrl::Enable,
118 ctrl::Enable,
119 Ctrl_SPEC,
120 crate::common::RW,
121 >::from_register(self, 0)
122 }
123
124 #[doc = "Security attribution if SAU disabled"]
125 #[inline(always)]
126 pub fn allns(
127 self,
128 ) -> crate::common::RegisterField<
129 1,
130 0x1,
131 1,
132 0,
133 ctrl::Allns,
134 ctrl::Allns,
135 Ctrl_SPEC,
136 crate::common::RW,
137 > {
138 crate::common::RegisterField::<
139 1,
140 0x1,
141 1,
142 0,
143 ctrl::Allns,
144 ctrl::Allns,
145 Ctrl_SPEC,
146 crate::common::RW,
147 >::from_register(self, 0)
148 }
149}
150impl ::core::default::Default for Ctrl {
151 #[inline(always)]
152 fn default() -> Ctrl {
153 <crate::RegValueT<Ctrl_SPEC> as RegisterValue<_>>::new(0)
154 }
155}
156pub mod ctrl {
157
158 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
159 pub struct Enable_SPEC;
160 pub type Enable = crate::EnumBitfieldStruct<u8, Enable_SPEC>;
161 impl Enable {
162 #[doc = "SAU is disabled"]
163 pub const DISABLE: Self = Self::new(0);
164
165 #[doc = "SAU is enabled"]
166 pub const ENABLE: Self = Self::new(1);
167 }
168 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
169 pub struct Allns_SPEC;
170 pub type Allns = crate::EnumBitfieldStruct<u8, Allns_SPEC>;
171 impl Allns {
172 #[doc = "Memory is marked as secure"]
173 pub const SECURE: Self = Self::new(0);
174
175 #[doc = "Memory is marked as non-secure"]
176 pub const NON_SECURE: Self = Self::new(1);
177 }
178}
179#[doc(hidden)]
180#[derive(Copy, Clone, Eq, PartialEq)]
181pub struct Type_SPEC;
182impl crate::sealed::RegSpec for Type_SPEC {
183 type DataType = u32;
184}
185
186#[doc = "Type Register"]
187pub type Type = crate::RegValueT<Type_SPEC>;
188
189impl Type {
190 #[doc = "Number of implemented SAU regions"]
191 #[inline(always)]
192 pub fn sregion(
193 self,
194 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Type_SPEC, crate::common::RW> {
195 crate::common::RegisterField::<0,0xff,1,0,u8,u8,Type_SPEC,crate::common::RW>::from_register(self,0)
196 }
197}
198impl ::core::default::Default for Type {
199 #[inline(always)]
200 fn default() -> Type {
201 <crate::RegValueT<Type_SPEC> as RegisterValue<_>>::new(0)
202 }
203}
204
205#[doc(hidden)]
206#[derive(Copy, Clone, Eq, PartialEq)]
207pub struct Rnr_SPEC;
208impl crate::sealed::RegSpec for Rnr_SPEC {
209 type DataType = u32;
210}
211
212#[doc = "Region Number Register"]
213pub type Rnr = crate::RegValueT<Rnr_SPEC>;
214
215impl Rnr {
216 #[doc = "Currently selected SAU region"]
217 #[inline(always)]
218 pub fn region(
219 self,
220 ) -> crate::common::RegisterField<
221 0,
222 0xff,
223 1,
224 0,
225 rnr::Region,
226 rnr::Region,
227 Rnr_SPEC,
228 crate::common::RW,
229 > {
230 crate::common::RegisterField::<
231 0,
232 0xff,
233 1,
234 0,
235 rnr::Region,
236 rnr::Region,
237 Rnr_SPEC,
238 crate::common::RW,
239 >::from_register(self, 0)
240 }
241}
242impl ::core::default::Default for Rnr {
243 #[inline(always)]
244 fn default() -> Rnr {
245 <crate::RegValueT<Rnr_SPEC> as RegisterValue<_>>::new(0)
246 }
247}
248pub mod rnr {
249
250 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
251 pub struct Region_SPEC;
252 pub type Region = crate::EnumBitfieldStruct<u8, Region_SPEC>;
253 impl Region {
254 #[doc = "Select SAU Region 0"]
255 pub const SAU_REGION_0: Self = Self::new(0);
256
257 #[doc = "Select SAU Region 1"]
258 pub const SAU_REGION_1: Self = Self::new(1);
259
260 #[doc = "Select SAU Region 2"]
261 pub const SAU_REGION_2: Self = Self::new(0);
262
263 #[doc = "Select SAU Region 3"]
264 pub const SAU_REGION_3: Self = Self::new(1);
265 }
266}
267#[doc(hidden)]
268#[derive(Copy, Clone, Eq, PartialEq)]
269pub struct Rbar_SPEC;
270impl crate::sealed::RegSpec for Rbar_SPEC {
271 type DataType = u32;
272}
273
274#[doc = "Region Base Address Register"]
275pub type Rbar = crate::RegValueT<Rbar_SPEC>;
276
277impl Rbar {
278 #[doc = "Base Address"]
279 #[inline(always)]
280 pub fn baddr(
281 self,
282 ) -> crate::common::RegisterField<5, 0x7ffffff, 1, 0, u32, u32, Rbar_SPEC, crate::common::RW>
283 {
284 crate::common::RegisterField::<5,0x7ffffff,1,0,u32,u32,Rbar_SPEC,crate::common::RW>::from_register(self,0)
285 }
286}
287impl ::core::default::Default for Rbar {
288 #[inline(always)]
289 fn default() -> Rbar {
290 <crate::RegValueT<Rbar_SPEC> as RegisterValue<_>>::new(0)
291 }
292}
293
294#[doc(hidden)]
295#[derive(Copy, Clone, Eq, PartialEq)]
296pub struct Rlar_SPEC;
297impl crate::sealed::RegSpec for Rlar_SPEC {
298 type DataType = u32;
299}
300
301#[doc = "Region Limit Address Register"]
302pub type Rlar = crate::RegValueT<Rlar_SPEC>;
303
304impl Rlar {
305 #[doc = "Limit Address"]
306 #[inline(always)]
307 pub fn laddr(
308 self,
309 ) -> crate::common::RegisterField<5, 0x7ffffff, 1, 0, u32, u32, Rlar_SPEC, crate::common::RW>
310 {
311 crate::common::RegisterField::<5,0x7ffffff,1,0,u32,u32,Rlar_SPEC,crate::common::RW>::from_register(self,0)
312 }
313
314 #[doc = "Non-Secure Callable"]
315 #[inline(always)]
316 pub fn nsc(self) -> crate::common::RegisterFieldBool<1, 1, 0, Rlar_SPEC, crate::common::RW> {
317 crate::common::RegisterFieldBool::<1, 1, 0, Rlar_SPEC, crate::common::RW>::from_register(
318 self, 0,
319 )
320 }
321
322 #[doc = "SAU Region enabled"]
323 #[inline(always)]
324 pub fn enable(self) -> crate::common::RegisterFieldBool<0, 1, 0, Rlar_SPEC, crate::common::RW> {
325 crate::common::RegisterFieldBool::<0, 1, 0, Rlar_SPEC, crate::common::RW>::from_register(
326 self, 0,
327 )
328 }
329}
330impl ::core::default::Default for Rlar {
331 #[inline(always)]
332 fn default() -> Rlar {
333 <crate::RegValueT<Rlar_SPEC> as RegisterValue<_>>::new(0)
334 }
335}