stm32f1_staging/stm32f103/can/
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-13)` reader - Filter active
6pub type FACT_R = crate::BitReader;
7///Field `FACT(0-13)` 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)] [(); 14][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..14).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}
95impl core::fmt::Debug for R {
96    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
97        f.debug_struct("FA1R")
98            .field("fact0", &self.fact0())
99            .field("fact1", &self.fact1())
100            .field("fact2", &self.fact2())
101            .field("fact3", &self.fact3())
102            .field("fact4", &self.fact4())
103            .field("fact5", &self.fact5())
104            .field("fact6", &self.fact6())
105            .field("fact7", &self.fact7())
106            .field("fact8", &self.fact8())
107            .field("fact9", &self.fact9())
108            .field("fact10", &self.fact10())
109            .field("fact11", &self.fact11())
110            .field("fact12", &self.fact12())
111            .field("fact13", &self.fact13())
112            .finish()
113    }
114}
115impl W {
116    ///Filter active
117    ///
118    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `FACT0` field.</div>
119    #[inline(always)]
120    pub fn fact(&mut self, n: u8) -> FACT_W<FA1Rrs> {
121        #[allow(clippy::no_effect)] [(); 14][n as usize];
122        FACT_W::new(self, n)
123    }
124    ///Bit 0 - Filter active
125    #[inline(always)]
126    pub fn fact0(&mut self) -> FACT_W<FA1Rrs> {
127        FACT_W::new(self, 0)
128    }
129    ///Bit 1 - Filter active
130    #[inline(always)]
131    pub fn fact1(&mut self) -> FACT_W<FA1Rrs> {
132        FACT_W::new(self, 1)
133    }
134    ///Bit 2 - Filter active
135    #[inline(always)]
136    pub fn fact2(&mut self) -> FACT_W<FA1Rrs> {
137        FACT_W::new(self, 2)
138    }
139    ///Bit 3 - Filter active
140    #[inline(always)]
141    pub fn fact3(&mut self) -> FACT_W<FA1Rrs> {
142        FACT_W::new(self, 3)
143    }
144    ///Bit 4 - Filter active
145    #[inline(always)]
146    pub fn fact4(&mut self) -> FACT_W<FA1Rrs> {
147        FACT_W::new(self, 4)
148    }
149    ///Bit 5 - Filter active
150    #[inline(always)]
151    pub fn fact5(&mut self) -> FACT_W<FA1Rrs> {
152        FACT_W::new(self, 5)
153    }
154    ///Bit 6 - Filter active
155    #[inline(always)]
156    pub fn fact6(&mut self) -> FACT_W<FA1Rrs> {
157        FACT_W::new(self, 6)
158    }
159    ///Bit 7 - Filter active
160    #[inline(always)]
161    pub fn fact7(&mut self) -> FACT_W<FA1Rrs> {
162        FACT_W::new(self, 7)
163    }
164    ///Bit 8 - Filter active
165    #[inline(always)]
166    pub fn fact8(&mut self) -> FACT_W<FA1Rrs> {
167        FACT_W::new(self, 8)
168    }
169    ///Bit 9 - Filter active
170    #[inline(always)]
171    pub fn fact9(&mut self) -> FACT_W<FA1Rrs> {
172        FACT_W::new(self, 9)
173    }
174    ///Bit 10 - Filter active
175    #[inline(always)]
176    pub fn fact10(&mut self) -> FACT_W<FA1Rrs> {
177        FACT_W::new(self, 10)
178    }
179    ///Bit 11 - Filter active
180    #[inline(always)]
181    pub fn fact11(&mut self) -> FACT_W<FA1Rrs> {
182        FACT_W::new(self, 11)
183    }
184    ///Bit 12 - Filter active
185    #[inline(always)]
186    pub fn fact12(&mut self) -> FACT_W<FA1Rrs> {
187        FACT_W::new(self, 12)
188    }
189    ///Bit 13 - Filter active
190    #[inline(always)]
191    pub fn fact13(&mut self) -> FACT_W<FA1Rrs> {
192        FACT_W::new(self, 13)
193    }
194}
195/**CAN_FA1R
196
197You 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).
198
199See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F103.html#CAN:FA1R)*/
200pub struct FA1Rrs;
201impl crate::RegisterSpec for FA1Rrs {
202    type Ux = u32;
203}
204///`read()` method returns [`fa1r::R`](R) reader structure
205impl crate::Readable for FA1Rrs {}
206///`write(|w| ..)` method takes [`fa1r::W`](W) writer structure
207impl crate::Writable for FA1Rrs {
208    type Safety = crate::Unsafe;
209}
210///`reset()` method sets FA1R to value 0
211impl crate::Resettable for FA1Rrs {}