py32f0/py32f040/exti/
ftsr.rs

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