stm32f7_staging/stm32f779/exti/
swier.rs1pub type R = crate::R<SWIERrs>;
3pub type W = crate::W<SWIERrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum SOFTWARE_INTERRUPT {
11 Pend = 1,
13}
14impl From<SOFTWARE_INTERRUPT> for bool {
15 #[inline(always)]
16 fn from(variant: SOFTWARE_INTERRUPT) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type SWIER_R = crate::BitReader<SOFTWARE_INTERRUPT>;
22impl SWIER_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<SOFTWARE_INTERRUPT> {
26 match self.bits {
27 true => Some(SOFTWARE_INTERRUPT::Pend),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_pend(&self) -> bool {
34 *self == SOFTWARE_INTERRUPT::Pend
35 }
36}
37pub type SWIER_W<'a, REG> = crate::BitWriter<'a, REG, SOFTWARE_INTERRUPT>;
39impl<'a, REG> SWIER_W<'a, REG>
40where
41 REG: crate::Writable + crate::RegisterSpec,
42{
43 #[inline(always)]
45 pub fn pend(self) -> &'a mut crate::W<REG> {
46 self.variant(SOFTWARE_INTERRUPT::Pend)
47 }
48}
49impl R {
50 #[inline(always)]
54 pub fn swier(&self, n: u8) -> SWIER_R {
55 #[allow(clippy::no_effect)]
56 [(); 23][n as usize];
57 SWIER_R::new(((self.bits >> n) & 1) != 0)
58 }
59 #[inline(always)]
62 pub fn swier_iter(&self) -> impl Iterator<Item = SWIER_R> + '_ {
63 (0..23).map(move |n| SWIER_R::new(((self.bits >> n) & 1) != 0))
64 }
65 #[inline(always)]
67 pub fn swier0(&self) -> SWIER_R {
68 SWIER_R::new((self.bits & 1) != 0)
69 }
70 #[inline(always)]
72 pub fn swier1(&self) -> SWIER_R {
73 SWIER_R::new(((self.bits >> 1) & 1) != 0)
74 }
75 #[inline(always)]
77 pub fn swier2(&self) -> SWIER_R {
78 SWIER_R::new(((self.bits >> 2) & 1) != 0)
79 }
80 #[inline(always)]
82 pub fn swier3(&self) -> SWIER_R {
83 SWIER_R::new(((self.bits >> 3) & 1) != 0)
84 }
85 #[inline(always)]
87 pub fn swier4(&self) -> SWIER_R {
88 SWIER_R::new(((self.bits >> 4) & 1) != 0)
89 }
90 #[inline(always)]
92 pub fn swier5(&self) -> SWIER_R {
93 SWIER_R::new(((self.bits >> 5) & 1) != 0)
94 }
95 #[inline(always)]
97 pub fn swier6(&self) -> SWIER_R {
98 SWIER_R::new(((self.bits >> 6) & 1) != 0)
99 }
100 #[inline(always)]
102 pub fn swier7(&self) -> SWIER_R {
103 SWIER_R::new(((self.bits >> 7) & 1) != 0)
104 }
105 #[inline(always)]
107 pub fn swier8(&self) -> SWIER_R {
108 SWIER_R::new(((self.bits >> 8) & 1) != 0)
109 }
110 #[inline(always)]
112 pub fn swier9(&self) -> SWIER_R {
113 SWIER_R::new(((self.bits >> 9) & 1) != 0)
114 }
115 #[inline(always)]
117 pub fn swier10(&self) -> SWIER_R {
118 SWIER_R::new(((self.bits >> 10) & 1) != 0)
119 }
120 #[inline(always)]
122 pub fn swier11(&self) -> SWIER_R {
123 SWIER_R::new(((self.bits >> 11) & 1) != 0)
124 }
125 #[inline(always)]
127 pub fn swier12(&self) -> SWIER_R {
128 SWIER_R::new(((self.bits >> 12) & 1) != 0)
129 }
130 #[inline(always)]
132 pub fn swier13(&self) -> SWIER_R {
133 SWIER_R::new(((self.bits >> 13) & 1) != 0)
134 }
135 #[inline(always)]
137 pub fn swier14(&self) -> SWIER_R {
138 SWIER_R::new(((self.bits >> 14) & 1) != 0)
139 }
140 #[inline(always)]
142 pub fn swier15(&self) -> SWIER_R {
143 SWIER_R::new(((self.bits >> 15) & 1) != 0)
144 }
145 #[inline(always)]
147 pub fn swier16(&self) -> SWIER_R {
148 SWIER_R::new(((self.bits >> 16) & 1) != 0)
149 }
150 #[inline(always)]
152 pub fn swier17(&self) -> SWIER_R {
153 SWIER_R::new(((self.bits >> 17) & 1) != 0)
154 }
155 #[inline(always)]
157 pub fn swier18(&self) -> SWIER_R {
158 SWIER_R::new(((self.bits >> 18) & 1) != 0)
159 }
160 #[inline(always)]
162 pub fn swier19(&self) -> SWIER_R {
163 SWIER_R::new(((self.bits >> 19) & 1) != 0)
164 }
165 #[inline(always)]
167 pub fn swier20(&self) -> SWIER_R {
168 SWIER_R::new(((self.bits >> 20) & 1) != 0)
169 }
170 #[inline(always)]
172 pub fn swier21(&self) -> SWIER_R {
173 SWIER_R::new(((self.bits >> 21) & 1) != 0)
174 }
175 #[inline(always)]
177 pub fn swier22(&self) -> SWIER_R {
178 SWIER_R::new(((self.bits >> 22) & 1) != 0)
179 }
180}
181impl core::fmt::Debug for R {
182 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
183 f.debug_struct("SWIER")
184 .field("swier0", &self.swier0())
185 .field("swier1", &self.swier1())
186 .field("swier2", &self.swier2())
187 .field("swier3", &self.swier3())
188 .field("swier4", &self.swier4())
189 .field("swier5", &self.swier5())
190 .field("swier6", &self.swier6())
191 .field("swier7", &self.swier7())
192 .field("swier8", &self.swier8())
193 .field("swier9", &self.swier9())
194 .field("swier10", &self.swier10())
195 .field("swier11", &self.swier11())
196 .field("swier12", &self.swier12())
197 .field("swier13", &self.swier13())
198 .field("swier14", &self.swier14())
199 .field("swier15", &self.swier15())
200 .field("swier16", &self.swier16())
201 .field("swier17", &self.swier17())
202 .field("swier18", &self.swier18())
203 .field("swier19", &self.swier19())
204 .field("swier20", &self.swier20())
205 .field("swier21", &self.swier21())
206 .field("swier22", &self.swier22())
207 .finish()
208 }
209}
210impl W {
211 #[inline(always)]
215 pub fn swier(&mut self, n: u8) -> SWIER_W<SWIERrs> {
216 #[allow(clippy::no_effect)]
217 [(); 23][n as usize];
218 SWIER_W::new(self, n)
219 }
220 #[inline(always)]
222 pub fn swier0(&mut self) -> SWIER_W<SWIERrs> {
223 SWIER_W::new(self, 0)
224 }
225 #[inline(always)]
227 pub fn swier1(&mut self) -> SWIER_W<SWIERrs> {
228 SWIER_W::new(self, 1)
229 }
230 #[inline(always)]
232 pub fn swier2(&mut self) -> SWIER_W<SWIERrs> {
233 SWIER_W::new(self, 2)
234 }
235 #[inline(always)]
237 pub fn swier3(&mut self) -> SWIER_W<SWIERrs> {
238 SWIER_W::new(self, 3)
239 }
240 #[inline(always)]
242 pub fn swier4(&mut self) -> SWIER_W<SWIERrs> {
243 SWIER_W::new(self, 4)
244 }
245 #[inline(always)]
247 pub fn swier5(&mut self) -> SWIER_W<SWIERrs> {
248 SWIER_W::new(self, 5)
249 }
250 #[inline(always)]
252 pub fn swier6(&mut self) -> SWIER_W<SWIERrs> {
253 SWIER_W::new(self, 6)
254 }
255 #[inline(always)]
257 pub fn swier7(&mut self) -> SWIER_W<SWIERrs> {
258 SWIER_W::new(self, 7)
259 }
260 #[inline(always)]
262 pub fn swier8(&mut self) -> SWIER_W<SWIERrs> {
263 SWIER_W::new(self, 8)
264 }
265 #[inline(always)]
267 pub fn swier9(&mut self) -> SWIER_W<SWIERrs> {
268 SWIER_W::new(self, 9)
269 }
270 #[inline(always)]
272 pub fn swier10(&mut self) -> SWIER_W<SWIERrs> {
273 SWIER_W::new(self, 10)
274 }
275 #[inline(always)]
277 pub fn swier11(&mut self) -> SWIER_W<SWIERrs> {
278 SWIER_W::new(self, 11)
279 }
280 #[inline(always)]
282 pub fn swier12(&mut self) -> SWIER_W<SWIERrs> {
283 SWIER_W::new(self, 12)
284 }
285 #[inline(always)]
287 pub fn swier13(&mut self) -> SWIER_W<SWIERrs> {
288 SWIER_W::new(self, 13)
289 }
290 #[inline(always)]
292 pub fn swier14(&mut self) -> SWIER_W<SWIERrs> {
293 SWIER_W::new(self, 14)
294 }
295 #[inline(always)]
297 pub fn swier15(&mut self) -> SWIER_W<SWIERrs> {
298 SWIER_W::new(self, 15)
299 }
300 #[inline(always)]
302 pub fn swier16(&mut self) -> SWIER_W<SWIERrs> {
303 SWIER_W::new(self, 16)
304 }
305 #[inline(always)]
307 pub fn swier17(&mut self) -> SWIER_W<SWIERrs> {
308 SWIER_W::new(self, 17)
309 }
310 #[inline(always)]
312 pub fn swier18(&mut self) -> SWIER_W<SWIERrs> {
313 SWIER_W::new(self, 18)
314 }
315 #[inline(always)]
317 pub fn swier19(&mut self) -> SWIER_W<SWIERrs> {
318 SWIER_W::new(self, 19)
319 }
320 #[inline(always)]
322 pub fn swier20(&mut self) -> SWIER_W<SWIERrs> {
323 SWIER_W::new(self, 20)
324 }
325 #[inline(always)]
327 pub fn swier21(&mut self) -> SWIER_W<SWIERrs> {
328 SWIER_W::new(self, 21)
329 }
330 #[inline(always)]
332 pub fn swier22(&mut self) -> SWIER_W<SWIERrs> {
333 SWIER_W::new(self, 22)
334 }
335}
336pub struct SWIERrs;
342impl crate::RegisterSpec for SWIERrs {
343 type Ux = u32;
344}
345impl crate::Readable for SWIERrs {}
347impl crate::Writable for SWIERrs {
349 type Safety = crate::Unsafe;
350}
351impl crate::Resettable for SWIERrs {}