Subversion Repositories HomeAutomation

Rev

Rev 19 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 19 Rev 22
Line 73... Line 73...
73
 
73
 
74
/* reg 3-1 */
74
/* reg 3-1 */
75
#define TXBnCTRL(n)             (0x30+n*0x10)
75
#define TXBnCTRL(n)             (0x30+n*0x10)
76
#define TXBnCTRL_ABTF
76
#define TXBnCTRL_ABTF
77
#define _TXBnCTRL_ABTF_B        6
77
#define _TXBnCTRL_ABTF_B        6
78
#define _TXBnCTRL_ABTF_M        0b01000000
78
#define _TXBnCTRL_ABTF_M        0x40
79
#define TXBnCTRL_MLOA
79
#define TXBnCTRL_MLOA
80
#define _TXBnCTRL_MLOA_B        5
80
#define _TXBnCTRL_MLOA_B        5
81
#define _TXBnCTRL_MLOA_M        0b00100000
81
#define _TXBnCTRL_MLOA_M        0x20
82
#define TXBnCTRL_TXERR
82
#define TXBnCTRL_TXERR
83
#define _TXBnCTRL_TXERR_B       4
83
#define _TXBnCTRL_TXERR_B       4
84
#define _TXBnCTRL_TXERR_M       0b00010000
84
#define _TXBnCTRL_TXERR_M       0x10
85
#define TXBnCTRL_TXREQ
85
#define TXBnCTRL_TXREQ
86
#define _TXBnCTRL_TXREQ_B       3
86
#define _TXBnCTRL_TXREQ_B       3
87
#define _TXBnCTRL_TXREQ_M       0b00001000
87
#define _TXBnCTRL_TXREQ_M       0x08
88
#define TXBnCTRL_TXP
88
#define TXBnCTRL_TXP
89
#define _TXBnCTRL_TXP_B         0
89
#define _TXBnCTRL_TXP_B         0
90
#define _TXBnCTRL_TXP_M         0b00000011
90
#define _TXBnCTRL_TXP_M         0x03
91
 
91
 
92
/* reg 3-2 */
92
/* reg 3-2 */
93
#define TXRTSCTRL               (0x0D)
93
#define TXRTSCTRL               (0x0D)
94
#define TXRTSCTRL_B2RTS
94
#define TXRTSCTRL_B2RTS
95
#define _TXRTSCTRL_B2RTS_B      5
95
#define _TXRTSCTRL_B2RTS_B      5
96
#define _TXRTSCTRL_B2RTS_M      0b00100000
96
#define _TXRTSCTRL_B2RTS_M      0x20
97
#define TXRTSCTRL_B1RTS
97
#define TXRTSCTRL_B1RTS
98
#define _TXRTSCTRL_B1RTS_B      4
98
#define _TXRTSCTRL_B1RTS_B      4
99
#define _TXRTSCTRL_B1RTS_M      0b00010000
99
#define _TXRTSCTRL_B1RTS_M      0x10
100
#define TXRTSCTRL_B0RTS
100
#define TXRTSCTRL_B0RTS
101
#define _TXRTSCTRL_B0RTS_B      3
101
#define _TXRTSCTRL_B0RTS_B      3
102
#define _TXRTSCTRL_B0RTS_M      0b00001000
102
#define _TXRTSCTRL_B0RTS_M      0x08
103
#define TXRTSCTRL_B2RTSM
103
#define TXRTSCTRL_B2RTSM
104
#define _TXRTSCTRL_B2RTSM_B     2
104
#define _TXRTSCTRL_B2RTSM_B     2
105
#define _TXRTSCTRL_B2RTSM_M     0b00000100
105
#define _TXRTSCTRL_B2RTSM_M     0x04
106
#define TXRTSCTRL_B1RTSM
106
#define TXRTSCTRL_B1RTSM
107
#define _TXRTSCTRL_B1RTSM_B     1
107
#define _TXRTSCTRL_B1RTSM_B     1
108
#define _TXRTSCTRL_B1RTSM_M     0b00000010
108
#define _TXRTSCTRL_B1RTSM_M     0x02
109
#define TXRTSCTRL_B0RTSM
109
#define TXRTSCTRL_B0RTSM
110
#define _TXRTSCTRL_B0RTSM_B     0
110
#define _TXRTSCTRL_B0RTSM_B     0
111
#define _TXRTSCTRL_B0RTSM_M     0b00000001
111
#define _TXRTSCTRL_B0RTSM_M     0x01
112
 
112
 
113
/* reg 3-3 */
113
/* reg 3-3 */
114
#define TXBnSIDH(n)             (0x31+n*0x10)
114
#define TXBnSIDH(n)             (0x31+n*0x10)
115
#define TXBnSIDH_SID
115
#define TXBnSIDH_SID
116
#define _TXBnSIDH_SID_B         0
116
#define _TXBnSIDH_SID_B         0
117
#define _TXBnSIDH_SID_M         0b11111111
117
#define _TXBnSIDH_SID_M         0xff
118
 
118
 
119
/* reg 3-4 */
119
/* reg 3-4 */
120
#define TXBnSIDL(n)             (0x32+n*0x10)
120
#define TXBnSIDL(n)             (0x32+n*0x10)
121
#define TXBnSIDL_SID
121
#define TXBnSIDL_SID
122
#define _TXBnSIDL_SID_B         5
122
#define _TXBnSIDL_SID_B         5
123
#define _TXBnSIDL_SID_M         0b11100000
123
#define _TXBnSIDL_SID_M         0xe0
124
#define TXBnSIDL_EXIDE
124
#define TXBnSIDL_EXIDE
125
#define _TXBnSIDL_EXIDE_B       3
125
#define _TXBnSIDL_EXIDE_B       3
126
#define _TXBnSIDL_EXIDE_M       0b00001000
126
#define _TXBnSIDL_EXIDE_M       0x08
127
#define TXBnSIDL_EID
127
#define TXBnSIDL_EID
128
#define _TXBnSIDL_EID_B         0
128
#define _TXBnSIDL_EID_B         0
129
#define _TXBnSIDL_EID_M         0b00000011
129
#define _TXBnSIDL_EID_M         0x03
130
 
130
 
131
/* reg 3-5 */
131
/* reg 3-5 */
132
#define TXBnEID8(n)             (0x33+n*0x10)
132
#define TXBnEID8(n)             (0x33+n*0x10)
133
#define TXBnEID8_EID
133
#define TXBnEID8_EID
134
#define _TXBnEID8_EID_B         0
134
#define _TXBnEID8_EID_B         0
135
#define _TXBnEID8_EID_M         0b11111111
135
#define _TXBnEID8_EID_M         0xff
136
 
136
 
137
/* reg 3-6 */
137
/* reg 3-6 */
138
#define TXBnEID0(n)             (0x34+n*0x10)
138
#define TXBnEID0(n)             (0x34+n*0x10)
139
#define TXBnEID0_EID
139
#define TXBnEID0_EID
140
#define _TXBnEID0_EID_B         0
140
#define _TXBnEID0_EID_B         0
141
#define _TXBnEID0_EID_M         0b11111111
141
#define _TXBnEID0_EID_M         0xff
142
 
142
 
143
/* reg 3-7 */
143
/* reg 3-7 */
144
#define TXBnDLC(n)              (0x35+n*0x10)
144
#define TXBnDLC(n)              (0x35+n*0x10)
145
#define TXBnDLC_RTR
145
#define TXBnDLC_RTR
146
#define _TXBnDLC_RTR_B          6
146
#define _TXBnDLC_RTR_B          6
147
#define _TXBnDLC_RTR_M          0b01000000
147
#define _TXBnDLC_RTR_M          0x40
148
#define TXBnDLC_DLC
148
#define TXBnDLC_DLC
149
#define _TXBnDLC_DLC_B          0
149
#define _TXBnDLC_DLC_B          0
150
#define _TXBnDLC_DLC_M          0b00001111
150
#define _TXBnDLC_DLC_M          0x0f
151
 
151
 
152
/* regs 3-8 are just data bytes */
152
/* regs 3-8 are just data bytes */
153
#define TXBnDm(n,m)             ((0x36+n*0x10)+m*0x01)  /* txbuf n, byte m */
153
#define TXBnDm(n,m)             ((0x36+n*0x10)+m*0x01)  /* txbuf n, byte m */
154
 
154
 
155
/* reg 4-1 */
155
/* reg 4-1 */
156
#define RXB0CTRL                (0x60)
156
#define RXB0CTRL                (0x60)
157
#define RXB0CTRL_RXM
157
#define RXB0CTRL_RXM
158
#define _RXB0CTRL_RXM_B         5
158
#define _RXB0CTRL_RXM_B         5
159
#define _RXB0CTRL_RXM_M         0b01100000
159
#define _RXB0CTRL_RXM_M         0x60
160
#define RXB0CTRL_RXRTR
160
#define RXB0CTRL_RXRTR
161
#define _RXB0CTRL_RXRTR_B       3
161
#define _RXB0CTRL_RXRTR_B       3
162
#define _RXB0CTRL_RXRTR_M       0b00001000
162
#define _RXB0CTRL_RXRTR_M       0x08
163
#define RXB0CTRL_BUKT
163
#define RXB0CTRL_BUKT
164
#define _RXB0CTRL_BUKT_B        2
164
#define _RXB0CTRL_BUKT_B        2
165
#define _RXB0CTRL_BUKT_M        0b00000100
165
#define _RXB0CTRL_BUKT_M        0x04
166
#define RXB0CTRL_FILHIT
166
#define RXB0CTRL_FILHIT
167
#define _RXB0CTRL_FILHIT_B      0
167
#define _RXB0CTRL_FILHIT_B      0
168
#define _RXB0CTRL_FILHIT_M      0b00000001
168
#define _RXB0CTRL_FILHIT_M      0x01
169
 
169
 
170
/* reg 4-2 */
170
/* reg 4-2 */
171
#define RXB1CTRL                (0x70)
171
#define RXB1CTRL                (0x70)
172
#define RXB1CTRL_RXM
172
#define RXB1CTRL_RXM
173
#define _RXB1CTRL_RXM_B         5
173
#define _RXB1CTRL_RXM_B         5
174
#define _RXB1CTRL_RXM_M         0b01100000
174
#define _RXB1CTRL_RXM_M         0x60
175
#define RXB1CTRL_RXRTR
175
#define RXB1CTRL_RXRTR
176
#define _RXB1CTRL_RXRTR_B       3
176
#define _RXB1CTRL_RXRTR_B       3
177
#define _RXB1CTRL_RXRTR_M       0b00001000
177
#define _RXB1CTRL_RXRTR_M       0x08
178
#define RXB1CTRL_FILHIT
178
#define RXB1CTRL_FILHIT
179
#define _RXB1CTRL_FILHIT_B      0
179
#define _RXB1CTRL_FILHIT_B      0
180
#define _RXB1CTRL_FILHIT_M      0b00000111
180
#define _RXB1CTRL_FILHIT_M      0x07
181
 
181
 
182
/* reg 4-3 */
182
/* reg 4-3 */
183
#define BFPCTRL                 (0x0C)
183
#define BFPCTRL                 (0x0C)
184
#define BFPCTRL_B1BFS
184
#define BFPCTRL_B1BFS
185
#define _BFPCTRL_B1BFS_B        5
185
#define _BFPCTRL_B1BFS_B        5
186
#define _BFPCTRL_B1BFS_M        0b00100000
186
#define _BFPCTRL_B1BFS_M        0x20
187
#define BFPCTRL_B0BFS
187
#define BFPCTRL_B0BFS
188
#define _BFPCTRL_B0BFS_B        4
188
#define _BFPCTRL_B0BFS_B        4
189
#define _BFPCTRL_B0BFS_M        0b00010000
189
#define _BFPCTRL_B0BFS_M        0x10
190
#define BFPCTRL_B1BFE
190
#define BFPCTRL_B1BFE
191
#define _BFPCTRL_B1BFE_B        3
191
#define _BFPCTRL_B1BFE_B        3
192
#define _BFPCTRL_B1BFE_M        0b00001000
192
#define _BFPCTRL_B1BFE_M        0x08
193
#define BFPCTRL_B0BFE
193
#define BFPCTRL_B0BFE
194
#define _BFPCTRL_B0BFE_B        2
194
#define _BFPCTRL_B0BFE_B        2
195
#define _BFPCTRL_B0BFE_M        0b00000100
195
#define _BFPCTRL_B0BFE_M        0x04
196
#define BFPCTRL_B1BFM
196
#define BFPCTRL_B1BFM
197
#define _BFPCTRL_B1BFM_B        1
197
#define _BFPCTRL_B1BFM_B        1
198
#define _BFPCTRL_B1BFM_M        0b00000010
198
#define _BFPCTRL_B1BFM_M        0x02
199
#define BFPCTRL_B0BFM
199
#define BFPCTRL_B0BFM
200
#define _BFPCTRL_B0BFM_B        0
200
#define _BFPCTRL_B0BFM_B        0
201
#define _BFPCTRL_B0BFM_M        0b00000001
201
#define _BFPCTRL_B0BFM_M        0x01
202
 
202
 
203
/* reg 4-4 */
203
/* reg 4-4 */
204
#define RXBnSIDH(n)             (0x61+n*0x10)
204
#define RXBnSIDH(n)             (0x61+n*0x10)
205
#define RXBnSIDH_SID
205
#define RXBnSIDH_SID
206
#define _RXBnSIDH_SID_B         0
206
#define _RXBnSIDH_SID_B         0
207
#define _RXBnSIDH_SID_M         0b11111111
207
#define _RXBnSIDH_SID_M         0xff
208
 
208
 
209
/* reg 4-5 */
209
/* reg 4-5 */
210
#define RXBnSIDL(n)             (0x62+n*0x10)
210
#define RXBnSIDL(n)             (0x62+n*0x10)
211
#define RXBnSIDL_SID
211
#define RXBnSIDL_SID
212
#define _RXBnSIDL_SID_B         5
212
#define _RXBnSIDL_SID_B         5
213
#define _RXBnSIDL_SID_M         0b11100000
213
#define _RXBnSIDL_SID_M         0xe0
214
#define RXBnSIDL_SRR
214
#define RXBnSIDL_SRR
215
#define _RXBnSIDL_SRR_B         4
215
#define _RXBnSIDL_SRR_B         4
216
#define _RXBnSIDL_SRR_M         0b00010000
216
#define _RXBnSIDL_SRR_M         0x10
217
#define RXBnSIDL_IDE
217
#define RXBnSIDL_IDE
218
#define _RXBnSIDL_IDE_B         3
218
#define _RXBnSIDL_IDE_B         3
219
#define _RXBnSIDL_IDE_M         0b00001000
219
#define _RXBnSIDL_IDE_M         0x08
220
#define RXBnSIDL_EID
220
#define RXBnSIDL_EID
221
#define _RXBnSIDL_EID_B         0
221
#define _RXBnSIDL_EID_B         0
222
#define _RXBnSIDL_EID_M         0b00000011
222
#define _RXBnSIDL_EID_M         0x03
223
 
223
 
224
/* reg 4-6 */
224
/* reg 4-6 */
225
#define RXBnEID8(n)             (0x63+n*0x10)
225
#define RXBnEID8(n)             (0x63+n*0x10)
226
#define RXBnEID8_EID
226
#define RXBnEID8_EID
227
#define _RXBnEID8_EID_B         0
227
#define _RXBnEID8_EID_B         0
228
#define _RXBnEID8_EID_M         0b11111111
228
#define _RXBnEID8_EID_M         0xff
229
 
229
 
230
/* reg 4-7 */
230
/* reg 4-7 */
231
#define RXBnEID0(n)             (0x64+n*0x10)
231
#define RXBnEID0(n)             (0x64+n*0x10)
232
#define RXBnEID0_EID
232
#define RXBnEID0_EID
233
#define _RXBnEID0_EID_B         0
233
#define _RXBnEID0_EID_B         0
234
#define _RXBnEID0_EID_M         0b11111111
234
#define _RXBnEID0_EID_M         0xff
235
 
235
 
236
/* reg 4-8 */
236
/* reg 4-8 */
237
#define RXBnDLC(n)              (0x65+n*0x10)
237
#define RXBnDLC(n)              (0x65+n*0x10)
238
#define RXBnDLC_RTR
238
#define RXBnDLC_RTR
239
#define _RXBnDLC_RTR_B          6
239
#define _RXBnDLC_RTR_B          6
240
#define _RXBnDLC_RTR_M          0b01000000
240
#define _RXBnDLC_RTR_M          0x40
241
#define RXBnDLC_RB
241
#define RXBnDLC_RB
242
#define _RXBnDLC_RB_B           4
242
#define _RXBnDLC_RB_B           4
243
#define _RXBnDLC_RB_M           0b00110000
243
#define _RXBnDLC_RB_M           0x30
244
#define RXBnDLC_DLC
244
#define RXBnDLC_DLC
245
#define _RXBnDLC_DLC_B          0
245
#define _RXBnDLC_DLC_B          0
246
#define _RXBnDLC_DLC_M          0b00001111
246
#define _RXBnDLC_DLC_M          0x0f
247
 
247
 
248
/* regs 4-9 are just data bytes */
248
/* regs 4-9 are just data bytes */
249
#define RXBnDm(n,m)             ((0x66+n*0x10)+m*0x01)  /* rxbuf n, byte m */
249
#define RXBnDm(n,m)             ((0x66+n*0x10)+m*0x01)  /* rxbuf n, byte m */
250
 
250
 
251
/* reg 4-10 */
251
/* reg 4-10 */
Line 255... Line 255...
255
#define RXF3SIDH                (0x10)
255
#define RXF3SIDH                (0x10)
256
#define RXF4SIDH                (0x14)
256
#define RXF4SIDH                (0x14)
257
#define RXF5SIDH                (0x18)
257
#define RXF5SIDH                (0x18)
258
#define RXFnSIDH_SID
258
#define RXFnSIDH_SID
259
#define _RXFnSIDH_SID_B         0
259
#define _RXFnSIDH_SID_B         0
260
#define _RXFnSIDH_SID_M         0b11111111
260
#define _RXFnSIDH_SID_M         0xffffffff
261
 
261
 
262
/* reg 4-11 */
262
/* reg 4-11 */
263
#define RXF0SIDL                (0x01)
263
#define RXF0SIDL                (0x01)
264
#define RXF1SIDL                (0x05)
264
#define RXF1SIDL                (0x05)
265
#define RXF2SIDL                (0x09)
265
#define RXF2SIDL                (0x09)
266
#define RXF3SIDL                (0x11)
266
#define RXF3SIDL                (0x11)
267
#define RXF4SIDL                (0x15)
267
#define RXF4SIDL                (0x15)
268
#define RXF5SIDL                (0x19)
268
#define RXF5SIDL                (0x19)
269
#define RXFnSIDL_SID
269
#define RXFnSIDL_SID
270
#define _RXFnSIDL_SID_B         5
270
#define _RXFnSIDL_SID_B         5
271
#define _RXFnSIDL_SID_M         0b11100000
271
#define _RXFnSIDL_SID_M         0xe0
272
#define RXFnSIDL_EXIDE
272
#define RXFnSIDL_EXIDE
273
#define _RXFnSIDL_EXIDE_B       3
273
#define _RXFnSIDL_EXIDE_B       3
274
#define _RXFnSIDL_EXIDE_M       0b00001000
274
#define _RXFnSIDL_EXIDE_M       0x08
275
#define RXFnSIDL_EID
275
#define RXFnSIDL_EID
276
#define _RXFnSIDL_EID_B         0
276
#define _RXFnSIDL_EID_B         0
277
#define _RXFnSIDL_EID_M         0b00000011
277
#define _RXFnSIDL_EID_M         0x03
278
 
278
 
279
/* reg 4-12 */
279
/* reg 4-12 */
280
#define RXF0EID8                (0x02)
280
#define RXF0EID8                (0x02)
281
#define RXF1EID8                (0x06)
281
#define RXF1EID8                (0x06)
282
#define RXF2EID8                (0x0A)
282
#define RXF2EID8                (0x0A)
283
#define RXF3EID8                (0x12)
283
#define RXF3EID8                (0x12)
284
#define RXF4EID8                (0x16)
284
#define RXF4EID8                (0x16)
285
#define RXF5EID8                (0x1A)
285
#define RXF5EID8                (0x1A)
286
#define RXFnEID8_EID
286
#define RXFnEID8_EID
287
#define _RXFnEID8_EID_B         0
287
#define _RXFnEID8_EID_B         0
288
#define _RXFnEID8_EID_M         0b11111111
288
#define _RXFnEID8_EID_M         0xff
289
 
289
 
290
/* reg 4-13 */
290
/* reg 4-13 */
291
#define RXF0EID0                (0x03)
291
#define RXF0EID0                (0x03)
292
#define RXF1EID0                (0x07)
292
#define RXF1EID0                (0x07)
293
#define RXF2EID0                (0x0B)
293
#define RXF2EID0                (0x0B)
294
#define RXF3EID0                (0x13)
294
#define RXF3EID0                (0x13)
295
#define RXF4EID0                (0x17)
295
#define RXF4EID0                (0x17)
296
#define RXF5EID0                (0x1B)
296
#define RXF5EID0                (0x1B)
297
#define RXFnEID0_EID
297
#define RXFnEID0_EID
298
#define _RXFnEID0_EID_B         0
298
#define _RXFnEID0_EID_B         0
299
#define _RXFnEID0_EID_M         0b11111111
299
#define _RXFnEID0_EID_M         0xff
300
 
300
 
301
/* reg 4-14 */
301
/* reg 4-14 */
302
#define RXMnSIDH(n)             (0x20+n*0x04)
302
#define RXMnSIDH(n)             (0x20+n*0x04)
303
#define RXMnSIDH_SID
303
#define RXMnSIDH_SID
304
#define _RXMnSIDH_SID_B         0
304
#define _RXMnSIDH_SID_B         0
305
#define _RXMnSIDH_SID_M         0b11111111
305
#define _RXMnSIDH_SID_M         0xff
306
 
306
 
307
/* reg 4-15 */
307
/* reg 4-15 */
308
#define RXMnSIDL(n)             (0x21+n*0x04)
308
#define RXMnSIDL(n)             (0x21+n*0x04)
309
#define RXMnSIDL_SID
309
#define RXMnSIDL_SID
310
#define _RXMnSIDL_SID_B         5
310
#define _RXMnSIDL_SID_B         5
311
#define _RXMnSIDL_SID_M         0b11100000
311
#define _RXMnSIDL_SID_M         0xe0
312
#define RXMnSIDL_EID
312
#define RXMnSIDL_EID
313
#define _RXMnSIDL_EID_B         0
313
#define _RXMnSIDL_EID_B         0
314
#define _RXMnSIDL_EID_M         0b00000011
314
#define _RXMnSIDL_EID_M         0x03
315
 
315
 
316
/* reg 4-16 */
316
/* reg 4-16 */
317
#define RXMnEID8(n)             (0x22+n*0x04)
317
#define RXMnEID8(n)             (0x22+n*0x04)
318
#define RXMnEID8_EID
318
#define RXMnEID8_EID
319
#define _RXMnEID8_EID_B         0
319
#define _RXMnEID8_EID_B         0
320
#define _RXMnEID8_EID_M         0b11111111
320
#define _RXMnEID8_EID_M         0xff
321
 
321
 
322
/* reg 4-18 */
322
/* reg 4-18 */
323
#define RXMnEID0(n)             (0x23+n*0x04)
323
#define RXMnEID0(n)             (0x23+n*0x04)
324
#define RXMnEID0_EID
324
#define RXMnEID0_EID
325
#define _RXMnEID0_EID_B         0
325
#define _RXMnEID0_EID_B         0
326
#define _RXMnEID0_EID_M         0b11111111
326
#define _RXMnEID0_EID_M         0xff
327
 
327
 
328
/* reg 5-1 */
328
/* reg 5-1 */
329
#define CNF1                    (0x2A)
329
#define CNF1                    (0x2A)
330
#define CNF1_SJW
330
#define CNF1_SJW
331
#define _CNF1_SJW_B             6
331
#define _CNF1_SJW_B             6
332
#define _CNF1_SJW_M             0b11000000
332
#define _CNF1_SJW_M             0xc0
333
#define CNF1_BRP
333
#define CNF1_BRP
334
#define _CNF1_BRP_B             0
334
#define _CNF1_BRP_B             0
335
#define _CNF1_BRP_M             0b00111111
335
#define _CNF1_BRP_M             0x3f
336
 
336
 
337
/* reg 5-2 */
337
/* reg 5-2 */
338
#define CNF2                    (0x29)
338
#define CNF2                    (0x29)
339
#define CNF2_BTLMODE
339
#define CNF2_BTLMODE
340
#define _CNF2_BTLMODE_B         7
340
#define _CNF2_BTLMODE_B         7
341
#define _CNF2_BTLMODE_M         0b10000000
341
#define _CNF2_BTLMODE_M         0x80
342
#define CNF2_SAM
342
#define CNF2_SAM
343
#define _CNF2_SAM_B             6
343
#define _CNF2_SAM_B             6
344
#define _CNF2_SAM_M             0b01000000
344
#define _CNF2_SAM_M             0x40
345
#define CNF2_PHSEG1
345
#define CNF2_PHSEG1
346
#define _CNF2_PHSEG1_B          3
346
#define _CNF2_PHSEG1_B          3
347
#define _CNF2_PHSEG1_M          0b00111000
347
#define _CNF2_PHSEG1_M          0x38
348
#define CNF2_PRSEG
348
#define CNF2_PRSEG
349
#define _CNF2_PRSEG_B           0
349
#define _CNF2_PRSEG_B           0
350
#define _CNF2_PRSEG_M           0b00000111
350
#define _CNF2_PRSEG_M           0x07
351
 
351
 
352
/* reg 5-3 */
352
/* reg 5-3 */
353
#define CNF3                    (0x28)
353
#define CNF3                    (0x28)
354
#define CNF3_WAKFIL
354
#define CNF3_WAKFIL
355
#define _CNF3_WAKFIL_B          6
355
#define _CNF3_WAKFIL_B          6
356
#define _CNF3_WAKFIL_M          0b01000000
356
#define _CNF3_WAKFIL_M          0x40
357
#define CNF3_PHSEG2
357
#define CNF3_PHSEG2
358
#define _CNF3_PHSEG2_B          0
358
#define _CNF3_PHSEG2_B          0
359
#define _CNF3_PHSEG2_M          0b00000111
359
#define _CNF3_PHSEG2_M          0x07
360
 
360
 
361
/* reg 6-1 */
361
/* reg 6-1 */
362
#define TEC                     (0x1C)
362
#define TEC                     (0x1C)
363
#define TEC_TEC
363
#define TEC_TEC
364
#define _TEC_TEC_B              0
364
#define _TEC_TEC_B              0
365
#define _TEC_TEC_M              0b11111111
365
#define _TEC_TEC_M              0xff
366
 
366
 
367
/* reg 6-2 */
367
/* reg 6-2 */
368
#define REC                     (0x1D)
368
#define REC                     (0x1D)
369
#define REC_REC
369
#define REC_REC
370
#define _REC_REC_B              0
370
#define _REC_REC_B              0
371
#define _REC_REC_M              0b11111111
371
#define _REC_REC_M              0xff
372
 
372
 
373
/* reg 6-3 */
373
/* reg 6-3 */
374
#define EFLG                    (0x2D)
374
#define EFLG                    (0x2D)
375
#define EFLG_RX1OVR
375
#define EFLG_RX1OVR
376
#define _EFLG_RX1OVR_B          7
376
#define _EFLG_RX1OVR_B          7
377
#define _EFLG_RX1OVR_M          0b10000000
377
#define _EFLG_RX1OVR_M          0x80
378
#define EFLG_RX0OVR
378
#define EFLG_RX0OVR
379
#define _EFLG_RX0OVR_B          6
379
#define _EFLG_RX0OVR_B          6
380
#define _EFLG_RX0OVR_M          0b01000000
380
#define _EFLG_RX0OVR_M          0x40
381
#define EFLG_TXBO
381
#define EFLG_TXBO
382
#define _EFLG_TXBO_B            5
382
#define _EFLG_TXBO_B            5
383
#define _EFLG_TXBO_M            0b001000000
383
#define _EFLG_TXBO_M            0x20
384
#define EFLG_TXEP
384
#define EFLG_TXEP
385
#define _EFLG_TXEP_B            4
385
#define _EFLG_TXEP_B            4
386
#define _EFLG_TXEP_M            0b00010000
386
#define _EFLG_TXEP_M            0x10
387
#define EFLG_RXEP
387
#define EFLG_RXEP
388
#define _EFLG_RXEP_B            3
388
#define _EFLG_RXEP_B            3
389
#define _EFLG_RXEP_M            0b00001000
389
#define _EFLG_RXEP_M            0x08
390
#define EFLG_TXWAR
390
#define EFLG_TXWAR
391
#define _EFLG_TXWAR_B           2
391
#define _EFLG_TXWAR_B           2
392
#define _EFLG_TXWAR_M           0b00000100
392
#define _EFLG_TXWAR_M           0x04
393
#define EFLG_RXWAR
393
#define EFLG_RXWAR
394
#define _EFLG_RXWAR_B           1
394
#define _EFLG_RXWAR_B           1
395
#define _EFLG_RXWAR_M           0b00000010
395
#define _EFLG_RXWAR_M           0x02
396
#define EFLG_EWARN
396
#define EFLG_EWARN
397
#define _EFLG_EWARN_B           0
397
#define _EFLG_EWARN_B           0
398
#define _EFLG_EWARN_M           0b00000001
398
#define _EFLG_EWARN_M           0xb01
399
 
399
 
400
/* reg 7-1 */
400
/* reg 7-1 */
401
#define CANINTE                 (0x2B)
401
#define CANINTE                 (0x2B)
402
#define CANINTE_MERRE
402
#define CANINTE_MERRE
403
#define _CANINTE_MERRE_B        7
403
#define _CANINTE_MERRE_B        7
404
#define _CANINTE_MERRE_M        0b10000000
404
#define _CANINTE_MERRE_M        0x80
405
#define CANINTE_WAKIE
405
#define CANINTE_WAKIE
406
#define _CANINTE_WAKIE_B        6
406
#define _CANINTE_WAKIE_B        6
407
#define _CANINTE_WAKIE_M        0b01000000
407
#define _CANINTE_WAKIE_M        0x40
408
#define CANINTE_ERRIE
408
#define CANINTE_ERRIE
409
#define _CANINTE_ERRIE_B        5
409
#define _CANINTE_ERRIE_B        5
410
#define _CANINTE_ERRIE_M        0b00100000
410
#define _CANINTE_ERRIE_M        0x20
411
#define CANINTE_TX2IE
411
#define CANINTE_TX2IE
412
#define _CANINTE_TX2IE_B        4
412
#define _CANINTE_TX2IE_B        4
413
#define _CANINTE_TX2IE_M        0b00010000
413
#define _CANINTE_TX2IE_M        0x10
414
#define CANINTE_TX1IE
414
#define CANINTE_TX1IE
415
#define _CANINTE_TX1IE_B        3
415
#define _CANINTE_TX1IE_B        3
416
#define _CANINTE_TX1IE_M        0b00001000
416
#define _CANINTE_TX1IE_M        0x08
417
#define CANINTE_TX0IE
417
#define CANINTE_TX0IE
418
#define _CANINTE_TX0IE_B        2
418
#define _CANINTE_TX0IE_B        2
419
#define _CANINTE_TX0IE_M        0b00000100
419
#define _CANINTE_TX0IE_M        0x04
420
#define CANINTE_RX1IE
420
#define CANINTE_RX1IE
421
#define _CANINTE_RX1IE_B        1
421
#define _CANINTE_RX1IE_B        1
422
#define _CANINTE_RX1IE_M        0b00000010
422
#define _CANINTE_RX1IE_M        0x02
423
#define CANINTE_RX0IE
423
#define CANINTE_RX0IE
424
#define _CANINTE_RX0IE_B        0
424
#define _CANINTE_RX0IE_B        0
425
#define _CANINTE_RX0IE_M        0b00000001
425
#define _CANINTE_RX0IE_M        0x01
426
 
426
 
427
/* reg 7-2 */
427
/* reg 7-2 */
428
#define CANINTF                 (0x2C)
428
#define CANINTF                 (0x2C)
429
#define CANINTF_MERRF
429
#define CANINTF_MERRF
430
#define _CANINTF_MERRF_B        7
430
#define _CANINTF_MERRF_B        7
431
#define _CANINTF_MERRF_M        0b10000000
431
#define _CANINTF_MERRF_M        0x80
432
#define CANINTF_WAKIF
432
#define CANINTF_WAKIF
433
#define _CANINTF_WAKIF_B        6
433
#define _CANINTF_WAKIF_B        6
434
#define _CANINTF_WAKIF_M        0b01000000
434
#define _CANINTF_WAKIF_M        0x40
435
#define CANINTF_ERRIF
435
#define CANINTF_ERRIF
436
#define _CANINTF_ERRIF_B        5
436
#define _CANINTF_ERRIF_B        5
437
#define _CANINTF_ERRIF_M        0b00100000
437
#define _CANINTF_ERRIF_M        0x20
438
#define CANINTF_TX2IF
438
#define CANINTF_TX2IF
439
#define _CANINTF_TX2IF_B        4
439
#define _CANINTF_TX2IF_B        4
440
#define _CANINTF_TX2IF_M        0b00010000
440
#define _CANINTF_TX2IF_M        0x10
441
#define CANINTF_TX1IF
441
#define CANINTF_TX1IF
442
#define _CANINTF_TX1IF_B        3
442
#define _CANINTF_TX1IF_B        3
443
#define _CANINTF_TX1IF_M        0b00001000
443
#define _CANINTF_TX1IF_M        0x08
444
#define CANINTF_TX0IF
444
#define CANINTF_TX0IF
445
#define _CANINTF_TX0IF_B        2
445
#define _CANINTF_TX0IF_B        2
446
#define _CANINTF_TX0IF_M        0b00000100
446
#define _CANINTF_TX0IF_M        0x04
447
#define CANINTF_RX1IF
447
#define CANINTF_RX1IF
448
#define _CANINTF_RX1IF_B        1
448
#define _CANINTF_RX1IF_B        1
449
#define _CANINTF_RX1IF_M        0b00000010
449
#define _CANINTF_RX1IF_M        0x02
450
#define CANINTF_RX0IF
450
#define CANINTF_RX0IF
451
#define _CANINTF_RX0IF_B        0
451
#define _CANINTF_RX0IF_B        0
452
#define _CANINTF_RX0IF_M        0b00000001
452
#define _CANINTF_RX0IF_M        0x01
453
 
453
 
454
/* reg 9-1 */
454
/* reg 9-1 */
455
#define CANCTRL                 (0x0F)
455
#define CANCTRL                 (0x0F)
456
#define CANCTRL_REQOP
456
#define CANCTRL_REQOP
457
#define _CANCTRL_REQOP_B        5
457
#define _CANCTRL_REQOP_B        5
458
#define _CANCTRL_REQOP_M        0b11100000
458
#define _CANCTRL_REQOP_M        0xe0
459
#define CANCTRL_ABAT
459
#define CANCTRL_ABAT
460
#define _CANCTRL_ABAT_B         4
460
#define _CANCTRL_ABAT_B         4
461
#define _CANCTRL_ABAT_M         0b00010000
461
#define _CANCTRL_ABAT_M         0x10
462
#define CANCTRL_CLKEN
462
#define CANCTRL_CLKEN
463
#define _CANCTRL_CLKEN_B        2
463
#define _CANCTRL_CLKEN_B        2
464
#define _CANCTRL_CLKEN_M        0b00000100
464
#define _CANCTRL_CLKEN_M        0x04
465
#define CANCTRL_CLKPRE
465
#define CANCTRL_CLKPRE
466
#define _CANCTRL_CLKPRE_B       0
466
#define _CANCTRL_CLKPRE_B       0
467
#define _CANCTRL_CLKPRE_M       0b00000011
467
#define _CANCTRL_CLKPRE_M       0x03
468
 
468
 
469
/* reg 9-2 */
469
/* reg 9-2 */
470
#define CANSTAT                 (0x0E)
470
#define CANSTAT                 (0x0E)
471
#define CANSTAT_OPMOD
471
#define CANSTAT_OPMOD
472
#define _CANSTAT_OPMOD_B        5
472
#define _CANSTAT_OPMOD_B        5
473
#define _CANSTAT_OPMOD_M        0b11100000
473
#define _CANSTAT_OPMOD_M        0xe0
474
#define CANSTAT_ICOD
474
#define CANSTAT_ICOD
475
#define _CANSTAT_ICOD_B         1
475
#define _CANSTAT_ICOD_B         1
476
#define _CANSTAT_ICOD_M         0b00001110
476
#define _CANSTAT_ICOD_M         0x0e
477
 
477
 
478
 
478
 
479
/* -----------------------------------------------------------------------------
479
/* -----------------------------------------------------------------------------
480
 * Various other useful definitions.
480
 * Various other useful definitions.
481
 * ---------------------------------------------------------------------------*/
481
 * ---------------------------------------------------------------------------*/
482
 
482
 
483
#define REQOP_NORMAL        0b000
483
#define REQOP_NORMAL        0
484
#define REQOP_SLEEP         0b001
484
#define REQOP_SLEEP         1
485
#define REQOP_LOOPBACK      0b010
485
#define REQOP_LOOPBACK      2
486
#define REQOP_LISTENONLY    0b011
486
#define REQOP_LISTENONLY    3
487
#define REQOP_CONFIG        0b100
487
#define REQOP_CONFIG        4
488
 
488
 
489
 
489
 
490
#endif /*MCP2510_H_*/
490
#endif /*MCP2510_H_*/