Rev 73 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 73 | Rev 97 | ||
|---|---|---|---|
| 1 | /********************************************************************* |
1 | /********************************************************************* |
| 2 | * |
2 | * |
| 3 | * CAN.c header file |
3 | * CAN.c header file |
| 4 | * |
4 | * |
| 5 | ********************************************************************* |
5 | ********************************************************************* |
| 6 | * FileName: CAN.h |
6 | * FileName: $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canToSerial/Include/CAN.h $ |
| 7 | * |
- | |
| 8 | * |
7 | * Last changed: $LastChangedDate: 2006-11-14 21:22:17 +0100 (Tue, 14 Nov 2006) $ |
| 9 | * |
8 | * By: $LastChangedBy: johboh $ |
| 10 | * |
9 | * Revision: $Revision: 97 $ |
| 11 | ********************************************************************/ |
10 | ********************************************************************/ |
| 12 | 11 | ||
| 13 | #ifndef CAN_H |
12 | #ifndef CAN_H |
| 14 | #define CAN_H |
13 | #define CAN_H |
| 15 | 14 | ||
| 16 | #include <CANdefs.h> |
15 | #include <CANdefs.h> |
| 17 | #include <compiler.h> |
16 | #include <compiler.h> |
| 18 | #include <typedefs.h> |
17 | #include <typedefs.h> |
| 19 | 18 | ||
| 20 | 19 | ||
| 21 | typedef struct _CAN_MESSAGE |
20 | typedef struct _CAN_MESSAGE |
| 22 | { |
21 | { |
| 23 | 22 | ||
| 24 | DWORD ident; |
23 | DWORD ident; |
| 25 | BOOL extended; |
24 | BOOL extended; |
| 26 | BOOL remote_request; |
25 | BOOL remote_request; |
| 27 | BYTE data_length; |
26 | BYTE data_length; |
| 28 | BYTE data[8]; |
27 | BYTE data[8]; |
| 29 | } CAN_MESSAGE; |
28 | } CAN_MESSAGE; |
| 30 | 29 | ||
| 31 | 30 | ||
| 32 | typedef enum {PRIO_LOWEST=0,PRIO_LOW=1,PRIO_HIGH=2,PRIO_HIGEST=3} CAN_PRIORITY; |
31 | typedef enum {PRIO_LOWEST=0,PRIO_LOW=1,PRIO_HIGH=2,PRIO_HIGEST=3} CAN_PRIORITY; |
| 33 | 32 | ||
| 34 | 33 | ||
| 35 | void canInit(void); |
34 | void canInit(void); |
| 36 | void canISR(void); |
35 | void canISR(void); |
| 37 | void canParse(CAN_MESSAGE cm); |
36 | void canParse(CAN_MESSAGE cm); |
| 38 | BOOL canSendMessage(CAN_MESSAGE cm, CAN_PRIORITY prio); |
37 | BOOL canSendMessage(CAN_MESSAGE cm, CAN_PRIORITY prio); |
| 39 | 38 | ||
| 40 | #endif //CAN.h |
39 | #endif //CAN.h |
| 41 | 40 | ||