stm32l0/stm32l0x1/exti/
ftsr.rs

1#[doc = "Register `FTSR` reader"]
2pub struct R(crate::R<FTSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FTSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FTSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FTSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FTSR` writer"]
17pub struct W(crate::W<FTSR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FTSR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<FTSR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FTSR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Falling trigger event configuration of line 0\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum FT0_A {
40    #[doc = "0: Falling edge trigger is disabled"]
41    Disabled = 0,
42    #[doc = "1: Falling edge trigger is enabled"]
43    Enabled = 1,
44}
45impl From<FT0_A> for bool {
46    #[inline(always)]
47    fn from(variant: FT0_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `FT0` reader - Falling trigger event configuration of line 0"]
52pub type FT0_R = crate::BitReader<FT0_A>;
53impl FT0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> FT0_A {
57        match self.bits {
58            false => FT0_A::Disabled,
59            true => FT0_A::Enabled,
60        }
61    }
62    #[doc = "Checks if the value of the field is `Disabled`"]
63    #[inline(always)]
64    pub fn is_disabled(&self) -> bool {
65        *self == FT0_A::Disabled
66    }
67    #[doc = "Checks if the value of the field is `Enabled`"]
68    #[inline(always)]
69    pub fn is_enabled(&self) -> bool {
70        *self == FT0_A::Enabled
71    }
72}
73#[doc = "Field `FT0` writer - Falling trigger event configuration of line 0"]
74pub type FT0_W<'a, const O: u8> = crate::BitWriter<'a, u32, FTSR_SPEC, FT0_A, O>;
75impl<'a, const O: u8> FT0_W<'a, O> {
76    #[doc = "Falling edge trigger is disabled"]
77    #[inline(always)]
78    pub fn disabled(self) -> &'a mut W {
79        self.variant(FT0_A::Disabled)
80    }
81    #[doc = "Falling edge trigger is enabled"]
82    #[inline(always)]
83    pub fn enabled(self) -> &'a mut W {
84        self.variant(FT0_A::Enabled)
85    }
86}
87#[doc = "Falling trigger event configuration of line 1"]
88pub use FT0_A as FT1_A;
89#[doc = "Falling trigger event configuration of line 2"]
90pub use FT0_A as FT2_A;
91#[doc = "Falling trigger event configuration of line 3"]
92pub use FT0_A as FT3_A;
93#[doc = "Falling trigger event configuration of line 4"]
94pub use FT0_A as FT4_A;
95#[doc = "Falling trigger event configuration of line 5"]
96pub use FT0_A as FT5_A;
97#[doc = "Falling trigger event configuration of line 6"]
98pub use FT0_A as FT6_A;
99#[doc = "Falling trigger event configuration of line 7"]
100pub use FT0_A as FT7_A;
101#[doc = "Falling trigger event configuration of line 8"]
102pub use FT0_A as FT8_A;
103#[doc = "Falling trigger event configuration of line 9"]
104pub use FT0_A as FT9_A;
105#[doc = "Falling trigger event configuration of line 10"]
106pub use FT0_A as FT10_A;
107#[doc = "Falling trigger event configuration of line 11"]
108pub use FT0_A as FT11_A;
109#[doc = "Falling trigger event configuration of line 12"]
110pub use FT0_A as FT12_A;
111#[doc = "Falling trigger event configuration of line 13"]
112pub use FT0_A as FT13_A;
113#[doc = "Falling trigger event configuration of line 14"]
114pub use FT0_A as FT14_A;
115#[doc = "Falling trigger event configuration of line 15"]
116pub use FT0_A as FT15_A;
117#[doc = "Falling trigger event configuration of line 16"]
118pub use FT0_A as FT16_A;
119#[doc = "Falling trigger event configuration of line 17"]
120pub use FT0_A as FT17_A;
121#[doc = "Falling trigger event configuration of line 19"]
122pub use FT0_A as FT19_A;
123#[doc = "Falling trigger event configuration of line 20"]
124pub use FT0_A as FT20_A;
125#[doc = "Falling trigger event configuration of line 21"]
126pub use FT0_A as FT21_A;
127#[doc = "Falling trigger event configuration of line 22"]
128pub use FT0_A as FT22_A;
129#[doc = "Field `FT1` reader - Falling trigger event configuration of line 1"]
130pub use FT0_R as FT1_R;
131#[doc = "Field `FT2` reader - Falling trigger event configuration of line 2"]
132pub use FT0_R as FT2_R;
133#[doc = "Field `FT3` reader - Falling trigger event configuration of line 3"]
134pub use FT0_R as FT3_R;
135#[doc = "Field `FT4` reader - Falling trigger event configuration of line 4"]
136pub use FT0_R as FT4_R;
137#[doc = "Field `FT5` reader - Falling trigger event configuration of line 5"]
138pub use FT0_R as FT5_R;
139#[doc = "Field `FT6` reader - Falling trigger event configuration of line 6"]
140pub use FT0_R as FT6_R;
141#[doc = "Field `FT7` reader - Falling trigger event configuration of line 7"]
142pub use FT0_R as FT7_R;
143#[doc = "Field `FT8` reader - Falling trigger event configuration of line 8"]
144pub use FT0_R as FT8_R;
145#[doc = "Field `FT9` reader - Falling trigger event configuration of line 9"]
146pub use FT0_R as FT9_R;
147#[doc = "Field `FT10` reader - Falling trigger event configuration of line 10"]
148pub use FT0_R as FT10_R;
149#[doc = "Field `FT11` reader - Falling trigger event configuration of line 11"]
150pub use FT0_R as FT11_R;
151#[doc = "Field `FT12` reader - Falling trigger event configuration of line 12"]
152pub use FT0_R as FT12_R;
153#[doc = "Field `FT13` reader - Falling trigger event configuration of line 13"]
154pub use FT0_R as FT13_R;
155#[doc = "Field `FT14` reader - Falling trigger event configuration of line 14"]
156pub use FT0_R as FT14_R;
157#[doc = "Field `FT15` reader - Falling trigger event configuration of line 15"]
158pub use FT0_R as FT15_R;
159#[doc = "Field `FT16` reader - Falling trigger event configuration of line 16"]
160pub use FT0_R as FT16_R;
161#[doc = "Field `FT17` reader - Falling trigger event configuration of line 17"]
162pub use FT0_R as FT17_R;
163#[doc = "Field `FT19` reader - Falling trigger event configuration of line 19"]
164pub use FT0_R as FT19_R;
165#[doc = "Field `FT20` reader - Falling trigger event configuration of line 20"]
166pub use FT0_R as FT20_R;
167#[doc = "Field `FT21` reader - Falling trigger event configuration of line 21"]
168pub use FT0_R as FT21_R;
169#[doc = "Field `FT22` reader - Falling trigger event configuration of line 22"]
170pub use FT0_R as FT22_R;
171#[doc = "Field `FT1` writer - Falling trigger event configuration of line 1"]
172pub use FT0_W as FT1_W;
173#[doc = "Field `FT2` writer - Falling trigger event configuration of line 2"]
174pub use FT0_W as FT2_W;
175#[doc = "Field `FT3` writer - Falling trigger event configuration of line 3"]
176pub use FT0_W as FT3_W;
177#[doc = "Field `FT4` writer - Falling trigger event configuration of line 4"]
178pub use FT0_W as FT4_W;
179#[doc = "Field `FT5` writer - Falling trigger event configuration of line 5"]
180pub use FT0_W as FT5_W;
181#[doc = "Field `FT6` writer - Falling trigger event configuration of line 6"]
182pub use FT0_W as FT6_W;
183#[doc = "Field `FT7` writer - Falling trigger event configuration of line 7"]
184pub use FT0_W as FT7_W;
185#[doc = "Field `FT8` writer - Falling trigger event configuration of line 8"]
186pub use FT0_W as FT8_W;
187#[doc = "Field `FT9` writer - Falling trigger event configuration of line 9"]
188pub use FT0_W as FT9_W;
189#[doc = "Field `FT10` writer - Falling trigger event configuration of line 10"]
190pub use FT0_W as FT10_W;
191#[doc = "Field `FT11` writer - Falling trigger event configuration of line 11"]
192pub use FT0_W as FT11_W;
193#[doc = "Field `FT12` writer - Falling trigger event configuration of line 12"]
194pub use FT0_W as FT12_W;
195#[doc = "Field `FT13` writer - Falling trigger event configuration of line 13"]
196pub use FT0_W as FT13_W;
197#[doc = "Field `FT14` writer - Falling trigger event configuration of line 14"]
198pub use FT0_W as FT14_W;
199#[doc = "Field `FT15` writer - Falling trigger event configuration of line 15"]
200pub use FT0_W as FT15_W;
201#[doc = "Field `FT16` writer - Falling trigger event configuration of line 16"]
202pub use FT0_W as FT16_W;
203#[doc = "Field `FT17` writer - Falling trigger event configuration of line 17"]
204pub use FT0_W as FT17_W;
205#[doc = "Field `FT19` writer - Falling trigger event configuration of line 19"]
206pub use FT0_W as FT19_W;
207#[doc = "Field `FT20` writer - Falling trigger event configuration of line 20"]
208pub use FT0_W as FT20_W;
209#[doc = "Field `FT21` writer - Falling trigger event configuration of line 21"]
210pub use FT0_W as FT21_W;
211#[doc = "Field `FT22` writer - Falling trigger event configuration of line 22"]
212pub use FT0_W as FT22_W;
213impl R {
214    #[doc = "Bit 0 - Falling trigger event configuration of line 0"]
215    #[inline(always)]
216    pub fn ft0(&self) -> FT0_R {
217        FT0_R::new((self.bits & 1) != 0)
218    }
219    #[doc = "Bit 1 - Falling trigger event configuration of line 1"]
220    #[inline(always)]
221    pub fn ft1(&self) -> FT1_R {
222        FT1_R::new(((self.bits >> 1) & 1) != 0)
223    }
224    #[doc = "Bit 2 - Falling trigger event configuration of line 2"]
225    #[inline(always)]
226    pub fn ft2(&self) -> FT2_R {
227        FT2_R::new(((self.bits >> 2) & 1) != 0)
228    }
229    #[doc = "Bit 3 - Falling trigger event configuration of line 3"]
230    #[inline(always)]
231    pub fn ft3(&self) -> FT3_R {
232        FT3_R::new(((self.bits >> 3) & 1) != 0)
233    }
234    #[doc = "Bit 4 - Falling trigger event configuration of line 4"]
235    #[inline(always)]
236    pub fn ft4(&self) -> FT4_R {
237        FT4_R::new(((self.bits >> 4) & 1) != 0)
238    }
239    #[doc = "Bit 5 - Falling trigger event configuration of line 5"]
240    #[inline(always)]
241    pub fn ft5(&self) -> FT5_R {
242        FT5_R::new(((self.bits >> 5) & 1) != 0)
243    }
244    #[doc = "Bit 6 - Falling trigger event configuration of line 6"]
245    #[inline(always)]
246    pub fn ft6(&self) -> FT6_R {
247        FT6_R::new(((self.bits >> 6) & 1) != 0)
248    }
249    #[doc = "Bit 7 - Falling trigger event configuration of line 7"]
250    #[inline(always)]
251    pub fn ft7(&self) -> FT7_R {
252        FT7_R::new(((self.bits >> 7) & 1) != 0)
253    }
254    #[doc = "Bit 8 - Falling trigger event configuration of line 8"]
255    #[inline(always)]
256    pub fn ft8(&self) -> FT8_R {
257        FT8_R::new(((self.bits >> 8) & 1) != 0)
258    }
259    #[doc = "Bit 9 - Falling trigger event configuration of line 9"]
260    #[inline(always)]
261    pub fn ft9(&self) -> FT9_R {
262        FT9_R::new(((self.bits >> 9) & 1) != 0)
263    }
264    #[doc = "Bit 10 - Falling trigger event configuration of line 10"]
265    #[inline(always)]
266    pub fn ft10(&self) -> FT10_R {
267        FT10_R::new(((self.bits >> 10) & 1) != 0)
268    }
269    #[doc = "Bit 11 - Falling trigger event configuration of line 11"]
270    #[inline(always)]
271    pub fn ft11(&self) -> FT11_R {
272        FT11_R::new(((self.bits >> 11) & 1) != 0)
273    }
274    #[doc = "Bit 12 - Falling trigger event configuration of line 12"]
275    #[inline(always)]
276    pub fn ft12(&self) -> FT12_R {
277        FT12_R::new(((self.bits >> 12) & 1) != 0)
278    }
279    #[doc = "Bit 13 - Falling trigger event configuration of line 13"]
280    #[inline(always)]
281    pub fn ft13(&self) -> FT13_R {
282        FT13_R::new(((self.bits >> 13) & 1) != 0)
283    }
284    #[doc = "Bit 14 - Falling trigger event configuration of line 14"]
285    #[inline(always)]
286    pub fn ft14(&self) -> FT14_R {
287        FT14_R::new(((self.bits >> 14) & 1) != 0)
288    }
289    #[doc = "Bit 15 - Falling trigger event configuration of line 15"]
290    #[inline(always)]
291    pub fn ft15(&self) -> FT15_R {
292        FT15_R::new(((self.bits >> 15) & 1) != 0)
293    }
294    #[doc = "Bit 16 - Falling trigger event configuration of line 16"]
295    #[inline(always)]
296    pub fn ft16(&self) -> FT16_R {
297        FT16_R::new(((self.bits >> 16) & 1) != 0)
298    }
299    #[doc = "Bit 17 - Falling trigger event configuration of line 17"]
300    #[inline(always)]
301    pub fn ft17(&self) -> FT17_R {
302        FT17_R::new(((self.bits >> 17) & 1) != 0)
303    }
304    #[doc = "Bit 19 - Falling trigger event configuration of line 19"]
305    #[inline(always)]
306    pub fn ft19(&self) -> FT19_R {
307        FT19_R::new(((self.bits >> 19) & 1) != 0)
308    }
309    #[doc = "Bit 20 - Falling trigger event configuration of line 20"]
310    #[inline(always)]
311    pub fn ft20(&self) -> FT20_R {
312        FT20_R::new(((self.bits >> 20) & 1) != 0)
313    }
314    #[doc = "Bit 21 - Falling trigger event configuration of line 21"]
315    #[inline(always)]
316    pub fn ft21(&self) -> FT21_R {
317        FT21_R::new(((self.bits >> 21) & 1) != 0)
318    }
319    #[doc = "Bit 22 - Falling trigger event configuration of line 22"]
320    #[inline(always)]
321    pub fn ft22(&self) -> FT22_R {
322        FT22_R::new(((self.bits >> 22) & 1) != 0)
323    }
324}
325impl W {
326    #[doc = "Bit 0 - Falling trigger event configuration of line 0"]
327    #[inline(always)]
328    pub fn ft0(&mut self) -> FT0_W<0> {
329        FT0_W::new(self)
330    }
331    #[doc = "Bit 1 - Falling trigger event configuration of line 1"]
332    #[inline(always)]
333    pub fn ft1(&mut self) -> FT1_W<1> {
334        FT1_W::new(self)
335    }
336    #[doc = "Bit 2 - Falling trigger event configuration of line 2"]
337    #[inline(always)]
338    pub fn ft2(&mut self) -> FT2_W<2> {
339        FT2_W::new(self)
340    }
341    #[doc = "Bit 3 - Falling trigger event configuration of line 3"]
342    #[inline(always)]
343    pub fn ft3(&mut self) -> FT3_W<3> {
344        FT3_W::new(self)
345    }
346    #[doc = "Bit 4 - Falling trigger event configuration of line 4"]
347    #[inline(always)]
348    pub fn ft4(&mut self) -> FT4_W<4> {
349        FT4_W::new(self)
350    }
351    #[doc = "Bit 5 - Falling trigger event configuration of line 5"]
352    #[inline(always)]
353    pub fn ft5(&mut self) -> FT5_W<5> {
354        FT5_W::new(self)
355    }
356    #[doc = "Bit 6 - Falling trigger event configuration of line 6"]
357    #[inline(always)]
358    pub fn ft6(&mut self) -> FT6_W<6> {
359        FT6_W::new(self)
360    }
361    #[doc = "Bit 7 - Falling trigger event configuration of line 7"]
362    #[inline(always)]
363    pub fn ft7(&mut self) -> FT7_W<7> {
364        FT7_W::new(self)
365    }
366    #[doc = "Bit 8 - Falling trigger event configuration of line 8"]
367    #[inline(always)]
368    pub fn ft8(&mut self) -> FT8_W<8> {
369        FT8_W::new(self)
370    }
371    #[doc = "Bit 9 - Falling trigger event configuration of line 9"]
372    #[inline(always)]
373    pub fn ft9(&mut self) -> FT9_W<9> {
374        FT9_W::new(self)
375    }
376    #[doc = "Bit 10 - Falling trigger event configuration of line 10"]
377    #[inline(always)]
378    pub fn ft10(&mut self) -> FT10_W<10> {
379        FT10_W::new(self)
380    }
381    #[doc = "Bit 11 - Falling trigger event configuration of line 11"]
382    #[inline(always)]
383    pub fn ft11(&mut self) -> FT11_W<11> {
384        FT11_W::new(self)
385    }
386    #[doc = "Bit 12 - Falling trigger event configuration of line 12"]
387    #[inline(always)]
388    pub fn ft12(&mut self) -> FT12_W<12> {
389        FT12_W::new(self)
390    }
391    #[doc = "Bit 13 - Falling trigger event configuration of line 13"]
392    #[inline(always)]
393    pub fn ft13(&mut self) -> FT13_W<13> {
394        FT13_W::new(self)
395    }
396    #[doc = "Bit 14 - Falling trigger event configuration of line 14"]
397    #[inline(always)]
398    pub fn ft14(&mut self) -> FT14_W<14> {
399        FT14_W::new(self)
400    }
401    #[doc = "Bit 15 - Falling trigger event configuration of line 15"]
402    #[inline(always)]
403    pub fn ft15(&mut self) -> FT15_W<15> {
404        FT15_W::new(self)
405    }
406    #[doc = "Bit 16 - Falling trigger event configuration of line 16"]
407    #[inline(always)]
408    pub fn ft16(&mut self) -> FT16_W<16> {
409        FT16_W::new(self)
410    }
411    #[doc = "Bit 17 - Falling trigger event configuration of line 17"]
412    #[inline(always)]
413    pub fn ft17(&mut self) -> FT17_W<17> {
414        FT17_W::new(self)
415    }
416    #[doc = "Bit 19 - Falling trigger event configuration of line 19"]
417    #[inline(always)]
418    pub fn ft19(&mut self) -> FT19_W<19> {
419        FT19_W::new(self)
420    }
421    #[doc = "Bit 20 - Falling trigger event configuration of line 20"]
422    #[inline(always)]
423    pub fn ft20(&mut self) -> FT20_W<20> {
424        FT20_W::new(self)
425    }
426    #[doc = "Bit 21 - Falling trigger event configuration of line 21"]
427    #[inline(always)]
428    pub fn ft21(&mut self) -> FT21_W<21> {
429        FT21_W::new(self)
430    }
431    #[doc = "Bit 22 - Falling trigger event configuration of line 22"]
432    #[inline(always)]
433    pub fn ft22(&mut self) -> FT22_W<22> {
434        FT22_W::new(self)
435    }
436    #[doc = "Writes raw bits to the register."]
437    #[inline(always)]
438    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
439        self.0.bits(bits);
440        self
441    }
442}
443#[doc = "Falling Trigger selection register (EXTI_FTSR)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ftsr](index.html) module"]
444pub struct FTSR_SPEC;
445impl crate::RegisterSpec for FTSR_SPEC {
446    type Ux = u32;
447}
448#[doc = "`read()` method returns [ftsr::R](R) reader structure"]
449impl crate::Readable for FTSR_SPEC {
450    type Reader = R;
451}
452#[doc = "`write(|w| ..)` method takes [ftsr::W](W) writer structure"]
453impl crate::Writable for FTSR_SPEC {
454    type Writer = W;
455}
456#[doc = "`reset()` method sets FTSR to value 0"]
457impl crate::Resettable for FTSR_SPEC {
458    #[inline(always)]
459    fn reset_value() -> Self::Ux {
460        0
461    }
462}