Rev 112 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
110 | killagreg | 1 | #ifndef _MKPROTOCOL_H |
2 | #define _MKPROTOCOL_H |
||
3 | |||
4 | // slave addresses |
||
5 | #define FC_ADDRESS 1 |
||
6 | #define NC_ADDRESS 2 |
||
7 | #define MK3MAG_ADDRESS 3 |
||
8 | |||
9 | typedef struct |
||
10 | { |
||
11 | u8* pData; |
||
12 | u16 Size; |
||
13 | u16 Position; |
||
14 | u8 Locked; |
||
15 | } __attribute__((packed)) Buffer_t; |
||
16 | |||
17 | typedef struct |
||
18 | { |
||
19 | u8 Address; |
||
20 | u8 CmdID; |
||
21 | u8* pData; |
||
22 | u16 DataLen; |
||
23 | } __attribute__((packed)) SerialMsg_t; |
||
24 | |||
25 | extern void MKProtocol_CreateSerialFrame(Buffer_t* pTxBuff, u8 CmdID, u8 Address, u8 numofbuffers , ...); //u8 *data, u8 len, ....; |
||
26 | extern void MKProtocol_CollectSerialFrame(Buffer_t* pRxBuff, u8 c); |
||
27 | extern void MKProtocol_DecodeSerialFrame(Buffer_t* pRxBuff, SerialMsg_t* pSerialMsg); |
||
28 | |||
29 | #endif // _MKPROTOCOL_H |