1#[doc = "Register `APB_BRIDGE_PER1_RULE2` reader"]
2pub struct R(crate::R<APB_BRIDGE_PER1_RULE2_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<APB_BRIDGE_PER1_RULE2_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<APB_BRIDGE_PER1_RULE2_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<APB_BRIDGE_PER1_RULE2_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `APB_BRIDGE_PER1_RULE2` writer"]
17pub struct W(crate::W<APB_BRIDGE_PER1_RULE2_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<APB_BRIDGE_PER1_RULE2_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<APB_BRIDGE_PER1_RULE2_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<APB_BRIDGE_PER1_RULE2_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RTC_WAKEUP` reader - RTC Wakeup"]
38pub type RTC_WAKEUP_R = crate::FieldReader<u8, RTC_WAKEUP_A>;
39#[doc = "RTC Wakeup\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum RTC_WAKEUP_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<RTC_WAKEUP_A> for u8 {
53 #[inline(always)]
54 fn from(variant: RTC_WAKEUP_A) -> Self {
55 variant as _
56 }
57}
58impl RTC_WAKEUP_R {
59 #[doc = "Get enumerated values variant"]
60 #[inline(always)]
61 pub fn variant(&self) -> RTC_WAKEUP_A {
62 match self.bits {
63 0 => RTC_WAKEUP_A::NONSECURE_NONPRIV_USER_ALLOWED,
64 1 => RTC_WAKEUP_A::NONSECURE_PRIV_USER_ALLOWED,
65 2 => RTC_WAKEUP_A::SECURE_NONPRIV_USER_ALLOWED,
66 3 => RTC_WAKEUP_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 == RTC_WAKEUP_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 == RTC_WAKEUP_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 == RTC_WAKEUP_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 == RTC_WAKEUP_A::SECURE_PRIV_USER_ALLOWED
89 }
90}
91#[doc = "Field `RTC_WAKEUP` writer - RTC Wakeup"]
92pub type RTC_WAKEUP_W<'a, const O: u8> =
93 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, RTC_WAKEUP_A, 2, O>;
94impl<'a, const O: u8> RTC_WAKEUP_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(RTC_WAKEUP_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(RTC_WAKEUP_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(RTC_WAKEUP_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(RTC_WAKEUP_A::SECURE_PRIV_USER_ALLOWED)
114 }
115}
116#[doc = "Field `DSI_HOST_CONTROLLER` reader - DSI Host Controller"]
117pub type DSI_HOST_CONTROLLER_R = crate::FieldReader<u8, DSI_HOST_CONTROLLER_A>;
118#[doc = "DSI Host Controller\n\nValue on reset: 0"]
119#[derive(Clone, Copy, Debug, PartialEq, Eq)]
120#[repr(u8)]
121pub enum DSI_HOST_CONTROLLER_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<DSI_HOST_CONTROLLER_A> for u8 {
132 #[inline(always)]
133 fn from(variant: DSI_HOST_CONTROLLER_A) -> Self {
134 variant as _
135 }
136}
137impl DSI_HOST_CONTROLLER_R {
138 #[doc = "Get enumerated values variant"]
139 #[inline(always)]
140 pub fn variant(&self) -> DSI_HOST_CONTROLLER_A {
141 match self.bits {
142 0 => DSI_HOST_CONTROLLER_A::NONSECURE_NONPRIV_USER_ALLOWED,
143 1 => DSI_HOST_CONTROLLER_A::NONSECURE_PRIV_USER_ALLOWED,
144 2 => DSI_HOST_CONTROLLER_A::SECURE_NONPRIV_USER_ALLOWED,
145 3 => DSI_HOST_CONTROLLER_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 == DSI_HOST_CONTROLLER_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 == DSI_HOST_CONTROLLER_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 == DSI_HOST_CONTROLLER_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 == DSI_HOST_CONTROLLER_A::SECURE_PRIV_USER_ALLOWED
168 }
169}
170#[doc = "Field `DSI_HOST_CONTROLLER` writer - DSI Host Controller"]
171pub type DSI_HOST_CONTROLLER_W<'a, const O: u8> =
172 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, DSI_HOST_CONTROLLER_A, 2, O>;
173impl<'a, const O: u8> DSI_HOST_CONTROLLER_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(DSI_HOST_CONTROLLER_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(DSI_HOST_CONTROLLER_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(DSI_HOST_CONTROLLER_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(DSI_HOST_CONTROLLER_A::SECURE_PRIV_USER_ALLOWED)
193 }
194}
195#[doc = "Field `FLEXIO_REGISTERS` reader - FLEXIO Registers"]
196pub type FLEXIO_REGISTERS_R = crate::FieldReader<u8, FLEXIO_REGISTERS_A>;
197#[doc = "FLEXIO Registers\n\nValue on reset: 0"]
198#[derive(Clone, Copy, Debug, PartialEq, Eq)]
199#[repr(u8)]
200pub enum FLEXIO_REGISTERS_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<FLEXIO_REGISTERS_A> for u8 {
211 #[inline(always)]
212 fn from(variant: FLEXIO_REGISTERS_A) -> Self {
213 variant as _
214 }
215}
216impl FLEXIO_REGISTERS_R {
217 #[doc = "Get enumerated values variant"]
218 #[inline(always)]
219 pub fn variant(&self) -> FLEXIO_REGISTERS_A {
220 match self.bits {
221 0 => FLEXIO_REGISTERS_A::NONSECURE_NONPRIV_USER_ALLOWED,
222 1 => FLEXIO_REGISTERS_A::NONSECURE_PRIV_USER_ALLOWED,
223 2 => FLEXIO_REGISTERS_A::SECURE_NONPRIV_USER_ALLOWED,
224 3 => FLEXIO_REGISTERS_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 == FLEXIO_REGISTERS_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 == FLEXIO_REGISTERS_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 == FLEXIO_REGISTERS_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 == FLEXIO_REGISTERS_A::SECURE_PRIV_USER_ALLOWED
247 }
248}
249#[doc = "Field `FLEXIO_REGISTERS` writer - FLEXIO Registers"]
250pub type FLEXIO_REGISTERS_W<'a, const O: u8> =
251 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, FLEXIO_REGISTERS_A, 2, O>;
252impl<'a, const O: u8> FLEXIO_REGISTERS_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(FLEXIO_REGISTERS_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(FLEXIO_REGISTERS_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(FLEXIO_REGISTERS_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(FLEXIO_REGISTERS_A::SECURE_PRIV_USER_ALLOWED)
272 }
273}
274#[doc = "Field `CACHE_CONTROL_0_REGS` reader - Cache Control 0 Registers"]
275pub type CACHE_CONTROL_0_REGS_R = crate::FieldReader<u8, CACHE_CONTROL_0_REGS_A>;
276#[doc = "Cache Control 0 Registers\n\nValue on reset: 0"]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278#[repr(u8)]
279pub enum CACHE_CONTROL_0_REGS_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<CACHE_CONTROL_0_REGS_A> for u8 {
290 #[inline(always)]
291 fn from(variant: CACHE_CONTROL_0_REGS_A) -> Self {
292 variant as _
293 }
294}
295impl CACHE_CONTROL_0_REGS_R {
296 #[doc = "Get enumerated values variant"]
297 #[inline(always)]
298 pub fn variant(&self) -> CACHE_CONTROL_0_REGS_A {
299 match self.bits {
300 0 => CACHE_CONTROL_0_REGS_A::NONSECURE_NONPRIV_USER_ALLOWED,
301 1 => CACHE_CONTROL_0_REGS_A::NONSECURE_PRIV_USER_ALLOWED,
302 2 => CACHE_CONTROL_0_REGS_A::SECURE_NONPRIV_USER_ALLOWED,
303 3 => CACHE_CONTROL_0_REGS_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 == CACHE_CONTROL_0_REGS_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 == CACHE_CONTROL_0_REGS_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 == CACHE_CONTROL_0_REGS_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 == CACHE_CONTROL_0_REGS_A::SECURE_PRIV_USER_ALLOWED
326 }
327}
328#[doc = "Field `CACHE_CONTROL_0_REGS` writer - Cache Control 0 Registers"]
329pub type CACHE_CONTROL_0_REGS_W<'a, const O: u8> =
330 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, CACHE_CONTROL_0_REGS_A, 2, O>;
331impl<'a, const O: u8> CACHE_CONTROL_0_REGS_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(CACHE_CONTROL_0_REGS_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(CACHE_CONTROL_0_REGS_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(CACHE_CONTROL_0_REGS_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(CACHE_CONTROL_0_REGS_A::SECURE_PRIV_USER_ALLOWED)
351 }
352}
353#[doc = "Field `CACHE_CONTROL_1_REGS` reader - Cache Control 1 Registers"]
354pub type CACHE_CONTROL_1_REGS_R = crate::FieldReader<u8, CACHE_CONTROL_1_REGS_A>;
355#[doc = "Cache Control 1 Registers\n\nValue on reset: 0"]
356#[derive(Clone, Copy, Debug, PartialEq, Eq)]
357#[repr(u8)]
358pub enum CACHE_CONTROL_1_REGS_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<CACHE_CONTROL_1_REGS_A> for u8 {
369 #[inline(always)]
370 fn from(variant: CACHE_CONTROL_1_REGS_A) -> Self {
371 variant as _
372 }
373}
374impl CACHE_CONTROL_1_REGS_R {
375 #[doc = "Get enumerated values variant"]
376 #[inline(always)]
377 pub fn variant(&self) -> CACHE_CONTROL_1_REGS_A {
378 match self.bits {
379 0 => CACHE_CONTROL_1_REGS_A::NONSECURE_NONPRIV_USER_ALLOWED,
380 1 => CACHE_CONTROL_1_REGS_A::NONSECURE_PRIV_USER_ALLOWED,
381 2 => CACHE_CONTROL_1_REGS_A::SECURE_NONPRIV_USER_ALLOWED,
382 3 => CACHE_CONTROL_1_REGS_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 == CACHE_CONTROL_1_REGS_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 == CACHE_CONTROL_1_REGS_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 == CACHE_CONTROL_1_REGS_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 == CACHE_CONTROL_1_REGS_A::SECURE_PRIV_USER_ALLOWED
405 }
406}
407#[doc = "Field `CACHE_CONTROL_1_REGS` writer - Cache Control 1 Registers"]
408pub type CACHE_CONTROL_1_REGS_W<'a, const O: u8> =
409 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, CACHE_CONTROL_1_REGS_A, 2, O>;
410impl<'a, const O: u8> CACHE_CONTROL_1_REGS_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(CACHE_CONTROL_1_REGS_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(CACHE_CONTROL_1_REGS_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(CACHE_CONTROL_1_REGS_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(CACHE_CONTROL_1_REGS_A::SECURE_PRIV_USER_ALLOWED)
430 }
431}
432#[doc = "Field `I3C0` reader - I3C0"]
433pub type I3C0_R = crate::FieldReader<u8, I3C0_A>;
434#[doc = "I3C0\n\nValue on reset: 0"]
435#[derive(Clone, Copy, Debug, PartialEq, Eq)]
436#[repr(u8)]
437pub enum I3C0_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<I3C0_A> for u8 {
448 #[inline(always)]
449 fn from(variant: I3C0_A) -> Self {
450 variant as _
451 }
452}
453impl I3C0_R {
454 #[doc = "Get enumerated values variant"]
455 #[inline(always)]
456 pub fn variant(&self) -> I3C0_A {
457 match self.bits {
458 0 => I3C0_A::NONSECURE_NONPRIV_USER_ALLOWED,
459 1 => I3C0_A::NONSECURE_PRIV_USER_ALLOWED,
460 2 => I3C0_A::SECURE_NONPRIV_USER_ALLOWED,
461 3 => I3C0_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 == I3C0_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 == I3C0_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 == I3C0_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 == I3C0_A::SECURE_PRIV_USER_ALLOWED
484 }
485}
486#[doc = "Field `I3C0` writer - I3C0"]
487pub type I3C0_W<'a, const O: u8> =
488 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, I3C0_A, 2, O>;
489impl<'a, const O: u8> I3C0_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(I3C0_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(I3C0_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(I3C0_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(I3C0_A::SECURE_PRIV_USER_ALLOWED)
509 }
510}
511#[doc = "Field `I3C1` reader - I3C1"]
512pub type I3C1_R = crate::FieldReader<u8, I3C1_A>;
513#[doc = "I3C1\n\nValue on reset: 0"]
514#[derive(Clone, Copy, Debug, PartialEq, Eq)]
515#[repr(u8)]
516pub enum I3C1_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<I3C1_A> for u8 {
527 #[inline(always)]
528 fn from(variant: I3C1_A) -> Self {
529 variant as _
530 }
531}
532impl I3C1_R {
533 #[doc = "Get enumerated values variant"]
534 #[inline(always)]
535 pub fn variant(&self) -> I3C1_A {
536 match self.bits {
537 0 => I3C1_A::NONSECURE_NONPRIV_USER_ALLOWED,
538 1 => I3C1_A::NONSECURE_PRIV_USER_ALLOWED,
539 2 => I3C1_A::SECURE_NONPRIV_USER_ALLOWED,
540 3 => I3C1_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 == I3C1_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 == I3C1_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 == I3C1_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 == I3C1_A::SECURE_PRIV_USER_ALLOWED
563 }
564}
565#[doc = "Field `I3C1` writer - I3C1"]
566pub type I3C1_W<'a, const O: u8> =
567 crate::FieldWriterSafe<'a, u32, APB_BRIDGE_PER1_RULE2_SPEC, u8, I3C1_A, 2, O>;
568impl<'a, const O: u8> I3C1_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(I3C1_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(I3C1_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(I3C1_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(I3C1_A::SECURE_PRIV_USER_ALLOWED)
588 }
589}
590impl R {
591 #[doc = "Bits 0:1 - RTC Wakeup"]
592 #[inline(always)]
593 pub fn rtc_wakeup(&self) -> RTC_WAKEUP_R {
594 RTC_WAKEUP_R::new((self.bits & 3) as u8)
595 }
596 #[doc = "Bits 4:5 - DSI Host Controller"]
597 #[inline(always)]
598 pub fn dsi_host_controller(&self) -> DSI_HOST_CONTROLLER_R {
599 DSI_HOST_CONTROLLER_R::new(((self.bits >> 4) & 3) as u8)
600 }
601 #[doc = "Bits 8:9 - FLEXIO Registers"]
602 #[inline(always)]
603 pub fn flexio_registers(&self) -> FLEXIO_REGISTERS_R {
604 FLEXIO_REGISTERS_R::new(((self.bits >> 8) & 3) as u8)
605 }
606 #[doc = "Bits 12:13 - Cache Control 0 Registers"]
607 #[inline(always)]
608 pub fn cache_control_0_regs(&self) -> CACHE_CONTROL_0_REGS_R {
609 CACHE_CONTROL_0_REGS_R::new(((self.bits >> 12) & 3) as u8)
610 }
611 #[doc = "Bits 16:17 - Cache Control 1 Registers"]
612 #[inline(always)]
613 pub fn cache_control_1_regs(&self) -> CACHE_CONTROL_1_REGS_R {
614 CACHE_CONTROL_1_REGS_R::new(((self.bits >> 16) & 3) as u8)
615 }
616 #[doc = "Bits 24:25 - I3C0"]
617 #[inline(always)]
618 pub fn i3c0(&self) -> I3C0_R {
619 I3C0_R::new(((self.bits >> 24) & 3) as u8)
620 }
621 #[doc = "Bits 28:29 - I3C1"]
622 #[inline(always)]
623 pub fn i3c1(&self) -> I3C1_R {
624 I3C1_R::new(((self.bits >> 28) & 3) as u8)
625 }
626}
627impl W {
628 #[doc = "Bits 0:1 - RTC Wakeup"]
629 #[inline(always)]
630 #[must_use]
631 pub fn rtc_wakeup(&mut self) -> RTC_WAKEUP_W<0> {
632 RTC_WAKEUP_W::new(self)
633 }
634 #[doc = "Bits 4:5 - DSI Host Controller"]
635 #[inline(always)]
636 #[must_use]
637 pub fn dsi_host_controller(&mut self) -> DSI_HOST_CONTROLLER_W<4> {
638 DSI_HOST_CONTROLLER_W::new(self)
639 }
640 #[doc = "Bits 8:9 - FLEXIO Registers"]
641 #[inline(always)]
642 #[must_use]
643 pub fn flexio_registers(&mut self) -> FLEXIO_REGISTERS_W<8> {
644 FLEXIO_REGISTERS_W::new(self)
645 }
646 #[doc = "Bits 12:13 - Cache Control 0 Registers"]
647 #[inline(always)]
648 #[must_use]
649 pub fn cache_control_0_regs(&mut self) -> CACHE_CONTROL_0_REGS_W<12> {
650 CACHE_CONTROL_0_REGS_W::new(self)
651 }
652 #[doc = "Bits 16:17 - Cache Control 1 Registers"]
653 #[inline(always)]
654 #[must_use]
655 pub fn cache_control_1_regs(&mut self) -> CACHE_CONTROL_1_REGS_W<16> {
656 CACHE_CONTROL_1_REGS_W::new(self)
657 }
658 #[doc = "Bits 24:25 - I3C0"]
659 #[inline(always)]
660 #[must_use]
661 pub fn i3c0(&mut self) -> I3C0_W<24> {
662 I3C0_W::new(self)
663 }
664 #[doc = "Bits 28:29 - I3C1"]
665 #[inline(always)]
666 #[must_use]
667 pub fn i3c1(&mut self) -> I3C1_W<28> {
668 I3C1_W::new(self)
669 }
670 #[doc = "Writes raw bits to the register."]
671 #[inline(always)]
672 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
673 self.0.bits(bits);
674 self
675 }
676}
677#[doc = "APB Bridge Peripheral 1 Rule 2 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 [apb_bridge_per1_rule2](index.html) module"]
678pub struct APB_BRIDGE_PER1_RULE2_SPEC;
679impl crate::RegisterSpec for APB_BRIDGE_PER1_RULE2_SPEC {
680 type Ux = u32;
681}
682#[doc = "`read()` method returns [apb_bridge_per1_rule2::R](R) reader structure"]
683impl crate::Readable for APB_BRIDGE_PER1_RULE2_SPEC {
684 type Reader = R;
685}
686#[doc = "`write(|w| ..)` method takes [apb_bridge_per1_rule2::W](W) writer structure"]
687impl crate::Writable for APB_BRIDGE_PER1_RULE2_SPEC {
688 type Writer = W;
689 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
690 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
691}
692#[doc = "`reset()` method sets APB_BRIDGE_PER1_RULE2 to value 0"]
693impl crate::Resettable for APB_BRIDGE_PER1_RULE2_SPEC {
694 const RESET_VALUE: Self::Ux = 0;
695}