Thiago Lima / Mbed 2 deprecated Telemetria_RX_SD_GPS

Dependencies:   mbed BufferedSerial SX1276GenericLib X_NUCLEO_IKS01A2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UbxGpsNavSol.hh Source File

UbxGpsNavSol.hh

00001 #ifndef UBXGPSNAVSOL_H_
00002 #define UBXGPSNAVSOL_H_
00003 
00004 #include "mbed.h"
00005 
00006 #define  UBX_NAV_SOL_HEADER_1          (0xB5)
00007 #define  UBX_NAV_SOL_HEADER_2          (0x62)
00008 #define  UBX_NAV_SOL_CLASS                (0x01)
00009 #define  UBX_NAV_SOL_ID             (0x06)
00010 #define  UBX_NAV_SOL_PAYLOAD_LENGTH    (52)
00011 
00012 class UbxGpsNavSol : public UARTSerial{
00013   public:
00014     UbxGpsNavSol(PinName tx, PinName rx, int baud);
00015     virtual ~UbxGpsNavSol();
00016     
00017     uint8_t buffer [60];
00018     bool ready();
00019     void disableNmea();
00020     bool enableNAVSOL();
00021     bool changeFrequency();
00022     bool changeBaudrate();
00023     bool disableUnnecessaryChannels();
00024     bool disableGNSS();
00025     bool restoreDefaults();
00026     void baud(int baud);
00027     bool saveConfiguration();
00028     // void setLength(unsigned char length);
00029     // Type         Name           Unit     Description (scaling)
00030     unsigned long   iTOW;       // ms       GPS time of week of the navigation epoch. See the description of iTOW for
00031                                 //          details
00032     long            fTOW;       // ns       Fractional part of iTOW (range: +/-500000). The precise GPS time of week in
00033                                 //          seconds is: (iTOW * 1e-3) + (fTOW * 1e-9)
00034     short           week;       // weeks    GPS week number of the navigation epoch
00035     unsigned char   gpsFix;     // -        GPSfix Type, range 0..5
00036     char            flags;      // -        Fix Status Flags (see graphic below)
00037     long            ecefX;      // cm       ECEF X coordinate
00038     long            ecefY;      // cm       ECEF Y coordinate
00039     long            ecefZ;      // cm       ECEF Z coordinate
00040     unsigned long   pAcc;       // cm       3D Position Accuracy Estimate
00041     long            ecefVX;     // cm/s     ECEF X velocity
00042     long            ecefVY;     // cm/s     ECEF Y velocity
00043     long            ecefVZ;     // cm/s     ECEF Z velocity
00044     unsigned long   sAcc;       // cm/s     Speed Accuracy Estimate
00045     unsigned short  pDOP;       // -        Position DOP (0.01)
00046     unsigned char   reserved1;  // -        Reserved
00047     unsigned char   numSV;      // -        Number of satellites used in Nav Solution
00048     unsigned long   reserved2;  // -        Reserved
00049 
00050   private:
00051     bool calculateChecksum(unsigned char *data);
00052     // Class properties
00053     unsigned char offsetClassProperties;
00054     unsigned char offsetHeaders;
00055     unsigned char size;
00056     unsigned char carriagePosition;
00057     unsigned char checksum[2];
00058 
00059     // Headers (common).
00060     unsigned char headerClass;
00061     unsigned char headerId;
00062     unsigned short headerLength;
00063     uint16_t payload_length;
00064 };
00065 #endif
00066