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/>.
22 #define GPS_HDOP_TO_EPH_MULTIPLIER 2 // empirical value
26 GPS_INITIALIZING
, // 1
28 GPS_CHECK_VERSION
, // 3
30 GPS_RECEIVING_DATA
, // 5
31 GPS_LOST_COMMUNICATION
, // 6
35 gpsConfig_t
* gpsConfig
;
36 serialConfig_t
* serialConfig
;
37 serialPort_t
* gpsPort
; // Serial GPS only
42 gpsBaudRate_e baudrateIndex
;
43 gpsBaudRate_e autoBaudrateIndex
; // Driver internal use (for autoBaud)
44 uint8_t autoConfigStep
; // Driver internal use (for autoConfig)
45 uint8_t autoConfigPosition
; // Driver internal use (for autoConfig)
47 uint32_t lastStateSwitchMs
;
48 uint32_t lastLastMessageMs
;
49 uint32_t lastMessageMs
;
52 extern gpsReceiverData_t gpsState
;
54 extern baudRate_e gpsToSerialBaudRate
[GPS_BAUDRATE_COUNT
];
56 extern void gpsSetState(gpsState_e state
);
57 extern void gpsFinalizeChangeBaud(void);
59 extern uint16_t gpsConstrainEPE(uint32_t epe
);
60 extern uint16_t gpsConstrainHDOP(uint32_t hdop
);
62 extern bool gpsHandleNMEA(void);
63 extern bool gpsHandleUBLOX(void);
64 extern bool gpsHandleI2CNAV(void);
65 extern bool gpsDetectI2CNAV(void);
66 extern bool gpsHandleNAZA(void);