Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ XsensParser

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

◆ GOT_BID

#define GOT_BID   2

Definition at line 40 of file xsens_parser.h.

◆ GOT_CHECKSUM

#define GOT_CHECKSUM   6

Definition at line 44 of file xsens_parser.h.

◆ GOT_DATA

#define GOT_DATA   5

Definition at line 43 of file xsens_parser.h.

◆ GOT_LEN

#define GOT_LEN   4

Definition at line 42 of file xsens_parser.h.

◆ GOT_MID

#define GOT_MID   3

Definition at line 41 of file xsens_parser.h.

◆ GOT_START

#define GOT_START   1

Definition at line 39 of file xsens_parser.h.

◆ UNINIT

#define UNINIT   0

Definition at line 38 of file xsens_parser.h.

◆ XSENS_MAX_PAYLOAD

#define XSENS_MAX_PAYLOAD   254

Includes macros generated from xsens_MTi-G.xml.

Definition at line 35 of file xsens_parser.h.

◆ XsensHeader

#define XsensHeader (   msg_id,
  len 
)
Value:
{ \
XsensUartSend1(XSENS_START); \
XsensInitCheksum(); \
XsensSend1(XSENS_BID); \
XsensSend1(msg_id); \
XsensSend1(len); \
}

Definition at line 71 of file xsens_parser.h.

◆ XsensInitCheksum

#define XsensInitCheksum ( )    { send_ck = 0; }

Definition at line 62 of file xsens_parser.h.

◆ XsensLinkDevice

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

Definition at line 60 of file xsens_parser.h.

◆ XsensSend1

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

Definition at line 66 of file xsens_parser.h.

◆ XsensSend1ByAddr

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

Definition at line 67 of file xsens_parser.h.

◆ XsensSend2ByAddr

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

Definition at line 68 of file xsens_parser.h.

◆ XsensSend4ByAddr

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

Definition at line 69 of file xsens_parser.h.

◆ XsensTrailer

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

Definition at line 78 of file xsens_parser.h.

◆ XsensUartSend1

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

Definition at line 65 of file xsens_parser.h.

◆ XsensUpdateChecksum

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

Definition at line 63 of file xsens_parser.h.

Function Documentation

◆ xsens_parser_event()

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

◆ send_ck

uint8_t send_ck
extern

Definition at line 31 of file xsens_parser.c.