Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gps_nmea.h File Reference

NMEA protocol specific code. More...

#include "mcu_periph/uart.h"
#include "modules/gps/gps.h"
#include "pprzlink/pprzlink_device.h"
+ Include dependency graph for gps_nmea.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GpsNmea
 

Macros

#define GPS_NMEA_NB_CHANNELS   12
 
#define NMEA_MAXLEN   255
 
#define PRIMARY_GPS   GPS_NMEA
 
#define gps_nmea_periodic_check()   gps_periodic_check(&gps_nmea.state)
 

Functions

void gps_nmea_init (void)
 
void gps_nmea_event (void)
 
void nmea_configure (void)
 The function to be called when a characted from the device is available. More...
 
void nmea_parse_char (uint8_t c)
 This is the actual parser. More...
 
bool nmea_parse_msg (void)
 nmea_parse_char() has a complete line. More...
 
uint8_t nmea_calc_crc (const char *buff, int buff_sz)
 Calculate control sum of binary buffer. More...
 
void nmea_parse_prop_init (void)
 
bool nmea_parse_prop_msg (void)
 
void nmea_gps_msg (void)
 
static void nmea_read_until (int *i)
 Read until a certain character, placed here for proprietary includes. More...
 

Variables

struct GpsNmea gps_nmea
 

Detailed Description

NMEA protocol specific code.

Definition in file gps_nmea.h.


Data Structure Documentation

◆ GpsNmea

struct GpsNmea

Definition at line 43 of file gps_nmea.h.

+ Collaboration diagram for GpsNmea:
Data Fields
uint8_t gps_nb_ovrn number if incomplete nmea-messages
bool have_gsv flag set to TRUE if GPGSV message received
bool is_configured flag set to TRUE if configuration is finished
bool msg_available flag set to TRUE if a new msg/sentence is available to be parsed
char msg_buf[NMEA_MAXLEN] buffer for storing one nmea-line
int msg_len
struct GpsState state
uint8_t status line parser status

Macro Definition Documentation

◆ GPS_NMEA_NB_CHANNELS

#define GPS_NMEA_NB_CHANNELS   12

Definition at line 35 of file gps_nmea.h.

◆ gps_nmea_periodic_check

#define gps_nmea_periodic_check ( )    gps_periodic_check(&gps_nmea.state)

Definition at line 60 of file gps_nmea.h.

◆ NMEA_MAXLEN

#define NMEA_MAXLEN   255

Definition at line 37 of file gps_nmea.h.

◆ PRIMARY_GPS

#define PRIMARY_GPS   GPS_NMEA

Definition at line 40 of file gps_nmea.h.

Function Documentation

◆ gps_nmea_event()

void gps_nmea_event ( void  )

Definition at line 78 of file gps_nmea.c.

References dev, gps_nmea, GpsNmea::is_configured, GpsNmea::msg_available, nmea_configure(), nmea_gps_msg(), and nmea_parse_char().

+ Here is the call graph for this function:

◆ gps_nmea_init()

void gps_nmea_init ( void  )

◆ nmea_calc_crc()

uint8_t nmea_calc_crc ( const char *  buff,
int  buff_sz 
)

Calculate control sum of binary buffer.

Definition at line 243 of file gps_nmea.c.

References buff.

Referenced by nmea_configure().

+ Here is the caller graph for this function:

◆ nmea_configure()

void nmea_configure ( void  )

The function to be called when a characted from the device is available.

The function to be called when a characted from the device is available.

Sets gps_nmea.is_configured to TRUE if all config msgs are sent.

Definition at line 66 of file gps_furuno.c.

References logger_uart_parse::crc, fd, furuno_cfg_cnt, gps_furuno_settings, GPS_FURUNO_SETTINGS_NB, gps_nmea, GpsLinkDevice, GpsNmea::is_configured, and nmea_calc_crc().

Referenced by gps_nmea_event(), and gps_nmea_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nmea_gps_msg()

void nmea_gps_msg ( void  )

Definition at line 95 of file gps_nmea.c.

References GpsState::fix, get_sys_time_usec(), GPS_FIX_3D, gps_nmea, GPS_NMEA_ID, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, sys_time::nb_sec, sys_time::nb_sec_rem, nmea_parse_msg(), and GpsNmea::state.

Referenced by gps_nmea_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nmea_parse_char()

void nmea_parse_char ( uint8_t  c)

This is the actual parser.

It reads one character at a time setting gps_nmea.msg_available to TRUE after a full line.

Definition at line 174 of file gps_nmea.c.

References GOT_CHECKSUM, GOT_END, GOT_START, gps_nmea, GpsNmea::msg_available, GpsNmea::msg_buf, GpsNmea::msg_len, NMEA_MAXLEN, NMEA_PRINT, GpsNmea::status, and WAIT.

Referenced by gps_nmea_event().

+ Here is the caller graph for this function:

◆ nmea_parse_msg()

bool nmea_parse_msg ( void  )

nmea_parse_char() has a complete line.

Find out what type of message it is and hand it to the parser for that type.

Returns
true if msg was valid and gps_nmea.state updated

Definition at line 133 of file gps_nmea.c.

References gps_nmea, GpsNmea::have_gsv, GpsNmea::msg_buf, GpsNmea::msg_len, nmea_parse_GGA(), nmea_parse_GSA(), nmea_parse_GSV(), nmea_parse_prop_msg(), nmea_parse_RMC(), NMEA_PRINT, GpsNmea::status, and WAIT.

Referenced by nmea_gps_msg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nmea_parse_prop_init()

void nmea_parse_prop_init ( void  )

Definition at line 90 of file gps_furuno.c.

References furuno_cfg_cnt.

Referenced by gps_nmea_init().

+ Here is the caller graph for this function:

◆ nmea_parse_prop_msg()

bool nmea_parse_prop_msg ( void  )

Definition at line 96 of file gps_furuno.c.

References gps_nmea, GpsNmea::msg_buf, GpsNmea::msg_len, and nmea_parse_perdcrv().

Referenced by nmea_parse_msg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nmea_read_until()

static void nmea_read_until ( int *  i)
inlinestatic

Read until a certain character, placed here for proprietary includes.

Definition at line 79 of file gps_nmea.h.

References gps_nmea, GpsNmea::msg_buf, and GpsNmea::msg_len.

Referenced by nmea_parse_GGA(), nmea_parse_GSA(), nmea_parse_GSV(), nmea_parse_perdcrv(), and nmea_parse_RMC().

+ Here is the caller graph for this function:

Variable Documentation

◆ gps_nmea