Subversion Repositories NaviCtrl

Rev

Rev 696 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 696 Rev 698
1
#ifndef __CANBUS_H
1
#ifndef __CANBUS_H
2
#define __CANBUS_H
2
#define __CANBUS_H
-
 
3
 
-
 
4
#define CAN_ID_VERSION  0
-
 
5
#define CAN_ID_STATUS   1
-
 
6
#define CAN_ID_TEXT1    2 // Status-Text 8 Bytes
-
 
7
#define CAN_ID_TEXT2    3
-
 
8
#define CAN_ID_TEXT3    4
-
 
9
#define CAN_ID_FS_LON   5
-
 
10
#define CAN_ID_FS_LAT   6
-
 
11
#define CAN_ID_FS_ALT   7
-
 
12
 
-
 
13
#define MAX_CAN_MSG     10
3
 
14
 
4
void CanbusInit(void);
15
void CanbusInit(void);
5
void ProcessCanBus(void);
16
void ProcessCanBus(void);
6
extern canmsg RxCanMsg;
17
extern canmsg RxCanMsg;
7
extern volatile u32 frame_received_flag;
18
extern volatile u32 frame_received_flag;
8
 
19
 
9
 
20
 
10
typedef struct
21
typedef struct
11
{
22
{
12
  u32 IdType;
23
  u32 IdType;
13
  u32 Id;
24
  u32 Id;
14
  u32 Length;      // data length
25
  u32 Length;      // data length
15
        union
26
        union
16
        {
27
        {
17
            u8  Byte[8];
28
            u8  Byte[8];
18
                s8      sByte[8];
29
                s8      sByte[8];
19
                u16 Int[2];
30
                u16 Int[2];
20
                s16 sInt[2];
31
                s16 sInt[2];
21
                u32 Long;
32
                u32 Long;
22
                s32 sLong;
33
                s32 sLong;
23
                float Float;
34
                float Float;
24
        } __attribute__((packed)) D;
35
        } __attribute__((packed)) D;
25
 } /*__attribute__((packed))*/ CanMessage_t;
36
 } /*__attribute__((packed))*/ CanMessage_t;
-
 
37
 
-
 
38
 
26
 
39
extern CanMessage_t CanTxMessage[MAX_CAN_MSG];
-
 
40
extern CanMessage_t CanRxMessage[MAX_CAN_MSG];
27
//extern CanMessage_t CanMessage;
41
extern u32 CanbusTimeOut;
28
 
42
 
29
#endif
43
#endif
30
 
44