stm32f3_staging/stm32f303/syscfg/
rcr.rs

1///Register `RCR` reader
2pub type R = crate::R<RCRrs>;
3///Register `RCR` writer
4pub type W = crate::W<RCRrs>;
5/**CCM SRAM page write protection bit
6
7Value on reset: 0*/
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum PAGE0_WP {
11    ///0: Write protection of pagex is disabled
12    Disabled = 0,
13    ///1: Write protection of pagex is enabled
14    Enabled = 1,
15}
16impl From<PAGE0_WP> for bool {
17    #[inline(always)]
18    fn from(variant: PAGE0_WP) -> Self {
19        variant as u8 != 0
20    }
21}
22///Field `PAGE0_WP` reader - CCM SRAM page write protection bit
23pub type PAGE0_WP_R = crate::BitReader<PAGE0_WP>;
24impl PAGE0_WP_R {
25    ///Get enumerated values variant
26    #[inline(always)]
27    pub const fn variant(&self) -> PAGE0_WP {
28        match self.bits {
29            false => PAGE0_WP::Disabled,
30            true => PAGE0_WP::Enabled,
31        }
32    }
33    ///Write protection of pagex is disabled
34    #[inline(always)]
35    pub fn is_disabled(&self) -> bool {
36        *self == PAGE0_WP::Disabled
37    }
38    ///Write protection of pagex is enabled
39    #[inline(always)]
40    pub fn is_enabled(&self) -> bool {
41        *self == PAGE0_WP::Enabled
42    }
43}
44///Field `PAGE0_WP` writer - CCM SRAM page write protection bit
45pub type PAGE0_WP_W<'a, REG> = crate::BitWriter<'a, REG, PAGE0_WP>;
46impl<'a, REG> PAGE0_WP_W<'a, REG>
47where
48    REG: crate::Writable + crate::RegisterSpec,
49{
50    ///Write protection of pagex is disabled
51    #[inline(always)]
52    pub fn disabled(self) -> &'a mut crate::W<REG> {
53        self.variant(PAGE0_WP::Disabled)
54    }
55    ///Write protection of pagex is enabled
56    #[inline(always)]
57    pub fn enabled(self) -> &'a mut crate::W<REG> {
58        self.variant(PAGE0_WP::Enabled)
59    }
60}
61///Field `PAGE1_WP` reader - CCM SRAM page write protection bit
62pub use PAGE0_WP_R as PAGE1_WP_R;
63///Field `PAGE2_WP` reader - CCM SRAM page write protection bit
64pub use PAGE0_WP_R as PAGE2_WP_R;
65///Field `PAGE3_WP` reader - CCM SRAM page write protection bit
66pub use PAGE0_WP_R as PAGE3_WP_R;
67///Field `PAGE4_WP` reader - CCM SRAM page write protection bit
68pub use PAGE0_WP_R as PAGE4_WP_R;
69///Field `PAGE5_WP` reader - CCM SRAM page write protection bit
70pub use PAGE0_WP_R as PAGE5_WP_R;
71///Field `PAGE6_WP` reader - CCM SRAM page write protection bit
72pub use PAGE0_WP_R as PAGE6_WP_R;
73///Field `PAGE7_WP` reader - CCM SRAM page write protection bit
74pub use PAGE0_WP_R as PAGE7_WP_R;
75///Field `PAGE8_WP` reader - CCM SRAM page write protection bit
76pub use PAGE0_WP_R as PAGE8_WP_R;
77///Field `PAGE9_WP` reader - CCM SRAM page write protection bit
78pub use PAGE0_WP_R as PAGE9_WP_R;
79///Field `PAGE10_WP` reader - CCM SRAM page write protection bit
80pub use PAGE0_WP_R as PAGE10_WP_R;
81///Field `PAGE11_WP` reader - CCM SRAM page write protection bit
82pub use PAGE0_WP_R as PAGE11_WP_R;
83///Field `PAGE12_WP` reader - CCM SRAM page write protection bit
84pub use PAGE0_WP_R as PAGE12_WP_R;
85///Field `PAGE13_WP` reader - CCM SRAM page write protection bit
86pub use PAGE0_WP_R as PAGE13_WP_R;
87///Field `PAGE14_WP` reader - CCM SRAM page write protection bit
88pub use PAGE0_WP_R as PAGE14_WP_R;
89///Field `PAGE15_WP` reader - CCM SRAM page write protection bit
90pub use PAGE0_WP_R as PAGE15_WP_R;
91///Field `PAGE1_WP` writer - CCM SRAM page write protection bit
92pub use PAGE0_WP_W as PAGE1_WP_W;
93///Field `PAGE2_WP` writer - CCM SRAM page write protection bit
94pub use PAGE0_WP_W as PAGE2_WP_W;
95///Field `PAGE3_WP` writer - CCM SRAM page write protection bit
96pub use PAGE0_WP_W as PAGE3_WP_W;
97///Field `PAGE4_WP` writer - CCM SRAM page write protection bit
98pub use PAGE0_WP_W as PAGE4_WP_W;
99///Field `PAGE5_WP` writer - CCM SRAM page write protection bit
100pub use PAGE0_WP_W as PAGE5_WP_W;
101///Field `PAGE6_WP` writer - CCM SRAM page write protection bit
102pub use PAGE0_WP_W as PAGE6_WP_W;
103///Field `PAGE7_WP` writer - CCM SRAM page write protection bit
104pub use PAGE0_WP_W as PAGE7_WP_W;
105///Field `PAGE8_WP` writer - CCM SRAM page write protection bit
106pub use PAGE0_WP_W as PAGE8_WP_W;
107///Field `PAGE9_WP` writer - CCM SRAM page write protection bit
108pub use PAGE0_WP_W as PAGE9_WP_W;
109///Field `PAGE10_WP` writer - CCM SRAM page write protection bit
110pub use PAGE0_WP_W as PAGE10_WP_W;
111///Field `PAGE11_WP` writer - CCM SRAM page write protection bit
112pub use PAGE0_WP_W as PAGE11_WP_W;
113///Field `PAGE12_WP` writer - CCM SRAM page write protection bit
114pub use PAGE0_WP_W as PAGE12_WP_W;
115///Field `PAGE13_WP` writer - CCM SRAM page write protection bit
116pub use PAGE0_WP_W as PAGE13_WP_W;
117///Field `PAGE14_WP` writer - CCM SRAM page write protection bit
118pub use PAGE0_WP_W as PAGE14_WP_W;
119///Field `PAGE15_WP` writer - CCM SRAM page write protection bit
120pub use PAGE0_WP_W as PAGE15_WP_W;
121impl R {
122    ///Bit 0 - CCM SRAM page write protection bit
123    #[inline(always)]
124    pub fn page0_wp(&self) -> PAGE0_WP_R {
125        PAGE0_WP_R::new((self.bits & 1) != 0)
126    }
127    ///Bit 1 - CCM SRAM page write protection bit
128    #[inline(always)]
129    pub fn page1_wp(&self) -> PAGE1_WP_R {
130        PAGE1_WP_R::new(((self.bits >> 1) & 1) != 0)
131    }
132    ///Bit 2 - CCM SRAM page write protection bit
133    #[inline(always)]
134    pub fn page2_wp(&self) -> PAGE2_WP_R {
135        PAGE2_WP_R::new(((self.bits >> 2) & 1) != 0)
136    }
137    ///Bit 3 - CCM SRAM page write protection bit
138    #[inline(always)]
139    pub fn page3_wp(&self) -> PAGE3_WP_R {
140        PAGE3_WP_R::new(((self.bits >> 3) & 1) != 0)
141    }
142    ///Bit 4 - CCM SRAM page write protection bit
143    #[inline(always)]
144    pub fn page4_wp(&self) -> PAGE4_WP_R {
145        PAGE4_WP_R::new(((self.bits >> 4) & 1) != 0)
146    }
147    ///Bit 5 - CCM SRAM page write protection bit
148    #[inline(always)]
149    pub fn page5_wp(&self) -> PAGE5_WP_R {
150        PAGE5_WP_R::new(((self.bits >> 5) & 1) != 0)
151    }
152    ///Bit 6 - CCM SRAM page write protection bit
153    #[inline(always)]
154    pub fn page6_wp(&self) -> PAGE6_WP_R {
155        PAGE6_WP_R::new(((self.bits >> 6) & 1) != 0)
156    }
157    ///Bit 7 - CCM SRAM page write protection bit
158    #[inline(always)]
159    pub fn page7_wp(&self) -> PAGE7_WP_R {
160        PAGE7_WP_R::new(((self.bits >> 7) & 1) != 0)
161    }
162    ///Bit 8 - CCM SRAM page write protection bit
163    #[inline(always)]
164    pub fn page8_wp(&self) -> PAGE8_WP_R {
165        PAGE8_WP_R::new(((self.bits >> 8) & 1) != 0)
166    }
167    ///Bit 9 - CCM SRAM page write protection bit
168    #[inline(always)]
169    pub fn page9_wp(&self) -> PAGE9_WP_R {
170        PAGE9_WP_R::new(((self.bits >> 9) & 1) != 0)
171    }
172    ///Bit 10 - CCM SRAM page write protection bit
173    #[inline(always)]
174    pub fn page10_wp(&self) -> PAGE10_WP_R {
175        PAGE10_WP_R::new(((self.bits >> 10) & 1) != 0)
176    }
177    ///Bit 11 - CCM SRAM page write protection bit
178    #[inline(always)]
179    pub fn page11_wp(&self) -> PAGE11_WP_R {
180        PAGE11_WP_R::new(((self.bits >> 11) & 1) != 0)
181    }
182    ///Bit 12 - CCM SRAM page write protection bit
183    #[inline(always)]
184    pub fn page12_wp(&self) -> PAGE12_WP_R {
185        PAGE12_WP_R::new(((self.bits >> 12) & 1) != 0)
186    }
187    ///Bit 13 - CCM SRAM page write protection bit
188    #[inline(always)]
189    pub fn page13_wp(&self) -> PAGE13_WP_R {
190        PAGE13_WP_R::new(((self.bits >> 13) & 1) != 0)
191    }
192    ///Bit 14 - CCM SRAM page write protection bit
193    #[inline(always)]
194    pub fn page14_wp(&self) -> PAGE14_WP_R {
195        PAGE14_WP_R::new(((self.bits >> 14) & 1) != 0)
196    }
197    ///Bit 15 - CCM SRAM page write protection bit
198    #[inline(always)]
199    pub fn page15_wp(&self) -> PAGE15_WP_R {
200        PAGE15_WP_R::new(((self.bits >> 15) & 1) != 0)
201    }
202}
203impl core::fmt::Debug for R {
204    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
205        f.debug_struct("RCR")
206            .field("page0_wp", &self.page0_wp())
207            .field("page1_wp", &self.page1_wp())
208            .field("page2_wp", &self.page2_wp())
209            .field("page3_wp", &self.page3_wp())
210            .field("page4_wp", &self.page4_wp())
211            .field("page5_wp", &self.page5_wp())
212            .field("page6_wp", &self.page6_wp())
213            .field("page7_wp", &self.page7_wp())
214            .field("page8_wp", &self.page8_wp())
215            .field("page9_wp", &self.page9_wp())
216            .field("page10_wp", &self.page10_wp())
217            .field("page11_wp", &self.page11_wp())
218            .field("page12_wp", &self.page12_wp())
219            .field("page13_wp", &self.page13_wp())
220            .field("page14_wp", &self.page14_wp())
221            .field("page15_wp", &self.page15_wp())
222            .finish()
223    }
224}
225impl W {
226    ///Bit 0 - CCM SRAM page write protection bit
227    #[inline(always)]
228    pub fn page0_wp(&mut self) -> PAGE0_WP_W<RCRrs> {
229        PAGE0_WP_W::new(self, 0)
230    }
231    ///Bit 1 - CCM SRAM page write protection bit
232    #[inline(always)]
233    pub fn page1_wp(&mut self) -> PAGE1_WP_W<RCRrs> {
234        PAGE1_WP_W::new(self, 1)
235    }
236    ///Bit 2 - CCM SRAM page write protection bit
237    #[inline(always)]
238    pub fn page2_wp(&mut self) -> PAGE2_WP_W<RCRrs> {
239        PAGE2_WP_W::new(self, 2)
240    }
241    ///Bit 3 - CCM SRAM page write protection bit
242    #[inline(always)]
243    pub fn page3_wp(&mut self) -> PAGE3_WP_W<RCRrs> {
244        PAGE3_WP_W::new(self, 3)
245    }
246    ///Bit 4 - CCM SRAM page write protection bit
247    #[inline(always)]
248    pub fn page4_wp(&mut self) -> PAGE4_WP_W<RCRrs> {
249        PAGE4_WP_W::new(self, 4)
250    }
251    ///Bit 5 - CCM SRAM page write protection bit
252    #[inline(always)]
253    pub fn page5_wp(&mut self) -> PAGE5_WP_W<RCRrs> {
254        PAGE5_WP_W::new(self, 5)
255    }
256    ///Bit 6 - CCM SRAM page write protection bit
257    #[inline(always)]
258    pub fn page6_wp(&mut self) -> PAGE6_WP_W<RCRrs> {
259        PAGE6_WP_W::new(self, 6)
260    }
261    ///Bit 7 - CCM SRAM page write protection bit
262    #[inline(always)]
263    pub fn page7_wp(&mut self) -> PAGE7_WP_W<RCRrs> {
264        PAGE7_WP_W::new(self, 7)
265    }
266    ///Bit 8 - CCM SRAM page write protection bit
267    #[inline(always)]
268    pub fn page8_wp(&mut self) -> PAGE8_WP_W<RCRrs> {
269        PAGE8_WP_W::new(self, 8)
270    }
271    ///Bit 9 - CCM SRAM page write protection bit
272    #[inline(always)]
273    pub fn page9_wp(&mut self) -> PAGE9_WP_W<RCRrs> {
274        PAGE9_WP_W::new(self, 9)
275    }
276    ///Bit 10 - CCM SRAM page write protection bit
277    #[inline(always)]
278    pub fn page10_wp(&mut self) -> PAGE10_WP_W<RCRrs> {
279        PAGE10_WP_W::new(self, 10)
280    }
281    ///Bit 11 - CCM SRAM page write protection bit
282    #[inline(always)]
283    pub fn page11_wp(&mut self) -> PAGE11_WP_W<RCRrs> {
284        PAGE11_WP_W::new(self, 11)
285    }
286    ///Bit 12 - CCM SRAM page write protection bit
287    #[inline(always)]
288    pub fn page12_wp(&mut self) -> PAGE12_WP_W<RCRrs> {
289        PAGE12_WP_W::new(self, 12)
290    }
291    ///Bit 13 - CCM SRAM page write protection bit
292    #[inline(always)]
293    pub fn page13_wp(&mut self) -> PAGE13_WP_W<RCRrs> {
294        PAGE13_WP_W::new(self, 13)
295    }
296    ///Bit 14 - CCM SRAM page write protection bit
297    #[inline(always)]
298    pub fn page14_wp(&mut self) -> PAGE14_WP_W<RCRrs> {
299        PAGE14_WP_W::new(self, 14)
300    }
301    ///Bit 15 - CCM SRAM page write protection bit
302    #[inline(always)]
303    pub fn page15_wp(&mut self) -> PAGE15_WP_W<RCRrs> {
304        PAGE15_WP_W::new(self, 15)
305    }
306}
307/**CCM SRAM protection register
308
309You can [`read`](crate::Reg::read) this register and get [`rcr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rcr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
310
311See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SYSCFG:RCR)*/
312pub struct RCRrs;
313impl crate::RegisterSpec for RCRrs {
314    type Ux = u32;
315}
316///`read()` method returns [`rcr::R`](R) reader structure
317impl crate::Readable for RCRrs {}
318///`write(|w| ..)` method takes [`rcr::W`](W) writer structure
319impl crate::Writable for RCRrs {
320    type Safety = crate::Unsafe;
321    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
322    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
323}
324///`reset()` method sets RCR to value 0
325impl crate::Resettable for RCRrs {
326    const RESET_VALUE: u32 = 0;
327}