TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136223 times)
  2. FAT32 Library (69491 times)
  3. Network Ethernet Library (55709 times)
  4. USB Device Library (45993 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40800 times)
  7. GSM click (28789 times)
  8. PID Library (26332 times)
  9. mikroSDK (26059 times)
  10. microSD click (25145 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

GPS Parser

Rating:

8

Author: MIKROE

Last Updated: 2018-02-13

Package Version: 1.0.0.0

Category: GPS

Downloaded: 5054 times

Followed by: 8 users

License: MIT license  

For those wishing to have all the information possible from their GPS, there's a click for that. This library is a gps parser. What is does is separates the various sentences that come from the gps satellites into useful parts and pieces. Then gives the developer access the the underlying data with useful getter type functions.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "GPS Parser" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "GPS Parser" changes.

Do you want to report abuse regarding "GPS Parser".

  • Information
  • Comments (9)

Library Blog

Pre-Notes: Library is customizable in size.  With all features enabled, library compiles to ~14kb.  To customize the size, comment or un-comment out sentences in the gps_config.h file. Usage Scenario:

  1. GPS data coming over i2c, uart, or spi
  2. Need specific information from GPS

How to: Set up gps data for parsing. 

Example:

#include "gps_parser.h"

void system_init()
{    
    ...    
    UART1_Init_Advanced(115200, _UART_8_BIT_DATA, _UART_NOPARITY,
    _UART_ONE_STOPBIT, &_GPIO_MODULE_USART1_PA9_10);
    Delay_ms( 100 ); // Allow a small delay for clock stability    
    RXNEIE_USART1_CR1_bit = 1; // Enable rx interrupt for usart 1    
    NVIC_IntEnable( IVT_INT_USART1 ); // Enable NVIC for rx usart1 interrupt    
    ….
}  

void main()
{    
    system_init();      
    while( 1 )    
    {        
        gps_parse();    
    }
}  

void UART1_RX_ISR() iv IVT_INT_USART1 ics ICS_AUTO
{    
    if( RXNE_USART1_SR_bit )    
    {        
        gps_put( USART1_DR );      
    }
}  

 

Explaination: What we have done is connected up a usart to a gps. When data comes from the gps it triggers the interrupt which places the incoming data into the gps_put() function. Meanwhile in the main loop we are repeatedly calling gps_parse(); When this function receives a full sentence, it quickly parses it into the respective data. The gps_put() function can also be put into a pooling loop as well.

while(1)
{    
    …    
    if( UART1_Data() )    
    {        
        gps_put( UART1_Read() );    
    }    
    gps_parse();
}

 

So what does this do? What it gives you access to is the following functions:

  • location_t * gps_current_lon (void)
  • location_t * gps_current_lat (void)
  • TimeStruct * gps_current_time (void)
  • utc_time_t * gps_current_fix (void)
  • fix_t gps_gga_fix_quality (void)
  • uint8_t gps_gga_satcount (void)
  • float gps_gga_hor_dilution (void)
  • double gps_gga_altitude (void)
  • double gps_gga_msl (void)
  • uint16_t gps_gga_lastDGPS_update (void)
  • uint16_t gps_gga_DGPS_stationID (void)
  • ACTIVE_t gps_gll_active (void)
  • GSA_MODE_t gps_gsa_mode (void)
  • GSA_MODE_t gps_gsa_fix_type (void)
  • uint8_t * gps_gsa_sat_prn (void)
  • float gps_gsa_precision_dilution (void)
  • float gps_gsa_horizontal_dilution (void)
  • float gps_gsa_vertical_dilution (void)
  • GPS_STATUS_t gps_rmc_status (void)
  • double gps_rmc_speed (void)
  • double gps_rmc_track (void)
  • double gps_rmc_mag_var (void)
  • azmuth_t gps_rmc_direction (void)
  • GPS_STATUS_t gps_rmc_mode (void)
  • double gps_vtg_track (void)
  • double gps_vtg_mag (void)
  • double gps_vtg_speedknt (void)
  • double gps_vtg_speedkm (void)
  • datum_code_t gps_dtm_local (void)
  • char * gps_dtm_localoffset (void)
  • double gps_dtm_latoffset (void)
  • azmuth_t gps_dtm_lat_offset_dir (void)
  • double gps_dtm_lonoffset (void)
  • azmuth_t gps_dtm_lon_offset_dir (void)
  • double gps_dtm_altoffset (void)
  • datum_code_t gps_dtm_datum (void)
  • float gps_gbs_laterror (void)
  • float gps_gbs_lonerror (void)
  • float gps_gbs_alterror (void)
  • uint8_t gps_gbs_satid (void)
  • float gps_gbs_probmiss (void)
  • double gps_gbs_failedest (void)
  • float gps_gbs_std_deviation (void)
  • char * gps_gpq_message (void)
  • uint8_t gps_grs_mode (void)
  • float gps_grs_range (void)
  • float gps_gst_rms (void)
  • float gps_gst_stddev_major (void)
  • float gps_gst_stddev_minor (void)
  • float gps_gst_orientation (void)
  • float gps_gst_stddev_lat (void)
  • float gps_gst_stddev_lon (void)
  • float gps_gst_stddev_alt (void)
  • double gps_ths_heading (void)
  • vehicle_status_t gps_ths_status (void)

     

 

GPS Preview

GPS Preview

GPS Preview image.

View full image
Search Paths

Search Paths

Edit your search paths for include files.

View full image

Note*

When changing the configuration of the library. You will need to re-build all sources to re-compile the library for the new / fewer features as described in gps_config.h.

Config of GPS Parser

Config of GPS Parser

gps_config.h

View full image
Rebuild all sources

Rebuild all sources

Rebuild all sources when making a change to the library.

View full image

ALSO FROM THIS AUTHOR

Charger click

0

Charger Click is a compact add-on board providing a standalone battery charger and monitor. This board features Microchip's MCP73831, a miniature single-cell, fully integrated Li-Ion, Li-Polymer charge management controller. The charge voltage of the MCP73831 is set to 4.20V, and a charge current to 250mA with an external resistor. In addition, this Click board™ features the DS2438, a smart battery monitor that monitors the total amount of current going into and out of the battery.

[Learn More]

Current click

0

Current click is an add-on board used for measurement of electric current. It features INA196 current shunt monitor, MCP3201 12-bit ADC, MAX6106 voltage reference as well as two screw terminals.

[Learn More]

Flash click

0

The Flash memory module used on this Click board is the EN25Q80B, an 8 Mbit serial Flash memory with 4 KB Uniform Sector, from EON Silicon Solutions. The Flash memory density is usually expressed in bits, so exactly 8,388,608 bits are organized in units (or words, also known as bytes) of 8 bits, which gives 1,048,576 bytes of data memory.

[Learn More]