Paparazzi UAS  v5.15_devel-50-g4d7045d
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_analog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 The Paparazzi Team
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 
27 #ifndef IMU_ANALOG_H
28 #define IMU_ANALOG_H
29 
30 
31 #define NB_ANALOG_IMU_ADC 6
32 
33 // if not all gyros are used, override the imu_scale_gyro handler
34 #if defined ADC_CHANNEL_GYRO_P && defined ADC_CHANNEL_GYRO_Q && ! defined ADC_CHANNEL_GYRO_R
35 
36 #define IMU_GYRO_R_SIGN 1
37 #define IMU_GYRO_R_NEUTRAL 0
38 #define IMU_GYRO_R_SENS_NUM 1
39 #define IMU_GYRO_R_SENS_DEN 1
40 
41 #elif defined ADC_CHANNEL_GYRO_P && ! defined ADC_CHANNEL_GYRO_Q && ! defined ADC_CHANNEL_GYRO_R
42 
43 #define IMU_GYRO_Q_SIGN 1
44 #define IMU_GYRO_Q_NEUTRAL 0
45 #define IMU_GYRO_Q_SENS_NUM 1
46 #define IMU_GYRO_Q_SENS_DEN 1
47 #define IMU_GYRO_R_SIGN 1
48 #define IMU_GYRO_R_NEUTRAL 0
49 #define IMU_GYRO_R_SENS_NUM 1
50 #define IMU_GYRO_R_SENS_DEN 1
51 
52 #endif
53 
54 #if ! defined ADC_CHANNEL_ACCEL_X && ! defined ADC_CHANNEL_ACCEL_Z && ! defined ADC_CHANNEL_ACCEL_Z
55 
56 #define IMU_ACCEL_X_SENS_NUM 1
57 #define IMU_ACCEL_X_SENS_DEN 1
58 #define IMU_ACCEL_Y_SENS_NUM 1
59 #define IMU_ACCEL_Y_SENS_DEN 1
60 #define IMU_ACCEL_Z_SENS_NUM 1
61 #define IMU_ACCEL_Z_SENS_DEN 1
62 
63 #endif
64 
65 
66 /*
67  * we include imh.h after the definitions of the neutrals
68  */
69 #include "subsystems/imu.h"
70 
71 
72 extern int imu_overrun;
73 
74 extern void imu_analog_init(void);
75 extern void imu_analog_periodic(void);
76 
77 #endif /* IMU_ANALOG_H */
int imu_overrun
Definition: imu_analog.c:26
Inertial Measurement Unit interface.
void imu_analog_periodic(void)
Definition: imu_analog.c:56
void imu_analog_init(void)
Definition: imu_analog.c:30