RX

Dependencies:   mbed BufferedSerial SX1276GenericLib X_NUCLEO_IKS01A2

Committer:
TMRL123
Date:
Wed Jun 05 00:23:37 2019 +0000
Revision:
0:674f1e460248
Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TMRL123 0:674f1e460248 1 #ifndef UBXGPSNAVSOL_H_
TMRL123 0:674f1e460248 2 #define UBXGPSNAVSOL_H_
TMRL123 0:674f1e460248 3
TMRL123 0:674f1e460248 4 #include "mbed.h"
TMRL123 0:674f1e460248 5
TMRL123 0:674f1e460248 6 #define UBX_NAV_SOL_HEADER_1 (0xB5)
TMRL123 0:674f1e460248 7 #define UBX_NAV_SOL_HEADER_2 (0x62)
TMRL123 0:674f1e460248 8 #define UBX_NAV_SOL_CLASS (0x01)
TMRL123 0:674f1e460248 9 #define UBX_NAV_SOL_ID (0x06)
TMRL123 0:674f1e460248 10 #define UBX_NAV_SOL_PAYLOAD_LENGTH (52)
TMRL123 0:674f1e460248 11
TMRL123 0:674f1e460248 12 class UbxGpsNavSol : public UARTSerial{
TMRL123 0:674f1e460248 13 public:
TMRL123 0:674f1e460248 14 UbxGpsNavSol(PinName tx, PinName rx, int baud);
TMRL123 0:674f1e460248 15 virtual ~UbxGpsNavSol();
TMRL123 0:674f1e460248 16
TMRL123 0:674f1e460248 17 uint8_t buffer [60];
TMRL123 0:674f1e460248 18 bool ready();
TMRL123 0:674f1e460248 19 void disableNmea();
TMRL123 0:674f1e460248 20 bool enableNAVSOL();
TMRL123 0:674f1e460248 21 bool changeFrequency();
TMRL123 0:674f1e460248 22 bool changeBaudrate();
TMRL123 0:674f1e460248 23 bool disableUnnecessaryChannels();
TMRL123 0:674f1e460248 24 bool disableGNSS();
TMRL123 0:674f1e460248 25 bool restoreDefaults();
TMRL123 0:674f1e460248 26 void baud(int baud);
TMRL123 0:674f1e460248 27 bool saveConfiguration();
TMRL123 0:674f1e460248 28 // void setLength(unsigned char length);
TMRL123 0:674f1e460248 29 // Type Name Unit Description (scaling)
TMRL123 0:674f1e460248 30 unsigned long iTOW; // ms GPS time of week of the navigation epoch. See the description of iTOW for
TMRL123 0:674f1e460248 31 // details
TMRL123 0:674f1e460248 32 long fTOW; // ns Fractional part of iTOW (range: +/-500000). The precise GPS time of week in
TMRL123 0:674f1e460248 33 // seconds is: (iTOW * 1e-3) + (fTOW * 1e-9)
TMRL123 0:674f1e460248 34 short week; // weeks GPS week number of the navigation epoch
TMRL123 0:674f1e460248 35 unsigned char gpsFix; // - GPSfix Type, range 0..5
TMRL123 0:674f1e460248 36 char flags; // - Fix Status Flags (see graphic below)
TMRL123 0:674f1e460248 37 long ecefX; // cm ECEF X coordinate
TMRL123 0:674f1e460248 38 long ecefY; // cm ECEF Y coordinate
TMRL123 0:674f1e460248 39 long ecefZ; // cm ECEF Z coordinate
TMRL123 0:674f1e460248 40 unsigned long pAcc; // cm 3D Position Accuracy Estimate
TMRL123 0:674f1e460248 41 long ecefVX; // cm/s ECEF X velocity
TMRL123 0:674f1e460248 42 long ecefVY; // cm/s ECEF Y velocity
TMRL123 0:674f1e460248 43 long ecefVZ; // cm/s ECEF Z velocity
TMRL123 0:674f1e460248 44 unsigned long sAcc; // cm/s Speed Accuracy Estimate
TMRL123 0:674f1e460248 45 unsigned short pDOP; // - Position DOP (0.01)
TMRL123 0:674f1e460248 46 unsigned char reserved1; // - Reserved
TMRL123 0:674f1e460248 47 unsigned char numSV; // - Number of satellites used in Nav Solution
TMRL123 0:674f1e460248 48 unsigned long reserved2; // - Reserved
TMRL123 0:674f1e460248 49
TMRL123 0:674f1e460248 50 private:
TMRL123 0:674f1e460248 51 bool calculateChecksum(unsigned char *data);
TMRL123 0:674f1e460248 52 // Class properties
TMRL123 0:674f1e460248 53 unsigned char offsetClassProperties;
TMRL123 0:674f1e460248 54 unsigned char offsetHeaders;
TMRL123 0:674f1e460248 55 unsigned char size;
TMRL123 0:674f1e460248 56 unsigned char carriagePosition;
TMRL123 0:674f1e460248 57 unsigned char checksum[2];
TMRL123 0:674f1e460248 58
TMRL123 0:674f1e460248 59 // Headers (common).
TMRL123 0:674f1e460248 60 unsigned char headerClass;
TMRL123 0:674f1e460248 61 unsigned char headerId;
TMRL123 0:674f1e460248 62 unsigned short headerLength;
TMRL123 0:674f1e460248 63 uint16_t payload_length;
TMRL123 0:674f1e460248 64 };
TMRL123 0:674f1e460248 65 #endif
TMRL123 0:674f1e460248 66