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/>.
20 #define GPS_DBHZ_MIN 0
21 #define GPS_DBHZ_MAX 55
26 #define GPS_DEGREES_DIVIDER 10000000L
45 #define SBAS_MODE_MAX SBAS_GAGAN
48 GPS_BAUDRATE_115200
= 0,
57 GPS_AUTOCONFIG_OFF
= 0,
77 #define GPS_BAUDRATE_MAX GPS_BAUDRATE_9600
79 typedef struct gpsConfig_s
{
80 gpsProvider_e provider
;
82 gpsAutoConfig_e autoConfig
;
83 gpsAutoBaud_e autoBaud
;
84 gpsNavModel_e navModel
;
87 typedef struct gpsCoordinateDDDMMmmmm_s
{
90 } gpsCoordinateDDDMMmmmm_t
;
92 /* LLH Location in NEU axis system */
93 typedef struct gpsLocation_s
{
94 int32_t lat
; // Lattitude * 1e+7
95 int32_t lon
; // Longitude * 1e+7
96 int32_t alt
; // Altitude in centimeters (meters * 100)
99 typedef struct gpsSolutionData_s
{
101 unsigned gpsHeartbeat
: 1; // Toggle each update
102 unsigned validVelNE
: 1;
103 unsigned validVelD
: 1;
104 unsigned validMag
: 1;
105 unsigned validEPE
: 1; // EPH/EPV values are valid - actual accuracy
108 gpsFixType_e fixType
;
116 int16_t groundCourse
;
118 uint16_t eph
; // horizontal accuracy (cm)
119 uint16_t epv
; // vertical accuracy (cm)
121 uint16_t hdop
; // generic HDOP value (*100)
125 uint16_t lastMessageDt
;
126 uint32_t errors
; // gps error counter - crc error/lost of data/sync etc..
128 uint32_t packetCount
;
131 extern gpsSolutionData_t gpsSol
;
132 extern gpsStatistics_t gpsStats
;
134 void gpsThread(void);
135 void updateGpsIndicator(uint32_t currentTime
);