px-lib  0.9.2
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers

Description

GPS NMEA protocol parser.

File(s):

See also
http://en.wikipedia.org/wiki/NMEA_0183

Data Structures

struct  px_nmea_data_t
 Parsed time, position, quality data. More...
 

Macros

#define PX_NMEA_GGA_STR   "GGA"
 Time, position and fix type data. More...
 
#define PX_NMEA_GLL_STR   "GLL"
 Latitude, longitude, UTC time of position fix and status. More...
 
#define PX_NMEA_GSA_STR   "GSA"
 GPS receiver operating mode, satellites used in the position solution and DOP values. More...
 
#define PX_NMEA_GSV_STR   "GSV"
 The number of GPS satellites in view, satellite ID numbers, elevation, azimuth, and SNR values. More...
 
#define PX_NMEA_MSS_STR   "MSS"
 Signal-to-noise ratio, signal strength, frequency, and bit rate from a radio-beacon receiver. More...
 
#define PX_NMEA_RMC_STR   "RMC"
 Time, date, position, course and speed data. More...
 
#define PX_NMEA_VTG_STR   "VTG"
 Course and speed information relative to the ground. More...
 
#define PX_NMEA_ZDA_STR   "ZDA"
 Date and time. More...
 

Typedefs

typedef void(* px_nmea_tx_byte_t) (uint8_t data)
 Definition for a pointer to a function that will be called to send a character. More...
 
typedef void(* px_nmea_on_valid_str_t) (const char *data)
 Definition for a pointer to a function that when a valid NMEA string is received. More...
 
typedef void(* px_nmea_on_valid_gps_data_t) (void)
 Definition for a pointer to a function that will be called when GPS data is valid. More...
 

Functions

void px_nmea_init (px_nmea_tx_byte_t tx_byte, px_nmea_on_valid_str_t on_valid_str, px_nmea_on_valid_gps_data_t on_valid_gps_data)
 Initialise NMEA parser module. More...
 
void px_nmea_on_rx_byte (uint8_t data)
 Function handler that is fed all raw received data. More...
 
void px_nmea_tx_frame (char *frame)
 Function that is called to send an NMEA frame with the checksum appended. More...
 

Data Structure Documentation

◆ px_nmea_data_t

struct px_nmea_data_t

Parsed time, position, quality data.

Definition at line 74 of file px_nmea.h.

Macro Definition Documentation

◆ PX_NMEA_GGA_STR

#define PX_NMEA_GGA_STR   "GGA"

Time, position and fix type data.

Definition at line 45 of file px_nmea.h.

◆ PX_NMEA_GLL_STR

#define PX_NMEA_GLL_STR   "GLL"

Latitude, longitude, UTC time of position fix and status.

Definition at line 46 of file px_nmea.h.

◆ PX_NMEA_GSA_STR

#define PX_NMEA_GSA_STR   "GSA"

GPS receiver operating mode, satellites used in the position solution and DOP values.

Definition at line 47 of file px_nmea.h.

◆ PX_NMEA_GSV_STR

#define PX_NMEA_GSV_STR   "GSV"

The number of GPS satellites in view, satellite ID numbers, elevation, azimuth, and SNR values.

Definition at line 48 of file px_nmea.h.

◆ PX_NMEA_MSS_STR

#define PX_NMEA_MSS_STR   "MSS"

Signal-to-noise ratio, signal strength, frequency, and bit rate from a radio-beacon receiver.

Definition at line 49 of file px_nmea.h.

◆ PX_NMEA_RMC_STR

#define PX_NMEA_RMC_STR   "RMC"

Time, date, position, course and speed data.

Definition at line 50 of file px_nmea.h.

◆ PX_NMEA_VTG_STR

#define PX_NMEA_VTG_STR   "VTG"

Course and speed information relative to the ground.

Definition at line 51 of file px_nmea.h.

◆ PX_NMEA_ZDA_STR

#define PX_NMEA_ZDA_STR   "ZDA"

Date and time.

Definition at line 52 of file px_nmea.h.

Typedef Documentation

◆ px_nmea_tx_byte_t

typedef void(* px_nmea_tx_byte_t) (uint8_t data)

Definition for a pointer to a function that will be called to send a character.

Definition at line 59 of file px_nmea.h.

◆ px_nmea_on_valid_str_t

typedef void(* px_nmea_on_valid_str_t) (const char *data)

Definition for a pointer to a function that when a valid NMEA string is received.

Definition at line 65 of file px_nmea.h.

◆ px_nmea_on_valid_gps_data_t

typedef void(* px_nmea_on_valid_gps_data_t) (void)

Definition for a pointer to a function that will be called when GPS data is valid.

Definition at line 71 of file px_nmea.h.

Function Documentation

◆ px_nmea_init()

void px_nmea_init ( px_nmea_tx_byte_t  tx_byte,
px_nmea_on_valid_str_t  on_valid_str,
px_nmea_on_valid_gps_data_t  on_valid_gps_data 
)

Initialise NMEA parser module.

Parameters
tx_bytePointer to a function that will be called to transmit a byte.
on_valid_strPointer to a function that will be called when a valid NMEA string has been received.
on_valid_gps_dataPointer to a function that will be called when the data structure has been completely polulated with valid data.

Definition at line 384 of file px_nmea.c.

◆ px_nmea_on_rx_byte()

void px_nmea_on_rx_byte ( uint8_t  data)

Function handler that is fed all raw received data.

Parameters
[in]datareceived 8-bit data

Definition at line 400 of file px_nmea.c.

◆ px_nmea_tx_frame()

void px_nmea_tx_frame ( char *  frame)

Function that is called to send an NMEA frame with the checksum appended.

Parameters
framePointer to zero terminated string.

Definition at line 494 of file px_nmea.c.