Subversion Repositories NaviCtrl

Rev

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

Rev Author Line No. Line
110 killagreg 1
#ifndef _MKPROTOCOL_H
2
#define _MKPROTOCOL_H
245 killagreg 3
#include "buffer.h"
110 killagreg 4
 
5
// slave addresses
190 killagreg 6
#define ANY_ADDRESS 0
110 killagreg 7
#define FC_ADDRESS 1
8
#define NC_ADDRESS 2
9
#define MK3MAG_ADDRESS 3
116 killagreg 10
#define MKOSD_ADDRESS 4
220 killagreg 11
#define BL_ADDRESS 5
110 killagreg 12
 
13
typedef struct
14
{
190 killagreg 15
        u8 Address;
16
        u8 CmdID;
110 killagreg 17
        u8* pData;
220 killagreg 18
        u16 DataLen;
110 killagreg 19
} __attribute__((packed)) SerialMsg_t;
20
 
245 killagreg 21
u8 MKProtocol_CollectSerialFrame(Buffer_t* pRxBuff, u8 c);
22
u8 MKProtocol_CreateSerialFrame(Buffer_t* pTxBuff, u8 CmdID, u8 Address, u8 numofbuffers , ...); //u8 *data, u8 len, ....;
23
void MKProtocol_DecodeSerialFrameHeader(Buffer_t* pRxBuff, SerialMsg_t* pSerialMsg);
24
void MKProtocol_DecodeSerialFrameData(Buffer_t* pRxBuff, SerialMsg_t* pSerialMsg);
110 killagreg 25
 
26
#endif // _MKPROTOCOL_H