sja1000_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$
28  */
29 // ----------------------------------------------------------------------------
30 
31 #ifndef SJA1000_DEFS_H
32 #define SJA1000_DEFS_H
33 
40 
41 #define MOD 0x00 // mode
42 #define CR 0x00 // control
43 
44 #define CMR 0x01 // command
45 #define SR 0x02 // status
46 #define IR 0x03 // interrupt
47 
48 #define BTR0 0x06 // bit timing 0
49 #define BTR1 0x07 // bit timing 1
50 #define OCR 0x08 // output control
51 #define CDR 0x1F // clock divider
52 
53 #define IER 0x04 // interrupt enable
54 
55 #define ALC 0x0B // arbitration lost capture
56 #define ECC 0x0C // error code capture
57 #define EWL 0x0D // error_warning_limit
58 #define RXERR 0x0E // RX error counter
59 #define TXERR 0x0F // TX error counter
60 
61 #define RMC 0x1D // RX message counter
62 #define RBSA 0x1E // RX_buffer_start_adress
63 
64 #define ACR0 0x10 // acceptance code0
65 #define ACR1 0x11 // acceptance code1
66 #define ACR2 0x12 // acceptance code2
67 #define ACR3 0x13 // acceptance code3
68 #define AMR0 0x14 // acceptance mask0
69 #define AMR1 0x15 // acceptance mask1
70 #define AMR2 0x16 // acceptance mask2
71 #define AMR3 0x17 // acceptance mask3
72 
73 #define RX_INFO 0x10
74 #define RX_ID1 0x11
75 #define RX_ID0 0x12
76 #define RX_DATA0 0x13
77 #define RX_DATA1 0x14
78 #define RX_DATA2 0x15
79 #define RX_DATA3 0x16
80 #define RX_DATA4 0x17
81 #define RX_DATA5 0x18
82 #define RX_DATA6 0x19
83 #define RX_DATA7 0x1A
84 
85 #define TX_INFO 0x10
86 #define TX_ID1 0x11
87 #define TX_ID0 0x12
88 #define TX_DATA0 0x13
89 #define TX_DATA1 0x14
90 #define TX_DATA2 0x15
91 #define TX_DATA3 0x16
92 #define TX_DATA4 0x17
93 #define TX_DATA5 0x18
94 #define TX_DATA6 0x19
95 #define TX_DATA7 0x1A
96 
103 
107 #define SM 4
108 #define AFM 3
109 #define STM 2
110 #define LOM 1
111 #define RM 0
112 
116 #define SRR 4
117 #define CDO 3
118 #define RRB 2
119 #define AT 1
120 #define TR 0
121 
125 #define BS 7
126 #define ES 6
127 #define TS 5
128 #define RS 4
129 #define TCS 3
130 #define TBS 2
131 #define DOS 1
132 #define RBS 0
133 
137 #define BEI 7
138 #define ALI 6
139 #define EPI 5
140 #define WUI 4
141 #define DOI 3
142 #define EI 2
143 #define TI 1
144 #define RI 0
145 
149 #define BEIE 7
150 #define ALIE 6
151 #define EPIE 5
152 #define WUIE 4
153 #define DOIE 3
154 #define EIE 2
155 #define TIE 1
156 #define RIE 0
157 
161 #define _SJW1 7
162 #define _SJW0 6
163 #define _BRP5 5
164 #define _BRP4 4
165 #define _BRP3 3
166 #define _BRP2 2
167 #define _BRP1 1
168 #define _BRP0 0
169 
173 #define SAM 7
174 #define TSEG22 6
175 #define TSEG21 5
176 #define TSEG20 4
177 #define TSEG13 3
178 #define TSEG12 2
179 #define TSEG11 1
180 #define TSEG10 0
181 
185 #define OCTP1 7
186 #define OCTN1 6
187 #define OCPOL1 5
188 #define OCTP0 4
189 #define OCTN0 3
190 #define OCPOL0 2
191 #define OCMODE1 1
192 #define OCMODE0 0
193 
197 #define BITNO4 4
198 #define BITNO3 3
199 #define BITNO2 2
200 #define BITNO1 1
201 #define BITNO0 0
202 
206 #define ERRC1 7
207 #define ERRC0 6
208 #define DIR 5
209 #define SEG4 4
210 #define SEG3 3
211 #define SEG2 2
212 #define SEG1 1
213 #define SEG0 0
214 
218 #define ERRC1 7
219 #define ERRC0 6
220 #define DIR 5
221 #define SEG4 4
222 #define SEG3 3
223 #define SEG2 2
224 #define SEG1 1
225 #define SEG0 0
226 
230 #define CANMODE 7
231 #define CBP 6
232 #define RXINTEN 5
233 #define CLKOFF 3
234 #define CD2 2
235 #define CD1 1
236 #define CD0 0
237 
241 #define FF 7
242 #define RTR 6
243 
246 #endif // SJA1000_DEFS_H


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