Allows for a GPS module to be connected to a serial port and exposes an easy to use API to get the GPS data. New feature, added Mbed/LPC17xx RTC synchronisation

Dependents:   SatGPS AntiTheftGPS FLIGHT_CONTROL_AND_COMMUNICATIONS_SYSTEM GPS-Lora ... more

Committer:
AjK
Date:
Thu Apr 21 14:06:17 2011 +0000
Revision:
6:64771e31464e
Parent:
4:1e3a53f150aa
1.16 See ChangeLog.c

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AjK 2:8aa059e7d8b1 1 /*
AjK 2:8aa059e7d8b1 2 Copyright (c) 2010 Andy Kirkham
AjK 2:8aa059e7d8b1 3
AjK 2:8aa059e7d8b1 4 Permission is hereby granted, free of charge, to any person obtaining a copy
AjK 2:8aa059e7d8b1 5 of this software and associated documentation files (the "Software"), to deal
AjK 2:8aa059e7d8b1 6 in the Software without restriction, including without limitation the rights
AjK 2:8aa059e7d8b1 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
AjK 2:8aa059e7d8b1 8 copies of the Software, and to permit persons to whom the Software is
AjK 2:8aa059e7d8b1 9 furnished to do so, subject to the following conditions:
AjK 2:8aa059e7d8b1 10
AjK 2:8aa059e7d8b1 11 The above copyright notice and this permission notice shall be included in
AjK 2:8aa059e7d8b1 12 all copies or substantial portions of the Software.
AjK 2:8aa059e7d8b1 13
AjK 2:8aa059e7d8b1 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
AjK 2:8aa059e7d8b1 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
AjK 2:8aa059e7d8b1 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AjK 2:8aa059e7d8b1 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
AjK 2:8aa059e7d8b1 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
AjK 2:8aa059e7d8b1 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
AjK 2:8aa059e7d8b1 20 THE SOFTWARE.
AjK 2:8aa059e7d8b1 21 */
AjK 2:8aa059e7d8b1 22
AjK 2:8aa059e7d8b1 23 #ifndef GPS_VTG_H
AjK 2:8aa059e7d8b1 24 #define GPS_VTG_H
AjK 2:8aa059e7d8b1 25
AjK 2:8aa059e7d8b1 26 #include "mbed.h"
AjK 2:8aa059e7d8b1 27
AjK 2:8aa059e7d8b1 28 /** GPS_Time definition.
AjK 2:8aa059e7d8b1 29 */
AjK 2:8aa059e7d8b1 30 class GPS_VTG {
AjK 2:8aa059e7d8b1 31 public:
AjK 2:8aa059e7d8b1 32
AjK 2:8aa059e7d8b1 33 //! The velocity (in knots)
AjK 2:8aa059e7d8b1 34 double _velocity_knots;
AjK 2:8aa059e7d8b1 35 //! The velocity (in kph)
AjK 2:8aa059e7d8b1 36 double _velocity_kph;
AjK 2:8aa059e7d8b1 37 //! The track (in decimal degrees true)
AjK 2:8aa059e7d8b1 38 double _track_true;
AjK 2:8aa059e7d8b1 39 //! The track (in decimal degrees magnetic)
AjK 2:8aa059e7d8b1 40 double _track_mag;
AjK 2:8aa059e7d8b1 41
AjK 2:8aa059e7d8b1 42 GPS_VTG();
AjK 2:8aa059e7d8b1 43 GPS_VTG * vtg(GPS_VTG *n);
AjK 2:8aa059e7d8b1 44 void nmea_vtg(char *s);
AjK 2:8aa059e7d8b1 45
AjK 2:8aa059e7d8b1 46 double velocity_knots(void) { return _velocity_knots; }
AjK 2:8aa059e7d8b1 47 double velocity_kph(void) { return _velocity_kph; }
AjK 2:8aa059e7d8b1 48 double track_true(void) { return _track_true; }
AjK 2:8aa059e7d8b1 49 double track_mag(void) { return _track_mag; }
AjK 2:8aa059e7d8b1 50
AjK 2:8aa059e7d8b1 51 };
AjK 2:8aa059e7d8b1 52
AjK 2:8aa059e7d8b1 53 #endif
AjK 2:8aa059e7d8b1 54