Paparazzi UAS
v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
xsens_common.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2003 Pascal Brisset, Antoine Drouin
3
*
4
* This file is part of paparazzi.
5
*
6
* paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with paparazzi; see the file COPYING. If not, write to
18
* the Free Software Foundation, 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
20
*/
21
26
#ifndef XSENS_COMMON_H
27
#define XSENS_COMMON_H
28
29
#include "
std.h
"
30
32
#include "xsens_protocol.h"
33
34
extern
uint8_t
xsens_id
;
35
extern
uint8_t
xsens_status
;
36
extern
uint8_t
xsens_len
;
37
extern
uint8_t
xsens_msg_idx
;
38
extern
uint8_t
ck
;
39
extern
uint8_t
send_ck
;
40
41
#define XsensLinkDevice (&((XSENS_LINK).device))
42
43
#define XsensInitCheksum() { send_ck = 0; }
44
#define XsensUpdateChecksum(c) { send_ck += c; }
45
46
#define XsensUartSend1(c) XsensLinkDevice->put_byte(XsensLinkDevice->periph, 0, c)
47
#define XsensSend1(c) { uint8_t i8=c; XsensUartSend1(i8); XsensUpdateChecksum(i8); }
48
#define XsensSend1ByAddr(x) { XsensSend1(*x); }
49
#define XsensSend2ByAddr(x) { XsensSend1(*(x+1)); XsensSend1(*x); }
50
#define XsensSend4ByAddr(x) { XsensSend1(*(x+3)); XsensSend1(*(x+2)); XsensSend1(*(x+1)); XsensSend1(*x); }
51
52
#define XsensHeader(msg_id, len) { \
53
XsensUartSend1(XSENS_START); \
54
XsensInitCheksum(); \
55
XsensSend1(XSENS_BID); \
56
XsensSend1(msg_id); \
57
XsensSend1(len); \
58
}
59
#define XsensTrailer() { uint8_t i8=0x100-send_ck; XsensUartSend1(i8); }
60
61
62
#define XSENS_MAX_PAYLOAD 254
63
extern
uint8_t
xsens_msg_buf
[
XSENS_MAX_PAYLOAD
];
64
65
#define UNINIT 0
66
#define GOT_START 1
67
#define GOT_BID 2
68
#define GOT_MID 3
69
#define GOT_LEN 4
70
#define GOT_DATA 5
71
#define GOT_CHECKSUM 6
72
73
extern
void
xsens_event
(
void
);
74
75
#endif
/* XSENS_COMMON_H */
send_ck
uint8_t send_ck
Definition:
xsens_common.c:38
XSENS_MAX_PAYLOAD
#define XSENS_MAX_PAYLOAD
Definition:
xsens_common.h:62
xsens_id
uint8_t xsens_id
Includes macros generated from xsens_MTi-G.xml.
Definition:
xsens_common.c:33
xsens_status
uint8_t xsens_status
Definition:
xsens_common.c:34
xsens_len
uint8_t xsens_len
Definition:
xsens_common.c:35
ck
uint8_t ck
Definition:
xsens_common.c:37
std.h
xsens_msg_idx
uint8_t xsens_msg_idx
Definition:
xsens_common.c:36
uint8_t
unsigned char uint8_t
Definition:
types.h:14
xsens_msg_buf
uint8_t xsens_msg_buf[XSENS_MAX_PAYLOAD]
Definition:
xsens_common.c:40
xsens_event
void xsens_event(void)
Definition:
xsens_common.c:44
sw
airborne
modules
ins
xsens_common.h
Generated on Sat Feb 9 2019 06:43:58 for Paparazzi UAS by
1.8.8