stm32f1_staging/stm32f101/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)] [(); 19][n as usize];
56 SWIER_R::new(((self.bits >> n) & 1) != 0)
57 }
58 #[inline(always)]
61 pub fn swier_iter(&self) -> impl Iterator<Item = SWIER_R> + '_ {
62 (0..19).map(move |n| SWIER_R::new(((self.bits >> n) & 1) != 0))
63 }
64 #[inline(always)]
66 pub fn swier0(&self) -> SWIER_R {
67 SWIER_R::new((self.bits & 1) != 0)
68 }
69 #[inline(always)]
71 pub fn swier1(&self) -> SWIER_R {
72 SWIER_R::new(((self.bits >> 1) & 1) != 0)
73 }
74 #[inline(always)]
76 pub fn swier2(&self) -> SWIER_R {
77 SWIER_R::new(((self.bits >> 2) & 1) != 0)
78 }
79 #[inline(always)]
81 pub fn swier3(&self) -> SWIER_R {
82 SWIER_R::new(((self.bits >> 3) & 1) != 0)
83 }
84 #[inline(always)]
86 pub fn swier4(&self) -> SWIER_R {
87 SWIER_R::new(((self.bits >> 4) & 1) != 0)
88 }
89 #[inline(always)]
91 pub fn swier5(&self) -> SWIER_R {
92 SWIER_R::new(((self.bits >> 5) & 1) != 0)
93 }
94 #[inline(always)]
96 pub fn swier6(&self) -> SWIER_R {
97 SWIER_R::new(((self.bits >> 6) & 1) != 0)
98 }
99 #[inline(always)]
101 pub fn swier7(&self) -> SWIER_R {
102 SWIER_R::new(((self.bits >> 7) & 1) != 0)
103 }
104 #[inline(always)]
106 pub fn swier8(&self) -> SWIER_R {
107 SWIER_R::new(((self.bits >> 8) & 1) != 0)
108 }
109 #[inline(always)]
111 pub fn swier9(&self) -> SWIER_R {
112 SWIER_R::new(((self.bits >> 9) & 1) != 0)
113 }
114 #[inline(always)]
116 pub fn swier10(&self) -> SWIER_R {
117 SWIER_R::new(((self.bits >> 10) & 1) != 0)
118 }
119 #[inline(always)]
121 pub fn swier11(&self) -> SWIER_R {
122 SWIER_R::new(((self.bits >> 11) & 1) != 0)
123 }
124 #[inline(always)]
126 pub fn swier12(&self) -> SWIER_R {
127 SWIER_R::new(((self.bits >> 12) & 1) != 0)
128 }
129 #[inline(always)]
131 pub fn swier13(&self) -> SWIER_R {
132 SWIER_R::new(((self.bits >> 13) & 1) != 0)
133 }
134 #[inline(always)]
136 pub fn swier14(&self) -> SWIER_R {
137 SWIER_R::new(((self.bits >> 14) & 1) != 0)
138 }
139 #[inline(always)]
141 pub fn swier15(&self) -> SWIER_R {
142 SWIER_R::new(((self.bits >> 15) & 1) != 0)
143 }
144 #[inline(always)]
146 pub fn swier16(&self) -> SWIER_R {
147 SWIER_R::new(((self.bits >> 16) & 1) != 0)
148 }
149 #[inline(always)]
151 pub fn swier17(&self) -> SWIER_R {
152 SWIER_R::new(((self.bits >> 17) & 1) != 0)
153 }
154 #[inline(always)]
156 pub fn swier18(&self) -> SWIER_R {
157 SWIER_R::new(((self.bits >> 18) & 1) != 0)
158 }
159}
160impl core::fmt::Debug for R {
161 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
162 f.debug_struct("SWIER")
163 .field("swier0", &self.swier0())
164 .field("swier1", &self.swier1())
165 .field("swier2", &self.swier2())
166 .field("swier3", &self.swier3())
167 .field("swier4", &self.swier4())
168 .field("swier5", &self.swier5())
169 .field("swier6", &self.swier6())
170 .field("swier7", &self.swier7())
171 .field("swier8", &self.swier8())
172 .field("swier9", &self.swier9())
173 .field("swier10", &self.swier10())
174 .field("swier11", &self.swier11())
175 .field("swier12", &self.swier12())
176 .field("swier13", &self.swier13())
177 .field("swier14", &self.swier14())
178 .field("swier15", &self.swier15())
179 .field("swier16", &self.swier16())
180 .field("swier17", &self.swier17())
181 .field("swier18", &self.swier18())
182 .finish()
183 }
184}
185impl W {
186 #[inline(always)]
190 pub fn swier(&mut self, n: u8) -> SWIER_W<SWIERrs> {
191 #[allow(clippy::no_effect)] [(); 19][n as usize];
192 SWIER_W::new(self, n)
193 }
194 #[inline(always)]
196 pub fn swier0(&mut self) -> SWIER_W<SWIERrs> {
197 SWIER_W::new(self, 0)
198 }
199 #[inline(always)]
201 pub fn swier1(&mut self) -> SWIER_W<SWIERrs> {
202 SWIER_W::new(self, 1)
203 }
204 #[inline(always)]
206 pub fn swier2(&mut self) -> SWIER_W<SWIERrs> {
207 SWIER_W::new(self, 2)
208 }
209 #[inline(always)]
211 pub fn swier3(&mut self) -> SWIER_W<SWIERrs> {
212 SWIER_W::new(self, 3)
213 }
214 #[inline(always)]
216 pub fn swier4(&mut self) -> SWIER_W<SWIERrs> {
217 SWIER_W::new(self, 4)
218 }
219 #[inline(always)]
221 pub fn swier5(&mut self) -> SWIER_W<SWIERrs> {
222 SWIER_W::new(self, 5)
223 }
224 #[inline(always)]
226 pub fn swier6(&mut self) -> SWIER_W<SWIERrs> {
227 SWIER_W::new(self, 6)
228 }
229 #[inline(always)]
231 pub fn swier7(&mut self) -> SWIER_W<SWIERrs> {
232 SWIER_W::new(self, 7)
233 }
234 #[inline(always)]
236 pub fn swier8(&mut self) -> SWIER_W<SWIERrs> {
237 SWIER_W::new(self, 8)
238 }
239 #[inline(always)]
241 pub fn swier9(&mut self) -> SWIER_W<SWIERrs> {
242 SWIER_W::new(self, 9)
243 }
244 #[inline(always)]
246 pub fn swier10(&mut self) -> SWIER_W<SWIERrs> {
247 SWIER_W::new(self, 10)
248 }
249 #[inline(always)]
251 pub fn swier11(&mut self) -> SWIER_W<SWIERrs> {
252 SWIER_W::new(self, 11)
253 }
254 #[inline(always)]
256 pub fn swier12(&mut self) -> SWIER_W<SWIERrs> {
257 SWIER_W::new(self, 12)
258 }
259 #[inline(always)]
261 pub fn swier13(&mut self) -> SWIER_W<SWIERrs> {
262 SWIER_W::new(self, 13)
263 }
264 #[inline(always)]
266 pub fn swier14(&mut self) -> SWIER_W<SWIERrs> {
267 SWIER_W::new(self, 14)
268 }
269 #[inline(always)]
271 pub fn swier15(&mut self) -> SWIER_W<SWIERrs> {
272 SWIER_W::new(self, 15)
273 }
274 #[inline(always)]
276 pub fn swier16(&mut self) -> SWIER_W<SWIERrs> {
277 SWIER_W::new(self, 16)
278 }
279 #[inline(always)]
281 pub fn swier17(&mut self) -> SWIER_W<SWIERrs> {
282 SWIER_W::new(self, 17)
283 }
284 #[inline(always)]
286 pub fn swier18(&mut self) -> SWIER_W<SWIERrs> {
287 SWIER_W::new(self, 18)
288 }
289}
290pub struct SWIERrs;
296impl crate::RegisterSpec for SWIERrs {
297 type Ux = u32;
298}
299impl crate::Readable for SWIERrs {}
301impl crate::Writable for SWIERrs {
303 type Safety = crate::Unsafe;
304}
305impl crate::Resettable for SWIERrs {}