cyt3bb_a/m0/peri_ms/ppu_pr/
ms_att2.rs

1#[doc = "Register `MS_ATT2` reader"]
2pub struct R(crate::R<MS_ATT2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MS_ATT2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MS_ATT2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MS_ATT2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MS_ATT2` writer"]
17pub struct W(crate::W<MS_ATT2_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MS_ATT2_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<MS_ATT2_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MS_ATT2_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PC8_UR` reader - Protection context 8, user read enable."]
38pub type PC8_UR_R = crate::BitReader<bool>;
39#[doc = "Field `PC8_UW` reader - Protection context 8, user write enable."]
40pub type PC8_UW_R = crate::BitReader<bool>;
41#[doc = "Field `PC8_UW` writer - Protection context 8, user write enable."]
42pub type PC8_UW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
43#[doc = "Field `PC8_PR` reader - Protection context 8, privileged read enable."]
44pub type PC8_PR_R = crate::BitReader<bool>;
45#[doc = "Field `PC8_PW` reader - Protection context 8, privileged write enable."]
46pub type PC8_PW_R = crate::BitReader<bool>;
47#[doc = "Field `PC8_PW` writer - Protection context 8, privileged write enable."]
48pub type PC8_PW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
49#[doc = "Field `PC8_NS` reader - Protection context 8, non-secure."]
50pub type PC8_NS_R = crate::BitReader<bool>;
51#[doc = "Field `PC8_NS` writer - Protection context 8, non-secure."]
52pub type PC8_NS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
53#[doc = "Field `PC9_UR` reader - Protection context 9, user read enable."]
54pub type PC9_UR_R = crate::BitReader<bool>;
55#[doc = "Field `PC9_UW` reader - Protection context 9, user write enable."]
56pub type PC9_UW_R = crate::BitReader<bool>;
57#[doc = "Field `PC9_UW` writer - Protection context 9, user write enable."]
58pub type PC9_UW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
59#[doc = "Field `PC9_PR` reader - Protection context 9, privileged read enable."]
60pub type PC9_PR_R = crate::BitReader<bool>;
61#[doc = "Field `PC9_PW` reader - Protection context 9, privileged write enable."]
62pub type PC9_PW_R = crate::BitReader<bool>;
63#[doc = "Field `PC9_PW` writer - Protection context 9, privileged write enable."]
64pub type PC9_PW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
65#[doc = "Field `PC9_NS` reader - Protection context 9, non-secure."]
66pub type PC9_NS_R = crate::BitReader<bool>;
67#[doc = "Field `PC9_NS` writer - Protection context 9, non-secure."]
68pub type PC9_NS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
69#[doc = "Field `PC10_UR` reader - Protection context 10, user read enable."]
70pub type PC10_UR_R = crate::BitReader<bool>;
71#[doc = "Field `PC10_UW` reader - Protection context 10, user write enable."]
72pub type PC10_UW_R = crate::BitReader<bool>;
73#[doc = "Field `PC10_UW` writer - Protection context 10, user write enable."]
74pub type PC10_UW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
75#[doc = "Field `PC10_PR` reader - Protection context 10, privileged read enable."]
76pub type PC10_PR_R = crate::BitReader<bool>;
77#[doc = "Field `PC10_PW` reader - Protection context 10, privileged write enable."]
78pub type PC10_PW_R = crate::BitReader<bool>;
79#[doc = "Field `PC10_PW` writer - Protection context 10, privileged write enable."]
80pub type PC10_PW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
81#[doc = "Field `PC10_NS` reader - Protection context 10, non-secure."]
82pub type PC10_NS_R = crate::BitReader<bool>;
83#[doc = "Field `PC10_NS` writer - Protection context 10, non-secure."]
84pub type PC10_NS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
85#[doc = "Field `PC11_UR` reader - Protection context 11, user read enable."]
86pub type PC11_UR_R = crate::BitReader<bool>;
87#[doc = "Field `PC11_UW` reader - Protection context 11, user write enable."]
88pub type PC11_UW_R = crate::BitReader<bool>;
89#[doc = "Field `PC11_UW` writer - Protection context 11, user write enable."]
90pub type PC11_UW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
91#[doc = "Field `PC11_PR` reader - Protection context 11, privileged read enable."]
92pub type PC11_PR_R = crate::BitReader<bool>;
93#[doc = "Field `PC11_PW` reader - Protection context 11, privileged write enable."]
94pub type PC11_PW_R = crate::BitReader<bool>;
95#[doc = "Field `PC11_PW` writer - Protection context 11, privileged write enable."]
96pub type PC11_PW_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
97#[doc = "Field `PC11_NS` reader - Protection context 11, non-secure."]
98pub type PC11_NS_R = crate::BitReader<bool>;
99#[doc = "Field `PC11_NS` writer - Protection context 11, non-secure."]
100pub type PC11_NS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MS_ATT2_SPEC, bool, O>;
101impl R {
102    #[doc = "Bit 0 - Protection context 8, user read enable."]
103    #[inline(always)]
104    pub fn pc8_ur(&self) -> PC8_UR_R {
105        PC8_UR_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - Protection context 8, user write enable."]
108    #[inline(always)]
109    pub fn pc8_uw(&self) -> PC8_UW_R {
110        PC8_UW_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - Protection context 8, privileged read enable."]
113    #[inline(always)]
114    pub fn pc8_pr(&self) -> PC8_PR_R {
115        PC8_PR_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - Protection context 8, privileged write enable."]
118    #[inline(always)]
119    pub fn pc8_pw(&self) -> PC8_PW_R {
120        PC8_PW_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - Protection context 8, non-secure."]
123    #[inline(always)]
124    pub fn pc8_ns(&self) -> PC8_NS_R {
125        PC8_NS_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 8 - Protection context 9, user read enable."]
128    #[inline(always)]
129    pub fn pc9_ur(&self) -> PC9_UR_R {
130        PC9_UR_R::new(((self.bits >> 8) & 1) != 0)
131    }
132    #[doc = "Bit 9 - Protection context 9, user write enable."]
133    #[inline(always)]
134    pub fn pc9_uw(&self) -> PC9_UW_R {
135        PC9_UW_R::new(((self.bits >> 9) & 1) != 0)
136    }
137    #[doc = "Bit 10 - Protection context 9, privileged read enable."]
138    #[inline(always)]
139    pub fn pc9_pr(&self) -> PC9_PR_R {
140        PC9_PR_R::new(((self.bits >> 10) & 1) != 0)
141    }
142    #[doc = "Bit 11 - Protection context 9, privileged write enable."]
143    #[inline(always)]
144    pub fn pc9_pw(&self) -> PC9_PW_R {
145        PC9_PW_R::new(((self.bits >> 11) & 1) != 0)
146    }
147    #[doc = "Bit 12 - Protection context 9, non-secure."]
148    #[inline(always)]
149    pub fn pc9_ns(&self) -> PC9_NS_R {
150        PC9_NS_R::new(((self.bits >> 12) & 1) != 0)
151    }
152    #[doc = "Bit 16 - Protection context 10, user read enable."]
153    #[inline(always)]
154    pub fn pc10_ur(&self) -> PC10_UR_R {
155        PC10_UR_R::new(((self.bits >> 16) & 1) != 0)
156    }
157    #[doc = "Bit 17 - Protection context 10, user write enable."]
158    #[inline(always)]
159    pub fn pc10_uw(&self) -> PC10_UW_R {
160        PC10_UW_R::new(((self.bits >> 17) & 1) != 0)
161    }
162    #[doc = "Bit 18 - Protection context 10, privileged read enable."]
163    #[inline(always)]
164    pub fn pc10_pr(&self) -> PC10_PR_R {
165        PC10_PR_R::new(((self.bits >> 18) & 1) != 0)
166    }
167    #[doc = "Bit 19 - Protection context 10, privileged write enable."]
168    #[inline(always)]
169    pub fn pc10_pw(&self) -> PC10_PW_R {
170        PC10_PW_R::new(((self.bits >> 19) & 1) != 0)
171    }
172    #[doc = "Bit 20 - Protection context 10, non-secure."]
173    #[inline(always)]
174    pub fn pc10_ns(&self) -> PC10_NS_R {
175        PC10_NS_R::new(((self.bits >> 20) & 1) != 0)
176    }
177    #[doc = "Bit 24 - Protection context 11, user read enable."]
178    #[inline(always)]
179    pub fn pc11_ur(&self) -> PC11_UR_R {
180        PC11_UR_R::new(((self.bits >> 24) & 1) != 0)
181    }
182    #[doc = "Bit 25 - Protection context 11, user write enable."]
183    #[inline(always)]
184    pub fn pc11_uw(&self) -> PC11_UW_R {
185        PC11_UW_R::new(((self.bits >> 25) & 1) != 0)
186    }
187    #[doc = "Bit 26 - Protection context 11, privileged read enable."]
188    #[inline(always)]
189    pub fn pc11_pr(&self) -> PC11_PR_R {
190        PC11_PR_R::new(((self.bits >> 26) & 1) != 0)
191    }
192    #[doc = "Bit 27 - Protection context 11, privileged write enable."]
193    #[inline(always)]
194    pub fn pc11_pw(&self) -> PC11_PW_R {
195        PC11_PW_R::new(((self.bits >> 27) & 1) != 0)
196    }
197    #[doc = "Bit 28 - Protection context 11, non-secure."]
198    #[inline(always)]
199    pub fn pc11_ns(&self) -> PC11_NS_R {
200        PC11_NS_R::new(((self.bits >> 28) & 1) != 0)
201    }
202}
203impl W {
204    #[doc = "Bit 1 - Protection context 8, user write enable."]
205    #[inline(always)]
206    #[must_use]
207    pub fn pc8_uw(&mut self) -> PC8_UW_W<1> {
208        PC8_UW_W::new(self)
209    }
210    #[doc = "Bit 3 - Protection context 8, privileged write enable."]
211    #[inline(always)]
212    #[must_use]
213    pub fn pc8_pw(&mut self) -> PC8_PW_W<3> {
214        PC8_PW_W::new(self)
215    }
216    #[doc = "Bit 4 - Protection context 8, non-secure."]
217    #[inline(always)]
218    #[must_use]
219    pub fn pc8_ns(&mut self) -> PC8_NS_W<4> {
220        PC8_NS_W::new(self)
221    }
222    #[doc = "Bit 9 - Protection context 9, user write enable."]
223    #[inline(always)]
224    #[must_use]
225    pub fn pc9_uw(&mut self) -> PC9_UW_W<9> {
226        PC9_UW_W::new(self)
227    }
228    #[doc = "Bit 11 - Protection context 9, privileged write enable."]
229    #[inline(always)]
230    #[must_use]
231    pub fn pc9_pw(&mut self) -> PC9_PW_W<11> {
232        PC9_PW_W::new(self)
233    }
234    #[doc = "Bit 12 - Protection context 9, non-secure."]
235    #[inline(always)]
236    #[must_use]
237    pub fn pc9_ns(&mut self) -> PC9_NS_W<12> {
238        PC9_NS_W::new(self)
239    }
240    #[doc = "Bit 17 - Protection context 10, user write enable."]
241    #[inline(always)]
242    #[must_use]
243    pub fn pc10_uw(&mut self) -> PC10_UW_W<17> {
244        PC10_UW_W::new(self)
245    }
246    #[doc = "Bit 19 - Protection context 10, privileged write enable."]
247    #[inline(always)]
248    #[must_use]
249    pub fn pc10_pw(&mut self) -> PC10_PW_W<19> {
250        PC10_PW_W::new(self)
251    }
252    #[doc = "Bit 20 - Protection context 10, non-secure."]
253    #[inline(always)]
254    #[must_use]
255    pub fn pc10_ns(&mut self) -> PC10_NS_W<20> {
256        PC10_NS_W::new(self)
257    }
258    #[doc = "Bit 25 - Protection context 11, user write enable."]
259    #[inline(always)]
260    #[must_use]
261    pub fn pc11_uw(&mut self) -> PC11_UW_W<25> {
262        PC11_UW_W::new(self)
263    }
264    #[doc = "Bit 27 - Protection context 11, privileged write enable."]
265    #[inline(always)]
266    #[must_use]
267    pub fn pc11_pw(&mut self) -> PC11_PW_W<27> {
268        PC11_PW_W::new(self)
269    }
270    #[doc = "Bit 28 - Protection context 11, non-secure."]
271    #[inline(always)]
272    #[must_use]
273    pub fn pc11_ns(&mut self) -> PC11_NS_W<28> {
274        PC11_NS_W::new(self)
275    }
276    #[doc = "Writes raw bits to the register."]
277    #[inline(always)]
278    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
279        self.0.bits(bits);
280        self
281    }
282}
283#[doc = "Master attributes 2\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 [ms_att2](index.html) module"]
284pub struct MS_ATT2_SPEC;
285impl crate::RegisterSpec for MS_ATT2_SPEC {
286    type Ux = u32;
287}
288#[doc = "`read()` method returns [ms_att2::R](R) reader structure"]
289impl crate::Readable for MS_ATT2_SPEC {
290    type Reader = R;
291}
292#[doc = "`write(|w| ..)` method takes [ms_att2::W](W) writer structure"]
293impl crate::Writable for MS_ATT2_SPEC {
294    type Writer = W;
295    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
296    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
297}
298#[doc = "`reset()` method sets MS_ATT2 to value 0x1f1f_1f1f"]
299impl crate::Resettable for MS_ATT2_SPEC {
300    const RESET_VALUE: Self::Ux = 0x1f1f_1f1f;
301}