Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps.c File Reference

Device independent GPS code. More...

#include "subsystems/gps.h"
#include "led.h"
+ Include dependency graph for gps.c:

Go to the source code of this file.

Macros

#define MSEC_PER_WEEK   (1000*60*60*24*7)
 

Functions

void gps_init (void)
 initialize the global GPS state More...
 
void gps_periodic_check (void)
 Periodic GPS check. More...
 
uint32_t gps_tow_from_sys_ticks (uint32_t sys_ticks)
 Convert time in sys_time ticks to GPS time of week. More...
 
void WEAK gps_inject_data (uint8_t packet_id, uint8_t length, uint8_t *data)
 Default parser for GPS injected data. More...
 

Variables

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

Detailed Description

Device independent GPS code.

Definition in file gps.c.

Macro Definition Documentation

#define MSEC_PER_WEEK   (1000*60*60*24*7)

Definition at line 39 of file gps.c.

Referenced by gps_tow_from_sys_ticks().

Function Documentation

void gps_init ( void  )

initialize the global GPS state

Definition at line 135 of file gps.c.

References GpsState::cacc, DefaultPeriodic, GpsState::fix, gpio_setup_output(), gps, GPS_FIX_NONE, gps_impl_init(), GPS_POWER_GPIO, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, LED_OFF, register_periodic_telemetry(), GpsState::tow, and GpsState::week.

Referenced by init_ap(), and main_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WEAK gps_inject_data ( uint8_t  packet_id,
uint8_t  length,
uint8_t data 
)

Default parser for GPS injected data.

GPS packet injection (default empty)

Definition at line 198 of file gps.c.

References gps_piksi_write(), and sbp_state.

+ Here is the call graph for this function:

void gps_periodic_check ( void  )

Periodic GPS check.

Marks GPS as lost when no GPS message was received for GPS_TIMEOUT seconds

Definition at line 166 of file gps.c.

References GpsState::fix, gps, GPS_FIX_NONE, GPS_TIMEOUT, GpsState::last_msg_time, and sys_time::nb_sec.

Referenced by failsafe_check(), and sensors_task().

+ 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 173 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:

Variable Documentation

struct GpsTimeSync gps_time_sync

Definition at line 43 of file gps.c.

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