gps nmea parser  0.5
The _ONLY_ GPS library you will need :)
gps.h
Go to the documentation of this file.
1 
25 #ifndef __SIMPLE_NMEA_PARSER__
26 #define __SIMPLE_NMEA_PARSER__
27 
28 #if defined(__cplusplus)
29 #extern "C" {
30 #endif
31 
32 
33 #include "simpletools.h"
34 #include "fdserial.h"
35 
36 #define KNOTS 0
37 #define MPH 1
38 #define KPH 2
39 #define MPS 3
40 
41 #define GPS_TRUE 1
42 #define GPS_FALSE 0
43 
44 #define GPS_INBUFF_SIZE 128 //needs to be big enough to hold an entire NMEA sentence and a few estra bytes
45 
46 
47 
48 //Type definitions
49 typedef unsigned char gps_byte_t;
50 
51 typedef struct nmea_data_s
52 {
53  int fix; //fix quality, 0=invalid, 1=GPS, 2=DGPS, etc...
54  int fix_valid; //boolean indicating a valid GPS fix
55  float lat_dds; //current latitude in decimal degress
56  float lon_dds; //current longitude in decimal degrees
57  int sats_tracked; //current number of satellites tracked by the GPS
58  float altitude; //current altitude, in meters, as float
59  float heading; //current direction of travel, in degrees, as float
60  float velocity; //current speed if travel, in knots, as float
61  float date; //current date, raw format with tenths of second, as float
62  int time; //current UTC time, raw format, as integer
63  float mag_var; //current magnetic variation, as float
64 
65 } nmea_data;
66 
78 int gps_open(int gpsSin, int gpsSout, int gps_baud);
79 
87 int gps_changeBaud(int newBaudRate);
88 
89 
94 void gps_close();
95 
96 
102 float gps_latitude();
103 
104 
110 float gps_longitude();
111 
112 
123 int gps_fix();
124 
125 
131 int gps_fixValid();
132 
133 
139 int gps_satsTracked();
140 
141 
147 float gps_altitude();
148 
149 
155 float gps_heading();
156 
157 
163 float gps_velocity(int units_type);
164 
165 
176 int gps_rawDate();
177 
178 
189 int gps_rawTime();
190 
191 
202 float gps_magneticVariation();
203 
204 //Private functions
205 
206 #if defined(__cplusplus)
207 }
208 #endif
209 // end __cplusplus
210 
211 #endif
212 // end __SIMPLE_NMEA_PARSER__ redefinition guard
213 
214 
int gps_changeBaud(int newBaudRate)
Changes the baud rate of the UART without requiring you to respecify communication pins...
Definition: gps_changeBaud.c:6
float gps_velocity(int units_type)
Provides the caller with the current compass degree heading the GPS module is travelling in...
Definition: gps_velocity.c:7
int gps_rawDate()
Runs the RFID card reading process in another cog.
Definition: gps_rawDate.c:5
int gps_open(int gpsSin, int gpsSout, int gps_baud)
Starts the GPS NMEA parser process. This process ultimately consumes two cogs - one cog to continuous...
Definition: gps_open.c:12
float gps_longitude()
Provides the caller with the current longitude in decimal degrees.
Definition: gps_longitude.c:5
float gps_altitude()
Provides the caller with the altitude above sea-level of the GPS module, in meters.
Definition: gps_altitude.c:6
float gps_heading()
Provides the caller with the current compass degree heading the GPS module is travelling in...
Definition: gps_heading.c:6
float gps_magneticVariation()
Runs the RFID card reading process in another cog.
Definition: gps_magneticVariation.c:5
int gps_fix()
Provides the caller with information about the quality of the current GPS fix. Possible values are: 0...
Definition: gps_fix.c:5
int gps_rawTime()
Runs the RFID card reading process in another cog.
Definition: gps_rawTime.c:5
float gps_latitude()
Provides the caller with the current latitude in decimal degrees.
Definition: gps_latitude.c:6
Definition: gps.h:51
void gps_close()
Stops the GPS parser process and communication UART. Calling this effectively frees two cogs...
Definition: gps_close.c:8
int gps_fixValid()
Provides the caller with a way to determine if the GPS module has a valid lock.
Definition: gps_fixValid.c:6
int gps_satsTracked()
Provides the caller with the number of GPS satellites the module is currently tracking.
Definition: gps_satsTracked.c:6