stm32f1_staging/stm32f100/exti/
ftsr.rs1pub type R = crate::R<FTSRrs>;
3pub type W = crate::W<FTSRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum FALLING_TRIGGER {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<FALLING_TRIGGER> for bool {
17 #[inline(always)]
18 fn from(variant: FALLING_TRIGGER) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type TR_R = crate::BitReader<FALLING_TRIGGER>;
24impl TR_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> FALLING_TRIGGER {
28 match self.bits {
29 false => FALLING_TRIGGER::Disabled,
30 true => FALLING_TRIGGER::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == FALLING_TRIGGER::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == FALLING_TRIGGER::Enabled
42 }
43}
44pub type TR_W<'a, REG> = crate::BitWriter<'a, REG, FALLING_TRIGGER>;
46impl<'a, REG> TR_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(FALLING_TRIGGER::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(FALLING_TRIGGER::Enabled)
59 }
60}
61impl R {
62 #[inline(always)]
66 pub fn tr(&self, n: u8) -> TR_R {
67 #[allow(clippy::no_effect)] [(); 18][n as usize];
68 TR_R::new(((self.bits >> n) & 1) != 0)
69 }
70 #[inline(always)]
73 pub fn tr_iter(&self) -> impl Iterator<Item = TR_R> + '_ {
74 (0..18).map(move |n| TR_R::new(((self.bits >> n) & 1) != 0))
75 }
76 #[inline(always)]
78 pub fn tr0(&self) -> TR_R {
79 TR_R::new((self.bits & 1) != 0)
80 }
81 #[inline(always)]
83 pub fn tr1(&self) -> TR_R {
84 TR_R::new(((self.bits >> 1) & 1) != 0)
85 }
86 #[inline(always)]
88 pub fn tr2(&self) -> TR_R {
89 TR_R::new(((self.bits >> 2) & 1) != 0)
90 }
91 #[inline(always)]
93 pub fn tr3(&self) -> TR_R {
94 TR_R::new(((self.bits >> 3) & 1) != 0)
95 }
96 #[inline(always)]
98 pub fn tr4(&self) -> TR_R {
99 TR_R::new(((self.bits >> 4) & 1) != 0)
100 }
101 #[inline(always)]
103 pub fn tr5(&self) -> TR_R {
104 TR_R::new(((self.bits >> 5) & 1) != 0)
105 }
106 #[inline(always)]
108 pub fn tr6(&self) -> TR_R {
109 TR_R::new(((self.bits >> 6) & 1) != 0)
110 }
111 #[inline(always)]
113 pub fn tr7(&self) -> TR_R {
114 TR_R::new(((self.bits >> 7) & 1) != 0)
115 }
116 #[inline(always)]
118 pub fn tr8(&self) -> TR_R {
119 TR_R::new(((self.bits >> 8) & 1) != 0)
120 }
121 #[inline(always)]
123 pub fn tr9(&self) -> TR_R {
124 TR_R::new(((self.bits >> 9) & 1) != 0)
125 }
126 #[inline(always)]
128 pub fn tr10(&self) -> TR_R {
129 TR_R::new(((self.bits >> 10) & 1) != 0)
130 }
131 #[inline(always)]
133 pub fn tr11(&self) -> TR_R {
134 TR_R::new(((self.bits >> 11) & 1) != 0)
135 }
136 #[inline(always)]
138 pub fn tr12(&self) -> TR_R {
139 TR_R::new(((self.bits >> 12) & 1) != 0)
140 }
141 #[inline(always)]
143 pub fn tr13(&self) -> TR_R {
144 TR_R::new(((self.bits >> 13) & 1) != 0)
145 }
146 #[inline(always)]
148 pub fn tr14(&self) -> TR_R {
149 TR_R::new(((self.bits >> 14) & 1) != 0)
150 }
151 #[inline(always)]
153 pub fn tr15(&self) -> TR_R {
154 TR_R::new(((self.bits >> 15) & 1) != 0)
155 }
156 #[inline(always)]
158 pub fn tr16(&self) -> TR_R {
159 TR_R::new(((self.bits >> 16) & 1) != 0)
160 }
161 #[inline(always)]
163 pub fn tr17(&self) -> TR_R {
164 TR_R::new(((self.bits >> 17) & 1) != 0)
165 }
166}
167impl core::fmt::Debug for R {
168 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
169 f.debug_struct("FTSR")
170 .field("tr0", &self.tr0())
171 .field("tr1", &self.tr1())
172 .field("tr2", &self.tr2())
173 .field("tr3", &self.tr3())
174 .field("tr4", &self.tr4())
175 .field("tr5", &self.tr5())
176 .field("tr6", &self.tr6())
177 .field("tr7", &self.tr7())
178 .field("tr8", &self.tr8())
179 .field("tr9", &self.tr9())
180 .field("tr10", &self.tr10())
181 .field("tr11", &self.tr11())
182 .field("tr12", &self.tr12())
183 .field("tr13", &self.tr13())
184 .field("tr14", &self.tr14())
185 .field("tr15", &self.tr15())
186 .field("tr16", &self.tr16())
187 .field("tr17", &self.tr17())
188 .finish()
189 }
190}
191impl W {
192 #[inline(always)]
196 pub fn tr(&mut self, n: u8) -> TR_W<FTSRrs> {
197 #[allow(clippy::no_effect)] [(); 18][n as usize];
198 TR_W::new(self, n)
199 }
200 #[inline(always)]
202 pub fn tr0(&mut self) -> TR_W<FTSRrs> {
203 TR_W::new(self, 0)
204 }
205 #[inline(always)]
207 pub fn tr1(&mut self) -> TR_W<FTSRrs> {
208 TR_W::new(self, 1)
209 }
210 #[inline(always)]
212 pub fn tr2(&mut self) -> TR_W<FTSRrs> {
213 TR_W::new(self, 2)
214 }
215 #[inline(always)]
217 pub fn tr3(&mut self) -> TR_W<FTSRrs> {
218 TR_W::new(self, 3)
219 }
220 #[inline(always)]
222 pub fn tr4(&mut self) -> TR_W<FTSRrs> {
223 TR_W::new(self, 4)
224 }
225 #[inline(always)]
227 pub fn tr5(&mut self) -> TR_W<FTSRrs> {
228 TR_W::new(self, 5)
229 }
230 #[inline(always)]
232 pub fn tr6(&mut self) -> TR_W<FTSRrs> {
233 TR_W::new(self, 6)
234 }
235 #[inline(always)]
237 pub fn tr7(&mut self) -> TR_W<FTSRrs> {
238 TR_W::new(self, 7)
239 }
240 #[inline(always)]
242 pub fn tr8(&mut self) -> TR_W<FTSRrs> {
243 TR_W::new(self, 8)
244 }
245 #[inline(always)]
247 pub fn tr9(&mut self) -> TR_W<FTSRrs> {
248 TR_W::new(self, 9)
249 }
250 #[inline(always)]
252 pub fn tr10(&mut self) -> TR_W<FTSRrs> {
253 TR_W::new(self, 10)
254 }
255 #[inline(always)]
257 pub fn tr11(&mut self) -> TR_W<FTSRrs> {
258 TR_W::new(self, 11)
259 }
260 #[inline(always)]
262 pub fn tr12(&mut self) -> TR_W<FTSRrs> {
263 TR_W::new(self, 12)
264 }
265 #[inline(always)]
267 pub fn tr13(&mut self) -> TR_W<FTSRrs> {
268 TR_W::new(self, 13)
269 }
270 #[inline(always)]
272 pub fn tr14(&mut self) -> TR_W<FTSRrs> {
273 TR_W::new(self, 14)
274 }
275 #[inline(always)]
277 pub fn tr15(&mut self) -> TR_W<FTSRrs> {
278 TR_W::new(self, 15)
279 }
280 #[inline(always)]
282 pub fn tr16(&mut self) -> TR_W<FTSRrs> {
283 TR_W::new(self, 16)
284 }
285 #[inline(always)]
287 pub fn tr17(&mut self) -> TR_W<FTSRrs> {
288 TR_W::new(self, 17)
289 }
290}
291pub struct FTSRrs;
297impl crate::RegisterSpec for FTSRrs {
298 type Ux = u32;
299}
300impl crate::Readable for FTSRrs {}
302impl crate::Writable for FTSRrs {
304 type Safety = crate::Unsafe;
305}
306impl crate::Resettable for FTSRrs {}