Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_aspirin2.h
Go to the documentation of this file.
1 /*
2  * This file is part of paparazzi.
3  *
4  * paparazzi is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  * paparazzi is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with paparazzi; see the file COPYING. If not, write to
16  * the Free Software Foundation, 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  */
20 
21 #ifndef PPZUAVIMU_H
22 #define PPZUAVIMU_H
23 
24 #include "std.h"
25 #include "subsystems/imu.h"
26 
27 extern volatile bool_t gyr_valid;
28 extern volatile bool_t acc_valid;
29 extern volatile bool_t mag_valid;
30 
31 /* must be defined in order to be IMU code: declared in imu.h
32 extern void imu_impl_init(void);
33 extern void imu_periodic(void);
34 */
35 
36 #define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \
37  aspirin2_subsystem_event(); \
38  if (gyr_valid) { \
39  gyr_valid = FALSE; \
40  _gyro_handler(); \
41  } \
42  if (acc_valid) { \
43  acc_valid = FALSE; \
44  _accel_handler(); \
45  } \
46  if (mag_valid) { \
47  mag_valid = FALSE; \
48  _mag_handler(); \
49  } \
50 }
51 
52 /* Own Extra Functions */
53 extern void aspirin2_subsystem_event( void );
54 extern void aspirin2_subsystem_downlink_raw( void );
55 
56 
57 #endif // PPZUAVIMU_H
void aspirin2_subsystem_downlink_raw(void)
Definition: imu_aspirin2.c:183
volatile bool_t acc_valid
Definition: imu_aspirin2.c:43
void aspirin2_subsystem_event(void)
Definition: imu_aspirin2.c:190
volatile bool_t mag_valid
Definition: imu_aspirin2.c:41
volatile bool_t gyr_valid
Definition: imu_aspirin2.c:42
Inertial Measurement Unit interface.