A porting of a GPS decoding and presenting program within the mbos RTOS. It is not a definitive application but a study program to test NMEA full decoding library and a first approach to an RTOS. Many thanks to Andrew Levido for his support and his patience on teaching me the RTOS principles from the other side of the Earth. It uses NMEA library by Tim (xtimor@gmail.com) ported by Ken Todotani (http://mbed.org/users/todotani/) on public mbed library (http://mbed.org/users/todotani/programs/GPS_nmeaLib/5yo4h) also available, as original universal C library, on http://nmea.sourceforge.net

Dependencies:   mbos Watchdog TextLCD mbed ConfigFile

Committer:
guiott
Date:
Fri Feb 03 16:29:52 2012 +0000
Revision:
3:a2f9eb3b8a16
Parent:
0:d177c0087d1f

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
guiott 0:d177c0087d1f 1 /*
guiott 0:d177c0087d1f 2 *
guiott 0:d177c0087d1f 3 * NMEA library
guiott 0:d177c0087d1f 4 * URL: http://nmea.sourceforge.net
guiott 0:d177c0087d1f 5 * Author: Tim (xtimor@gmail.com)
guiott 0:d177c0087d1f 6 * Licence: http://www.gnu.org/licenses/lgpl.html
guiott 0:d177c0087d1f 7 * $Id: info.h 10 2007-11-15 14:50:15Z xtimor $
guiott 0:d177c0087d1f 8 *
guiott 0:d177c0087d1f 9 */
guiott 0:d177c0087d1f 10
guiott 0:d177c0087d1f 11 /*! \file */
guiott 0:d177c0087d1f 12
guiott 0:d177c0087d1f 13 #ifndef __NMEA_INFO_H__
guiott 0:d177c0087d1f 14 #define __NMEA_INFO_H__
guiott 0:d177c0087d1f 15
guiott 0:d177c0087d1f 16 #include "time.h"
guiott 0:d177c0087d1f 17
guiott 0:d177c0087d1f 18 #define NMEA_SIG_BAD (0)
guiott 0:d177c0087d1f 19 #define NMEA_SIG_LOW (1)
guiott 0:d177c0087d1f 20 #define NMEA_SIG_MID (2)
guiott 0:d177c0087d1f 21 #define NMEA_SIG_HIGH (3)
guiott 0:d177c0087d1f 22
guiott 0:d177c0087d1f 23 #define NMEA_FIX_BAD (1)
guiott 0:d177c0087d1f 24 #define NMEA_FIX_2D (2)
guiott 0:d177c0087d1f 25 #define NMEA_FIX_3D (3)
guiott 0:d177c0087d1f 26
guiott 0:d177c0087d1f 27 #define NMEA_MAXSAT (12)
guiott 0:d177c0087d1f 28 #define NMEA_SATINPACK (4)
guiott 0:d177c0087d1f 29 #define NMEA_NSATPACKS (NMEA_MAXSAT / NMEA_SATINPACK)
guiott 0:d177c0087d1f 30
guiott 0:d177c0087d1f 31 #define NMEA_DEF_LAT (5001.2621)
guiott 0:d177c0087d1f 32 #define NMEA_DEF_LON (3613.0595)
guiott 0:d177c0087d1f 33
guiott 0:d177c0087d1f 34 #ifdef __cplusplus
guiott 0:d177c0087d1f 35 extern "C" {
guiott 0:d177c0087d1f 36 #endif
guiott 0:d177c0087d1f 37
guiott 0:d177c0087d1f 38 /**
guiott 0:d177c0087d1f 39 * Position data in fractional degrees or radians
guiott 0:d177c0087d1f 40 */
guiott 0:d177c0087d1f 41 typedef struct _nmeaPOS
guiott 0:d177c0087d1f 42 {
guiott 0:d177c0087d1f 43 double lat; /**< Latitude */
guiott 0:d177c0087d1f 44 double lon; /**< Longitude */
guiott 0:d177c0087d1f 45
guiott 0:d177c0087d1f 46 } nmeaPOS;
guiott 0:d177c0087d1f 47
guiott 0:d177c0087d1f 48 /**
guiott 0:d177c0087d1f 49 * Information about satellite
guiott 0:d177c0087d1f 50 * @see nmeaSATINFO
guiott 0:d177c0087d1f 51 * @see nmeaGPGSV
guiott 0:d177c0087d1f 52 */
guiott 0:d177c0087d1f 53 typedef struct _nmeaSATELLITE
guiott 0:d177c0087d1f 54 {
guiott 0:d177c0087d1f 55 int id; /**< Satellite PRN number */
guiott 0:d177c0087d1f 56 int in_use; /**< Used in position fix */
guiott 0:d177c0087d1f 57 int elv; /**< Elevation in degrees, 90 maximum */
guiott 0:d177c0087d1f 58 int azimuth; /**< Azimuth, degrees from true north, 000 to 359 */
guiott 0:d177c0087d1f 59 int sig; /**< Signal, 00-99 dB */
guiott 0:d177c0087d1f 60
guiott 0:d177c0087d1f 61 } nmeaSATELLITE;
guiott 0:d177c0087d1f 62
guiott 0:d177c0087d1f 63 /**
guiott 0:d177c0087d1f 64 * Information about all satellites in view
guiott 0:d177c0087d1f 65 * @see nmeaINFO
guiott 0:d177c0087d1f 66 * @see nmeaGPGSV
guiott 0:d177c0087d1f 67 */
guiott 0:d177c0087d1f 68 typedef struct _nmeaSATINFO
guiott 0:d177c0087d1f 69 {
guiott 0:d177c0087d1f 70 int inuse; /**< Number of satellites in use (not those in view) */
guiott 0:d177c0087d1f 71 int inview; /**< Total number of satellites in view */
guiott 0:d177c0087d1f 72 nmeaSATELLITE sat[NMEA_MAXSAT]; /**< Satellites information */
guiott 0:d177c0087d1f 73
guiott 0:d177c0087d1f 74 } nmeaSATINFO;
guiott 0:d177c0087d1f 75
guiott 0:d177c0087d1f 76 /**
guiott 0:d177c0087d1f 77 * Summary GPS information from all parsed packets,
guiott 0:d177c0087d1f 78 * used also for generating NMEA stream
guiott 0:d177c0087d1f 79 * @see nmea_parse
guiott 0:d177c0087d1f 80 * @see nmea_GPGGA2info, nmea_...2info
guiott 0:d177c0087d1f 81 */
guiott 0:d177c0087d1f 82 typedef struct _nmeaINFO
guiott 0:d177c0087d1f 83 {
guiott 0:d177c0087d1f 84 int smask; /**< Mask specifying types of packages from which data have been obtained */
guiott 0:d177c0087d1f 85
guiott 0:d177c0087d1f 86 nmeaTIME utc; /**< UTC of position */
guiott 0:d177c0087d1f 87
guiott 0:d177c0087d1f 88 int sig; /**< GPS quality indicator (0 = Invalid; 1 = Fix; 2 = Differential, 3 = Sensitive) */
guiott 0:d177c0087d1f 89 int fix; /**< Operating mode, used for navigation (1 = Fix not available; 2 = 2D; 3 = 3D) */
guiott 0:d177c0087d1f 90
guiott 0:d177c0087d1f 91 double PDOP; /**< Position Dilution Of Precision */
guiott 0:d177c0087d1f 92 double HDOP; /**< Horizontal Dilution Of Precision */
guiott 0:d177c0087d1f 93 double VDOP; /**< Vertical Dilution Of Precision */
guiott 0:d177c0087d1f 94
guiott 0:d177c0087d1f 95 double lat; /**< Latitude in NDEG - +/-[degree][min].[sec/60] */
guiott 0:d177c0087d1f 96 double lon; /**< Longitude in NDEG - +/-[degree][min].[sec/60] */
guiott 0:d177c0087d1f 97 double elv; /**< Antenna altitude above/below mean sea level (geoid) in meters */
guiott 0:d177c0087d1f 98 double speed; /**< Speed over the ground in kilometers/hour */
guiott 0:d177c0087d1f 99 double direction; /**< Track angle in degrees True */
guiott 0:d177c0087d1f 100 double declination; /**< Magnetic variation degrees (Easterly var. subtracts from true course) */
guiott 0:d177c0087d1f 101
guiott 0:d177c0087d1f 102 nmeaSATINFO satinfo; /**< Satellites information */
guiott 0:d177c0087d1f 103
guiott 0:d177c0087d1f 104 } nmeaINFO;
guiott 0:d177c0087d1f 105
guiott 0:d177c0087d1f 106 void nmea_zero_INFO(nmeaINFO *info);
guiott 0:d177c0087d1f 107
guiott 0:d177c0087d1f 108 #ifdef __cplusplus
guiott 0:d177c0087d1f 109 }
guiott 0:d177c0087d1f 110 #endif
guiott 0:d177c0087d1f 111
guiott 0:d177c0087d1f 112 #endif /* __NMEA_INFO_H__ */