6 static const uint8_t CANCTRL_REQOP = 0xE0;
7 static const uint8_t CANCTRL_ABAT = 0x10;
8 static const uint8_t CANCTRL_OSM = 0x08;
9 static const uint8_t CANCTRL_CLKEN = 0x04;
10 static const uint8_t CANCTRL_CLKPRE = 0x03;
128 static const uint8_t CANSTAT_OPMOD = 0xE0;
129 static const uint8_t CANSTAT_ICOD = 0x0E;
131 static const uint8_t CNF3_SOF = 0x80;
133 static const uint8_t TXB_EXIDE_MASK = 0x08;
134 static const uint8_t DLC_MASK = 0x0F;
135 static const uint8_t RTR_MASK = 0x40;
137 static const uint8_t RXB_CTRL_RXM_STD = 0x20;
138 static const uint8_t RXB_CTRL_RXM_EXT = 0x40;
139 static const uint8_t RXB_CTRL_RXM_STDEXT = 0x00;
140 static const uint8_t RXB_CTRL_RXM_MASK = 0x60;
141 static const uint8_t RXB_CTRL_RTR = 0x08;
142 static const uint8_t RXB_0_CTRL_BUKT = 0x04;
144 static const uint8_t MCP_SIDH = 0;
145 static const uint8_t MCP_SIDL = 1;
146 static const uint8_t MCP_EID8 = 2;
147 static const uint8_t MCP_EID0 = 3;
148 static const uint8_t MCP_DLC = 4;
149 static const uint8_t MCP_DATA = 5;
154 static const uint8_t MCP_8MHZ_1000KBPS_CFG1 = 0x00;
155 static const uint8_t MCP_8MHZ_1000KBPS_CFG2 = 0x80;
156 static const uint8_t MCP_8MHZ_1000KBPS_CFG3 = 0x80;
158 static const uint8_t MCP_8MHZ_500KBPS_CFG1 = 0x00;
159 static const uint8_t MCP_8MHZ_500KBPS_CFG2 = 0x90;
160 static const uint8_t MCP_8MHZ_500KBPS_CFG3 = 0x82;
162 static const uint8_t MCP_8MHZ_250KBPS_CFG1 = 0x00;
163 static const uint8_t MCP_8MHZ_250KBPS_CFG2 = 0xB1;
164 static const uint8_t MCP_8MHZ_250KBPS_CFG3 = 0x85;
166 static const uint8_t MCP_8MHZ_200KBPS_CFG1 = 0x00;
167 static const uint8_t MCP_8MHZ_200KBPS_CFG2 = 0xB4;
168 static const uint8_t MCP_8MHZ_200KBPS_CFG3 = 0x86;
170 static const uint8_t MCP_8MHZ_125KBPS_CFG1 = 0x01;
171 static const uint8_t MCP_8MHZ_125KBPS_CFG2 = 0xB1;
172 static const uint8_t MCP_8MHZ_125KBPS_CFG3 = 0x85;
174 static const uint8_t MCP_8MHZ_100KBPS_CFG1 = 0x01;
175 static const uint8_t MCP_8MHZ_100KBPS_CFG2 = 0xB4;
176 static const uint8_t MCP_8MHZ_100KBPS_CFG3 = 0x86;
178 static const uint8_t MCP_8MHZ_80KBPS_CFG1 = 0x01;
179 static const uint8_t MCP_8MHZ_80KBPS_CFG2 = 0xBF;
180 static const uint8_t MCP_8MHZ_80KBPS_CFG3 = 0x87;
182 static const uint8_t MCP_8MHZ_50KBPS_CFG1 = 0x03;
183 static const uint8_t MCP_8MHZ_50KBPS_CFG2 = 0xB4;
184 static const uint8_t MCP_8MHZ_50KBPS_CFG3 = 0x86;
186 static const uint8_t MCP_8MHZ_40KBPS_CFG1 = 0x03;
187 static const uint8_t MCP_8MHZ_40KBPS_CFG2 = 0xBF;
188 static const uint8_t MCP_8MHZ_40KBPS_CFG3 = 0x87;
190 static const uint8_t MCP_8MHZ_33K3BPS_CFG1 = 0x47;
191 static const uint8_t MCP_8MHZ_33K3BPS_CFG2 = 0xE2;
192 static const uint8_t MCP_8MHZ_33K3BPS_CFG3 = 0x85;
194 static const uint8_t MCP_8MHZ_31K25BPS_CFG1 = 0x07;
195 static const uint8_t MCP_8MHZ_31K25BPS_CFG2 = 0xA4;
196 static const uint8_t MCP_8MHZ_31K25BPS_CFG3 = 0x84;
198 static const uint8_t MCP_8MHZ_20KBPS_CFG1 = 0x07;
199 static const uint8_t MCP_8MHZ_20KBPS_CFG2 = 0xBF;
200 static const uint8_t MCP_8MHZ_20KBPS_CFG3 = 0x87;
202 static const uint8_t MCP_8MHZ_10KBPS_CFG1 = 0x0F;
203 static const uint8_t MCP_8MHZ_10KBPS_CFG2 = 0xBF;
204 static const uint8_t MCP_8MHZ_10KBPS_CFG3 = 0x87;
206 static const uint8_t MCP_8MHZ_5KBPS_CFG1 = 0x1F;
207 static const uint8_t MCP_8MHZ_5KBPS_CFG2 = 0xBF;
208 static const uint8_t MCP_8MHZ_5KBPS_CFG3 = 0x87;
214 static const uint8_t MCP_12MHZ_1000KBPS_CFG1 = 0x00;
215 static const uint8_t MCP_12MHZ_1000KBPS_CFG2 = 0x88;
216 static const uint8_t MCP_12MHZ_1000KBPS_CFG3 = 0x81;
218 static const uint8_t MCP_12MHZ_500KBPS_CFG1 = 0x00;
219 static const uint8_t MCP_12MHZ_500KBPS_CFG2 = 0x9B;
220 static const uint8_t MCP_12MHZ_500KBPS_CFG3 = 0x82;
222 static const uint8_t MCP_12MHZ_250KBPS_CFG1 = 0x01;
223 static const uint8_t MCP_12MHZ_250KBPS_CFG2 = 0x9B;
224 static const uint8_t MCP_12MHZ_250KBPS_CFG3 = 0x82;
226 static const uint8_t MCP_12MHZ_200KBPS_CFG1 = 0x01;
227 static const uint8_t MCP_12MHZ_200KBPS_CFG2 = 0xA4;
228 static const uint8_t MCP_12MHZ_200KBPS_CFG3 = 0x83;
230 static const uint8_t MCP_12MHZ_125KBPS_CFG1 = 0x03;
231 static const uint8_t MCP_12MHZ_125KBPS_CFG2 = 0x9B;
232 static const uint8_t MCP_12MHZ_125KBPS_CFG3 = 0x82;
234 static const uint8_t MCP_12MHZ_100KBPS_CFG1 = 0x03;
235 static const uint8_t MCP_12MHZ_100KBPS_CFG2 = 0xA4;
236 static const uint8_t MCP_12MHZ_100KBPS_CFG3 = 0x83;
238 static const uint8_t MCP_12MHZ_80KBPS_CFG1 = 0x04;
239 static const uint8_t MCP_12MHZ_80KBPS_CFG2 = 0xA4;
240 static const uint8_t MCP_12MHZ_80KBPS_CFG3 = 0x83;
242 static const uint8_t MCP_12MHZ_50KBPS_CFG1 = 0x07;
243 static const uint8_t MCP_12MHZ_50KBPS_CFG2 = 0xA4;
244 static const uint8_t MCP_12MHZ_50KBPS_CFG3 = 0x83;
246 static const uint8_t MCP_12MHZ_40KBPS_CFG1 = 0x09;
247 static const uint8_t MCP_12MHZ_40KBPS_CFG2 = 0xA4;
248 static const uint8_t MCP_12MHZ_40KBPS_CFG3 = 0x83;
250 static const uint8_t MCP_12MHZ_33K3BPS_CFG1 = 0x08;
251 static const uint8_t MCP_12MHZ_33K3BPS_CFG2 = 0xB6;
252 static const uint8_t MCP_12MHZ_33K3BPS_CFG3 = 0x84;
254 static const uint8_t MCP_12MHZ_20KBPS_CFG1 = 0x0E;
255 static const uint8_t MCP_12MHZ_20KBPS_CFG2 = 0xB6;
256 static const uint8_t MCP_12MHZ_20KBPS_CFG3 = 0x84;
258 static const uint8_t MCP_12MHZ_10KBPS_CFG1 = 0x31;
259 static const uint8_t MCP_12MHZ_10KBPS_CFG2 = 0x9B;
260 static const uint8_t MCP_12MHZ_10KBPS_CFG3 = 0x82;
262 static const uint8_t MCP_12MHZ_5KBPS_CFG1 = 0x3B;
263 static const uint8_t MCP_12MHZ_5KBPS_CFG2 = 0xB6;
264 static const uint8_t MCP_12MHZ_5KBPS_CFG3 = 0x84;
269 static const uint8_t MCP_16MHZ_1000KBPS_CFG1 = 0x00;
270 static const uint8_t MCP_16MHZ_1000KBPS_CFG2 = 0xD0;
271 static const uint8_t MCP_16MHZ_1000KBPS_CFG3 = 0x82;
273 static const uint8_t MCP_16MHZ_500KBPS_CFG1 = 0x00;
274 static const uint8_t MCP_16MHZ_500KBPS_CFG2 = 0xF0;
275 static const uint8_t MCP_16MHZ_500KBPS_CFG3 = 0x86;
277 static const uint8_t MCP_16MHZ_250KBPS_CFG1 = 0x41;
278 static const uint8_t MCP_16MHZ_250KBPS_CFG2 = 0xF1;
279 static const uint8_t MCP_16MHZ_250KBPS_CFG3 = 0x85;
281 static const uint8_t MCP_16MHZ_200KBPS_CFG1 = 0x01;
282 static const uint8_t MCP_16MHZ_200KBPS_CFG2 = 0xFA;
283 static const uint8_t MCP_16MHZ_200KBPS_CFG3 = 0x87;
285 static const uint8_t MCP_16MHZ_125KBPS_CFG1 = 0x03;
286 static const uint8_t MCP_16MHZ_125KBPS_CFG2 = 0xF0;
287 static const uint8_t MCP_16MHZ_125KBPS_CFG3 = 0x86;
289 static const uint8_t MCP_16MHZ_100KBPS_CFG1 = 0x03;
290 static const uint8_t MCP_16MHZ_100KBPS_CFG2 = 0xFA;
291 static const uint8_t MCP_16MHZ_100KBPS_CFG3 = 0x87;
293 static const uint8_t MCP_16MHZ_80KBPS_CFG1 = 0x03;
294 static const uint8_t MCP_16MHZ_80KBPS_CFG2 = 0xFF;
295 static const uint8_t MCP_16MHZ_80KBPS_CFG3 = 0x87;
297 static const uint8_t MCP_16MHZ_83K3BPS_CFG1 = 0x03;
298 static const uint8_t MCP_16MHZ_83K3BPS_CFG2 = 0xBE;
299 static const uint8_t MCP_16MHZ_83K3BPS_CFG3 = 0x07;
301 static const uint8_t MCP_16MHZ_50KBPS_CFG1 = 0x07;
302 static const uint8_t MCP_16MHZ_50KBPS_CFG2 = 0xFA;
303 static const uint8_t MCP_16MHZ_50KBPS_CFG3 = 0x87;
305 static const uint8_t MCP_16MHZ_40KBPS_CFG1 = 0x07;
306 static const uint8_t MCP_16MHZ_40KBPS_CFG2 = 0xFF;
307 static const uint8_t MCP_16MHZ_40KBPS_CFG3 = 0x87;
309 static const uint8_t MCP_16MHZ_33K3BPS_CFG1 = 0x4E;
310 static const uint8_t MCP_16MHZ_33K3BPS_CFG2 = 0xF1;
311 static const uint8_t MCP_16MHZ_33K3BPS_CFG3 = 0x85;
313 static const uint8_t MCP_16MHZ_20KBPS_CFG1 = 0x0F;
314 static const uint8_t MCP_16MHZ_20KBPS_CFG2 = 0xFF;
315 static const uint8_t MCP_16MHZ_20KBPS_CFG3 = 0x87;
317 static const uint8_t MCP_16MHZ_10KBPS_CFG1 = 0x1F;
318 static const uint8_t MCP_16MHZ_10KBPS_CFG2 = 0xFF;
319 static const uint8_t MCP_16MHZ_10KBPS_CFG3 = 0x87;
321 static const uint8_t MCP_16MHZ_5KBPS_CFG1 = 0x3F;
322 static const uint8_t MCP_16MHZ_5KBPS_CFG2 = 0xFF;
323 static const uint8_t MCP_16MHZ_5KBPS_CFG3 = 0x87;
328 static const uint8_t MCP_20MHZ_1000KBPS_CFG1 = 0x00;
329 static const uint8_t MCP_20MHZ_1000KBPS_CFG2 = 0xD9;
330 static const uint8_t MCP_20MHZ_1000KBPS_CFG3 = 0x82;
332 static const uint8_t MCP_20MHZ_500KBPS_CFG1 = 0x00;
333 static const uint8_t MCP_20MHZ_500KBPS_CFG2 = 0xFA;
334 static const uint8_t MCP_20MHZ_500KBPS_CFG3 = 0x87;
336 static const uint8_t MCP_20MHZ_250KBPS_CFG1 = 0x41;
337 static const uint8_t MCP_20MHZ_250KBPS_CFG2 = 0xFB;
338 static const uint8_t MCP_20MHZ_250KBPS_CFG3 = 0x86;
340 static const uint8_t MCP_20MHZ_200KBPS_CFG1 = 0x01;
341 static const uint8_t MCP_20MHZ_200KBPS_CFG2 = 0xFF;
342 static const uint8_t MCP_20MHZ_200KBPS_CFG3 = 0x87;
344 static const uint8_t MCP_20MHZ_125KBPS_CFG1 = 0x03;
345 static const uint8_t MCP_20MHZ_125KBPS_CFG2 = 0xFA;
346 static const uint8_t MCP_20MHZ_125KBPS_CFG3 = 0x87;
348 static const uint8_t MCP_20MHZ_100KBPS_CFG1 = 0x04;
349 static const uint8_t MCP_20MHZ_100KBPS_CFG2 = 0xFA;
350 static const uint8_t MCP_20MHZ_100KBPS_CFG3 = 0x87;
352 static const uint8_t MCP_20MHZ_83K3BPS_CFG1 = 0x04;
353 static const uint8_t MCP_20MHZ_83K3BPS_CFG2 = 0xFE;
354 static const uint8_t MCP_20MHZ_83K3BPS_CFG3 = 0x87;
356 static const uint8_t MCP_20MHZ_80KBPS_CFG1 = 0x04;
357 static const uint8_t MCP_20MHZ_80KBPS_CFG2 = 0xFF;
358 static const uint8_t MCP_20MHZ_80KBPS_CFG3 = 0x87;
360 static const uint8_t MCP_20MHZ_50KBPS_CFG1 = 0x09;
361 static const uint8_t MCP_20MHZ_50KBPS_CFG2 = 0xFA;
362 static const uint8_t MCP_20MHZ_50KBPS_CFG3 = 0x87;
364 static const uint8_t MCP_20MHZ_40KBPS_CFG1 = 0x09;
365 static const uint8_t MCP_20MHZ_40KBPS_CFG2 = 0xFF;
366 static const uint8_t MCP_20MHZ_40KBPS_CFG3 = 0x87;
368 static const uint8_t MCP_20MHZ_33K3BPS_CFG1 = 0x0B;
369 static const uint8_t MCP_20MHZ_33K3BPS_CFG2 = 0xFF;
370 static const uint8_t MCP_20MHZ_33K3BPS_CFG3 = 0x87;
Implementation of SPI Controller mode.