Merge remote-tracking branch 'origin/master' into mmosca-mavlinkrc
[inav.git] / src / main / msp / msp_protocol_v2_sensor_msg.h
blob4ff03248855cf35891a61956e817c08edc9d377b
1 /*
2 * This file is part of INAV Project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
25 #pragma once
27 typedef struct __attribute__((packed)) {
28 uint8_t quality; // [0;255]
29 int32_t motionX;
30 int32_t motionY;
31 } mspSensorOpflowDataMessage_t;
33 typedef struct __attribute__((packed)) {
34 uint8_t quality; // [0;255]
35 int32_t distanceMm; // Negative value for out of range
36 } mspSensorRangefinderDataMessage_t;
38 typedef struct __attribute__((packed)) {
39 uint8_t instance; // sensor instance number to support multi-sensor setups
40 uint16_t gpsWeek; // GPS week, 0xFFFF if not available
41 uint32_t msTOW;
42 uint8_t fixType;
43 uint8_t satellitesInView;
44 uint16_t horizontalPosAccuracy; // [cm]
45 uint16_t verticalPosAccuracy; // [cm]
46 uint16_t horizontalVelAccuracy; // [cm/s]
47 uint16_t hdop;
48 int32_t longitude;
49 int32_t latitude;
50 int32_t mslAltitude; // cm
51 int32_t nedVelNorth; // cm/s
52 int32_t nedVelEast;
53 int32_t nedVelDown;
54 uint16_t groundCourse; // deg * 100, 0..36000
55 uint16_t trueYaw; // deg * 100, values of 0..36000 are valid. 65535 = no data available
56 uint16_t year;
57 uint8_t month;
58 uint8_t day;
59 uint8_t hour;
60 uint8_t min;
61 uint8_t sec;
62 } mspSensorGpsDataMessage_t;
64 typedef struct __attribute__((packed)) {
65 uint8_t instance;
66 uint32_t timeMs;
67 float pressurePa;
68 int16_t temp; // centi-degrees C
69 } mspSensorBaroDataMessage_t;
71 typedef struct __attribute__((packed)) {
72 uint8_t instance;
73 uint32_t timeMs;
74 float diffPressurePa;
75 int16_t temp; // centi-degrees C
76 } mspSensorAirspeedDataMessage_t;
78 typedef struct __attribute__((packed)) {
79 uint8_t instance;
80 uint32_t timeMs;
81 int16_t magX; // mGauss, front
82 int16_t magY; // mGauss, right
83 int16_t magZ; // mGauss, down
84 } mspSensorCompassDataMessage_t;