stm32f0/stm32f0x2/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 SWIER0_R = crate::BitReader<SOFTWARE_INTERRUPT>;
22impl SWIER0_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 SWIER0_W<'a, REG> = crate::BitWriter<'a, REG, SOFTWARE_INTERRUPT>;
39impl<'a, REG> SWIER0_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}
49pub use SWIER0_R as SWIER1_R;
51pub use SWIER0_R as SWIER2_R;
53pub use SWIER0_R as SWIER3_R;
55pub use SWIER0_R as SWIER4_R;
57pub use SWIER0_R as SWIER5_R;
59pub use SWIER0_R as SWIER6_R;
61pub use SWIER0_R as SWIER7_R;
63pub use SWIER0_R as SWIER8_R;
65pub use SWIER0_R as SWIER9_R;
67pub use SWIER0_R as SWIER10_R;
69pub use SWIER0_R as SWIER11_R;
71pub use SWIER0_R as SWIER12_R;
73pub use SWIER0_R as SWIER13_R;
75pub use SWIER0_R as SWIER14_R;
77pub use SWIER0_R as SWIER15_R;
79pub use SWIER0_R as SWIER16_R;
81pub use SWIER0_R as SWIER17_R;
83pub use SWIER0_R as SWIER19_R;
85pub use SWIER0_W as SWIER1_W;
87pub use SWIER0_W as SWIER2_W;
89pub use SWIER0_W as SWIER3_W;
91pub use SWIER0_W as SWIER4_W;
93pub use SWIER0_W as SWIER5_W;
95pub use SWIER0_W as SWIER6_W;
97pub use SWIER0_W as SWIER7_W;
99pub use SWIER0_W as SWIER8_W;
101pub use SWIER0_W as SWIER9_W;
103pub use SWIER0_W as SWIER10_W;
105pub use SWIER0_W as SWIER11_W;
107pub use SWIER0_W as SWIER12_W;
109pub use SWIER0_W as SWIER13_W;
111pub use SWIER0_W as SWIER14_W;
113pub use SWIER0_W as SWIER15_W;
115pub use SWIER0_W as SWIER16_W;
117pub use SWIER0_W as SWIER17_W;
119pub use SWIER0_W as SWIER19_W;
121impl R {
122 #[inline(always)]
124 pub fn swier0(&self) -> SWIER0_R {
125 SWIER0_R::new((self.bits & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn swier1(&self) -> SWIER1_R {
130 SWIER1_R::new(((self.bits >> 1) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn swier2(&self) -> SWIER2_R {
135 SWIER2_R::new(((self.bits >> 2) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn swier3(&self) -> SWIER3_R {
140 SWIER3_R::new(((self.bits >> 3) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn swier4(&self) -> SWIER4_R {
145 SWIER4_R::new(((self.bits >> 4) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn swier5(&self) -> SWIER5_R {
150 SWIER5_R::new(((self.bits >> 5) & 1) != 0)
151 }
152 #[inline(always)]
154 pub fn swier6(&self) -> SWIER6_R {
155 SWIER6_R::new(((self.bits >> 6) & 1) != 0)
156 }
157 #[inline(always)]
159 pub fn swier7(&self) -> SWIER7_R {
160 SWIER7_R::new(((self.bits >> 7) & 1) != 0)
161 }
162 #[inline(always)]
164 pub fn swier8(&self) -> SWIER8_R {
165 SWIER8_R::new(((self.bits >> 8) & 1) != 0)
166 }
167 #[inline(always)]
169 pub fn swier9(&self) -> SWIER9_R {
170 SWIER9_R::new(((self.bits >> 9) & 1) != 0)
171 }
172 #[inline(always)]
174 pub fn swier10(&self) -> SWIER10_R {
175 SWIER10_R::new(((self.bits >> 10) & 1) != 0)
176 }
177 #[inline(always)]
179 pub fn swier11(&self) -> SWIER11_R {
180 SWIER11_R::new(((self.bits >> 11) & 1) != 0)
181 }
182 #[inline(always)]
184 pub fn swier12(&self) -> SWIER12_R {
185 SWIER12_R::new(((self.bits >> 12) & 1) != 0)
186 }
187 #[inline(always)]
189 pub fn swier13(&self) -> SWIER13_R {
190 SWIER13_R::new(((self.bits >> 13) & 1) != 0)
191 }
192 #[inline(always)]
194 pub fn swier14(&self) -> SWIER14_R {
195 SWIER14_R::new(((self.bits >> 14) & 1) != 0)
196 }
197 #[inline(always)]
199 pub fn swier15(&self) -> SWIER15_R {
200 SWIER15_R::new(((self.bits >> 15) & 1) != 0)
201 }
202 #[inline(always)]
204 pub fn swier16(&self) -> SWIER16_R {
205 SWIER16_R::new(((self.bits >> 16) & 1) != 0)
206 }
207 #[inline(always)]
209 pub fn swier17(&self) -> SWIER17_R {
210 SWIER17_R::new(((self.bits >> 17) & 1) != 0)
211 }
212 #[inline(always)]
214 pub fn swier19(&self) -> SWIER19_R {
215 SWIER19_R::new(((self.bits >> 19) & 1) != 0)
216 }
217}
218impl core::fmt::Debug for R {
219 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
220 f.debug_struct("SWIER")
221 .field("swier0", &self.swier0())
222 .field("swier1", &self.swier1())
223 .field("swier2", &self.swier2())
224 .field("swier3", &self.swier3())
225 .field("swier4", &self.swier4())
226 .field("swier5", &self.swier5())
227 .field("swier6", &self.swier6())
228 .field("swier7", &self.swier7())
229 .field("swier8", &self.swier8())
230 .field("swier9", &self.swier9())
231 .field("swier10", &self.swier10())
232 .field("swier11", &self.swier11())
233 .field("swier12", &self.swier12())
234 .field("swier13", &self.swier13())
235 .field("swier14", &self.swier14())
236 .field("swier15", &self.swier15())
237 .field("swier16", &self.swier16())
238 .field("swier17", &self.swier17())
239 .field("swier19", &self.swier19())
240 .finish()
241 }
242}
243impl W {
244 #[inline(always)]
246 pub fn swier0(&mut self) -> SWIER0_W<SWIERrs> {
247 SWIER0_W::new(self, 0)
248 }
249 #[inline(always)]
251 pub fn swier1(&mut self) -> SWIER1_W<SWIERrs> {
252 SWIER1_W::new(self, 1)
253 }
254 #[inline(always)]
256 pub fn swier2(&mut self) -> SWIER2_W<SWIERrs> {
257 SWIER2_W::new(self, 2)
258 }
259 #[inline(always)]
261 pub fn swier3(&mut self) -> SWIER3_W<SWIERrs> {
262 SWIER3_W::new(self, 3)
263 }
264 #[inline(always)]
266 pub fn swier4(&mut self) -> SWIER4_W<SWIERrs> {
267 SWIER4_W::new(self, 4)
268 }
269 #[inline(always)]
271 pub fn swier5(&mut self) -> SWIER5_W<SWIERrs> {
272 SWIER5_W::new(self, 5)
273 }
274 #[inline(always)]
276 pub fn swier6(&mut self) -> SWIER6_W<SWIERrs> {
277 SWIER6_W::new(self, 6)
278 }
279 #[inline(always)]
281 pub fn swier7(&mut self) -> SWIER7_W<SWIERrs> {
282 SWIER7_W::new(self, 7)
283 }
284 #[inline(always)]
286 pub fn swier8(&mut self) -> SWIER8_W<SWIERrs> {
287 SWIER8_W::new(self, 8)
288 }
289 #[inline(always)]
291 pub fn swier9(&mut self) -> SWIER9_W<SWIERrs> {
292 SWIER9_W::new(self, 9)
293 }
294 #[inline(always)]
296 pub fn swier10(&mut self) -> SWIER10_W<SWIERrs> {
297 SWIER10_W::new(self, 10)
298 }
299 #[inline(always)]
301 pub fn swier11(&mut self) -> SWIER11_W<SWIERrs> {
302 SWIER11_W::new(self, 11)
303 }
304 #[inline(always)]
306 pub fn swier12(&mut self) -> SWIER12_W<SWIERrs> {
307 SWIER12_W::new(self, 12)
308 }
309 #[inline(always)]
311 pub fn swier13(&mut self) -> SWIER13_W<SWIERrs> {
312 SWIER13_W::new(self, 13)
313 }
314 #[inline(always)]
316 pub fn swier14(&mut self) -> SWIER14_W<SWIERrs> {
317 SWIER14_W::new(self, 14)
318 }
319 #[inline(always)]
321 pub fn swier15(&mut self) -> SWIER15_W<SWIERrs> {
322 SWIER15_W::new(self, 15)
323 }
324 #[inline(always)]
326 pub fn swier16(&mut self) -> SWIER16_W<SWIERrs> {
327 SWIER16_W::new(self, 16)
328 }
329 #[inline(always)]
331 pub fn swier17(&mut self) -> SWIER17_W<SWIERrs> {
332 SWIER17_W::new(self, 17)
333 }
334 #[inline(always)]
336 pub fn swier19(&mut self) -> SWIER19_W<SWIERrs> {
337 SWIER19_W::new(self, 19)
338 }
339}
340pub struct SWIERrs;
346impl crate::RegisterSpec for SWIERrs {
347 type Ux = u32;
348}
349impl crate::Readable for SWIERrs {}
351impl crate::Writable for SWIERrs {
353 type Safety = crate::Unsafe;
354}
355impl crate::Resettable for SWIERrs {}