Mbed library to handle GPS data reception and parsing

Dependents:   GPS_U-blox_NEO-6M_Code

Features

  • All positionning parameters are contained into a global data structure.
  • Automatic nema string parsing and data structure update.
    • GSA,GGA,VTG and RMC
  • Convert latitude and longitude to decimal value.
  • Converts latittude,longitude and altitude to ECEF coordinates.

Planed developement

  • Test library for RTOS use.
  • Complete the nema parsing decoders (couple of parameters are not parsed yet and not present in the data structure).
  • Add conversion tool to get ENU coordinates.
Committer:
chris215
Date:
Sun Feb 14 05:55:38 2016 +0000
Revision:
2:72ac4d7044a7
Parent:
0:0c1aa5906cef
Child:
4:d911d7c4e09d
Modified librairy to increase performance. Reduced interrupt overhead by removing most of the nema parsing.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris215 0:0c1aa5906cef 1 #ifndef _MBED_GPS_H_
chris215 0:0c1aa5906cef 2 #define _MBED_GPS_H_
chris215 0:0c1aa5906cef 3 #include "mbedGPSDefs.h"
chris215 0:0c1aa5906cef 4 #include "mbed.h"
chris215 2:72ac4d7044a7 5 #define MESSAGE_QUEUE_SIZE 20
chris215 0:0c1aa5906cef 6
chris215 0:0c1aa5906cef 7
chris215 0:0c1aa5906cef 8
chris215 0:0c1aa5906cef 9
chris215 0:0c1aa5906cef 10 class GPS : RawSerial{
chris215 0:0c1aa5906cef 11 public:
chris215 0:0c1aa5906cef 12 GPS(PinName TxPin,PinName RxPin);
chris215 0:0c1aa5906cef 13
chris215 0:0c1aa5906cef 14 void SetBaud(int rate);
chris215 0:0c1aa5906cef 15
chris215 0:0c1aa5906cef 16 ECEFPoint ReadPositionECEF(void);
chris215 0:0c1aa5906cef 17
chris215 0:0c1aa5906cef 18 ECEFDistance DistanceBetweenTwoWP(ECEFPoint p1,ECEFPoint p2);
chris215 0:0c1aa5906cef 19
chris215 0:0c1aa5906cef 20 geodPoint ReadDecGeodLoc(void);
chris215 0:0c1aa5906cef 21 geodPoint ReadRawGeodLoc(void);
chris215 0:0c1aa5906cef 22
chris215 0:0c1aa5906cef 23 bool FixIs3d(void);
chris215 0:0c1aa5906cef 24 bool FixIs2d(void);
chris215 0:0c1aa5906cef 25 bool GPSFixValid(void);
chris215 0:0c1aa5906cef 26
chris215 0:0c1aa5906cef 27 GPSInfo info; //current gps information
chris215 2:72ac4d7044a7 28
chris215 2:72ac4d7044a7 29 void PumpGpsMessages(void);
chris215 2:72ac4d7044a7 30
chris215 0:0c1aa5906cef 31 private:
chris215 0:0c1aa5906cef 32 void RxIrqHandler(void);
chris215 2:72ac4d7044a7 33 message GPSRMCMessage;
chris215 2:72ac4d7044a7 34 message GPSVTGMessage;
chris215 2:72ac4d7044a7 35 message GPSGSAMessage;
chris215 2:72ac4d7044a7 36 message GPSGGAMessage;
chris215 0:0c1aa5906cef 37 message RxMessageBuffer;
chris215 2:72ac4d7044a7 38 uint32_t RxQueueSize;
chris215 2:72ac4d7044a7 39 uint32_t RxQueueWriteIndex;
chris215 2:72ac4d7044a7 40 uint32_t RxQueueReadIndex;
chris215 0:0c1aa5906cef 41 char insertIndex;
chris215 0:0c1aa5906cef 42 };
chris215 0:0c1aa5906cef 43
chris215 0:0c1aa5906cef 44 #endif