stm32f1_staging/stm32f103/can/
fm1r.rs

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