PropWare
2.1.2
C++ objects and CMake build system for Parallax Propeller
|
Click here for docs on the
develop
branch.
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...
Go to the source code of this file.
Classes | |
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 speed the GPS module is travelling at. If the GPS module is not in motion, the GPS module may report close-to-zero speeds because of small variations in the timing signals received from the GPS satellite. More... | |
int | gps_rawDate () |
Provides the caller with the UTC date received from the GPS satellite network. The date will be an decimal integer value in the format DDMMYY. More... | |
int | gps_rawTime () |
Provides the caller with the UTC time received from the GPS satellite network. The time will be an decimal integer value in the format HHMMSS. More... | |
float | gps_magneticVariation () |
Provides the caller with the number of degrees of magnetic varation. This value can be fractional, so it is returned as a float. More... | |
void | gps_txByte (int txByte) |
Provides the caller with a way to send data to the GPS module. This way, the module can be configured to suit the application needs. More... | |
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.
Definition in file gps.h.
struct nmea_data_s |
float gps_altitude | ( | ) |
Provides the caller with the altitude above sea-level of the GPS module, in meters.
Definition at line 13 of file gps_altitude.c.
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.
The | desired new baud rate, in symbols per second. |
Definition at line 14 of file gps_changeBaud.c.
int gps_fix | ( | ) |
int gps_fixValid | ( | ) |
Provides the caller with a way to determine if the GPS module has a valid lock.
Definition at line 14 of file gps_fixValid.c.
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.
Definition at line 14 of file gps_heading.c.
float gps_latitude | ( | ) |
Provides the caller with the current latitude in decimal degrees.
Definition at line 14 of file gps_latitude.c.
float gps_longitude | ( | ) |
Provides the caller with the current longitude in decimal degrees.
Definition at line 14 of file gps_longitude.c.
float gps_magneticVariation | ( | ) |
Provides the caller with the number of degrees of magnetic varation. This value can be fractional, so it is returned as a float.
Definition at line 14 of file gps_magneticVariation.c.
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.
gpsSin | Propeller I/O pin connected to GPS modules TXD pin. Receives NMEA sentences from the GPS module on this pin. |
gpsSout | Propeller I/O pin connected to GPS modules RXD pin. The Propeller transmits data to the GPS module on this pin. |
gps_baud | Specifies the baud rate the UART communicates at. |
Definition at line 21 of file gps_open.c.
int gps_rawDate | ( | ) |
Provides the caller with the UTC date received from the GPS satellite network. The date will be an decimal integer value in the format DDMMYY.
Definition at line 14 of file gps_rawDate.c.
int gps_rawTime | ( | ) |
Provides the caller with the UTC time received from the GPS satellite network. The time will be an decimal integer value in the format HHMMSS.
Definition at line 14 of file gps_rawTime.c.
int gps_satsTracked | ( | ) |
Provides the caller with the number of GPS satellites the module is currently tracking.
Definition at line 14 of file gps_satsTracked.c.
void gps_txByte | ( | int | txByte | ) |
Provides the caller with a way to send data to the GPS module. This way, the module can be configured to suit the application needs.
The | byte to send to the GPS module. |
Definition at line 14 of file gps_txByte.c.
float gps_velocity | ( | int | units_type | ) |
Provides the caller with the current speed the GPS module is travelling at. If the GPS module is not in motion, the GPS module may report close-to-zero speeds because of small variations in the timing signals received from the GPS satellite.
The | desired unit type to scale the measured speed by. Possible unit types are KNOTS, MPH, KPH, MPS. |
Definition at line 14 of file gps_velocity.c.