Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
xsens_common.h File Reference

Parser for the Xsens protocol. More...

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

Go to the source code of this file.

Macros

#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); }
 
#define XSENS_MAX_PAYLOAD   254
 
#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
 

Functions

void xsens_event (void)
 

Variables

uint8_t xsens_id
 Includes macros generated from xsens_MTi-G.xml. More...
 
uint8_t xsens_status
 
uint8_t xsens_len
 
uint8_t xsens_msg_idx
 
uint8_t ck
 
uint8_t send_ck
 
uint8_t xsens_msg_buf [XSENS_MAX_PAYLOAD]
 

Detailed Description

Parser for the Xsens protocol.

Definition in file xsens_common.h.

Macro Definition Documentation

#define GOT_BID   2

Definition at line 67 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define GOT_CHECKSUM   6

Definition at line 71 of file xsens_common.h.

#define GOT_DATA   5

Definition at line 70 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define GOT_LEN   4

Definition at line 69 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define GOT_MID   3

Definition at line 68 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define GOT_START   1

Definition at line 66 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define UNINIT   0

Definition at line 65 of file xsens_common.h.

#define XSENS_MAX_PAYLOAD   254

Definition at line 62 of file xsens_common.h.

Referenced by parse_xsens_buffer().

#define XsensHeader (   msg_id,
  len 
)
Value:
{ \
XsensUartSend1(XSENS_START); \
XsensSend1(XSENS_BID); \
XsensSend1(msg_id); \
XsensSend1(len); \
}
#define XsensUartSend1(c)
Definition: xsens_common.h:46
#define XsensSend1(c)
Definition: xsens_common.h:47
#define XsensInitCheksum()
Definition: xsens_common.h:43

Definition at line 52 of file xsens_common.h.

Referenced by xsens700_periodic().

#define XsensInitCheksum ( )    { send_ck = 0; }

Definition at line 43 of file xsens_common.h.

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

Definition at line 41 of file xsens_common.h.

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

Definition at line 47 of file xsens_common.h.

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

Definition at line 48 of file xsens_common.h.

Referenced by xsens_ask_message_rate().

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

Definition at line 49 of file xsens_common.h.

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

Definition at line 50 of file xsens_common.h.

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

Definition at line 59 of file xsens_common.h.

Referenced by xsens700_periodic().

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

Definition at line 46 of file xsens_common.h.

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

Definition at line 44 of file xsens_common.h.

Function Documentation

void xsens_event ( void  )

Definition at line 44 of file xsens_common.c.

References dev, parse_xsens_buffer(), and xsens_msg_received.

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 ck

Definition at line 37 of file xsens_common.c.

Referenced by parse_xsens_buffer().

uint8_t send_ck

Definition at line 38 of file xsens_common.c.

uint8_t xsens_id

Includes macros generated from xsens_MTi-G.xml.

Definition at line 33 of file xsens_common.c.

Referenced by parse_xsens700_msg(), parse_xsens_buffer(), and parse_xsens_msg().

uint8_t xsens_len

Definition at line 35 of file xsens_common.c.

Referenced by parse_xsens700_msg(), and parse_xsens_buffer().

uint8_t xsens_msg_buf[XSENS_MAX_PAYLOAD]

Definition at line 40 of file xsens_common.c.

Referenced by parse_xsens700_msg(), parse_xsens_buffer(), and parse_xsens_msg().

uint8_t xsens_msg_idx

Definition at line 36 of file xsens_common.c.

Referenced by parse_xsens_buffer().

uint8_t xsens_status

Definition at line 34 of file xsens_common.c.

Referenced by parse_xsens_buffer(), xsens700_init(), and xsens_init().