nrf5340_app_pac/dcnf_ns/extram/
protect.rs

1#[doc = "Register `PROTECT` reader"]
2pub struct R(crate::R<PROTECT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PROTECT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PROTECT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PROTECT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PROTECT` writer"]
17pub struct W(crate::W<PROTECT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PROTECT_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<PROTECT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PROTECT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SLAVE0` reader - Control access to slave 0 of master EXTRAM\\[n\\]"]
38pub type SLAVE0_R = crate::BitReader<SLAVE0_A>;
39#[doc = "Control access to slave 0 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum SLAVE0_A {
42    #[doc = "0: Access to slave is allowed"]
43    ALLOWED = 0,
44    #[doc = "1: Access to slave is blocked"]
45    BLOCKED = 1,
46}
47impl From<SLAVE0_A> for bool {
48    #[inline(always)]
49    fn from(variant: SLAVE0_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl SLAVE0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> SLAVE0_A {
57        match self.bits {
58            false => SLAVE0_A::ALLOWED,
59            true => SLAVE0_A::BLOCKED,
60        }
61    }
62    #[doc = "Checks if the value of the field is `ALLOWED`"]
63    #[inline(always)]
64    pub fn is_allowed(&self) -> bool {
65        *self == SLAVE0_A::ALLOWED
66    }
67    #[doc = "Checks if the value of the field is `BLOCKED`"]
68    #[inline(always)]
69    pub fn is_blocked(&self) -> bool {
70        *self == SLAVE0_A::BLOCKED
71    }
72}
73#[doc = "Field `SLAVE0` writer - Control access to slave 0 of master EXTRAM\\[n\\]"]
74pub type SLAVE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE0_A, O>;
75impl<'a, const O: u8> SLAVE0_W<'a, O> {
76    #[doc = "Access to slave is allowed"]
77    #[inline(always)]
78    pub fn allowed(self) -> &'a mut W {
79        self.variant(SLAVE0_A::ALLOWED)
80    }
81    #[doc = "Access to slave is blocked"]
82    #[inline(always)]
83    pub fn blocked(self) -> &'a mut W {
84        self.variant(SLAVE0_A::BLOCKED)
85    }
86}
87#[doc = "Field `SLAVE1` reader - Control access to slave 1 of master EXTRAM\\[n\\]"]
88pub type SLAVE1_R = crate::BitReader<SLAVE1_A>;
89#[doc = "Control access to slave 1 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq)]
91pub enum SLAVE1_A {
92    #[doc = "0: Access to slave is allowed"]
93    ALLOWED = 0,
94    #[doc = "1: Access to slave is blocked"]
95    BLOCKED = 1,
96}
97impl From<SLAVE1_A> for bool {
98    #[inline(always)]
99    fn from(variant: SLAVE1_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl SLAVE1_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> SLAVE1_A {
107        match self.bits {
108            false => SLAVE1_A::ALLOWED,
109            true => SLAVE1_A::BLOCKED,
110        }
111    }
112    #[doc = "Checks if the value of the field is `ALLOWED`"]
113    #[inline(always)]
114    pub fn is_allowed(&self) -> bool {
115        *self == SLAVE1_A::ALLOWED
116    }
117    #[doc = "Checks if the value of the field is `BLOCKED`"]
118    #[inline(always)]
119    pub fn is_blocked(&self) -> bool {
120        *self == SLAVE1_A::BLOCKED
121    }
122}
123#[doc = "Field `SLAVE1` writer - Control access to slave 1 of master EXTRAM\\[n\\]"]
124pub type SLAVE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE1_A, O>;
125impl<'a, const O: u8> SLAVE1_W<'a, O> {
126    #[doc = "Access to slave is allowed"]
127    #[inline(always)]
128    pub fn allowed(self) -> &'a mut W {
129        self.variant(SLAVE1_A::ALLOWED)
130    }
131    #[doc = "Access to slave is blocked"]
132    #[inline(always)]
133    pub fn blocked(self) -> &'a mut W {
134        self.variant(SLAVE1_A::BLOCKED)
135    }
136}
137#[doc = "Field `SLAVE2` reader - Control access to slave 2 of master EXTRAM\\[n\\]"]
138pub type SLAVE2_R = crate::BitReader<SLAVE2_A>;
139#[doc = "Control access to slave 2 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum SLAVE2_A {
142    #[doc = "0: Access to slave is allowed"]
143    ALLOWED = 0,
144    #[doc = "1: Access to slave is blocked"]
145    BLOCKED = 1,
146}
147impl From<SLAVE2_A> for bool {
148    #[inline(always)]
149    fn from(variant: SLAVE2_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl SLAVE2_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> SLAVE2_A {
157        match self.bits {
158            false => SLAVE2_A::ALLOWED,
159            true => SLAVE2_A::BLOCKED,
160        }
161    }
162    #[doc = "Checks if the value of the field is `ALLOWED`"]
163    #[inline(always)]
164    pub fn is_allowed(&self) -> bool {
165        *self == SLAVE2_A::ALLOWED
166    }
167    #[doc = "Checks if the value of the field is `BLOCKED`"]
168    #[inline(always)]
169    pub fn is_blocked(&self) -> bool {
170        *self == SLAVE2_A::BLOCKED
171    }
172}
173#[doc = "Field `SLAVE2` writer - Control access to slave 2 of master EXTRAM\\[n\\]"]
174pub type SLAVE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE2_A, O>;
175impl<'a, const O: u8> SLAVE2_W<'a, O> {
176    #[doc = "Access to slave is allowed"]
177    #[inline(always)]
178    pub fn allowed(self) -> &'a mut W {
179        self.variant(SLAVE2_A::ALLOWED)
180    }
181    #[doc = "Access to slave is blocked"]
182    #[inline(always)]
183    pub fn blocked(self) -> &'a mut W {
184        self.variant(SLAVE2_A::BLOCKED)
185    }
186}
187#[doc = "Field `SLAVE3` reader - Control access to slave 3 of master EXTRAM\\[n\\]"]
188pub type SLAVE3_R = crate::BitReader<SLAVE3_A>;
189#[doc = "Control access to slave 3 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum SLAVE3_A {
192    #[doc = "0: Access to slave is allowed"]
193    ALLOWED = 0,
194    #[doc = "1: Access to slave is blocked"]
195    BLOCKED = 1,
196}
197impl From<SLAVE3_A> for bool {
198    #[inline(always)]
199    fn from(variant: SLAVE3_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl SLAVE3_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> SLAVE3_A {
207        match self.bits {
208            false => SLAVE3_A::ALLOWED,
209            true => SLAVE3_A::BLOCKED,
210        }
211    }
212    #[doc = "Checks if the value of the field is `ALLOWED`"]
213    #[inline(always)]
214    pub fn is_allowed(&self) -> bool {
215        *self == SLAVE3_A::ALLOWED
216    }
217    #[doc = "Checks if the value of the field is `BLOCKED`"]
218    #[inline(always)]
219    pub fn is_blocked(&self) -> bool {
220        *self == SLAVE3_A::BLOCKED
221    }
222}
223#[doc = "Field `SLAVE3` writer - Control access to slave 3 of master EXTRAM\\[n\\]"]
224pub type SLAVE3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE3_A, O>;
225impl<'a, const O: u8> SLAVE3_W<'a, O> {
226    #[doc = "Access to slave is allowed"]
227    #[inline(always)]
228    pub fn allowed(self) -> &'a mut W {
229        self.variant(SLAVE3_A::ALLOWED)
230    }
231    #[doc = "Access to slave is blocked"]
232    #[inline(always)]
233    pub fn blocked(self) -> &'a mut W {
234        self.variant(SLAVE3_A::BLOCKED)
235    }
236}
237#[doc = "Field `SLAVE4` reader - Control access to slave 4 of master EXTRAM\\[n\\]"]
238pub type SLAVE4_R = crate::BitReader<SLAVE4_A>;
239#[doc = "Control access to slave 4 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq)]
241pub enum SLAVE4_A {
242    #[doc = "0: Access to slave is allowed"]
243    ALLOWED = 0,
244    #[doc = "1: Access to slave is blocked"]
245    BLOCKED = 1,
246}
247impl From<SLAVE4_A> for bool {
248    #[inline(always)]
249    fn from(variant: SLAVE4_A) -> Self {
250        variant as u8 != 0
251    }
252}
253impl SLAVE4_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> SLAVE4_A {
257        match self.bits {
258            false => SLAVE4_A::ALLOWED,
259            true => SLAVE4_A::BLOCKED,
260        }
261    }
262    #[doc = "Checks if the value of the field is `ALLOWED`"]
263    #[inline(always)]
264    pub fn is_allowed(&self) -> bool {
265        *self == SLAVE4_A::ALLOWED
266    }
267    #[doc = "Checks if the value of the field is `BLOCKED`"]
268    #[inline(always)]
269    pub fn is_blocked(&self) -> bool {
270        *self == SLAVE4_A::BLOCKED
271    }
272}
273#[doc = "Field `SLAVE4` writer - Control access to slave 4 of master EXTRAM\\[n\\]"]
274pub type SLAVE4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE4_A, O>;
275impl<'a, const O: u8> SLAVE4_W<'a, O> {
276    #[doc = "Access to slave is allowed"]
277    #[inline(always)]
278    pub fn allowed(self) -> &'a mut W {
279        self.variant(SLAVE4_A::ALLOWED)
280    }
281    #[doc = "Access to slave is blocked"]
282    #[inline(always)]
283    pub fn blocked(self) -> &'a mut W {
284        self.variant(SLAVE4_A::BLOCKED)
285    }
286}
287#[doc = "Field `SLAVE5` reader - Control access to slave 5 of master EXTRAM\\[n\\]"]
288pub type SLAVE5_R = crate::BitReader<SLAVE5_A>;
289#[doc = "Control access to slave 5 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum SLAVE5_A {
292    #[doc = "0: Access to slave is allowed"]
293    ALLOWED = 0,
294    #[doc = "1: Access to slave is blocked"]
295    BLOCKED = 1,
296}
297impl From<SLAVE5_A> for bool {
298    #[inline(always)]
299    fn from(variant: SLAVE5_A) -> Self {
300        variant as u8 != 0
301    }
302}
303impl SLAVE5_R {
304    #[doc = "Get enumerated values variant"]
305    #[inline(always)]
306    pub fn variant(&self) -> SLAVE5_A {
307        match self.bits {
308            false => SLAVE5_A::ALLOWED,
309            true => SLAVE5_A::BLOCKED,
310        }
311    }
312    #[doc = "Checks if the value of the field is `ALLOWED`"]
313    #[inline(always)]
314    pub fn is_allowed(&self) -> bool {
315        *self == SLAVE5_A::ALLOWED
316    }
317    #[doc = "Checks if the value of the field is `BLOCKED`"]
318    #[inline(always)]
319    pub fn is_blocked(&self) -> bool {
320        *self == SLAVE5_A::BLOCKED
321    }
322}
323#[doc = "Field `SLAVE5` writer - Control access to slave 5 of master EXTRAM\\[n\\]"]
324pub type SLAVE5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE5_A, O>;
325impl<'a, const O: u8> SLAVE5_W<'a, O> {
326    #[doc = "Access to slave is allowed"]
327    #[inline(always)]
328    pub fn allowed(self) -> &'a mut W {
329        self.variant(SLAVE5_A::ALLOWED)
330    }
331    #[doc = "Access to slave is blocked"]
332    #[inline(always)]
333    pub fn blocked(self) -> &'a mut W {
334        self.variant(SLAVE5_A::BLOCKED)
335    }
336}
337#[doc = "Field `SLAVE6` reader - Control access to slave 6 of master EXTRAM\\[n\\]"]
338pub type SLAVE6_R = crate::BitReader<SLAVE6_A>;
339#[doc = "Control access to slave 6 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
340#[derive(Clone, Copy, Debug, PartialEq)]
341pub enum SLAVE6_A {
342    #[doc = "0: Access to slave is allowed"]
343    ALLOWED = 0,
344    #[doc = "1: Access to slave is blocked"]
345    BLOCKED = 1,
346}
347impl From<SLAVE6_A> for bool {
348    #[inline(always)]
349    fn from(variant: SLAVE6_A) -> Self {
350        variant as u8 != 0
351    }
352}
353impl SLAVE6_R {
354    #[doc = "Get enumerated values variant"]
355    #[inline(always)]
356    pub fn variant(&self) -> SLAVE6_A {
357        match self.bits {
358            false => SLAVE6_A::ALLOWED,
359            true => SLAVE6_A::BLOCKED,
360        }
361    }
362    #[doc = "Checks if the value of the field is `ALLOWED`"]
363    #[inline(always)]
364    pub fn is_allowed(&self) -> bool {
365        *self == SLAVE6_A::ALLOWED
366    }
367    #[doc = "Checks if the value of the field is `BLOCKED`"]
368    #[inline(always)]
369    pub fn is_blocked(&self) -> bool {
370        *self == SLAVE6_A::BLOCKED
371    }
372}
373#[doc = "Field `SLAVE6` writer - Control access to slave 6 of master EXTRAM\\[n\\]"]
374pub type SLAVE6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE6_A, O>;
375impl<'a, const O: u8> SLAVE6_W<'a, O> {
376    #[doc = "Access to slave is allowed"]
377    #[inline(always)]
378    pub fn allowed(self) -> &'a mut W {
379        self.variant(SLAVE6_A::ALLOWED)
380    }
381    #[doc = "Access to slave is blocked"]
382    #[inline(always)]
383    pub fn blocked(self) -> &'a mut W {
384        self.variant(SLAVE6_A::BLOCKED)
385    }
386}
387#[doc = "Field `SLAVE7` reader - Control access to slave 7 of master EXTRAM\\[n\\]"]
388pub type SLAVE7_R = crate::BitReader<SLAVE7_A>;
389#[doc = "Control access to slave 7 of master EXTRAM\\[n\\]\n\nValue on reset: 0"]
390#[derive(Clone, Copy, Debug, PartialEq)]
391pub enum SLAVE7_A {
392    #[doc = "0: Access to slave is allowed"]
393    ALLOWED = 0,
394    #[doc = "1: Access to slave is blocked"]
395    BLOCKED = 1,
396}
397impl From<SLAVE7_A> for bool {
398    #[inline(always)]
399    fn from(variant: SLAVE7_A) -> Self {
400        variant as u8 != 0
401    }
402}
403impl SLAVE7_R {
404    #[doc = "Get enumerated values variant"]
405    #[inline(always)]
406    pub fn variant(&self) -> SLAVE7_A {
407        match self.bits {
408            false => SLAVE7_A::ALLOWED,
409            true => SLAVE7_A::BLOCKED,
410        }
411    }
412    #[doc = "Checks if the value of the field is `ALLOWED`"]
413    #[inline(always)]
414    pub fn is_allowed(&self) -> bool {
415        *self == SLAVE7_A::ALLOWED
416    }
417    #[doc = "Checks if the value of the field is `BLOCKED`"]
418    #[inline(always)]
419    pub fn is_blocked(&self) -> bool {
420        *self == SLAVE7_A::BLOCKED
421    }
422}
423#[doc = "Field `SLAVE7` writer - Control access to slave 7 of master EXTRAM\\[n\\]"]
424pub type SLAVE7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PROTECT_SPEC, SLAVE7_A, O>;
425impl<'a, const O: u8> SLAVE7_W<'a, O> {
426    #[doc = "Access to slave is allowed"]
427    #[inline(always)]
428    pub fn allowed(self) -> &'a mut W {
429        self.variant(SLAVE7_A::ALLOWED)
430    }
431    #[doc = "Access to slave is blocked"]
432    #[inline(always)]
433    pub fn blocked(self) -> &'a mut W {
434        self.variant(SLAVE7_A::BLOCKED)
435    }
436}
437impl R {
438    #[doc = "Bit 0 - Control access to slave 0 of master EXTRAM\\[n\\]"]
439    #[inline(always)]
440    pub fn slave0(&self) -> SLAVE0_R {
441        SLAVE0_R::new((self.bits & 1) != 0)
442    }
443    #[doc = "Bit 1 - Control access to slave 1 of master EXTRAM\\[n\\]"]
444    #[inline(always)]
445    pub fn slave1(&self) -> SLAVE1_R {
446        SLAVE1_R::new(((self.bits >> 1) & 1) != 0)
447    }
448    #[doc = "Bit 2 - Control access to slave 2 of master EXTRAM\\[n\\]"]
449    #[inline(always)]
450    pub fn slave2(&self) -> SLAVE2_R {
451        SLAVE2_R::new(((self.bits >> 2) & 1) != 0)
452    }
453    #[doc = "Bit 3 - Control access to slave 3 of master EXTRAM\\[n\\]"]
454    #[inline(always)]
455    pub fn slave3(&self) -> SLAVE3_R {
456        SLAVE3_R::new(((self.bits >> 3) & 1) != 0)
457    }
458    #[doc = "Bit 4 - Control access to slave 4 of master EXTRAM\\[n\\]"]
459    #[inline(always)]
460    pub fn slave4(&self) -> SLAVE4_R {
461        SLAVE4_R::new(((self.bits >> 4) & 1) != 0)
462    }
463    #[doc = "Bit 5 - Control access to slave 5 of master EXTRAM\\[n\\]"]
464    #[inline(always)]
465    pub fn slave5(&self) -> SLAVE5_R {
466        SLAVE5_R::new(((self.bits >> 5) & 1) != 0)
467    }
468    #[doc = "Bit 6 - Control access to slave 6 of master EXTRAM\\[n\\]"]
469    #[inline(always)]
470    pub fn slave6(&self) -> SLAVE6_R {
471        SLAVE6_R::new(((self.bits >> 6) & 1) != 0)
472    }
473    #[doc = "Bit 7 - Control access to slave 7 of master EXTRAM\\[n\\]"]
474    #[inline(always)]
475    pub fn slave7(&self) -> SLAVE7_R {
476        SLAVE7_R::new(((self.bits >> 7) & 1) != 0)
477    }
478}
479impl W {
480    #[doc = "Bit 0 - Control access to slave 0 of master EXTRAM\\[n\\]"]
481    #[inline(always)]
482    pub fn slave0(&mut self) -> SLAVE0_W<0> {
483        SLAVE0_W::new(self)
484    }
485    #[doc = "Bit 1 - Control access to slave 1 of master EXTRAM\\[n\\]"]
486    #[inline(always)]
487    pub fn slave1(&mut self) -> SLAVE1_W<1> {
488        SLAVE1_W::new(self)
489    }
490    #[doc = "Bit 2 - Control access to slave 2 of master EXTRAM\\[n\\]"]
491    #[inline(always)]
492    pub fn slave2(&mut self) -> SLAVE2_W<2> {
493        SLAVE2_W::new(self)
494    }
495    #[doc = "Bit 3 - Control access to slave 3 of master EXTRAM\\[n\\]"]
496    #[inline(always)]
497    pub fn slave3(&mut self) -> SLAVE3_W<3> {
498        SLAVE3_W::new(self)
499    }
500    #[doc = "Bit 4 - Control access to slave 4 of master EXTRAM\\[n\\]"]
501    #[inline(always)]
502    pub fn slave4(&mut self) -> SLAVE4_W<4> {
503        SLAVE4_W::new(self)
504    }
505    #[doc = "Bit 5 - Control access to slave 5 of master EXTRAM\\[n\\]"]
506    #[inline(always)]
507    pub fn slave5(&mut self) -> SLAVE5_W<5> {
508        SLAVE5_W::new(self)
509    }
510    #[doc = "Bit 6 - Control access to slave 6 of master EXTRAM\\[n\\]"]
511    #[inline(always)]
512    pub fn slave6(&mut self) -> SLAVE6_W<6> {
513        SLAVE6_W::new(self)
514    }
515    #[doc = "Bit 7 - Control access to slave 7 of master EXTRAM\\[n\\]"]
516    #[inline(always)]
517    pub fn slave7(&mut self) -> SLAVE7_W<7> {
518        SLAVE7_W::new(self)
519    }
520    #[doc = "Writes raw bits to the register."]
521    #[inline(always)]
522    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
523        self.0.bits(bits);
524        self
525    }
526}
527#[doc = "Description cluster: Control access from master connected to AMLI master port EXTRAM\\[n\\]\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 [protect](index.html) module"]
528pub struct PROTECT_SPEC;
529impl crate::RegisterSpec for PROTECT_SPEC {
530    type Ux = u32;
531}
532#[doc = "`read()` method returns [protect::R](R) reader structure"]
533impl crate::Readable for PROTECT_SPEC {
534    type Reader = R;
535}
536#[doc = "`write(|w| ..)` method takes [protect::W](W) writer structure"]
537impl crate::Writable for PROTECT_SPEC {
538    type Writer = W;
539}
540#[doc = "`reset()` method sets PROTECT to value 0"]
541impl crate::Resettable for PROTECT_SPEC {
542    #[inline(always)]
543    fn reset_value() -> Self::Ux {
544        0
545    }
546}