TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139560 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47607 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 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: 5332 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

DC Motor 4 click

0

DC MOTOR 4 click is capable of driving motors between 4.5V and 36V. It carries the MAX14870 motor driver from Maxim Integrated. The click is designed to run on either 3.3V or 5V power supply. DC MOTOR 4 click communicates with the target MCU over the following pins on the mikroBUSâ„¢ line: PWM, AN, CS, and INT.

[Learn More]

Ir Eclipse Click

0

IR eclipse Click carries an EE-SX198 photo interrupter sensor. This sensor consists of an infrared transmitter and receiver facing each other and spaced apart by a 3mm slit.

[Learn More]

Button 2 Click

0

Button 2 Click is a compact add-on board designed for simple and efficient tactile input detection. This board features the TL3215AF160BQ, a TL3215 series of tactile switches from E-Switch, featuring high reliability and precise operation. The switch has a 2mm actuator, 160gf actuation force, silver contact material, and a lifespan of 1,000,000 cycles, while the integrated blue LED provides visual feedback. The board supports the new Click Snap feature, allowing easy detachment of the sensor area for flexible use.

[Learn More]