Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ins_module.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
28
#ifndef INS_MODULE_H
29
#define INS_MODULE_H
30
31
#include "
std.h
"
32
#include "
subsystems/ins.h
"
33
34
#ifndef INS_FORMAT
35
#define INS_FORMAT float
36
#endif
37
38
extern
INS_FORMAT
ins_x
;
39
extern
INS_FORMAT
ins_y
;
40
extern
INS_FORMAT
ins_z
;
41
42
extern
INS_FORMAT
ins_vx
;
43
extern
INS_FORMAT
ins_vy
;
44
extern
INS_FORMAT
ins_vz
;
45
46
extern
INS_FORMAT
ins_phi
;
47
extern
INS_FORMAT
ins_theta
;
48
extern
INS_FORMAT
ins_psi
;
49
50
extern
INS_FORMAT
ins_p
;
51
extern
INS_FORMAT
ins_q
;
52
extern
INS_FORMAT
ins_r
;
53
54
extern
INS_FORMAT
ins_ax
;
55
extern
INS_FORMAT
ins_ay
;
56
extern
INS_FORMAT
ins_az
;
57
58
extern
INS_FORMAT
ins_mx
;
59
extern
INS_FORMAT
ins_my
;
60
extern
INS_FORMAT
ins_mz
;
61
62
#if USE_INS_MODULE
63
extern
INS_FORMAT
ins_roll_neutral
;
64
extern
INS_FORMAT
ins_pitch_neutral
;
65
#endif
66
67
extern
volatile
uint8_t
ins_msg_received
;
68
extern
volatile
uint8_t
new_ins_attitude
;
69
70
void
handle_ins_msg
(
void
);
71
void
parse_ins_msg
(
void
);
72
void
parse_ins_buffer
(
uint8_t
);
73
74
#include "pprzlink/pprzlink_device.h"
75
76
#define InsLinkDevice (&((INS_LINK).device))
77
78
#ifndef SITL
79
#include "
mcu_periph/uart.h
"
80
#include "
mcu_periph/spi.h
"
81
82
#define InsSend1(c) InsLinkDevice->put_byte(InsLinkDevice->periph, 0, c)
83
#define InsUartSend1(c) InsSend1(c)
84
#define InsSend(_dat,_len) { for (uint8_t i = 0; i< (_len); i++) InsSend1(_dat[i]); };
85
#define InsUartSetBaudrate(_b) uart_periph_set_baudrate(INS_LINK, _b)
86
87
#endif
89
static inline void ins_event_check_and_handle(void (* handler)(void))
90
{
91
struct
link_device *
dev
=
InsLinkDevice
;
92
if
(
dev
->char_available(
dev
->periph)) {
93
while
(
dev
->char_available(
dev
->periph) && !
ins_msg_received
) {
94
parse_ins_buffer
(
dev
->get_byte(
dev
->periph));
95
}
96
}
97
if
(
ins_msg_received
) {
98
parse_ins_msg
();
99
handler();
100
ins_msg_received
=
false
;
101
}
102
}
103
104
#endif
/* INS_MODULE_H */
ins.h
INS_FORMAT
#define INS_FORMAT
Definition:
ins_module.h:35
ins_pitch_neutral
float ins_pitch_neutral
Definition:
ins_arduimu.c:15
ins_psi
INS_FORMAT ins_psi
ins_r
INS_FORMAT ins_r
ins_my
INS_FORMAT ins_my
spi.h
InsLinkDevice
#define InsLinkDevice
Definition:
ins_module.h:76
ins_vx
INS_FORMAT ins_vx
ins_msg_received
volatile uint8_t ins_msg_received
Definition:
ins_vn100.c:64
ins_y
INS_FORMAT ins_y
std.h
uart.h
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
ins_z
INS_FORMAT ins_z
ins_vy
INS_FORMAT ins_vy
dev
static const struct usb_device_descriptor dev
Definition:
usb_ser_hw.c:74
ins_ax
INS_FORMAT ins_ax
uint8_t
unsigned char uint8_t
Definition:
types.h:14
ins_phi
INS_FORMAT ins_phi
parse_ins_buffer
void parse_ins_buffer(uint8_t)
ins_ay
INS_FORMAT ins_ay
ins_x
INS_FORMAT ins_x
ins_az
INS_FORMAT ins_az
handle_ins_msg
void handle_ins_msg(void)
Definition:
ins_xsens.c:154
ins_mz
INS_FORMAT ins_mz
ins_q
INS_FORMAT ins_q
ins_roll_neutral
float ins_roll_neutral
Definition:
ins_arduimu.c:14
ins_vz
INS_FORMAT ins_vz
ins_p
INS_FORMAT ins_p
ins_theta
INS_FORMAT ins_theta
new_ins_attitude
volatile uint8_t new_ins_attitude
ins_mx
INS_FORMAT ins_mx
parse_ins_msg
void parse_ins_msg(void)
Definition:
ahrs_chimu_spi.c:107
sw
airborne
modules
ins
ins_module.h
Generated on Tue Feb 1 2022 13:51:15 for Paparazzi UAS by
1.8.17