brians | 0ab60bb | 2013-01-31 02:21:51 +0000 | [diff] [blame] | 1 | #ifndef _CAN_H_ |
2 | #define _CAN_H_ | ||||
3 | |||||
4 | typedef struct _can_message { | ||||
5 | unsigned RTR:1; | ||||
6 | unsigned error:7; | ||||
7 | uint16_t id; | ||||
8 | uint8_t priority; | ||||
9 | uint8_t length; | ||||
10 | union { | ||||
11 | uint8_t data[8]; | ||||
12 | uint32_t wdata[2]; | ||||
13 | }; | ||||
14 | } can_message; | ||||
15 | |||||
16 | int CAN_get(can_message *message); | ||||
Brian Silverman | 1dbe354 | 2013-10-31 20:29:11 -0700 | [diff] [blame] | 17 | |
18 | // Sets up PCLKSEL for CAN stuff (errata PCLKSELx.1). | ||||
19 | void CAN_PCLKSEL(void); | ||||
brians | 0ab60bb | 2013-01-31 02:21:51 +0000 | [diff] [blame] | 20 | void initCAN(void); |
21 | |||||
22 | #endif |