Merge pull request #11195 from mathiasvr/pr-elrs-clean
[betaflight.git] / src / main / sensors / sensors.h
blob80367d12f889aecd9cbae9d370abc84d4735338b
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 typedef enum {
24 SENSOR_INDEX_GYRO = 0,
25 SENSOR_INDEX_ACC,
26 SENSOR_INDEX_BARO,
27 SENSOR_INDEX_MAG,
28 SENSOR_INDEX_RANGEFINDER,
29 SENSOR_INDEX_COUNT
30 } sensorIndex_e;
32 extern uint8_t requestedSensors[SENSOR_INDEX_COUNT];
33 extern uint8_t detectedSensors[SENSOR_INDEX_COUNT];
35 typedef struct int16_flightDynamicsTrims_s {
36 int16_t roll;
37 int16_t pitch;
38 int16_t yaw;
39 int16_t calibrationCompleted;
40 } flightDynamicsTrims_def_t;
42 typedef union flightDynamicsTrims_u {
43 int16_t raw[4];
44 flightDynamicsTrims_def_t values;
45 } flightDynamicsTrims_t;
47 typedef enum {
48 SENSOR_GYRO = 1 << 0, // always present
49 SENSOR_ACC = 1 << 1,
50 SENSOR_BARO = 1 << 2,
51 SENSOR_MAG = 1 << 3,
52 SENSOR_SONAR = 1 << 4,
53 SENSOR_RANGEFINDER = 1 << 4,
54 SENSOR_GPS = 1 << 5,
55 SENSOR_GPSMAG = 1 << 6
56 } sensors_e;