stm32f1_staging/stm32f107/can1/
fa1r.rs

1///Register `FA1R` reader
2pub type R = crate::R<FA1Rrs>;
3///Register `FA1R` writer
4pub type W = crate::W<FA1Rrs>;
5///Field `FACT(0-27)` reader - Filter active
6pub type FACT_R = crate::BitReader;
7///Field `FACT(0-27)` writer - Filter active
8pub type FACT_W<'a, REG> = crate::BitWriter<'a, REG>;
9impl R {
10    ///Filter active
11    ///
12    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `FACT0` field.</div>
13    #[inline(always)]
14    pub fn fact(&self, n: u8) -> FACT_R {
15        #[allow(clippy::no_effect)] [(); 28][n as usize];
16        FACT_R::new(((self.bits >> n) & 1) != 0)
17    }
18    ///Iterator for array of:
19    ///Filter active
20    #[inline(always)]
21    pub fn fact_iter(&self) -> impl Iterator<Item = FACT_R> + '_ {
22        (0..28).map(move |n| FACT_R::new(((self.bits >> n) & 1) != 0))
23    }
24    ///Bit 0 - Filter active
25    #[inline(always)]
26    pub fn fact0(&self) -> FACT_R {
27        FACT_R::new((self.bits & 1) != 0)
28    }
29    ///Bit 1 - Filter active
30    #[inline(always)]
31    pub fn fact1(&self) -> FACT_R {
32        FACT_R::new(((self.bits >> 1) & 1) != 0)
33    }
34    ///Bit 2 - Filter active
35    #[inline(always)]
36    pub fn fact2(&self) -> FACT_R {
37        FACT_R::new(((self.bits >> 2) & 1) != 0)
38    }
39    ///Bit 3 - Filter active
40    #[inline(always)]
41    pub fn fact3(&self) -> FACT_R {
42        FACT_R::new(((self.bits >> 3) & 1) != 0)
43    }
44    ///Bit 4 - Filter active
45    #[inline(always)]
46    pub fn fact4(&self) -> FACT_R {
47        FACT_R::new(((self.bits >> 4) & 1) != 0)
48    }
49    ///Bit 5 - Filter active
50    #[inline(always)]
51    pub fn fact5(&self) -> FACT_R {
52        FACT_R::new(((self.bits >> 5) & 1) != 0)
53    }
54    ///Bit 6 - Filter active
55    #[inline(always)]
56    pub fn fact6(&self) -> FACT_R {
57        FACT_R::new(((self.bits >> 6) & 1) != 0)
58    }
59    ///Bit 7 - Filter active
60    #[inline(always)]
61    pub fn fact7(&self) -> FACT_R {
62        FACT_R::new(((self.bits >> 7) & 1) != 0)
63    }
64    ///Bit 8 - Filter active
65    #[inline(always)]
66    pub fn fact8(&self) -> FACT_R {
67        FACT_R::new(((self.bits >> 8) & 1) != 0)
68    }
69    ///Bit 9 - Filter active
70    #[inline(always)]
71    pub fn fact9(&self) -> FACT_R {
72        FACT_R::new(((self.bits >> 9) & 1) != 0)
73    }
74    ///Bit 10 - Filter active
75    #[inline(always)]
76    pub fn fact10(&self) -> FACT_R {
77        FACT_R::new(((self.bits >> 10) & 1) != 0)
78    }
79    ///Bit 11 - Filter active
80    #[inline(always)]
81    pub fn fact11(&self) -> FACT_R {
82        FACT_R::new(((self.bits >> 11) & 1) != 0)
83    }
84    ///Bit 12 - Filter active
85    #[inline(always)]
86    pub fn fact12(&self) -> FACT_R {
87        FACT_R::new(((self.bits >> 12) & 1) != 0)
88    }
89    ///Bit 13 - Filter active
90    #[inline(always)]
91    pub fn fact13(&self) -> FACT_R {
92        FACT_R::new(((self.bits >> 13) & 1) != 0)
93    }
94    ///Bit 14 - Filter active
95    #[inline(always)]
96    pub fn fact14(&self) -> FACT_R {
97        FACT_R::new(((self.bits >> 14) & 1) != 0)
98    }
99    ///Bit 15 - Filter active
100    #[inline(always)]
101    pub fn fact15(&self) -> FACT_R {
102        FACT_R::new(((self.bits >> 15) & 1) != 0)
103    }
104    ///Bit 16 - Filter active
105    #[inline(always)]
106    pub fn fact16(&self) -> FACT_R {
107        FACT_R::new(((self.bits >> 16) & 1) != 0)
108    }
109    ///Bit 17 - Filter active
110    #[inline(always)]
111    pub fn fact17(&self) -> FACT_R {
112        FACT_R::new(((self.bits >> 17) & 1) != 0)
113    }
114    ///Bit 18 - Filter active
115    #[inline(always)]
116    pub fn fact18(&self) -> FACT_R {
117        FACT_R::new(((self.bits >> 18) & 1) != 0)
118    }
119    ///Bit 19 - Filter active
120    #[inline(always)]
121    pub fn fact19(&self) -> FACT_R {
122        FACT_R::new(((self.bits >> 19) & 1) != 0)
123    }
124    ///Bit 20 - Filter active
125    #[inline(always)]
126    pub fn fact20(&self) -> FACT_R {
127        FACT_R::new(((self.bits >> 20) & 1) != 0)
128    }
129    ///Bit 21 - Filter active
130    #[inline(always)]
131    pub fn fact21(&self) -> FACT_R {
132        FACT_R::new(((self.bits >> 21) & 1) != 0)
133    }
134    ///Bit 22 - Filter active
135    #[inline(always)]
136    pub fn fact22(&self) -> FACT_R {
137        FACT_R::new(((self.bits >> 22) & 1) != 0)
138    }
139    ///Bit 23 - Filter active
140    #[inline(always)]
141    pub fn fact23(&self) -> FACT_R {
142        FACT_R::new(((self.bits >> 23) & 1) != 0)
143    }
144    ///Bit 24 - Filter active
145    #[inline(always)]
146    pub fn fact24(&self) -> FACT_R {
147        FACT_R::new(((self.bits >> 24) & 1) != 0)
148    }
149    ///Bit 25 - Filter active
150    #[inline(always)]
151    pub fn fact25(&self) -> FACT_R {
152        FACT_R::new(((self.bits >> 25) & 1) != 0)
153    }
154    ///Bit 26 - Filter active
155    #[inline(always)]
156    pub fn fact26(&self) -> FACT_R {
157        FACT_R::new(((self.bits >> 26) & 1) != 0)
158    }
159    ///Bit 27 - Filter active
160    #[inline(always)]
161    pub fn fact27(&self) -> FACT_R {
162        FACT_R::new(((self.bits >> 27) & 1) != 0)
163    }
164}
165impl core::fmt::Debug for R {
166    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
167        f.debug_struct("FA1R")
168            .field("fact0", &self.fact0())
169            .field("fact1", &self.fact1())
170            .field("fact2", &self.fact2())
171            .field("fact3", &self.fact3())
172            .field("fact4", &self.fact4())
173            .field("fact5", &self.fact5())
174            .field("fact6", &self.fact6())
175            .field("fact7", &self.fact7())
176            .field("fact8", &self.fact8())
177            .field("fact9", &self.fact9())
178            .field("fact10", &self.fact10())
179            .field("fact11", &self.fact11())
180            .field("fact12", &self.fact12())
181            .field("fact13", &self.fact13())
182            .field("fact14", &self.fact14())
183            .field("fact15", &self.fact15())
184            .field("fact16", &self.fact16())
185            .field("fact17", &self.fact17())
186            .field("fact18", &self.fact18())
187            .field("fact19", &self.fact19())
188            .field("fact20", &self.fact20())
189            .field("fact21", &self.fact21())
190            .field("fact22", &self.fact22())
191            .field("fact23", &self.fact23())
192            .field("fact24", &self.fact24())
193            .field("fact25", &self.fact25())
194            .field("fact26", &self.fact26())
195            .field("fact27", &self.fact27())
196            .finish()
197    }
198}
199impl W {
200    ///Filter active
201    ///
202    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `FACT0` field.</div>
203    #[inline(always)]
204    pub fn fact(&mut self, n: u8) -> FACT_W<FA1Rrs> {
205        #[allow(clippy::no_effect)] [(); 28][n as usize];
206        FACT_W::new(self, n)
207    }
208    ///Bit 0 - Filter active
209    #[inline(always)]
210    pub fn fact0(&mut self) -> FACT_W<FA1Rrs> {
211        FACT_W::new(self, 0)
212    }
213    ///Bit 1 - Filter active
214    #[inline(always)]
215    pub fn fact1(&mut self) -> FACT_W<FA1Rrs> {
216        FACT_W::new(self, 1)
217    }
218    ///Bit 2 - Filter active
219    #[inline(always)]
220    pub fn fact2(&mut self) -> FACT_W<FA1Rrs> {
221        FACT_W::new(self, 2)
222    }
223    ///Bit 3 - Filter active
224    #[inline(always)]
225    pub fn fact3(&mut self) -> FACT_W<FA1Rrs> {
226        FACT_W::new(self, 3)
227    }
228    ///Bit 4 - Filter active
229    #[inline(always)]
230    pub fn fact4(&mut self) -> FACT_W<FA1Rrs> {
231        FACT_W::new(self, 4)
232    }
233    ///Bit 5 - Filter active
234    #[inline(always)]
235    pub fn fact5(&mut self) -> FACT_W<FA1Rrs> {
236        FACT_W::new(self, 5)
237    }
238    ///Bit 6 - Filter active
239    #[inline(always)]
240    pub fn fact6(&mut self) -> FACT_W<FA1Rrs> {
241        FACT_W::new(self, 6)
242    }
243    ///Bit 7 - Filter active
244    #[inline(always)]
245    pub fn fact7(&mut self) -> FACT_W<FA1Rrs> {
246        FACT_W::new(self, 7)
247    }
248    ///Bit 8 - Filter active
249    #[inline(always)]
250    pub fn fact8(&mut self) -> FACT_W<FA1Rrs> {
251        FACT_W::new(self, 8)
252    }
253    ///Bit 9 - Filter active
254    #[inline(always)]
255    pub fn fact9(&mut self) -> FACT_W<FA1Rrs> {
256        FACT_W::new(self, 9)
257    }
258    ///Bit 10 - Filter active
259    #[inline(always)]
260    pub fn fact10(&mut self) -> FACT_W<FA1Rrs> {
261        FACT_W::new(self, 10)
262    }
263    ///Bit 11 - Filter active
264    #[inline(always)]
265    pub fn fact11(&mut self) -> FACT_W<FA1Rrs> {
266        FACT_W::new(self, 11)
267    }
268    ///Bit 12 - Filter active
269    #[inline(always)]
270    pub fn fact12(&mut self) -> FACT_W<FA1Rrs> {
271        FACT_W::new(self, 12)
272    }
273    ///Bit 13 - Filter active
274    #[inline(always)]
275    pub fn fact13(&mut self) -> FACT_W<FA1Rrs> {
276        FACT_W::new(self, 13)
277    }
278    ///Bit 14 - Filter active
279    #[inline(always)]
280    pub fn fact14(&mut self) -> FACT_W<FA1Rrs> {
281        FACT_W::new(self, 14)
282    }
283    ///Bit 15 - Filter active
284    #[inline(always)]
285    pub fn fact15(&mut self) -> FACT_W<FA1Rrs> {
286        FACT_W::new(self, 15)
287    }
288    ///Bit 16 - Filter active
289    #[inline(always)]
290    pub fn fact16(&mut self) -> FACT_W<FA1Rrs> {
291        FACT_W::new(self, 16)
292    }
293    ///Bit 17 - Filter active
294    #[inline(always)]
295    pub fn fact17(&mut self) -> FACT_W<FA1Rrs> {
296        FACT_W::new(self, 17)
297    }
298    ///Bit 18 - Filter active
299    #[inline(always)]
300    pub fn fact18(&mut self) -> FACT_W<FA1Rrs> {
301        FACT_W::new(self, 18)
302    }
303    ///Bit 19 - Filter active
304    #[inline(always)]
305    pub fn fact19(&mut self) -> FACT_W<FA1Rrs> {
306        FACT_W::new(self, 19)
307    }
308    ///Bit 20 - Filter active
309    #[inline(always)]
310    pub fn fact20(&mut self) -> FACT_W<FA1Rrs> {
311        FACT_W::new(self, 20)
312    }
313    ///Bit 21 - Filter active
314    #[inline(always)]
315    pub fn fact21(&mut self) -> FACT_W<FA1Rrs> {
316        FACT_W::new(self, 21)
317    }
318    ///Bit 22 - Filter active
319    #[inline(always)]
320    pub fn fact22(&mut self) -> FACT_W<FA1Rrs> {
321        FACT_W::new(self, 22)
322    }
323    ///Bit 23 - Filter active
324    #[inline(always)]
325    pub fn fact23(&mut self) -> FACT_W<FA1Rrs> {
326        FACT_W::new(self, 23)
327    }
328    ///Bit 24 - Filter active
329    #[inline(always)]
330    pub fn fact24(&mut self) -> FACT_W<FA1Rrs> {
331        FACT_W::new(self, 24)
332    }
333    ///Bit 25 - Filter active
334    #[inline(always)]
335    pub fn fact25(&mut self) -> FACT_W<FA1Rrs> {
336        FACT_W::new(self, 25)
337    }
338    ///Bit 26 - Filter active
339    #[inline(always)]
340    pub fn fact26(&mut self) -> FACT_W<FA1Rrs> {
341        FACT_W::new(self, 26)
342    }
343    ///Bit 27 - Filter active
344    #[inline(always)]
345    pub fn fact27(&mut self) -> FACT_W<FA1Rrs> {
346        FACT_W::new(self, 27)
347    }
348}
349/**CAN_FA1R
350
351You can [`read`](crate::Reg::read) this register and get [`fa1r::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fa1r::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
352
353See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F107.html#CAN1:FA1R)*/
354pub struct FA1Rrs;
355impl crate::RegisterSpec for FA1Rrs {
356    type Ux = u32;
357}
358///`read()` method returns [`fa1r::R`](R) reader structure
359impl crate::Readable for FA1Rrs {}
360///`write(|w| ..)` method takes [`fa1r::W`](W) writer structure
361impl crate::Writable for FA1Rrs {
362    type Safety = crate::Unsafe;
363}
364///`reset()` method sets FA1R to value 0
365impl crate::Resettable for FA1Rrs {}