cmtmsg.h.svn-base

来自「AVR单片机下」· SVN-BASE 代码 · 共 41 行

SVN-BASE
41
字号
/*                ****ROBOCON 2009 | BUPT TEAM******* * ------------------------------------------------------------------------ * FileName   : cmtmsg.h * Version    : 1.0 * Biref      : * Code by    : leaf * Date       : Apr 3, 2009 * Note       : * * * ------------------------------------------------------------------------ */#ifndef CMTMSG_H_INCLUDED#define CMTMSG_H_INCLUDED#include <stdint.h>#include <stdio.h>#include "vector.h"#include "cmtmid.h"#define CMT_MSG_PREAMBLE   ((UINT8)0xFF)typedef UINT8 CmtMsgId;typedef struct{	CmtMsgId mid;	size_t size;	Vector   data;} *pCmtMsg, CmtMsg;void cmtMsgInit(CmtMsg *msg, size_t datasize);void cmtMsgSetId(CmtMsg *msg, CmtMsgId id);void cmtMsgDisplay(CmtMsg *msg, FILE *dev);void cmtMsgAppendData(CmtMsg *msg, const void *data, size_t len);void cmtMsgAppendByte(CmtMsg *msg, UINT8 data);void cmtMsgClearData(CmtMsg *msg);void cmtMsgFreeData(CmtMsg *msg);UINT8 cmtMsgGetByte(const CmtMsg *msg, size_t idx);float cmtMsgGetFloat(const CmtMsg *msg, size_t idx);INT16 cmtMsgGetInt16(const CmtMsg *msg, size_t idx);INT16 cmtMsgGetIntAng(const CmtMsg *msg, size_t idx);double cmtMsgGetF1220(const CmtMsg *msg, size_t idx);#endif  /* CMTMSG_H_INCLUDED */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?