Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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.


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


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...


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 107 of file gps.c.

References GpsState::cacc, 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 gps_periodic_check ( void  )

Periodic GPS check.

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

Definition at line 136 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

GPS tow in ms

Definition at line 142 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().