Multiple telemtry providers can now be active at the same time on any
[betaflight.git] / src / main / telemetry / telemetry.h
blob49b309a043849d5df26275f9f06c101a7a5ee3f5
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight 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.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
19 * telemetry.h
21 * Created on: 6 Apr 2014
22 * Author: Hydra
25 #ifndef TELEMETRY_COMMON_H_
26 #define TELEMETRY_COMMON_H_
28 typedef enum {
29 FRSKY_FORMAT_DMS = 0,
30 FRSKY_FORMAT_NMEA
31 } frskyGpsCoordFormat_e;
33 typedef enum {
34 FRSKY_UNIT_METRICS = 0,
35 FRSKY_UNIT_IMPERIALS
36 } frskyUnit_e;
38 typedef struct telemetryConfig_s {
39 uint8_t telemetry_switch; // Use aux channel to change serial output & baudrate( MSP / Telemetry ). It disables automatic switching to Telemetry when armed.
40 serialInversion_e telemetry_inversion; // also shared with smartport inversion
41 float gpsNoFixLatitude;
42 float gpsNoFixLongitude;
43 frskyGpsCoordFormat_e frsky_coordinate_format;
44 frskyUnit_e frsky_unit;
45 } telemetryConfig_t;
47 void checkTelemetryState(void);
48 void handleTelemetry(void);
50 bool determineNewTelemetryEnabledState(portSharing_e portSharing);
52 void useTelemetryConfig(telemetryConfig_t *telemetryConfig);
54 #endif /* TELEMETRY_COMMON_H_ */