stm32f7_staging/stm32f779/exti/
swier.rs

1///Register `SWIER` reader
2pub type R = crate::R<SWIERrs>;
3///Register `SWIER` writer
4pub type W = crate::W<SWIERrs>;
5/**Software Interrupt on line %s
6
7Value on reset: 0*/
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum SOFTWARE_INTERRUPT {
11    ///1: Generates an interrupt request
12    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}
20///Field `SWIER(0-22)` reader - Software Interrupt on line %s
21pub type SWIER_R = crate::BitReader<SOFTWARE_INTERRUPT>;
22impl SWIER_R {
23    ///Get enumerated values variant
24    #[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    ///Generates an interrupt request
32    #[inline(always)]
33    pub fn is_pend(&self) -> bool {
34        *self == SOFTWARE_INTERRUPT::Pend
35    }
36}
37///Field `SWIER(0-22)` writer - Software Interrupt on line %s
38pub 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    ///Generates an interrupt request
44    #[inline(always)]
45    pub fn pend(self) -> &'a mut crate::W<REG> {
46        self.variant(SOFTWARE_INTERRUPT::Pend)
47    }
48}
49impl R {
50    ///Software Interrupt on line (0-22)
51    ///
52    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `SWIER0` field.</div>
53    #[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    ///Iterator for array of:
60    ///Software Interrupt on line (0-22)
61    #[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    ///Bit 0 - Software Interrupt on line 0
66    #[inline(always)]
67    pub fn swier0(&self) -> SWIER_R {
68        SWIER_R::new((self.bits & 1) != 0)
69    }
70    ///Bit 1 - Software Interrupt on line 1
71    #[inline(always)]
72    pub fn swier1(&self) -> SWIER_R {
73        SWIER_R::new(((self.bits >> 1) & 1) != 0)
74    }
75    ///Bit 2 - Software Interrupt on line 2
76    #[inline(always)]
77    pub fn swier2(&self) -> SWIER_R {
78        SWIER_R::new(((self.bits >> 2) & 1) != 0)
79    }
80    ///Bit 3 - Software Interrupt on line 3
81    #[inline(always)]
82    pub fn swier3(&self) -> SWIER_R {
83        SWIER_R::new(((self.bits >> 3) & 1) != 0)
84    }
85    ///Bit 4 - Software Interrupt on line 4
86    #[inline(always)]
87    pub fn swier4(&self) -> SWIER_R {
88        SWIER_R::new(((self.bits >> 4) & 1) != 0)
89    }
90    ///Bit 5 - Software Interrupt on line 5
91    #[inline(always)]
92    pub fn swier5(&self) -> SWIER_R {
93        SWIER_R::new(((self.bits >> 5) & 1) != 0)
94    }
95    ///Bit 6 - Software Interrupt on line 6
96    #[inline(always)]
97    pub fn swier6(&self) -> SWIER_R {
98        SWIER_R::new(((self.bits >> 6) & 1) != 0)
99    }
100    ///Bit 7 - Software Interrupt on line 7
101    #[inline(always)]
102    pub fn swier7(&self) -> SWIER_R {
103        SWIER_R::new(((self.bits >> 7) & 1) != 0)
104    }
105    ///Bit 8 - Software Interrupt on line 8
106    #[inline(always)]
107    pub fn swier8(&self) -> SWIER_R {
108        SWIER_R::new(((self.bits >> 8) & 1) != 0)
109    }
110    ///Bit 9 - Software Interrupt on line 9
111    #[inline(always)]
112    pub fn swier9(&self) -> SWIER_R {
113        SWIER_R::new(((self.bits >> 9) & 1) != 0)
114    }
115    ///Bit 10 - Software Interrupt on line 10
116    #[inline(always)]
117    pub fn swier10(&self) -> SWIER_R {
118        SWIER_R::new(((self.bits >> 10) & 1) != 0)
119    }
120    ///Bit 11 - Software Interrupt on line 11
121    #[inline(always)]
122    pub fn swier11(&self) -> SWIER_R {
123        SWIER_R::new(((self.bits >> 11) & 1) != 0)
124    }
125    ///Bit 12 - Software Interrupt on line 12
126    #[inline(always)]
127    pub fn swier12(&self) -> SWIER_R {
128        SWIER_R::new(((self.bits >> 12) & 1) != 0)
129    }
130    ///Bit 13 - Software Interrupt on line 13
131    #[inline(always)]
132    pub fn swier13(&self) -> SWIER_R {
133        SWIER_R::new(((self.bits >> 13) & 1) != 0)
134    }
135    ///Bit 14 - Software Interrupt on line 14
136    #[inline(always)]
137    pub fn swier14(&self) -> SWIER_R {
138        SWIER_R::new(((self.bits >> 14) & 1) != 0)
139    }
140    ///Bit 15 - Software Interrupt on line 15
141    #[inline(always)]
142    pub fn swier15(&self) -> SWIER_R {
143        SWIER_R::new(((self.bits >> 15) & 1) != 0)
144    }
145    ///Bit 16 - Software Interrupt on line 16
146    #[inline(always)]
147    pub fn swier16(&self) -> SWIER_R {
148        SWIER_R::new(((self.bits >> 16) & 1) != 0)
149    }
150    ///Bit 17 - Software Interrupt on line 17
151    #[inline(always)]
152    pub fn swier17(&self) -> SWIER_R {
153        SWIER_R::new(((self.bits >> 17) & 1) != 0)
154    }
155    ///Bit 18 - Software Interrupt on line 18
156    #[inline(always)]
157    pub fn swier18(&self) -> SWIER_R {
158        SWIER_R::new(((self.bits >> 18) & 1) != 0)
159    }
160    ///Bit 19 - Software Interrupt on line 19
161    #[inline(always)]
162    pub fn swier19(&self) -> SWIER_R {
163        SWIER_R::new(((self.bits >> 19) & 1) != 0)
164    }
165    ///Bit 20 - Software Interrupt on line 20
166    #[inline(always)]
167    pub fn swier20(&self) -> SWIER_R {
168        SWIER_R::new(((self.bits >> 20) & 1) != 0)
169    }
170    ///Bit 21 - Software Interrupt on line 21
171    #[inline(always)]
172    pub fn swier21(&self) -> SWIER_R {
173        SWIER_R::new(((self.bits >> 21) & 1) != 0)
174    }
175    ///Bit 22 - Software Interrupt on line 22
176    #[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    ///Software Interrupt on line (0-22)
212    ///
213    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `SWIER0` field.</div>
214    #[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    ///Bit 0 - Software Interrupt on line 0
221    #[inline(always)]
222    pub fn swier0(&mut self) -> SWIER_W<SWIERrs> {
223        SWIER_W::new(self, 0)
224    }
225    ///Bit 1 - Software Interrupt on line 1
226    #[inline(always)]
227    pub fn swier1(&mut self) -> SWIER_W<SWIERrs> {
228        SWIER_W::new(self, 1)
229    }
230    ///Bit 2 - Software Interrupt on line 2
231    #[inline(always)]
232    pub fn swier2(&mut self) -> SWIER_W<SWIERrs> {
233        SWIER_W::new(self, 2)
234    }
235    ///Bit 3 - Software Interrupt on line 3
236    #[inline(always)]
237    pub fn swier3(&mut self) -> SWIER_W<SWIERrs> {
238        SWIER_W::new(self, 3)
239    }
240    ///Bit 4 - Software Interrupt on line 4
241    #[inline(always)]
242    pub fn swier4(&mut self) -> SWIER_W<SWIERrs> {
243        SWIER_W::new(self, 4)
244    }
245    ///Bit 5 - Software Interrupt on line 5
246    #[inline(always)]
247    pub fn swier5(&mut self) -> SWIER_W<SWIERrs> {
248        SWIER_W::new(self, 5)
249    }
250    ///Bit 6 - Software Interrupt on line 6
251    #[inline(always)]
252    pub fn swier6(&mut self) -> SWIER_W<SWIERrs> {
253        SWIER_W::new(self, 6)
254    }
255    ///Bit 7 - Software Interrupt on line 7
256    #[inline(always)]
257    pub fn swier7(&mut self) -> SWIER_W<SWIERrs> {
258        SWIER_W::new(self, 7)
259    }
260    ///Bit 8 - Software Interrupt on line 8
261    #[inline(always)]
262    pub fn swier8(&mut self) -> SWIER_W<SWIERrs> {
263        SWIER_W::new(self, 8)
264    }
265    ///Bit 9 - Software Interrupt on line 9
266    #[inline(always)]
267    pub fn swier9(&mut self) -> SWIER_W<SWIERrs> {
268        SWIER_W::new(self, 9)
269    }
270    ///Bit 10 - Software Interrupt on line 10
271    #[inline(always)]
272    pub fn swier10(&mut self) -> SWIER_W<SWIERrs> {
273        SWIER_W::new(self, 10)
274    }
275    ///Bit 11 - Software Interrupt on line 11
276    #[inline(always)]
277    pub fn swier11(&mut self) -> SWIER_W<SWIERrs> {
278        SWIER_W::new(self, 11)
279    }
280    ///Bit 12 - Software Interrupt on line 12
281    #[inline(always)]
282    pub fn swier12(&mut self) -> SWIER_W<SWIERrs> {
283        SWIER_W::new(self, 12)
284    }
285    ///Bit 13 - Software Interrupt on line 13
286    #[inline(always)]
287    pub fn swier13(&mut self) -> SWIER_W<SWIERrs> {
288        SWIER_W::new(self, 13)
289    }
290    ///Bit 14 - Software Interrupt on line 14
291    #[inline(always)]
292    pub fn swier14(&mut self) -> SWIER_W<SWIERrs> {
293        SWIER_W::new(self, 14)
294    }
295    ///Bit 15 - Software Interrupt on line 15
296    #[inline(always)]
297    pub fn swier15(&mut self) -> SWIER_W<SWIERrs> {
298        SWIER_W::new(self, 15)
299    }
300    ///Bit 16 - Software Interrupt on line 16
301    #[inline(always)]
302    pub fn swier16(&mut self) -> SWIER_W<SWIERrs> {
303        SWIER_W::new(self, 16)
304    }
305    ///Bit 17 - Software Interrupt on line 17
306    #[inline(always)]
307    pub fn swier17(&mut self) -> SWIER_W<SWIERrs> {
308        SWIER_W::new(self, 17)
309    }
310    ///Bit 18 - Software Interrupt on line 18
311    #[inline(always)]
312    pub fn swier18(&mut self) -> SWIER_W<SWIERrs> {
313        SWIER_W::new(self, 18)
314    }
315    ///Bit 19 - Software Interrupt on line 19
316    #[inline(always)]
317    pub fn swier19(&mut self) -> SWIER_W<SWIERrs> {
318        SWIER_W::new(self, 19)
319    }
320    ///Bit 20 - Software Interrupt on line 20
321    #[inline(always)]
322    pub fn swier20(&mut self) -> SWIER_W<SWIERrs> {
323        SWIER_W::new(self, 20)
324    }
325    ///Bit 21 - Software Interrupt on line 21
326    #[inline(always)]
327    pub fn swier21(&mut self) -> SWIER_W<SWIERrs> {
328        SWIER_W::new(self, 21)
329    }
330    ///Bit 22 - Software Interrupt on line 22
331    #[inline(always)]
332    pub fn swier22(&mut self) -> SWIER_W<SWIERrs> {
333        SWIER_W::new(self, 22)
334    }
335}
336/**Software interrupt event register (EXTI_SWIER)
337
338You can [`read`](crate::Reg::read) this register and get [`swier::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swier::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
339
340See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F779.html#EXTI:SWIER)*/
341pub struct SWIERrs;
342impl crate::RegisterSpec for SWIERrs {
343    type Ux = u32;
344}
345///`read()` method returns [`swier::R`](R) reader structure
346impl crate::Readable for SWIERrs {}
347///`write(|w| ..)` method takes [`swier::W`](W) writer structure
348impl crate::Writable for SWIERrs {
349    type Safety = crate::Unsafe;
350}
351///`reset()` method sets SWIER to value 0
352impl crate::Resettable for SWIERrs {}