Subversion Repositories HomeAutomation

Rev

Rev 53 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 53 Rev 56
1
/*********************************************************************
1
/*********************************************************************
2
 *
2
 *
3
 *                  CAN.c header file
3
 *                  CAN.c header file
4
 *
4
 *
5
 *********************************************************************
5
 *********************************************************************
6
 * FileName:        CAN.h
6
 * FileName:        CAN.h
7
 *
7
 *
8
 * Author               Date    Comment
8
 * Author               Date    Comment
9
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
 * Johan Böhlin     21-10-06    Original        (Rev 1.0)
10
 * Johan Böhlin     21-10-06    Original        (Rev 1.0)
11
 ********************************************************************/
11
 ********************************************************************/
12
 
12
 
13
#ifndef CAN_H
13
#ifndef CAN_H
14
#define CAN_H
14
#define CAN_H
15
 
15
 
16
#include <CANdefs.h>
16
#include <CANdefs.h>
17
#include <compiler.h>
17
#include <compiler.h>
18
#include <typedefs.h>
18
#include <typedefs.h>
19
 
19
 
20
 
20
 
21
typedef struct _CAN_MESSAGE
21
typedef struct _CAN_MESSAGE
22
{
22
{
23
   
23
   
24
    DWORD ident;
24
    DWORD ident;
25
    BOOL extended;
25
    BOOL extended;
-
 
26
    BOOL remote_request;
26
    BYTE data_length;
27
    BYTE data_length;
27
    BYTE data[8];
28
    BYTE data[8];
28
} CAN_MESSAGE;
29
} CAN_MESSAGE;
29
 
30
 
30
 
31
 
-
 
32
typedef enum {PRIO_LOWEST=0,PRIO_LOW=1,PRIO_HIGH=2,PRIO_HIGEST=3} CAN_PRIORITY;
31
 
33
 
32
 
34
 
33
void canInit(void);
35
void canInit(void);
34
void canISR(void);
36
void canISR(void);
35
void canParse(CAN_MESSAGE cm);
37
void canParse(CAN_MESSAGE cm);
36
BOOL canSendMessage(CAN_MESSAGE cm);
38
BOOL canSendMessage(CAN_MESSAGE cm, CAN_PRIORITY prio);
37
 
39
 
38
#endif //CAN.h
40
#endif //CAN.h
39
 
41