2018 revision to classic DataBus AVC code.

Dependencies:   LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell

Revision:
16:eb28d0f64a9b
Child:
18:3f8a8f6e3cc1
diff -r 35c40765f7c3 -r eb28d0f64a9b Ublox6.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Ublox6.h	Thu Dec 13 17:35:29 2018 +0000
@@ -0,0 +1,75 @@
+#ifndef __UBLOX6_H
+#define __UBLOX6_H
+
+/** uBlox GPS UBX Protocol Reader
+ * Parses uBlox GPS binary protocol
+ * 
+ * @author Wayne Holder; Ported to mbed by Michael Shimniok
+ */
+#include "mbed.h"
+
+class Ublox6 {
+public:
+    // TODO 3 convert this to time units
+    static const int lag=40;        // number of updater steps by which gps output lags reality
+
+    /**
+     * UBX protocol parser (Wayne Holder)
+     * @param cc is the character to parse
+     * @note stores parsed gps data in member variables and sets _available
+     * to true to indicate gps data is waiting.
+     */    
+    void parse(unsigned char cc);
+
+    /**
+     * get latitude
+     */    
+    double latitude(void);   
+    
+    /**
+     * get longitude
+     */
+    double longitude(void);
+
+    /**
+     * Get Horizontal Dilution of Precision
+     * @return float horizontal dilution of precision
+     */
+    float hdop(void);
+
+    /**
+     * get count of active satellites
+     */
+    int sat_count(void);
+
+    /**
+     * get speed in m/s
+     */    
+    float speed_mps(void);
+    
+    /**
+     * get heading in degrees
+     */
+    float heading_deg(void);
+    
+    /**
+     * determine if data is available to be used
+     */
+    bool available(void);
+    
+    /**
+     * reset the data available flag
+     */
+    void reset_available(void);
+
+private:
+    int _available;     // is data available?
+    float _latitude;        // temp storage, latitude
+    float _longitude;       // temp storage, longitude
+    float _hdop;            // horiz dilution of precision
+    float _course_deg;      // course in degrees
+    float _speed_mps;       // speed in m/s
+    int _sat_count;         // satellite count
+};
+
+#endif