APM:Libraries
bxcan.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
3  * Bit definitions were copied from NuttX STM32 CAN driver.
4  *
5  * With modifications for Ardupilot CAN driver
6  * Copyright (C) 2017 Eugene Shamaev
7  */
8 
9 #pragma once
10 
11 #include <uavcan/uavcan.hpp>
12 #include <stdint.h>
13 
14 #include <nuttx/arch.h>
15 #include <arch/board/board.h>
16 #include <chip/stm32_tim.h>
17 #include <syslog.h>
18 #include <nuttx/config.h>
19 #include <nuttx/fs/fs.h>
20 #include <nuttx/irq.h>
21 #include <nuttx/mm.h>
22 #include <pthread.h>
23 
24 #ifndef UAVCAN_CPP_VERSION
25 # error UAVCAN_CPP_VERSION
26 #endif
27 
28 #if UAVCAN_CPP_VERSION < UAVCAN_CPP11
29 // #undef'ed at the end of this file
30 # define constexpr const
31 #endif
32 
33 namespace PX4 {
34 namespace bxcan {
35 
36 # define CAN_IRQ_ATTACH(irq, handler) \
37  do { \
38  const int res = irq_attach(irq, handler); \
39  (void)res; \
40  assert(res >= 0); \
41  up_enable_irq(irq); \
42  } while(0)
43 
44 struct TxMailboxType {
45  volatile uint32_t TIR;
46  volatile uint32_t TDTR;
47  volatile uint32_t TDLR;
48  volatile uint32_t TDHR;
49 };
50 
51 struct RxMailboxType {
52  volatile uint32_t RIR;
53  volatile uint32_t RDTR;
54  volatile uint32_t RDLR;
55  volatile uint32_t RDHR;
56 };
57 
59  volatile uint32_t FR1;
60  volatile uint32_t FR2;
61 };
62 
63 struct CanType {
64  volatile uint32_t MCR;
65  volatile uint32_t MSR;
66  volatile uint32_t TSR;
67  volatile uint32_t RF0R;
68  volatile uint32_t RF1R;
69  volatile uint32_t IER;
70  volatile uint32_t ESR;
71  volatile uint32_t BTR;
72  uint32_t RESERVED0[88];
73  TxMailboxType TxMailbox[3];
74  RxMailboxType RxMailbox[2];
75  uint32_t RESERVED1[12];
76  volatile uint32_t FMR;
77  volatile uint32_t FM1R;
78  uint32_t RESERVED2;
79  volatile uint32_t FS1R;
80  uint32_t RESERVED3;
81  volatile uint32_t FFA1R;
82  uint32_t RESERVED4;
83  volatile uint32_t FA1R;
84  uint32_t RESERVED5[8];
85  FilterRegisterType FilterRegister[28];
86 };
87 
91 CanType* const Can[2] = { reinterpret_cast<CanType*>(STM32_CAN1_BASE), reinterpret_cast<CanType*>(STM32_CAN2_BASE) };
92 
93 /* CAN master control register */
94 
95 constexpr unsigned long MCR_INRQ = (1U << 0); /* Bit 0: Initialization Request */
96 constexpr unsigned long MCR_SLEEP = (1U << 1); /* Bit 1: Sleep Mode Request */
97 constexpr unsigned long MCR_TXFP = (1U << 2); /* Bit 2: Transmit FIFO Priority */
98 constexpr unsigned long MCR_RFLM = (1U << 3); /* Bit 3: Receive FIFO Locked Mode */
99 constexpr unsigned long MCR_NART = (1U << 4); /* Bit 4: No Automatic Retransmission */
100 constexpr unsigned long MCR_AWUM = (1U << 5); /* Bit 5: Automatic Wakeup Mode */
101 constexpr unsigned long MCR_ABOM = (1U << 6); /* Bit 6: Automatic Bus-Off Management */
102 constexpr unsigned long MCR_TTCM = (1U << 7); /* Bit 7: Time Triggered Communication Mode Enable */
103 constexpr unsigned long MCR_RESET = (1U << 15);/* Bit 15: bxCAN software master reset */
104 constexpr unsigned long MCR_DBF = (1U << 16);/* Bit 16: Debug freeze */
105 
106 /* CAN master status register */
107 
108 constexpr unsigned long MSR_INAK = (1U << 0); /* Bit 0: Initialization Acknowledge */
109 constexpr unsigned long MSR_SLAK = (1U << 1); /* Bit 1: Sleep Acknowledge */
110 constexpr unsigned long MSR_ERRI = (1U << 2); /* Bit 2: Error Interrupt */
111 constexpr unsigned long MSR_WKUI = (1U << 3); /* Bit 3: Wakeup Interrupt */
112 constexpr unsigned long MSR_SLAKI = (1U << 4); /* Bit 4: Sleep acknowledge interrupt */
113 constexpr unsigned long MSR_TXM = (1U << 8); /* Bit 8: Transmit Mode */
114 constexpr unsigned long MSR_RXM = (1U << 9); /* Bit 9: Receive Mode */
115 constexpr unsigned long MSR_SAMP = (1U << 10);/* Bit 10: Last Sample Point */
116 constexpr unsigned long MSR_RX = (1U << 11);/* Bit 11: CAN Rx Signal */
117 
118 /* CAN transmit status register */
119 
120 constexpr unsigned long TSR_RQCP0 = (1U << 0); /* Bit 0: Request Completed Mailbox 0 */
121 constexpr unsigned long TSR_TXOK0 = (1U << 1); /* Bit 1 : Transmission OK of Mailbox 0 */
122 constexpr unsigned long TSR_ALST0 = (1U << 2); /* Bit 2 : Arbitration Lost for Mailbox 0 */
123 constexpr unsigned long TSR_TERR0 = (1U << 3); /* Bit 3 : Transmission Error of Mailbox 0 */
124 constexpr unsigned long TSR_ABRQ0 = (1U << 7); /* Bit 7 : Abort Request for Mailbox 0 */
125 constexpr unsigned long TSR_RQCP1 = (1U << 8); /* Bit 8 : Request Completed Mailbox 1 */
126 constexpr unsigned long TSR_TXOK1 = (1U << 9); /* Bit 9 : Transmission OK of Mailbox 1 */
127 constexpr unsigned long TSR_ALST1 = (1U << 10);/* Bit 10 : Arbitration Lost for Mailbox 1 */
128 constexpr unsigned long TSR_TERR1 = (1U << 11);/* Bit 11 : Transmission Error of Mailbox 1 */
129 constexpr unsigned long TSR_ABRQ1 = (1U << 15);/* Bit 15 : Abort Request for Mailbox 1 */
130 constexpr unsigned long TSR_RQCP2 = (1U << 16);/* Bit 16 : Request Completed Mailbox 2 */
131 constexpr unsigned long TSR_TXOK2 = (1U << 17);/* Bit 17 : Transmission OK of Mailbox 2 */
132 constexpr unsigned long TSR_ALST2 = (1U << 18);/* Bit 18: Arbitration Lost for Mailbox 2 */
133 constexpr unsigned long TSR_TERR2 = (1U << 19);/* Bit 19: Transmission Error of Mailbox 2 */
134 constexpr unsigned long TSR_ABRQ2 = (1U << 23);/* Bit 23: Abort Request for Mailbox 2 */
135 constexpr unsigned long TSR_CODE_SHIFT = (24U); /* Bits 25-24: Mailbox Code */
136 constexpr unsigned long TSR_CODE_MASK = (3U << TSR_CODE_SHIFT);
137 constexpr unsigned long TSR_TME0 = (1U << 26);/* Bit 26: Transmit Mailbox 0 Empty */
138 constexpr unsigned long TSR_TME1 = (1U << 27);/* Bit 27: Transmit Mailbox 1 Empty */
139 constexpr unsigned long TSR_TME2 = (1U << 28);/* Bit 28: Transmit Mailbox 2 Empty */
140 constexpr unsigned long TSR_LOW0 = (1U << 29);/* Bit 29: Lowest Priority Flag for Mailbox 0 */
141 constexpr unsigned long TSR_LOW1 = (1U << 30);/* Bit 30: Lowest Priority Flag for Mailbox 1 */
142 constexpr unsigned long TSR_LOW2 = (1U << 31);/* Bit 31: Lowest Priority Flag for Mailbox 2 */
143 
144 /* CAN receive FIFO 0/1 registers */
145 
146 constexpr unsigned long RFR_FMP_SHIFT = (0U); /* Bits 1-0: FIFO Message Pending */
147 constexpr unsigned long RFR_FMP_MASK = (3U << RFR_FMP_SHIFT);
148 constexpr unsigned long RFR_FULL = (1U << 3); /* Bit 3: FIFO 0 Full */
149 constexpr unsigned long RFR_FOVR = (1U << 4); /* Bit 4: FIFO 0 Overrun */
150 constexpr unsigned long RFR_RFOM = (1U << 5); /* Bit 5: Release FIFO 0 Output Mailbox */
151 
152 /* CAN interrupt enable register */
153 
154 constexpr unsigned long IER_TMEIE = (1U << 0); /* Bit 0: Transmit Mailbox Empty Interrupt Enable */
155 constexpr unsigned long IER_FMPIE0 = (1U << 1); /* Bit 1: FIFO Message Pending Interrupt Enable */
156 constexpr unsigned long IER_FFIE0 = (1U << 2); /* Bit 2: FIFO Full Interrupt Enable */
157 constexpr unsigned long IER_FOVIE0 = (1U << 3); /* Bit 3: FIFO Overrun Interrupt Enable */
158 constexpr unsigned long IER_FMPIE1 = (1U << 4); /* Bit 4: FIFO Message Pending Interrupt Enable */
159 constexpr unsigned long IER_FFIE1 = (1U << 5); /* Bit 5: FIFO Full Interrupt Enable */
160 constexpr unsigned long IER_FOVIE1 = (1U << 6); /* Bit 6: FIFO Overrun Interrupt Enable */
161 constexpr unsigned long IER_EWGIE = (1U << 8); /* Bit 8: Error Warning Interrupt Enable */
162 constexpr unsigned long IER_EPVIE = (1U << 9); /* Bit 9: Error Passive Interrupt Enable */
163 constexpr unsigned long IER_BOFIE = (1U << 10);/* Bit 10: Bus-Off Interrupt Enable */
164 constexpr unsigned long IER_LECIE = (1U << 11);/* Bit 11: Last Error Code Interrupt Enable */
165 constexpr unsigned long IER_ERRIE = (1U << 15);/* Bit 15: Error Interrupt Enable */
166 constexpr unsigned long IER_WKUIE = (1U << 16);/* Bit 16: Wakeup Interrupt Enable */
167 constexpr unsigned long IER_SLKIE = (1U << 17);/* Bit 17: Sleep Interrupt Enable */
168 
169 /* CAN error status register */
170 
171 constexpr unsigned long ESR_EWGF = (1U << 0); /* Bit 0: Error Warning Flag */
172 constexpr unsigned long ESR_EPVF = (1U << 1); /* Bit 1: Error Passive Flag */
173 constexpr unsigned long ESR_BOFF = (1U << 2); /* Bit 2: Bus-Off Flag */
174 constexpr unsigned long ESR_LEC_SHIFT = (4U); /* Bits 6-4: Last Error Code */
175 constexpr unsigned long ESR_LEC_MASK = (7U << ESR_LEC_SHIFT);
176 constexpr unsigned long ESR_NOERROR = (0U << ESR_LEC_SHIFT);/* 000: No Error */
177 constexpr unsigned long ESR_STUFFERROR = (1U << ESR_LEC_SHIFT);/* 001: Stuff Error */
178 constexpr unsigned long ESR_FORMERROR = (2U << ESR_LEC_SHIFT);/* 010: Form Error */
179 constexpr unsigned long ESR_ACKERROR = (3U << ESR_LEC_SHIFT);/* 011: Acknowledgment Error */
180 constexpr unsigned long ESR_BRECERROR = (4U << ESR_LEC_SHIFT);/* 100: Bit recessive Error */
181 constexpr unsigned long ESR_BDOMERROR = (5U << ESR_LEC_SHIFT);/* 101: Bit dominant Error */
182 constexpr unsigned long ESR_CRCERRPR = (6U << ESR_LEC_SHIFT);/* 110: CRC Error */
183 constexpr unsigned long ESR_SWERROR = (7U << ESR_LEC_SHIFT);/* 111: Set by software */
184 constexpr unsigned long ESR_TEC_SHIFT = (16U); /* Bits 23-16: LS byte of the 9-bit Transmit Error Counter */
185 constexpr unsigned long ESR_TEC_MASK = (0xFFU << ESR_TEC_SHIFT);
186 constexpr unsigned long ESR_REC_SHIFT = (24U); /* Bits 31-24: Receive Error Counter */
187 constexpr unsigned long ESR_REC_MASK = (0xFFU << ESR_REC_SHIFT);
188 
189 /* CAN bit timing register */
190 
191 constexpr unsigned long BTR_BRP_SHIFT = (0U); /* Bits 9-0: Baud Rate Prescaler */
192 constexpr unsigned long BTR_BRP_MASK = (0x03FFU << BTR_BRP_SHIFT);
193 constexpr unsigned long BTR_TS1_SHIFT = (16U); /* Bits 19-16: Time Segment 1 */
194 constexpr unsigned long BTR_TS1_MASK = (0x0FU << BTR_TS1_SHIFT);
195 constexpr unsigned long BTR_TS2_SHIFT = (20U); /* Bits 22-20: Time Segment 2 */
196 constexpr unsigned long BTR_TS2_MASK = (7U << BTR_TS2_SHIFT);
197 constexpr unsigned long BTR_SJW_SHIFT = (24U); /* Bits 25-24: Resynchronization Jump Width */
198 constexpr unsigned long BTR_SJW_MASK = (3U << BTR_SJW_SHIFT);
199 constexpr unsigned long BTR_LBKM = (1U << 30);/* Bit 30: Loop Back Mode (Debug);*/
200 constexpr unsigned long BTR_SILM = (1U << 31);/* Bit 31: Silent Mode (Debug);*/
201 
202 constexpr unsigned long BTR_BRP_MAX = (1024U); /* Maximum BTR value (without decrement);*/
203 constexpr unsigned long BTR_TSEG1_MAX = (16U); /* Maximum TSEG1 value (without decrement);*/
204 constexpr unsigned long BTR_TSEG2_MAX = (8U); /* Maximum TSEG2 value (without decrement);*/
205 
206 /* TX mailbox identifier register */
207 
208 constexpr unsigned long TIR_TXRQ = (1U << 0); /* Bit 0: Transmit Mailbox Request */
209 constexpr unsigned long TIR_RTR = (1U << 1); /* Bit 1: Remote Transmission Request */
210 constexpr unsigned long TIR_IDE = (1U << 2); /* Bit 2: Identifier Extension */
211 constexpr unsigned long TIR_EXID_SHIFT = (3U); /* Bit 3-31: Extended Identifier */
212 constexpr unsigned long TIR_EXID_MASK = (0x1FFFFFFFU << TIR_EXID_SHIFT);
213 constexpr unsigned long TIR_STID_SHIFT = (21U); /* Bits 21-31: Standard Identifier */
214 constexpr unsigned long TIR_STID_MASK = (0x07FFU << TIR_STID_SHIFT);
215 
216 /* Mailbox data length control and time stamp register */
217 
218 constexpr unsigned long TDTR_DLC_SHIFT = (0U); /* Bits 3:0: Data Length Code */
219 constexpr unsigned long TDTR_DLC_MASK = (0x0FU << TDTR_DLC_SHIFT);
220 constexpr unsigned long TDTR_TGT = (1U << 8); /* Bit 8: Transmit Global Time */
221 constexpr unsigned long TDTR_TIME_SHIFT = (16U); /* Bits 31:16: Message Time Stamp */
222 constexpr unsigned long TDTR_TIME_MASK = (0xFFFFU << TDTR_TIME_SHIFT);
223 
224 /* Mailbox data low register */
225 
226 constexpr unsigned long TDLR_DATA0_SHIFT = (0U); /* Bits 7-0: Data Byte 0 */
227 constexpr unsigned long TDLR_DATA0_MASK = (0xFFU << TDLR_DATA0_SHIFT);
228 constexpr unsigned long TDLR_DATA1_SHIFT = (8U); /* Bits 15-8: Data Byte 1 */
229 constexpr unsigned long TDLR_DATA1_MASK = (0xFFU << TDLR_DATA1_SHIFT);
230 constexpr unsigned long TDLR_DATA2_SHIFT = (16U); /* Bits 23-16: Data Byte 2 */
231 constexpr unsigned long TDLR_DATA2_MASK = (0xFFU << TDLR_DATA2_SHIFT);
232 constexpr unsigned long TDLR_DATA3_SHIFT = (24U); /* Bits 31-24: Data Byte 3 */
233 constexpr unsigned long TDLR_DATA3_MASK = (0xFFU << TDLR_DATA3_SHIFT);
234 
235 /* Mailbox data high register */
236 
237 constexpr unsigned long TDHR_DATA4_SHIFT = (0U); /* Bits 7-0: Data Byte 4 */
238 constexpr unsigned long TDHR_DATA4_MASK = (0xFFU << TDHR_DATA4_SHIFT);
239 constexpr unsigned long TDHR_DATA5_SHIFT = (8U); /* Bits 15-8: Data Byte 5 */
240 constexpr unsigned long TDHR_DATA5_MASK = (0xFFU << TDHR_DATA5_SHIFT);
241 constexpr unsigned long TDHR_DATA6_SHIFT = (16U); /* Bits 23-16: Data Byte 6 */
242 constexpr unsigned long TDHR_DATA6_MASK = (0xFFU << TDHR_DATA6_SHIFT);
243 constexpr unsigned long TDHR_DATA7_SHIFT = (24U); /* Bits 31-24: Data Byte 7 */
244 constexpr unsigned long TDHR_DATA7_MASK = (0xFFU << TDHR_DATA7_SHIFT);
245 
246 /* Rx FIFO mailbox identifier register */
247 
248 constexpr unsigned long RIR_RTR = (1U << 1); /* Bit 1: Remote Transmission Request */
249 constexpr unsigned long RIR_IDE = (1U << 2); /* Bit 2: Identifier Extension */
250 constexpr unsigned long RIR_EXID_SHIFT = (3U); /* Bit 3-31: Extended Identifier */
251 constexpr unsigned long RIR_EXID_MASK = (0x1FFFFFFFU << RIR_EXID_SHIFT);
252 constexpr unsigned long RIR_STID_SHIFT = (21U); /* Bits 21-31: Standard Identifier */
253 constexpr unsigned long RIR_STID_MASK = (0x07FFU << RIR_STID_SHIFT);
254 
255 /* Receive FIFO mailbox data length control and time stamp register */
256 
257 constexpr unsigned long RDTR_DLC_SHIFT = (0U); /* Bits 3:0: Data Length Code */
258 constexpr unsigned long RDTR_DLC_MASK = (0x0FU << RDTR_DLC_SHIFT);
259 constexpr unsigned long RDTR_FM_SHIFT = (8U); /* Bits 15-8: Filter Match Index */
260 constexpr unsigned long RDTR_FM_MASK = (0xFFU << RDTR_FM_SHIFT);
261 constexpr unsigned long RDTR_TIME_SHIFT = (16U); /* Bits 31:16: Message Time Stamp */
262 constexpr unsigned long RDTR_TIME_MASK = (0xFFFFU << RDTR_TIME_SHIFT);
263 
264 /* Receive FIFO mailbox data low register */
265 
266 constexpr unsigned long RDLR_DATA0_SHIFT = (0U); /* Bits 7-0: Data Byte 0 */
267 constexpr unsigned long RDLR_DATA0_MASK = (0xFFU << RDLR_DATA0_SHIFT);
268 constexpr unsigned long RDLR_DATA1_SHIFT = (8U); /* Bits 15-8: Data Byte 1 */
269 constexpr unsigned long RDLR_DATA1_MASK = (0xFFU << RDLR_DATA1_SHIFT);
270 constexpr unsigned long RDLR_DATA2_SHIFT = (16U); /* Bits 23-16: Data Byte 2 */
271 constexpr unsigned long RDLR_DATA2_MASK = (0xFFU << RDLR_DATA2_SHIFT);
272 constexpr unsigned long RDLR_DATA3_SHIFT = (24U); /* Bits 31-24: Data Byte 3 */
273 constexpr unsigned long RDLR_DATA3_MASK = (0xFFU << RDLR_DATA3_SHIFT);
274 
275 /* Receive FIFO mailbox data high register */
276 
277 constexpr unsigned long RDHR_DATA4_SHIFT = (0U); /* Bits 7-0: Data Byte 4 */
278 constexpr unsigned long RDHR_DATA4_MASK = (0xFFU << RDHR_DATA4_SHIFT);
279 constexpr unsigned long RDHR_DATA5_SHIFT = (8U); /* Bits 15-8: Data Byte 5 */
280 constexpr unsigned long RDHR_DATA5_MASK = (0xFFU << RDHR_DATA5_SHIFT);
281 constexpr unsigned long RDHR_DATA6_SHIFT = (16U); /* Bits 23-16: Data Byte 6 */
282 constexpr unsigned long RDHR_DATA6_MASK = (0xFFU << RDHR_DATA6_SHIFT);
283 constexpr unsigned long RDHR_DATA7_SHIFT = (24U); /* Bits 31-24: Data Byte 7 */
284 constexpr unsigned long RDHR_DATA7_MASK = (0xFFU << RDHR_DATA7_SHIFT);
285 
286 /* CAN filter master register */
287 
288 constexpr unsigned long FMR_FINIT = (1U << 0); /* Bit 0: Filter Init Mode */
289 }
290 }
291 
292 #if UAVCAN_CPP_VERSION < UAVCAN_CPP11
293 # undef constexpr
294 #endif
constexpr unsigned long TDTR_TIME_SHIFT
Definition: bxcan.h:221
constexpr unsigned long TDHR_DATA5_SHIFT
Definition: bxcan.h:239
volatile uint32_t FMR
Definition: bxcan.h:76
constexpr unsigned long MCR_DBF
Definition: bxcan.h:104
constexpr unsigned long BTR_TSEG2_MAX
Definition: bxcan.h:204
constexpr unsigned long RDHR_DATA4_MASK
Definition: bxcan.h:278
volatile uint32_t RIR
Definition: bxcan.h:52
constexpr unsigned long BTR_BRP_MAX
Definition: bxcan.h:202
volatile uint32_t TSR
Definition: bxcan.h:66
volatile uint32_t TDLR
Definition: bxcan.h:47
constexpr unsigned long BTR_LBKM
Definition: bxcan.h:199
constexpr unsigned long TDHR_DATA4_MASK
Definition: bxcan.h:238
volatile uint32_t ESR
Definition: bxcan.h:70
constexpr unsigned long BTR_SJW_MASK
Definition: bxcan.h:198
constexpr unsigned long TDTR_TIME_MASK
Definition: bxcan.h:222
constexpr unsigned long ESR_FORMERROR
Definition: bxcan.h:178
constexpr unsigned long TSR_RQCP0
Definition: bxcan.h:120
constexpr unsigned long RDLR_DATA0_MASK
Definition: bxcan.h:267
constexpr unsigned long TIR_IDE
Definition: bxcan.h:210
constexpr unsigned long RDHR_DATA6_SHIFT
Definition: bxcan.h:281
constexpr unsigned long BTR_SJW_SHIFT
Definition: bxcan.h:197
constexpr unsigned long RDLR_DATA0_SHIFT
Definition: bxcan.h:266
volatile uint32_t RDTR
Definition: bxcan.h:53
constexpr unsigned long TIR_RTR
Definition: bxcan.h:209
constexpr unsigned long RDLR_DATA2_MASK
Definition: bxcan.h:271
constexpr unsigned long TSR_ABRQ0
Definition: bxcan.h:124
constexpr unsigned long BTR_TS2_SHIFT
Definition: bxcan.h:195
constexpr unsigned long TSR_TXOK2
Definition: bxcan.h:131
constexpr unsigned long ESR_TEC_MASK
Definition: bxcan.h:185
uint32_t RESERVED4
Definition: bxcan.h:82
constexpr unsigned long RDLR_DATA2_SHIFT
Definition: bxcan.h:270
constexpr unsigned long RDHR_DATA7_SHIFT
Definition: bxcan.h:283
constexpr unsigned long IER_FMPIE0
Definition: bxcan.h:155
volatile uint32_t RF1R
Definition: bxcan.h:68
constexpr unsigned long MSR_RX
Definition: bxcan.h:116
volatile uint32_t MSR
Definition: bxcan.h:65
constexpr unsigned long RIR_STID_SHIFT
Definition: bxcan.h:252
constexpr unsigned long RDTR_TIME_SHIFT
Definition: bxcan.h:261
constexpr unsigned long FMR_FINIT
Definition: bxcan.h:288
constexpr unsigned long TIR_TXRQ
Definition: bxcan.h:208
constexpr unsigned long IER_FOVIE0
Definition: bxcan.h:157
volatile uint32_t IER
Definition: bxcan.h:69
constexpr unsigned long RDLR_DATA3_MASK
Definition: bxcan.h:273
constexpr unsigned long TSR_TERR1
Definition: bxcan.h:128
volatile uint32_t TDHR
Definition: bxcan.h:48
constexpr unsigned long TSR_ALST2
Definition: bxcan.h:132
constexpr unsigned long RDLR_DATA1_SHIFT
Definition: bxcan.h:268
constexpr unsigned long TDLR_DATA2_SHIFT
Definition: bxcan.h:230
constexpr unsigned long TDTR_DLC_MASK
Definition: bxcan.h:219
constexpr unsigned long IER_FFIE0
Definition: bxcan.h:156
constexpr unsigned long TSR_TME2
Definition: bxcan.h:139
constexpr unsigned long BTR_TSEG1_MAX
Definition: bxcan.h:203
constexpr unsigned long BTR_TS1_MASK
Definition: bxcan.h:194
constexpr unsigned long TIR_EXID_MASK
Definition: bxcan.h:212
constexpr unsigned long IER_BOFIE
Definition: bxcan.h:163
constexpr unsigned long MSR_RXM
Definition: bxcan.h:114
constexpr unsigned long MCR_RESET
Definition: bxcan.h:103
constexpr unsigned long RDTR_DLC_MASK
Definition: bxcan.h:258
constexpr unsigned long IER_TMEIE
Definition: bxcan.h:154
constexpr unsigned long RDHR_DATA6_MASK
Definition: bxcan.h:282
constexpr unsigned long RDLR_DATA3_SHIFT
Definition: bxcan.h:272
constexpr unsigned long IER_SLKIE
Definition: bxcan.h:167
constexpr unsigned long MCR_AWUM
Definition: bxcan.h:100
constexpr unsigned long MSR_SLAKI
Definition: bxcan.h:112
constexpr unsigned long TDHR_DATA5_MASK
Definition: bxcan.h:240
constexpr unsigned long MSR_INAK
Definition: bxcan.h:108
constexpr unsigned long TSR_RQCP1
Definition: bxcan.h:125
constexpr unsigned long TSR_TXOK1
Definition: bxcan.h:126
constexpr unsigned long MSR_SAMP
Definition: bxcan.h:115
constexpr unsigned long ESR_STUFFERROR
Definition: bxcan.h:177
constexpr unsigned long RDHR_DATA4_SHIFT
Definition: bxcan.h:277
constexpr unsigned long MCR_RFLM
Definition: bxcan.h:98
volatile uint32_t TIR
Definition: bxcan.h:45
constexpr unsigned long RDTR_DLC_SHIFT
Definition: bxcan.h:257
constexpr unsigned long RDHR_DATA5_SHIFT
Definition: bxcan.h:279
constexpr unsigned long RIR_EXID_SHIFT
Definition: bxcan.h:250
constexpr unsigned long RFR_RFOM
Definition: bxcan.h:150
constexpr unsigned long ESR_LEC_SHIFT
Definition: bxcan.h:174
constexpr unsigned long IER_EWGIE
Definition: bxcan.h:161
constexpr unsigned long RFR_FMP_SHIFT
Definition: bxcan.h:146
constexpr unsigned long TSR_ABRQ2
Definition: bxcan.h:134
constexpr unsigned long ESR_BDOMERROR
Definition: bxcan.h:181
constexpr unsigned long RIR_IDE
Definition: bxcan.h:249
constexpr unsigned long TDTR_TGT
Definition: bxcan.h:220
constexpr unsigned long IER_FMPIE1
Definition: bxcan.h:158
constexpr unsigned long MSR_TXM
Definition: bxcan.h:113
constexpr unsigned long BTR_BRP_SHIFT
Definition: bxcan.h:191
constexpr unsigned long TDLR_DATA2_MASK
Definition: bxcan.h:231
constexpr unsigned long RFR_FULL
Definition: bxcan.h:148
constexpr unsigned long TIR_STID_MASK
Definition: bxcan.h:214
constexpr unsigned long BTR_TS2_MASK
Definition: bxcan.h:196
#define constexpr
Definition: AP_HAL_Macros.h:16
constexpr unsigned long MSR_WKUI
Definition: bxcan.h:111
constexpr unsigned long MCR_TTCM
Definition: bxcan.h:102
constexpr unsigned long ESR_EWGF
Definition: bxcan.h:171
constexpr unsigned long TSR_TME0
Definition: bxcan.h:137
constexpr unsigned long MSR_ERRI
Definition: bxcan.h:110
constexpr unsigned long TDLR_DATA0_SHIFT
Definition: bxcan.h:226
constexpr unsigned long TSR_ALST0
Definition: bxcan.h:122
constexpr unsigned long TDHR_DATA6_MASK
Definition: bxcan.h:242
constexpr unsigned long RDLR_DATA1_MASK
Definition: bxcan.h:269
volatile uint32_t TDTR
Definition: bxcan.h:46
constexpr unsigned long TSR_ALST1
Definition: bxcan.h:127
constexpr unsigned long RFR_FOVR
Definition: bxcan.h:149
constexpr unsigned long ESR_EPVF
Definition: bxcan.h:172
volatile uint32_t FS1R
Definition: bxcan.h:79
constexpr unsigned long TDTR_DLC_SHIFT
Definition: bxcan.h:218
constexpr unsigned long RDHR_DATA7_MASK
Definition: bxcan.h:284
volatile uint32_t RDLR
Definition: bxcan.h:54
constexpr unsigned long RDTR_TIME_MASK
Definition: bxcan.h:262
constexpr unsigned long TDHR_DATA7_MASK
Definition: bxcan.h:244
constexpr unsigned long MCR_ABOM
Definition: bxcan.h:101
volatile uint32_t BTR
Definition: bxcan.h:71
constexpr unsigned long RIR_STID_MASK
Definition: bxcan.h:253
constexpr unsigned long ESR_SWERROR
Definition: bxcan.h:183
constexpr unsigned long TDLR_DATA3_SHIFT
Definition: bxcan.h:232
constexpr unsigned long MCR_NART
Definition: bxcan.h:99
constexpr unsigned long ESR_LEC_MASK
Definition: bxcan.h:175
constexpr unsigned long TDLR_DATA1_MASK
Definition: bxcan.h:229
volatile uint32_t FM1R
Definition: bxcan.h:77
constexpr unsigned long TDHR_DATA7_SHIFT
Definition: bxcan.h:243
constexpr unsigned long TDLR_DATA3_MASK
Definition: bxcan.h:233
constexpr unsigned long ESR_BRECERROR
Definition: bxcan.h:180
constexpr unsigned long TSR_TXOK0
Definition: bxcan.h:121
constexpr unsigned long RDHR_DATA5_MASK
Definition: bxcan.h:280
constexpr unsigned long MSR_SLAK
Definition: bxcan.h:109
constexpr unsigned long TSR_RQCP2
Definition: bxcan.h:130
constexpr unsigned long TSR_LOW0
Definition: bxcan.h:140
volatile uint32_t MCR
Definition: bxcan.h:64
constexpr unsigned long TDHR_DATA6_SHIFT
Definition: bxcan.h:241
constexpr unsigned long RDTR_FM_MASK
Definition: bxcan.h:260
constexpr unsigned long BTR_TS1_SHIFT
Definition: bxcan.h:193
volatile uint32_t FFA1R
Definition: bxcan.h:81
constexpr unsigned long ESR_REC_SHIFT
Definition: bxcan.h:186
constexpr unsigned long IER_LECIE
Definition: bxcan.h:164
constexpr unsigned long TDHR_DATA4_SHIFT
Definition: bxcan.h:237
constexpr unsigned long TIR_EXID_SHIFT
Definition: bxcan.h:211
constexpr unsigned long ESR_BOFF
Definition: bxcan.h:173
constexpr unsigned long TSR_CODE_MASK
Definition: bxcan.h:136
constexpr unsigned long TSR_CODE_SHIFT
Definition: bxcan.h:135
constexpr unsigned long RFR_FMP_MASK
Definition: bxcan.h:147
volatile uint32_t RDHR
Definition: bxcan.h:55
constexpr unsigned long TSR_ABRQ1
Definition: bxcan.h:129
constexpr unsigned long IER_EPVIE
Definition: bxcan.h:162
constexpr unsigned long TSR_TERR0
Definition: bxcan.h:123
constexpr unsigned long BTR_SILM
Definition: bxcan.h:200
constexpr unsigned long MCR_INRQ
Definition: bxcan.h:95
constexpr unsigned long TSR_TME1
Definition: bxcan.h:138
constexpr unsigned long RDTR_FM_SHIFT
Definition: bxcan.h:259
volatile uint32_t FA1R
Definition: bxcan.h:83
constexpr unsigned long ESR_REC_MASK
Definition: bxcan.h:187
constexpr unsigned long ESR_NOERROR
Definition: bxcan.h:176
constexpr unsigned long TSR_TERR2
Definition: bxcan.h:133
constexpr unsigned long BTR_BRP_MASK
Definition: bxcan.h:192
constexpr unsigned long MCR_SLEEP
Definition: bxcan.h:96
constexpr unsigned long ESR_TEC_SHIFT
Definition: bxcan.h:184
constexpr unsigned long TSR_LOW2
Definition: bxcan.h:142
constexpr unsigned long RIR_RTR
Definition: bxcan.h:248
constexpr unsigned long ESR_ACKERROR
Definition: bxcan.h:179
CanType *const Can[2]
Definition: bxcan.h:91
volatile uint32_t FR1
Definition: bxcan.h:59
constexpr unsigned long TIR_STID_SHIFT
Definition: bxcan.h:213
volatile uint32_t RF0R
Definition: bxcan.h:67
constexpr unsigned long IER_ERRIE
Definition: bxcan.h:165
constexpr unsigned long IER_FFIE1
Definition: bxcan.h:159
constexpr unsigned long MCR_TXFP
Definition: bxcan.h:97
uint32_t RESERVED3
Definition: bxcan.h:80
constexpr unsigned long TDLR_DATA0_MASK
Definition: bxcan.h:227
constexpr unsigned long IER_FOVIE1
Definition: bxcan.h:160
constexpr unsigned long RIR_EXID_MASK
Definition: bxcan.h:251
volatile uint32_t FR2
Definition: bxcan.h:60
uint32_t RESERVED2
Definition: bxcan.h:78
constexpr unsigned long TSR_LOW1
Definition: bxcan.h:141
constexpr unsigned long ESR_CRCERRPR
Definition: bxcan.h:182
constexpr unsigned long TDLR_DATA1_SHIFT
Definition: bxcan.h:228
constexpr unsigned long IER_WKUIE
Definition: bxcan.h:166