Paparazzi UAS  v5.15_devel-59-g8c145b7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_umarim.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Gautier Hattenberger
3  * Derived from Aspirin and ppzuavimu drivers
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
32 #ifndef IMU_UMARIM_H
33 #define IMU_UMARIM_H
34 
35 #include "std.h"
36 #include "generated/airframe.h"
37 #include "subsystems/imu.h"
38 
39 #include "peripherals/itg3200.h"
41 
42 // Default configuration
43 #if !defined IMU_GYRO_P_SIGN & !defined IMU_GYRO_Q_SIGN & !defined IMU_GYRO_R_SIGN
44 #define IMU_GYRO_P_SIGN 1
45 #define IMU_GYRO_Q_SIGN 1
46 #define IMU_GYRO_R_SIGN 1
47 #endif
48 #if !defined IMU_ACCEL_X_SIGN & !defined IMU_ACCEL_Y_SIGN & !defined IMU_ACCEL_Z_SIGN
49 #define IMU_ACCEL_X_SIGN 1
50 #define IMU_ACCEL_Y_SIGN 1
51 #define IMU_ACCEL_Z_SIGN 1
52 #endif
53 
59 #if !defined IMU_GYRO_P_SENS & !defined IMU_GYRO_Q_SENS & !defined IMU_GYRO_R_SENS
60 #define IMU_GYRO_P_SENS 4.973
61 #define IMU_GYRO_P_SENS_NUM 4973
62 #define IMU_GYRO_P_SENS_DEN 1000
63 #define IMU_GYRO_Q_SENS 4.973
64 #define IMU_GYRO_Q_SENS_NUM 4973
65 #define IMU_GYRO_Q_SENS_DEN 1000
66 #define IMU_GYRO_R_SENS 4.973
67 #define IMU_GYRO_R_SENS_NUM 4973
68 #define IMU_GYRO_R_SENS_DEN 1000
69 #endif
70 #if !defined IMU_GYRO_P_NEUTRAL & !defined IMU_GYRO_Q_NEUTRAL & !defined IMU_GYRO_R_NEUTRAL
71 #define IMU_GYRO_P_NEUTRAL 0
72 #define IMU_GYRO_Q_NEUTRAL 0
73 #define IMU_GYRO_R_NEUTRAL 0
74 #endif
75 
76 
88 #if !defined IMU_ACCEL_X_SENS & !defined IMU_ACCEL_Y_SENS & !defined IMU_ACCEL_Z_SENS
89 #define IMU_ACCEL_X_SENS 37.91
90 #define IMU_ACCEL_X_SENS_NUM 3791
91 #define IMU_ACCEL_X_SENS_DEN 100
92 #define IMU_ACCEL_Y_SENS 37.91
93 #define IMU_ACCEL_Y_SENS_NUM 3791
94 #define IMU_ACCEL_Y_SENS_DEN 100
95 #define IMU_ACCEL_Z_SENS 39.24
96 #define IMU_ACCEL_Z_SENS_NUM 39.24
97 #define IMU_ACCEL_Z_SENS_DEN 100
98 #endif
99 #if !defined IMU_ACCEL_X_NEUTRAL & !defined IMU_ACCEL_Y_NEUTRAL & !defined IMU_ACCEL_Z_NEUTRAL
100 #define IMU_ACCEL_X_NEUTRAL 0
101 #define IMU_ACCEL_Y_NEUTRAL 0
102 #define IMU_ACCEL_Z_NEUTRAL 0
103 #endif
104 
105 extern volatile bool gyr_valid;
106 extern volatile bool acc_valid;
107 
108 struct ImuUmarim {
109  struct Itg3200 itg;
111 };
112 
113 extern struct ImuUmarim imu_umarim;
114 
115 extern void imu_umarim_init(void);
116 extern void imu_umarim_periodic(void);
117 extern void imu_umarim_event(void);
118 extern void imu_umarim_downlink_raw(void);
119 
120 #endif // PPZUAVIMU_H
volatile bool gyr_valid
void imu_umarim_periodic(void)
Definition: imu_umarim.c:83
struct Adxl345_I2c adxl
Definition: imu_umarim.h:110
void imu_umarim_init(void)
Definition: imu_umarim.c:66
void imu_umarim_downlink_raw(void)
Definition: imu_umarim.c:94
struct ImuUmarim imu_umarim
Definition: imu_umarim.c:64
volatile bool acc_valid
void imu_umarim_event(void)
Definition: imu_umarim.c:103
Driver for the gyro ITG3200 from InvenSense.
Inertial Measurement Unit interface.
Driver for the accelerometer ADXL345 from Analog Devices using I2C.
struct Itg3200 itg
Definition: imu_umarim.h:109