stm32g0_staging/stm32g030/flash/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type PG_R = crate::BitReader;
7pub type PG_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type PER_R = crate::BitReader;
11pub type PER_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type MER1_R = crate::BitReader;
15pub type MER1_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type PNB_R = crate::FieldReader<u16>;
19pub type PNB_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
21pub type BKER_R = crate::BitReader;
23pub type BKER_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type MER2_R = crate::BitReader;
27pub type MER2_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type STRT_R = crate::BitReader;
31pub type STRT_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type OPTSTRT_R = crate::BitReader;
35pub type OPTSTRT_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type FSTPG_R = crate::BitReader;
39pub type FSTPG_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type EOPIE_R = crate::BitReader;
43pub type EOPIE_W<'a, REG> = crate::BitWriter<'a, REG>;
45pub type ERRIE_R = crate::BitReader;
47pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type OBL_LAUNCH_R = crate::BitReader;
51pub type OBL_LAUNCH_W<'a, REG> = crate::BitWriter<'a, REG>;
53pub type OPTLOCK_R = crate::BitReader;
55pub type OPTLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type LOCK_R = crate::BitReader;
59pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
61impl R {
62 #[inline(always)]
64 pub fn pg(&self) -> PG_R {
65 PG_R::new((self.bits & 1) != 0)
66 }
67 #[inline(always)]
69 pub fn per(&self) -> PER_R {
70 PER_R::new(((self.bits >> 1) & 1) != 0)
71 }
72 #[inline(always)]
74 pub fn mer1(&self) -> MER1_R {
75 MER1_R::new(((self.bits >> 2) & 1) != 0)
76 }
77 #[inline(always)]
79 pub fn pnb(&self) -> PNB_R {
80 PNB_R::new(((self.bits >> 3) & 0x03ff) as u16)
81 }
82 #[inline(always)]
84 pub fn bker(&self) -> BKER_R {
85 BKER_R::new(((self.bits >> 13) & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn mer2(&self) -> MER2_R {
90 MER2_R::new(((self.bits >> 15) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn strt(&self) -> STRT_R {
95 STRT_R::new(((self.bits >> 16) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn optstrt(&self) -> OPTSTRT_R {
100 OPTSTRT_R::new(((self.bits >> 17) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn fstpg(&self) -> FSTPG_R {
105 FSTPG_R::new(((self.bits >> 18) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn eopie(&self) -> EOPIE_R {
110 EOPIE_R::new(((self.bits >> 24) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn errie(&self) -> ERRIE_R {
115 ERRIE_R::new(((self.bits >> 25) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn obl_launch(&self) -> OBL_LAUNCH_R {
120 OBL_LAUNCH_R::new(((self.bits >> 27) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn optlock(&self) -> OPTLOCK_R {
125 OPTLOCK_R::new(((self.bits >> 30) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn lock(&self) -> LOCK_R {
130 LOCK_R::new(((self.bits >> 31) & 1) != 0)
131 }
132}
133impl core::fmt::Debug for R {
134 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
135 f.debug_struct("CR")
136 .field("pg", &self.pg())
137 .field("per", &self.per())
138 .field("mer1", &self.mer1())
139 .field("pnb", &self.pnb())
140 .field("bker", &self.bker())
141 .field("mer2", &self.mer2())
142 .field("strt", &self.strt())
143 .field("optstrt", &self.optstrt())
144 .field("fstpg", &self.fstpg())
145 .field("eopie", &self.eopie())
146 .field("errie", &self.errie())
147 .field("obl_launch", &self.obl_launch())
148 .field("optlock", &self.optlock())
149 .field("lock", &self.lock())
150 .finish()
151 }
152}
153impl W {
154 #[inline(always)]
156 pub fn pg(&mut self) -> PG_W<CRrs> {
157 PG_W::new(self, 0)
158 }
159 #[inline(always)]
161 pub fn per(&mut self) -> PER_W<CRrs> {
162 PER_W::new(self, 1)
163 }
164 #[inline(always)]
166 pub fn mer1(&mut self) -> MER1_W<CRrs> {
167 MER1_W::new(self, 2)
168 }
169 #[inline(always)]
171 pub fn pnb(&mut self) -> PNB_W<CRrs> {
172 PNB_W::new(self, 3)
173 }
174 #[inline(always)]
176 pub fn bker(&mut self) -> BKER_W<CRrs> {
177 BKER_W::new(self, 13)
178 }
179 #[inline(always)]
181 pub fn mer2(&mut self) -> MER2_W<CRrs> {
182 MER2_W::new(self, 15)
183 }
184 #[inline(always)]
186 pub fn strt(&mut self) -> STRT_W<CRrs> {
187 STRT_W::new(self, 16)
188 }
189 #[inline(always)]
191 pub fn optstrt(&mut self) -> OPTSTRT_W<CRrs> {
192 OPTSTRT_W::new(self, 17)
193 }
194 #[inline(always)]
196 pub fn fstpg(&mut self) -> FSTPG_W<CRrs> {
197 FSTPG_W::new(self, 18)
198 }
199 #[inline(always)]
201 pub fn eopie(&mut self) -> EOPIE_W<CRrs> {
202 EOPIE_W::new(self, 24)
203 }
204 #[inline(always)]
206 pub fn errie(&mut self) -> ERRIE_W<CRrs> {
207 ERRIE_W::new(self, 25)
208 }
209 #[inline(always)]
211 pub fn obl_launch(&mut self) -> OBL_LAUNCH_W<CRrs> {
212 OBL_LAUNCH_W::new(self, 27)
213 }
214 #[inline(always)]
216 pub fn optlock(&mut self) -> OPTLOCK_W<CRrs> {
217 OPTLOCK_W::new(self, 30)
218 }
219 #[inline(always)]
221 pub fn lock(&mut self) -> LOCK_W<CRrs> {
222 LOCK_W::new(self, 31)
223 }
224}
225pub struct CRrs;
231impl crate::RegisterSpec for CRrs {
232 type Ux = u32;
233}
234impl crate::Readable for CRrs {}
236impl crate::Writable for CRrs {
238 type Safety = crate::Unsafe;
239 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
240 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
241}
242impl crate::Resettable for CRrs {
244 const RESET_VALUE: u32 = 0xc000_0000;
245}