Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
xsens_parser.h File Reference

Parser for the XSens protocol. More...

#include "std.h"
#include "xsens_protocol.h"
+ Include dependency graph for xsens_parser.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  XsensParser
 

Macros

#define XSENS_MAX_PAYLOAD   254
 Includes macros generated from xsens_MTi-G.xml. More...
 
#define UNINIT   0
 
#define GOT_START   1
 
#define GOT_BID   2
 
#define GOT_MID   3
 
#define GOT_LEN   4
 
#define GOT_DATA   5
 
#define GOT_CHECKSUM   6
 
#define XsensLinkDevice   (&((XSENS_LINK).device))
 
#define XsensInitCheksum()   { send_ck = 0; }
 
#define XsensUpdateChecksum(c)   { send_ck += c; }
 
#define XsensUartSend1(c)   XsensLinkDevice->put_byte(XsensLinkDevice->periph, 0, c)
 
#define XsensSend1(c)   { uint8_t i8=c; XsensUartSend1(i8); XsensUpdateChecksum(i8); }
 
#define XsensSend1ByAddr(x)   { XsensSend1(*x); }
 
#define XsensSend2ByAddr(x)   { XsensSend1(*(x+1)); XsensSend1(*x); }
 
#define XsensSend4ByAddr(x)   { XsensSend1(*(x+3)); XsensSend1(*(x+2)); XsensSend1(*(x+1)); XsensSend1(*x); }
 
#define XsensHeader(msg_id, len)
 
#define XsensTrailer()   { uint8_t i8=0x100-send_ck; XsensUartSend1(i8); }
 

Functions

void xsens_parser_event (struct XsensParser *xsensparser)
 

Variables

uint8_t send_ck
 

Detailed Description

Parser for the XSens protocol.

Transmit XSens protocol.

Definition in file xsens_parser.h.


Data Structure Documentation

struct XsensParser

Definition at line 46 of file xsens_parser.h.

Data Fields
uint8_t ck
uint8_t id
uint8_t len
uint8_t msg_buf[XSENS_MAX_PAYLOAD]
uint8_t msg_idx
volatile uint8_t msg_received
uint8_t status

Macro Definition Documentation

#define GOT_BID   2

Definition at line 40 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define GOT_CHECKSUM   6

Definition at line 44 of file xsens_parser.h.

#define GOT_DATA   5

Definition at line 43 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define GOT_LEN   4

Definition at line 42 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define GOT_MID   3

Definition at line 41 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define GOT_START   1

Definition at line 39 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define UNINIT   0

Definition at line 38 of file xsens_parser.h.

#define XSENS_MAX_PAYLOAD   254

Includes macros generated from xsens_MTi-G.xml.

Definition at line 35 of file xsens_parser.h.

Referenced by xsens_parser_func().

#define XsensHeader (   msg_id,
  len 
)
Value:
{ \
XsensUartSend1(XSENS_START); \
XsensSend1(XSENS_BID); \
XsensSend1(msg_id); \
XsensSend1(len); \
}
#define XsensInitCheksum()
Definition: xsens_parser.h:62
#define XsensSend1(c)
Definition: xsens_parser.h:66
#define XsensUartSend1(c)
Definition: xsens_parser.h:65

Definition at line 71 of file xsens_parser.h.

Referenced by xsens700_periodic().

#define XsensInitCheksum ( )    { send_ck = 0; }

Definition at line 62 of file xsens_parser.h.

#define XsensLinkDevice   (&((XSENS_LINK).device))

Definition at line 60 of file xsens_parser.h.

#define XsensSend1 (   c)    { uint8_t i8=c; XsensUartSend1(i8); XsensUpdateChecksum(i8); }

Definition at line 66 of file xsens_parser.h.

#define XsensSend1ByAddr (   x)    { XsensSend1(*x); }

Definition at line 67 of file xsens_parser.h.

Referenced by xsens_ask_message_rate().

#define XsensSend2ByAddr (   x)    { XsensSend1(*(x+1)); XsensSend1(*x); }

Definition at line 68 of file xsens_parser.h.

#define XsensSend4ByAddr (   x)    { XsensSend1(*(x+3)); XsensSend1(*(x+2)); XsensSend1(*(x+1)); XsensSend1(*x); }

Definition at line 69 of file xsens_parser.h.

#define XsensTrailer ( )    { uint8_t i8=0x100-send_ck; XsensUartSend1(i8); }

Definition at line 78 of file xsens_parser.h.

Referenced by xsens700_periodic().

#define XsensUartSend1 (   c)    XsensLinkDevice->put_byte(XsensLinkDevice->periph, 0, c)

Definition at line 65 of file xsens_parser.h.

#define XsensUpdateChecksum (   c)    { send_ck += c; }

Definition at line 63 of file xsens_parser.h.

Function Documentation

void xsens_parser_event ( struct XsensParser xsensparser)

Definition at line 35 of file xsens_parser.c.

References dev, XsensParser::msg_received, and xsens_parser_func().

Referenced by imu_xsens_event(), ins_xsens700_event(), and ins_xsens_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uint8_t send_ck

Definition at line 31 of file xsens_parser.c.