feat: add U-BLOX GPS support (#4689)

This commit is contained in:
David PHAM-VAN
2024-04-08 08:36:45 +10:00
committed by GitHub
parent 9ed9227212
commit 4b8f80af3a
13 changed files with 1536 additions and 262 deletions
+9 -2
View File
@@ -22,6 +22,7 @@
#ifndef _GPS_H_
#define _GPS_H_
#include "opentx.h"
#include <inttypes.h>
struct gpsdata_t
@@ -32,7 +33,7 @@ struct gpsdata_t
uint8_t numSat;
uint32_t packetCount;
uint32_t errorCount;
uint16_t altitude; // altitude in 0.1m
int32_t altitude; // altitude in 0.1m
uint16_t speed; // speed in 0.1m/s
uint16_t groundCourse; // degrees * 10
uint16_t hdop;
@@ -44,8 +45,12 @@ extern gpsdata_t gpsData;
extern uint8_t gpsTraceEnabled;
#endif
#define GPS_PROTOCOL_AUTO 0
#define GPS_PROTOCOL_NMEA 1
#define GPS_PROTOCOL_UBX 2
// Setup GPS serial port
void gpsSetSerialDriver(void* ctx, const etx_serial_driver_t* drv);
void gpsSetSerialDriver(void* ctx, const etx_serial_driver_t* drv, int protocol);
// Periodic processing
void gpsWakeup();
@@ -53,4 +58,6 @@ void gpsWakeup();
// Send a 0-terminated frame
void gpsSendFrame(const char * frame);
uint32_t GPS_coord_to_degrees(const char * coordinateString);
#endif // _GPS_H_