Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps.h File Reference

Device independent GPS code (interface) More...

#include "std.h"
#include "math/pprz_geodetic_int.h"
#include "mcu_periph/sys_time.h"
+ Include dependency graph for gps.h:

Go to the source code of this file.

Data Structures

struct  SVinfo
 data structure for Space Vehicle Information of a single satellite More...
 
struct  GpsState
 data structure for GPS information More...
 
struct  GpsTimeSync
 data structure for GPS time sync More...
 

Macros

#define GPS_FIX_NONE   0x00
 
#define GPS_FIX_2D   0x02
 
#define GPS_FIX_3D   0x03
 
#define GpsFixValid()   (gps.fix == GPS_FIX_3D)
 
#define GPS_NB_CHANNELS   1
 
#define GPS_TIMEOUT   5
 
#define gps_Reset(_val)
 GPS Reset. More...
 

Functions

void gps_init (void)
 initialize the global GPS state More...
 
void gps_impl_init (void)
 
bool_t GpsIsLost (void)
 
uint32_t gps_tow_from_sys_ticks (uint32_t sys_ticks)
 Convert time in sys_time ticks to GPS time of week. More...
 

Variables

struct GpsState gps
 global GPS state More...
 
struct GpsTimeSync gps_time_sync
 

Detailed Description

Device independent GPS code (interface)

Definition in file gps.h.

Macro Definition Documentation

#define GPS_FIX_2D   0x02

Definition at line 42 of file gps.h.

Referenced by gps_mtk_read_message(), gps_skytraq_read_message(), parse_ins_msg(), and sirf_parse_41().

#define GPS_FIX_NONE   0x00
#define GPS_NB_CHANNELS   1

Definition at line 49 of file gps.h.

#define gps_Reset (   _val)
Value:
{ \
}

GPS Reset.

Todo:
this still needs to call gps specific stuff

Definition at line 127 of file gps.h.

#define GPS_TIMEOUT   5

Definition at line 109 of file gps.h.

Referenced by GpsIsLost().

#define GpsFixValid ( )    (gps.fix == GPS_FIX_3D)

Definition at line 45 of file gps.h.

Referenced by alt_filter_periodic().

Function Documentation

void gps_init ( void  )

initialize the global GPS state

Definition at line 37 of file gps.c.

References GpsState::cacc, GpsState::fix, gps, GPS_FIX_NONE, gps_impl_init(), and LED_OFF.

Referenced by init_ap(), and main_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t gps_tow_from_sys_ticks ( uint32_t  sys_ticks)

Convert time in sys_time ticks to GPS time of week.

The resolution is sys_time.resolution

Returns
GPS tow in ms

Definition at line 48 of file gps.c.

References gps_time_sync, msec_of_sys_time_ticks(), MSEC_PER_WEEK, GpsTimeSync::t0_ticks, and GpsTimeSync::t0_tow.

Referenced by trigger_ext_periodic(), and windturbine_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool_t GpsIsLost ( void  )
inline

Definition at line 114 of file gps.h.

References FALSE, GpsState::fix, gps, GPS_FIX_NONE, GPS_TIMEOUT, GpsState::last_fix_time, sys_time::nb_sec, and TRUE.

Referenced by autopilot_on_rc_frame(), and failsafe_check().

+ Here is the caller graph for this function:

Variable Documentation

struct GpsTimeSync gps_time_sync

Definition at line 35 of file gps.c.

Referenced by gps_mtk_read_message(), gps_tow_from_sys_ticks(), and gps_ubx_read_message().