stm32f1_staging/stm32f107/can1/
tsr.rs1pub type R = crate::R<TSRrs>;
3pub type W = crate::W<TSRrs>;
5pub type RQCP0_R = crate::BitReader;
7pub type RQCP0_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type TXOK0_R = crate::BitReader;
11pub type TXOK0_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type ALST0_R = crate::BitReader;
15pub type ALST0_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type TERR0_R = crate::BitReader;
19pub type TERR0_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type ABRQ0_R = crate::BitReader;
23pub type ABRQ0_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type RQCP1_R = crate::BitReader;
27pub type RQCP1_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type TXOK1_R = crate::BitReader;
31pub type TXOK1_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type ALST1_R = crate::BitReader;
35pub type ALST1_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type TERR1_R = crate::BitReader;
39pub type TERR1_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type ABRQ1_R = crate::BitReader;
43pub type ABRQ1_W<'a, REG> = crate::BitWriter<'a, REG>;
45pub type RQCP2_R = crate::BitReader;
47pub type RQCP2_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type TXOK2_R = crate::BitReader;
51pub type TXOK2_W<'a, REG> = crate::BitWriter<'a, REG>;
53pub type ALST2_R = crate::BitReader;
55pub type ALST2_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type TERR2_R = crate::BitReader;
59pub type TERR2_W<'a, REG> = crate::BitWriter<'a, REG>;
61pub type ABRQ2_R = crate::BitReader;
63pub type ABRQ2_W<'a, REG> = crate::BitWriter<'a, REG>;
65pub type CODE_R = crate::FieldReader;
67pub type TME_R = crate::BitReader;
69pub type LOW_R = crate::BitReader;
71impl R {
72 #[inline(always)]
74 pub fn rqcp0(&self) -> RQCP0_R {
75 RQCP0_R::new((self.bits & 1) != 0)
76 }
77 #[inline(always)]
79 pub fn txok0(&self) -> TXOK0_R {
80 TXOK0_R::new(((self.bits >> 1) & 1) != 0)
81 }
82 #[inline(always)]
84 pub fn alst0(&self) -> ALST0_R {
85 ALST0_R::new(((self.bits >> 2) & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn terr0(&self) -> TERR0_R {
90 TERR0_R::new(((self.bits >> 3) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn abrq0(&self) -> ABRQ0_R {
95 ABRQ0_R::new(((self.bits >> 7) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn rqcp1(&self) -> RQCP1_R {
100 RQCP1_R::new(((self.bits >> 8) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn txok1(&self) -> TXOK1_R {
105 TXOK1_R::new(((self.bits >> 9) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn alst1(&self) -> ALST1_R {
110 ALST1_R::new(((self.bits >> 10) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn terr1(&self) -> TERR1_R {
115 TERR1_R::new(((self.bits >> 11) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn abrq1(&self) -> ABRQ1_R {
120 ABRQ1_R::new(((self.bits >> 15) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn rqcp2(&self) -> RQCP2_R {
125 RQCP2_R::new(((self.bits >> 16) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn txok2(&self) -> TXOK2_R {
130 TXOK2_R::new(((self.bits >> 17) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn alst2(&self) -> ALST2_R {
135 ALST2_R::new(((self.bits >> 18) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn terr2(&self) -> TERR2_R {
140 TERR2_R::new(((self.bits >> 19) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn abrq2(&self) -> ABRQ2_R {
145 ABRQ2_R::new(((self.bits >> 23) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn code(&self) -> CODE_R {
150 CODE_R::new(((self.bits >> 24) & 3) as u8)
151 }
152 #[inline(always)]
156 pub fn tme(&self, n: u8) -> TME_R {
157 #[allow(clippy::no_effect)] [(); 3][n as usize];
158 TME_R::new(((self.bits >> (n + 26)) & 1) != 0)
159 }
160 #[inline(always)]
163 pub fn tme_iter(&self) -> impl Iterator<Item = TME_R> + '_ {
164 (0..3).map(move |n| TME_R::new(((self.bits >> (n + 26)) & 1) != 0))
165 }
166 #[inline(always)]
168 pub fn tme0(&self) -> TME_R {
169 TME_R::new(((self.bits >> 26) & 1) != 0)
170 }
171 #[inline(always)]
173 pub fn tme1(&self) -> TME_R {
174 TME_R::new(((self.bits >> 27) & 1) != 0)
175 }
176 #[inline(always)]
178 pub fn tme2(&self) -> TME_R {
179 TME_R::new(((self.bits >> 28) & 1) != 0)
180 }
181 #[inline(always)]
185 pub fn low(&self, n: u8) -> LOW_R {
186 #[allow(clippy::no_effect)] [(); 3][n as usize];
187 LOW_R::new(((self.bits >> (n + 29)) & 1) != 0)
188 }
189 #[inline(always)]
192 pub fn low_iter(&self) -> impl Iterator<Item = LOW_R> + '_ {
193 (0..3).map(move |n| LOW_R::new(((self.bits >> (n + 29)) & 1) != 0))
194 }
195 #[inline(always)]
197 pub fn low0(&self) -> LOW_R {
198 LOW_R::new(((self.bits >> 29) & 1) != 0)
199 }
200 #[inline(always)]
202 pub fn low1(&self) -> LOW_R {
203 LOW_R::new(((self.bits >> 30) & 1) != 0)
204 }
205 #[inline(always)]
207 pub fn low2(&self) -> LOW_R {
208 LOW_R::new(((self.bits >> 31) & 1) != 0)
209 }
210}
211impl core::fmt::Debug for R {
212 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
213 f.debug_struct("TSR")
214 .field("low0", &self.low0())
215 .field("low1", &self.low1())
216 .field("low2", &self.low2())
217 .field("tme0", &self.tme0())
218 .field("tme1", &self.tme1())
219 .field("tme2", &self.tme2())
220 .field("code", &self.code())
221 .field("abrq2", &self.abrq2())
222 .field("terr2", &self.terr2())
223 .field("alst2", &self.alst2())
224 .field("txok2", &self.txok2())
225 .field("rqcp2", &self.rqcp2())
226 .field("abrq1", &self.abrq1())
227 .field("terr1", &self.terr1())
228 .field("alst1", &self.alst1())
229 .field("txok1", &self.txok1())
230 .field("rqcp1", &self.rqcp1())
231 .field("abrq0", &self.abrq0())
232 .field("terr0", &self.terr0())
233 .field("alst0", &self.alst0())
234 .field("txok0", &self.txok0())
235 .field("rqcp0", &self.rqcp0())
236 .finish()
237 }
238}
239impl W {
240 #[inline(always)]
242 pub fn rqcp0(&mut self) -> RQCP0_W<TSRrs> {
243 RQCP0_W::new(self, 0)
244 }
245 #[inline(always)]
247 pub fn txok0(&mut self) -> TXOK0_W<TSRrs> {
248 TXOK0_W::new(self, 1)
249 }
250 #[inline(always)]
252 pub fn alst0(&mut self) -> ALST0_W<TSRrs> {
253 ALST0_W::new(self, 2)
254 }
255 #[inline(always)]
257 pub fn terr0(&mut self) -> TERR0_W<TSRrs> {
258 TERR0_W::new(self, 3)
259 }
260 #[inline(always)]
262 pub fn abrq0(&mut self) -> ABRQ0_W<TSRrs> {
263 ABRQ0_W::new(self, 7)
264 }
265 #[inline(always)]
267 pub fn rqcp1(&mut self) -> RQCP1_W<TSRrs> {
268 RQCP1_W::new(self, 8)
269 }
270 #[inline(always)]
272 pub fn txok1(&mut self) -> TXOK1_W<TSRrs> {
273 TXOK1_W::new(self, 9)
274 }
275 #[inline(always)]
277 pub fn alst1(&mut self) -> ALST1_W<TSRrs> {
278 ALST1_W::new(self, 10)
279 }
280 #[inline(always)]
282 pub fn terr1(&mut self) -> TERR1_W<TSRrs> {
283 TERR1_W::new(self, 11)
284 }
285 #[inline(always)]
287 pub fn abrq1(&mut self) -> ABRQ1_W<TSRrs> {
288 ABRQ1_W::new(self, 15)
289 }
290 #[inline(always)]
292 pub fn rqcp2(&mut self) -> RQCP2_W<TSRrs> {
293 RQCP2_W::new(self, 16)
294 }
295 #[inline(always)]
297 pub fn txok2(&mut self) -> TXOK2_W<TSRrs> {
298 TXOK2_W::new(self, 17)
299 }
300 #[inline(always)]
302 pub fn alst2(&mut self) -> ALST2_W<TSRrs> {
303 ALST2_W::new(self, 18)
304 }
305 #[inline(always)]
307 pub fn terr2(&mut self) -> TERR2_W<TSRrs> {
308 TERR2_W::new(self, 19)
309 }
310 #[inline(always)]
312 pub fn abrq2(&mut self) -> ABRQ2_W<TSRrs> {
313 ABRQ2_W::new(self, 23)
314 }
315}
316pub struct TSRrs;
322impl crate::RegisterSpec for TSRrs {
323 type Ux = u32;
324}
325impl crate::Readable for TSRrs {}
327impl crate::Writable for TSRrs {
329 type Safety = crate::Unsafe;
330}
331impl crate::Resettable for TSRrs {}