mcp2515_defs.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 /*
3  * Copyright (c) 2007 Fabian Greif, Roboterclub Aachen e.V.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  * $Id: mcp2515_defs.h 6611 2008-07-14 09:58:16Z fabian $
28  */
29 // ----------------------------------------------------------------------------
30 
31 #ifndef MCP2515_DEFS_H
32 #define MCP2515_DEFS_H
33 
36 #define SPI_RESET 0xC0
37 #define SPI_READ 0x03
38 #define SPI_READ_RX 0x90
39 #define SPI_WRITE 0x02
40 #define SPI_WRITE_TX 0x40
41 #define SPI_RTS 0x80
42 #define SPI_READ_STATUS 0xA0
43 #define SPI_RX_STATUS 0xB0
44 #define SPI_BIT_MODIFY 0x05
45 
53 #define RXF0SIDH 0x00
54 #define RXF0SIDL 0x01
55 #define RXF0EID8 0x02
56 #define RXF0EID0 0x03
57 #define RXF1SIDH 0x04
58 #define RXF1SIDL 0x05
59 #define RXF1EID8 0x06
60 #define RXF1EID0 0x07
61 #define RXF2SIDH 0x08
62 #define RXF2SIDL 0x09
63 #define RXF2EID8 0x0A
64 #define RXF2EID0 0x0B
65 #define BFPCTRL 0x0C
66 #define TXRTSCTRL 0x0D
67 #define CANSTAT 0x0E
68 #define CANCTRL 0x0F
69 
70 #define RXF3SIDH 0x10
71 #define RXF3SIDL 0x11
72 #define RXF3EID8 0x12
73 #define RXF3EID0 0x13
74 #define RXF4SIDH 0x14
75 #define RXF4SIDL 0x15
76 #define RXF4EID8 0x16
77 #define RXF4EID0 0x17
78 #define RXF5SIDH 0x18
79 #define RXF5SIDL 0x19
80 #define RXF5EID8 0x1A
81 #define RXF5EID0 0x1B
82 #define TEC 0x1C
83 #define REC 0x1D
84 
85 #define RXM0SIDH 0x20
86 #define RXM0SIDL 0x21
87 #define RXM0EID8 0x22
88 #define RXM0EID0 0x23
89 #define RXM1SIDH 0x24
90 #define RXM1SIDL 0x25
91 #define RXM1EID8 0x26
92 #define RXM1EID0 0x27
93 #define CNF3 0x28
94 #define CNF2 0x29
95 #define CNF1 0x2A
96 #define CANINTE 0x2B
97 #define CANINTF 0x2C
98 #define EFLG 0x2D
99 
100 #define TXB0CTRL 0x30
101 #define TXB0SIDH 0x31
102 #define TXB0SIDL 0x32
103 #define TXB0EID8 0x33
104 #define TXB0EID0 0x34
105 #define TXB0DLC 0x35
106 #define TXB0D0 0x36
107 #define TXB0D1 0x37
108 #define TXB0D2 0x38
109 #define TXB0D3 0x39
110 #define TXB0D4 0x3A
111 #define TXB0D5 0x3B
112 #define TXB0D6 0x3C
113 #define TXB0D7 0x3D
114 
115 #define TXB1CTRL 0x40
116 #define TXB1SIDH 0x41
117 #define TXB1SIDL 0x42
118 #define TXB1EID8 0x43
119 #define TXB1EID0 0x44
120 #define TXB1DLC 0x45
121 #define TXB1D0 0x46
122 #define TXB1D1 0x47
123 #define TXB1D2 0x48
124 #define TXB1D3 0x49
125 #define TXB1D4 0x4A
126 #define TXB1D5 0x4B
127 #define TXB1D6 0x4C
128 #define TXB1D7 0x4D
129 
130 #define TXB2CTRL 0x50
131 #define TXB2SIDH 0x51
132 #define TXB2SIDL 0x52
133 #define TXB2EID8 0x53
134 #define TXB2EID0 0x54
135 #define TXB2DLC 0x55
136 #define TXB2D0 0x56
137 #define TXB2D1 0x57
138 #define TXB2D2 0x58
139 #define TXB2D3 0x59
140 #define TXB2D4 0x5A
141 #define TXB2D5 0x5B
142 #define TXB2D6 0x5C
143 #define TXB2D7 0x5D
144 
145 #define RXB0CTRL 0x60
146 #define RXB0SIDH 0x61
147 #define RXB0SIDL 0x62
148 #define RXB0EID8 0x63
149 #define RXB0EID0 0x64
150 #define RXB0DLC 0x65
151 #define RXB0D0 0x66
152 #define RXB0D1 0x67
153 #define RXB0D2 0x68
154 #define RXB0D3 0x69
155 #define RXB0D4 0x6A
156 #define RXB0D5 0x6B
157 #define RXB0D6 0x6C
158 #define RXB0D7 0x6D
159 
160 #define RXB1CTRL 0x70
161 #define RXB1SIDH 0x71
162 #define RXB1SIDL 0x72
163 #define RXB1EID8 0x73
164 #define RXB1EID0 0x74
165 #define RXB1DLC 0x75
166 #define RXB1D0 0x76
167 #define RXB1D1 0x77
168 #define RXB1D2 0x78
169 #define RXB1D3 0x79
170 #define RXB1D4 0x7A
171 #define RXB1D5 0x7B
172 #define RXB1D6 0x7C
173 #define RXB1D7 0x7D
174 
178 
180 #define B1BFS 5
181 #define B0BFS 4
182 #define B1BFE 3
183 #define B0BFE 2
184 #define B1BFM 1
185 #define B0BFM 0
186 
188 #define B2RTS 5
189 #define B1RTS 4
190 #define B0RTS 3
191 #define B2RTSM 2
192 #define B1RTSM 1
193 #define B0RTSM 0
194 
196 #define OPMOD2 7
197 #define OPMOD1 6
198 #define OPMOD0 5
199 #define ICOD2 3
200 #define ICOD1 2
201 #define ICOD0 1
202 
204 #define REQOP2 7
205 #define REQOP1 6
206 #define REQOP0 5
207 #define ABAT 4
208 #define CLKEN 2
209 #define CLKPRE1 1
210 #define CLKPRE0 0
211 
213 #define WAKFIL 6
214 #define PHSEG22 2
215 #define PHSEG21 1
216 #define PHSEG20 0
217 
219 #define BTLMODE 7
220 #define SAM 6
221 #define PHSEG12 5
222 #define PHSEG11 4
223 #define PHSEG10 3
224 #define PHSEG2 2
225 #define PHSEG1 1
226 #define PHSEG0 0
227 
229 #define SJW1 7
230 #define SJW0 6
231 #define BRP5 5
232 #define BRP4 4
233 #define BRP3 3
234 #define BRP2 2
235 #define BRP1 1
236 #define BRP0 0
237 
239 #define MERRE 7
240 #define WAKIE 6
241 #define ERRIE 5
242 #define TX2IE 4
243 #define TX1IE 3
244 #define TX0IE 2
245 #define RX1IE 1
246 #define RX0IE 0
247 
249 #define MERRF 7
250 #define WAKIF 6
251 #define ERRIF 5
252 #define TX2IF 4
253 #define TX1IF 3
254 #define TX0IF 2
255 #define RX1IF 1
256 #define RX0IF 0
257 
259 #define RX1OVR 7
260 #define RX0OVR 6
261 #define TXB0 5
262 #define TXEP 4
263 #define RXEP 3
264 #define TXWAR 2
265 #define RXWAR 1
266 #define EWARN 0
267 
269 #define ABTF 6
270 #define MLOA 5
271 #define TXERR 4
272 #define TXREQ 3
273 #define TXP1 1
274 #define TXP0 0
275 
277 #define RXM1 6
278 #define RXM0 5
279 #define RXRTR 3
280 #define BUKT 2
281 #define BUKT1 1
282 #define FILHIT0 0
283 
285 #define EXIDE 3
286 
291 #define FILHIT2 2
292 #define FILHIT1 1
293 
295 #define SRR 4
296 #define IDE 3
297 
302 #define RTR 6
303 #define DLC3 3
304 #define DLC2 2
305 #define DLC1 1
306 #define DLC0 0
307 
309 #endif // MCP2515_DEFS_H


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:02