stm32f4/stm32f407/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)]
158 [(); 3][n as usize];
159 TME_R::new(((self.bits >> (n + 26)) & 1) != 0)
160 }
161 #[inline(always)]
164 pub fn tme_iter(&self) -> impl Iterator<Item = TME_R> + '_ {
165 (0..3).map(move |n| TME_R::new(((self.bits >> (n + 26)) & 1) != 0))
166 }
167 #[inline(always)]
169 pub fn tme0(&self) -> TME_R {
170 TME_R::new(((self.bits >> 26) & 1) != 0)
171 }
172 #[inline(always)]
174 pub fn tme1(&self) -> TME_R {
175 TME_R::new(((self.bits >> 27) & 1) != 0)
176 }
177 #[inline(always)]
179 pub fn tme2(&self) -> TME_R {
180 TME_R::new(((self.bits >> 28) & 1) != 0)
181 }
182 #[inline(always)]
186 pub fn low(&self, n: u8) -> LOW_R {
187 #[allow(clippy::no_effect)]
188 [(); 3][n as usize];
189 LOW_R::new(((self.bits >> (n + 29)) & 1) != 0)
190 }
191 #[inline(always)]
194 pub fn low_iter(&self) -> impl Iterator<Item = LOW_R> + '_ {
195 (0..3).map(move |n| LOW_R::new(((self.bits >> (n + 29)) & 1) != 0))
196 }
197 #[inline(always)]
199 pub fn low0(&self) -> LOW_R {
200 LOW_R::new(((self.bits >> 29) & 1) != 0)
201 }
202 #[inline(always)]
204 pub fn low1(&self) -> LOW_R {
205 LOW_R::new(((self.bits >> 30) & 1) != 0)
206 }
207 #[inline(always)]
209 pub fn low2(&self) -> LOW_R {
210 LOW_R::new(((self.bits >> 31) & 1) != 0)
211 }
212}
213impl core::fmt::Debug for R {
214 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
215 f.debug_struct("TSR")
216 .field("low0", &self.low0())
217 .field("low1", &self.low1())
218 .field("low2", &self.low2())
219 .field("tme0", &self.tme0())
220 .field("tme1", &self.tme1())
221 .field("tme2", &self.tme2())
222 .field("code", &self.code())
223 .field("abrq2", &self.abrq2())
224 .field("terr2", &self.terr2())
225 .field("alst2", &self.alst2())
226 .field("txok2", &self.txok2())
227 .field("rqcp2", &self.rqcp2())
228 .field("abrq1", &self.abrq1())
229 .field("terr1", &self.terr1())
230 .field("alst1", &self.alst1())
231 .field("txok1", &self.txok1())
232 .field("rqcp1", &self.rqcp1())
233 .field("abrq0", &self.abrq0())
234 .field("terr0", &self.terr0())
235 .field("alst0", &self.alst0())
236 .field("txok0", &self.txok0())
237 .field("rqcp0", &self.rqcp0())
238 .finish()
239 }
240}
241impl W {
242 #[inline(always)]
244 pub fn rqcp0(&mut self) -> RQCP0_W<TSRrs> {
245 RQCP0_W::new(self, 0)
246 }
247 #[inline(always)]
249 pub fn txok0(&mut self) -> TXOK0_W<TSRrs> {
250 TXOK0_W::new(self, 1)
251 }
252 #[inline(always)]
254 pub fn alst0(&mut self) -> ALST0_W<TSRrs> {
255 ALST0_W::new(self, 2)
256 }
257 #[inline(always)]
259 pub fn terr0(&mut self) -> TERR0_W<TSRrs> {
260 TERR0_W::new(self, 3)
261 }
262 #[inline(always)]
264 pub fn abrq0(&mut self) -> ABRQ0_W<TSRrs> {
265 ABRQ0_W::new(self, 7)
266 }
267 #[inline(always)]
269 pub fn rqcp1(&mut self) -> RQCP1_W<TSRrs> {
270 RQCP1_W::new(self, 8)
271 }
272 #[inline(always)]
274 pub fn txok1(&mut self) -> TXOK1_W<TSRrs> {
275 TXOK1_W::new(self, 9)
276 }
277 #[inline(always)]
279 pub fn alst1(&mut self) -> ALST1_W<TSRrs> {
280 ALST1_W::new(self, 10)
281 }
282 #[inline(always)]
284 pub fn terr1(&mut self) -> TERR1_W<TSRrs> {
285 TERR1_W::new(self, 11)
286 }
287 #[inline(always)]
289 pub fn abrq1(&mut self) -> ABRQ1_W<TSRrs> {
290 ABRQ1_W::new(self, 15)
291 }
292 #[inline(always)]
294 pub fn rqcp2(&mut self) -> RQCP2_W<TSRrs> {
295 RQCP2_W::new(self, 16)
296 }
297 #[inline(always)]
299 pub fn txok2(&mut self) -> TXOK2_W<TSRrs> {
300 TXOK2_W::new(self, 17)
301 }
302 #[inline(always)]
304 pub fn alst2(&mut self) -> ALST2_W<TSRrs> {
305 ALST2_W::new(self, 18)
306 }
307 #[inline(always)]
309 pub fn terr2(&mut self) -> TERR2_W<TSRrs> {
310 TERR2_W::new(self, 19)
311 }
312 #[inline(always)]
314 pub fn abrq2(&mut self) -> ABRQ2_W<TSRrs> {
315 ABRQ2_W::new(self, 23)
316 }
317}
318pub struct TSRrs;
324impl crate::RegisterSpec for TSRrs {
325 type Ux = u32;
326}
327impl crate::Readable for TSRrs {}
329impl crate::Writable for TSRrs {
331 type Safety = crate::Unsafe;
332}
333impl crate::Resettable for TSRrs {
335 const RESET_VALUE: u32 = 0x1c00_0000;
336}