stm32f1_staging/stm32f103/can/
ffa1r.rs

1///Register `FFA1R` reader
2pub type R = crate::R<FFA1Rrs>;
3///Register `FFA1R` writer
4pub type W = crate::W<FFA1Rrs>;
5///Field `FFA(0-13)` reader - Filter FIFO assignment for filter %s
6pub type FFA_R = crate::BitReader;
7///Field `FFA(0-13)` writer - Filter FIFO assignment for filter %s
8pub type FFA_W<'a, REG> = crate::BitWriter<'a, REG>;
9impl R {
10    ///Filter FIFO assignment for filter (0-13)
11    ///
12    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `FFA0` field.</div>
13    #[inline(always)]
14    pub fn ffa(&self, n: u8) -> FFA_R {
15        #[allow(clippy::no_effect)] [(); 14][n as usize];
16        FFA_R::new(((self.bits >> n) & 1) != 0)
17    }
18    ///Iterator for array of:
19    ///Filter FIFO assignment for filter (0-13)
20    #[inline(always)]
21    pub fn ffa_iter(&self) -> impl Iterator<Item = FFA_R> + '_ {
22        (0..14).map(move |n| FFA_R::new(((self.bits >> n) & 1) != 0))
23    }
24    ///Bit 0 - Filter FIFO assignment for filter 0
25    #[inline(always)]
26    pub fn ffa0(&self) -> FFA_R {
27        FFA_R::new((self.bits & 1) != 0)
28    }
29    ///Bit 1 - Filter FIFO assignment for filter 1
30    #[inline(always)]
31    pub fn ffa1(&self) -> FFA_R {
32        FFA_R::new(((self.bits >> 1) & 1) != 0)
33    }
34    ///Bit 2 - Filter FIFO assignment for filter 2
35    #[inline(always)]
36    pub fn ffa2(&self) -> FFA_R {
37        FFA_R::new(((self.bits >> 2) & 1) != 0)
38    }
39    ///Bit 3 - Filter FIFO assignment for filter 3
40    #[inline(always)]
41    pub fn ffa3(&self) -> FFA_R {
42        FFA_R::new(((self.bits >> 3) & 1) != 0)
43    }
44    ///Bit 4 - Filter FIFO assignment for filter 4
45    #[inline(always)]
46    pub fn ffa4(&self) -> FFA_R {
47        FFA_R::new(((self.bits >> 4) & 1) != 0)
48    }
49    ///Bit 5 - Filter FIFO assignment for filter 5
50    #[inline(always)]
51    pub fn ffa5(&self) -> FFA_R {
52        FFA_R::new(((self.bits >> 5) & 1) != 0)
53    }
54    ///Bit 6 - Filter FIFO assignment for filter 6
55    #[inline(always)]
56    pub fn ffa6(&self) -> FFA_R {
57        FFA_R::new(((self.bits >> 6) & 1) != 0)
58    }
59    ///Bit 7 - Filter FIFO assignment for filter 7
60    #[inline(always)]
61    pub fn ffa7(&self) -> FFA_R {
62        FFA_R::new(((self.bits >> 7) & 1) != 0)
63    }
64    ///Bit 8 - Filter FIFO assignment for filter 8
65    #[inline(always)]
66    pub fn ffa8(&self) -> FFA_R {
67        FFA_R::new(((self.bits >> 8) & 1) != 0)
68    }
69    ///Bit 9 - Filter FIFO assignment for filter 9
70    #[inline(always)]
71    pub fn ffa9(&self) -> FFA_R {
72        FFA_R::new(((self.bits >> 9) & 1) != 0)
73    }
74    ///Bit 10 - Filter FIFO assignment for filter 10
75    #[inline(always)]
76    pub fn ffa10(&self) -> FFA_R {
77        FFA_R::new(((self.bits >> 10) & 1) != 0)
78    }
79    ///Bit 11 - Filter FIFO assignment for filter 11
80    #[inline(always)]
81    pub fn ffa11(&self) -> FFA_R {
82        FFA_R::new(((self.bits >> 11) & 1) != 0)
83    }
84    ///Bit 12 - Filter FIFO assignment for filter 12
85    #[inline(always)]
86    pub fn ffa12(&self) -> FFA_R {
87        FFA_R::new(((self.bits >> 12) & 1) != 0)
88    }
89    ///Bit 13 - Filter FIFO assignment for filter 13
90    #[inline(always)]
91    pub fn ffa13(&self) -> FFA_R {
92        FFA_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("FFA1R")
98            .field("ffa0", &self.ffa0())
99            .field("ffa1", &self.ffa1())
100            .field("ffa2", &self.ffa2())
101            .field("ffa3", &self.ffa3())
102            .field("ffa4", &self.ffa4())
103            .field("ffa5", &self.ffa5())
104            .field("ffa6", &self.ffa6())
105            .field("ffa7", &self.ffa7())
106            .field("ffa8", &self.ffa8())
107            .field("ffa9", &self.ffa9())
108            .field("ffa10", &self.ffa10())
109            .field("ffa11", &self.ffa11())
110            .field("ffa12", &self.ffa12())
111            .field("ffa13", &self.ffa13())
112            .finish()
113    }
114}
115impl W {
116    ///Filter FIFO assignment for filter (0-13)
117    ///
118    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `FFA0` field.</div>
119    #[inline(always)]
120    pub fn ffa(&mut self, n: u8) -> FFA_W<FFA1Rrs> {
121        #[allow(clippy::no_effect)] [(); 14][n as usize];
122        FFA_W::new(self, n)
123    }
124    ///Bit 0 - Filter FIFO assignment for filter 0
125    #[inline(always)]
126    pub fn ffa0(&mut self) -> FFA_W<FFA1Rrs> {
127        FFA_W::new(self, 0)
128    }
129    ///Bit 1 - Filter FIFO assignment for filter 1
130    #[inline(always)]
131    pub fn ffa1(&mut self) -> FFA_W<FFA1Rrs> {
132        FFA_W::new(self, 1)
133    }
134    ///Bit 2 - Filter FIFO assignment for filter 2
135    #[inline(always)]
136    pub fn ffa2(&mut self) -> FFA_W<FFA1Rrs> {
137        FFA_W::new(self, 2)
138    }
139    ///Bit 3 - Filter FIFO assignment for filter 3
140    #[inline(always)]
141    pub fn ffa3(&mut self) -> FFA_W<FFA1Rrs> {
142        FFA_W::new(self, 3)
143    }
144    ///Bit 4 - Filter FIFO assignment for filter 4
145    #[inline(always)]
146    pub fn ffa4(&mut self) -> FFA_W<FFA1Rrs> {
147        FFA_W::new(self, 4)
148    }
149    ///Bit 5 - Filter FIFO assignment for filter 5
150    #[inline(always)]
151    pub fn ffa5(&mut self) -> FFA_W<FFA1Rrs> {
152        FFA_W::new(self, 5)
153    }
154    ///Bit 6 - Filter FIFO assignment for filter 6
155    #[inline(always)]
156    pub fn ffa6(&mut self) -> FFA_W<FFA1Rrs> {
157        FFA_W::new(self, 6)
158    }
159    ///Bit 7 - Filter FIFO assignment for filter 7
160    #[inline(always)]
161    pub fn ffa7(&mut self) -> FFA_W<FFA1Rrs> {
162        FFA_W::new(self, 7)
163    }
164    ///Bit 8 - Filter FIFO assignment for filter 8
165    #[inline(always)]
166    pub fn ffa8(&mut self) -> FFA_W<FFA1Rrs> {
167        FFA_W::new(self, 8)
168    }
169    ///Bit 9 - Filter FIFO assignment for filter 9
170    #[inline(always)]
171    pub fn ffa9(&mut self) -> FFA_W<FFA1Rrs> {
172        FFA_W::new(self, 9)
173    }
174    ///Bit 10 - Filter FIFO assignment for filter 10
175    #[inline(always)]
176    pub fn ffa10(&mut self) -> FFA_W<FFA1Rrs> {
177        FFA_W::new(self, 10)
178    }
179    ///Bit 11 - Filter FIFO assignment for filter 11
180    #[inline(always)]
181    pub fn ffa11(&mut self) -> FFA_W<FFA1Rrs> {
182        FFA_W::new(self, 11)
183    }
184    ///Bit 12 - Filter FIFO assignment for filter 12
185    #[inline(always)]
186    pub fn ffa12(&mut self) -> FFA_W<FFA1Rrs> {
187        FFA_W::new(self, 12)
188    }
189    ///Bit 13 - Filter FIFO assignment for filter 13
190    #[inline(always)]
191    pub fn ffa13(&mut self) -> FFA_W<FFA1Rrs> {
192        FFA_W::new(self, 13)
193    }
194}
195/**CAN_FFA1R
196
197You can [`read`](crate::Reg::read) this register and get [`ffa1r::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ffa1r::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:FFA1R)*/
200pub struct FFA1Rrs;
201impl crate::RegisterSpec for FFA1Rrs {
202    type Ux = u32;
203}
204///`read()` method returns [`ffa1r::R`](R) reader structure
205impl crate::Readable for FFA1Rrs {}
206///`write(|w| ..)` method takes [`ffa1r::W`](W) writer structure
207impl crate::Writable for FFA1Rrs {
208    type Safety = crate::Unsafe;
209}
210///`reset()` method sets FFA1R to value 0
211impl crate::Resettable for FFA1Rrs {}