TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139245 times)
  2. FAT32 Library (71743 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28073 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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: 5293 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

SPIRIT click

6

SPIRIT click carries the SP1ML 868MHz ultra low-power RF module. The click is designed to run on a 3.3V or 5V power supply. It communicates with the target MCU over UART interface, with additional functionality provided by the following pins on the mikroBUS line: PWM, RST, CS.

[Learn More]

TV remote relay switch

1

This is a simple demonstration of using NEC protocol remote control with the IR click, Relay click and STM32 M4 clicker board. Upon a button press, an appropriate relay will toggle.

[Learn More]

EnOcean 3 Click

0

EnOcean 3 Click carries an ultra-low power TCM515 transceiver gateway module which operates at 868MHz radio band, perfectly suited for the realization of transceiver gateways, actuators and controllers for systems communicating based on the EnOcean radio standard.

[Learn More]