Subversion Repositories NaviCtrl

Rev

Rev 698 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
691 holgerb 1
#ifndef __CANBUS_H
2
#define __CANBUS_H
3
 
698 holgerb 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
14
 
691 holgerb 15
void CanbusInit(void);
16
void ProcessCanBus(void);
17
extern canmsg RxCanMsg;
18
extern volatile u32 frame_received_flag;
19
 
696 holgerb 20
 
21
typedef struct
22
{
23
  u32 IdType;
24
  u32 Id;
25
  u32 Length;      // data length
26
        union
27
        {
28
            u8  Byte[8];
29
                s8      sByte[8];
30
                u16 Int[2];
31
                s16 sInt[2];
32
                u32 Long;
33
                s32 sLong;
34
                float Float;
35
        } __attribute__((packed)) D;
36
 } /*__attribute__((packed))*/ CanMessage_t;
37
 
38
 
698 holgerb 39
extern CanMessage_t CanTxMessage[MAX_CAN_MSG];
40
extern CanMessage_t CanRxMessage[MAX_CAN_MSG];
41
extern u32 CanbusTimeOut;
42
 
691 holgerb 43
#endif