PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Simple Libraries
Sensor
libgps
gps.h
1
23
#ifndef __SIMPLE_NMEA_PARSER__
24
#define __SIMPLE_NMEA_PARSER__
25
26
#if defined(__cplusplus)
27
#extern "C" {
28
#endif
29
30
31
#include "simpletools.h"
32
#include "fdserial.h"
33
34
#define KNOTS 0
35
#define MPH 1
36
#define KPH 2
37
#define MPS 3
38
39
#define GPS_TRUE 1
40
#define GPS_FALSE 0
41
42
#define GPS_INBUFF_SIZE 128 //needs to be big enough to hold an entire NMEA sentence and a few estra bytes
43
44
//Type definitions
45
typedef
unsigned
char
gps_byte_t;
46
47
typedef
struct
nmea_data_s
48
{
49
int
fix;
//fix quality, 0=invalid, 1=GPS, 2=DGPS, etc...
50
int
fix_valid;
//boolean indicating a valid GPS fix
51
float
lat_dds;
//current latitude in decimal degress
52
float
lon_dds;
//current longitude in decimal degrees
53
int
sats_tracked;
//current number of satellites tracked by the GPS
54
float
altitude;
//current altitude, in meters, as float
55
float
heading;
//current direction of travel, in degrees, as float
56
float
velocity;
//current speed if travel, in knots, as float
57
float
date;
//current date, raw format with tenths of second, as float
58
int
time;
//current UTC time, raw format, as integer
59
float
mag_var;
//current magnetic variation, as float
60
61
}
nmea_data
;
62
74
int
gps_open(
int
gpsSin,
int
gpsSout,
int
gps_baud);
75
83
int
gps_changeBaud(
int
newBaudRate);
84
85
90
void
gps_close();
91
92
98
float
gps_latitude();
99
100
106
float
gps_longitude();
107
108
119
int
gps_fix();
120
121
127
int
gps_fixValid();
128
129
135
int
gps_satsTracked();
136
137
143
float
gps_altitude();
144
145
151
float
gps_heading();
152
153
161
float
gps_velocity(
int
units_type);
162
163
169
int
gps_rawDate();
170
171
177
int
gps_rawTime();
178
179
185
float
gps_magneticVariation();
186
187
195
void
gps_txByte(
int
txByte);
196
197
#if defined(__cplusplus)
198
}
199
#endif
200
// end __cplusplus
201
202
#endif
203
// end __SIMPLE_NMEA_PARSER__ redefinition guard
204
205
nmea_data_s
Definition:
gps.h:47
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12