gps nmea parser  0.5
The _ONLY_ GPS library you will need :)
Data Structures | Macros | Typedefs | Functions
gps.h File Reference

This library provides basic NMEA parsing capabilities. It is designed to take raw NMEA strings, parse the data out of them, and make the data available to a parent application through accessor functions. More...

#include "simpletools.h"
#include "fdserial.h"

Go to the source code of this file.

Data Structures

struct  nmea_data_s
 

Macros

#define KNOTS   0
 
#define MPH   1
 
#define KPH   2
 
#define MPS   3
 
#define GPS_TRUE   1
 
#define GPS_FALSE   0
 
#define GPS_INBUFF_SIZE   128
 

Typedefs

typedef unsigned char gps_byte_t
 
typedef struct nmea_data_s nmea_data
 

Functions

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 continuously parse new data and the other cog to act as a UART serial port to receive data from the GPS module. More...
 
int gps_changeBaud (int newBaudRate)
 Changes the baud rate of the UART without requiring you to respecify communication pins. To change the communication pins, call gps_close() and re-call gps_open() with the new settings. More...
 
void gps_close ()
 Stops the GPS parser process and communication UART. Calling this effectively frees two cogs.
 
float gps_latitude ()
 Provides the caller with the current latitude in decimal degrees. More...
 
float gps_longitude ()
 Provides the caller with the current longitude in decimal degrees. More...
 
int gps_fix ()
 Provides the caller with information about the quality of the current GPS fix. Possible values are: 0: invalid fix 1: GPS fix 2: DGPS fix (3D fix) others. More...
 
int gps_fixValid ()
 Provides the caller with a way to determine if the GPS module has a valid lock. More...
 
int gps_satsTracked ()
 Provides the caller with the number of GPS satellites the module is currently tracking. More...
 
float gps_altitude ()
 Provides the caller with the altitude above sea-level of the GPS module, in meters. More...
 
float gps_heading ()
 Provides the caller with the current compass degree heading the GPS module is travelling in. If the GPS module is not in motion, the heading degree will be zero. More...
 
float gps_velocity (int units_type)
 Provides the caller with the current compass degree heading the GPS module is travelling in. If the GPS module is not in motion, the heading degree will be zero. More...
 
int gps_rawDate ()
 Runs the RFID card reading process in another cog. More...
 
int gps_rawTime ()
 Runs the RFID card reading process in another cog. More...
 
float gps_magneticVariation ()
 Runs the RFID card reading process in another cog. More...
 

Detailed Description

This library provides basic NMEA parsing capabilities. It is designed to take raw NMEA strings, parse the data out of them, and make the data available to a parent application through accessor functions.

Author
Daniel Harris
Core Usage
Each call to rfid_open launches a serial communication process into another core.
Memory Models
Use with CMM or LMM.
Version
0.5

Function Documentation

float gps_altitude ( )

Provides the caller with the altitude above sea-level of the GPS module, in meters.

Returns
The currect altitude above sea-level, in meters.
int gps_changeBaud ( int  newBaudRate)

Changes the baud rate of the UART without requiring you to respecify communication pins. To change the communication pins, call gps_close() and re-call gps_open() with the new settings.

Parameters
Thedesired new baud rate, in symbols per second.
Returns
Non-zero result for success, or zero upon failure to re-launch the parser process.
int gps_fix ( )

Provides the caller with information about the quality of the current GPS fix. Possible values are: 0: invalid fix 1: GPS fix 2: DGPS fix (3D fix) others.

Returns
The currect fix type the GPS module has acquired.
int gps_fixValid ( )

Provides the caller with a way to determine if the GPS module has a valid lock.

Returns
A non-zero value if the GPS module has a lock, or zero if there is no valid lock.
float gps_heading ( )

Provides the caller with the current compass degree heading the GPS module is travelling in. If the GPS module is not in motion, the heading degree will be zero.

Returns
The compass degree heading the module is travelling in.
float gps_latitude ( )

Provides the caller with the current latitude in decimal degrees.

Returns
A float representing the current latitude in decimal degrees. Or zero if there is no valid fix.
float gps_longitude ( )

Provides the caller with the current longitude in decimal degrees.

Returns
A float representing the current longitude in decimal degrees. Or zero if there is no valid fix.
float gps_magneticVariation ( )

Runs the RFID card reading process in another cog.

Parameters
soutPinPropeller I/O pin connected to RFID reader's SOUT pin.
enablePinPropeller I/O pin connected to RFID reader's /ENABLE pin.
Returns
Device identifier for use with simpletext, fdserial, and rfidser library functions.
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 continuously parse new data and the other cog to act as a UART serial port to receive data from the GPS module.

Parameters
gpsSinPropeller I/O pin connected to GPS modules TXD pin. Receives NMEA sentences from the GPS module on this pin.
gpsSoutPropeller I/O pin connected to GPS modules RXD pin. The Propeller transmits data to the GPS module on this pin.
gps_baudSpecifies the baud rate the UART communicates at.
Returns
Non-zero result for success, or zero upon failure to launch the parser process.
int gps_rawDate ( )

Runs the RFID card reading process in another cog.

Parameters
soutPinPropeller I/O pin connected to RFID reader's SOUT pin.
enablePinPropeller I/O pin connected to RFID reader's /ENABLE pin.
Returns
Device identifier for use with simpletext, fdserial, and rfidser library functions.
int gps_rawTime ( )

Runs the RFID card reading process in another cog.

Parameters
soutPinPropeller I/O pin connected to RFID reader's SOUT pin.
enablePinPropeller I/O pin connected to RFID reader's /ENABLE pin.
Returns
Device identifier for use with simpletext, fdserial, and rfidser library functions.
int gps_satsTracked ( )

Provides the caller with the number of GPS satellites the module is currently tracking.

Returns
The number of satellites currently being tracked by the GPS module.
float gps_velocity ( int  units_type)

Provides the caller with the current compass degree heading the GPS module is travelling in. If the GPS module is not in motion, the heading degree will be zero.

Returns
The compass degree heading the module is travelling in.