Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
170 jimmy 1
#ifndef COM_H_
2
#define COM_H_
3
 
4
 
5
/*-----------------------------------------------------------------------------
6
 * Includes
7
 *---------------------------------------------------------------------------*/
8
#include <inttypes.h>
9
#include <can.h>
10
 
11
 
12
/*-----------------------------------------------------------------------------
13
 * Type Definitions
14
 *---------------------------------------------------------------------------*/
15
/**
16
 * Communication Message Type.
172 eqlazer 17
 *
18
 * IDENT:<FUNCT><FUNCC><NID><SID> DATA:<data7>...<data0>
19
 *
170 jimmy 20
 */
21
typedef struct {
172 eqlazer 22
 
23
    /*
24
     * <FUNCT>, 4 bits = Function Type.
25
     */
26
    uint8_t Funct;
27
 
28
    /*
29
     * <FUNCC>, 10 bits = Function Code.
30
     */
31
    uint16_t Funcc;
32
 
33
    /*
34
     * <NID>, 6 bits = Network ID.
35
     */
36
    uint8_t Nid;
37
 
38
    /*
39
     * <SID>, 9 bits = Sender ID.
40
     */
41
    uint16_t Sid;
42
 
170 jimmy 43
} Com_Message_t;
44
 
45
 
46
/*-----------------------------------------------------------------------------
47
 * Public Function Prototypes
48
 *---------------------------------------------------------------------------*/
49
void Com_Init(void);
50
void Com_Service(void);
51
void ProtocolParseCanMessage(Can_Message_t *cmsg);
52
 
53
 
54
#endif /*COM_H_*/