27 #ifndef XSENS_PARSER_H
28 #define XSENS_PARSER_H
33 #include "xsens_protocol.h"
35 #define XSENS_MAX_PAYLOAD 254
44 #define GOT_CHECKSUM 6
60 #define XsensLinkDevice (&((XSENS_LINK).device))
62 #define XsensInitCheksum() { send_ck = 0; }
63 #define XsensUpdateChecksum(c) { send_ck += c; }
65 #define XsensUartSend1(c) XsensLinkDevice->put_byte(XsensLinkDevice->periph, 0, c)
66 #define XsensSend1(c) { uint8_t i8=c; XsensUartSend1(i8); XsensUpdateChecksum(i8); }
67 #define XsensSend1ByAddr(x) { XsensSend1(*x); }
68 #define XsensSend2ByAddr(x) { XsensSend1(*(x+1)); XsensSend1(*x); }
69 #define XsensSend4ByAddr(x) { XsensSend1(*(x+3)); XsensSend1(*(x+2)); XsensSend1(*(x+1)); XsensSend1(*x); }
71 #define XsensHeader(msg_id, len) { \
72 XsensUartSend1(XSENS_START); \
74 XsensSend1(XSENS_BID); \
78 #define XsensTrailer() { uint8_t i8=0x100-send_ck; XsensUartSend1(i8); }
void xsens_parser_event(struct XsensParser *xsensparser)
volatile uint8_t msg_received
uint8_t msg_buf[XSENS_MAX_PAYLOAD]
#define XSENS_MAX_PAYLOAD
Includes macros generated from xsens_MTi-G.xml.