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_sirf.h File Reference

Sirf protocol specific code. More...

#include "std.h"
#include "mcu_periph/link_device.h"
#include "mcu_periph/uart.h"
+ Include dependency graph for gps_sirf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GpsSirf
 
struct  sirf_msg_2
 Message ID 2 from GPS. More...
 
struct  sirf_msg_41
 Message ID 41 from GPS. More...
 

Macros

#define GPS_NB_CHANNELS   16
 
#define SIRF_MAXLEN   255
 
#define UNINIT   0
 
#define GOT_A0   1
 
#define GOT_A2   2
 
#define GOT_B0   3
 
#define Invert2Bytes(x)   ((x>>8) | (x<<8))
 
#define Invert4Bytes(x)   ((x>>24) | ((x<<8) & 0x00FF0000) | ((x>>8) & 0x0000FF00) | (x<<24))
 

Functions

void sirf_parse_char (uint8_t c)
 
void sirf_parse_msg (void)
 
void gps_sirf_msg (void)
 
static void GpsEvent (void)
 

Variables

struct GpsSirf gps_sirf
 

Detailed Description

Sirf protocol specific code.

Definition in file gps_sirf.h.


Data Structure Documentation

struct GpsSirf

Definition at line 43 of file gps_sirf.h.

Data Fields
bool_t msg_available
char msg_buf[SIRF_MAXLEN] buffer for storing one nmea-line
int msg_len
bool_t pos_available
int read_state
struct sirf_msg_2

Message ID 2 from GPS.

Total payload length should be 41 bytes.

Definition at line 58 of file gps_sirf.h.

Data Fields
uint8_t ch10prn
uint8_t ch11prn
uint8_t ch12prn
uint8_t ch1prn pseudo-random noise, 12 channels
uint8_t ch2prn
uint8_t ch3prn
uint8_t ch4prn
uint8_t ch5prn
uint8_t ch6prn
uint8_t ch7prn
uint8_t ch8prn
uint8_t ch9prn
uint8_t hdop horizontal dilution of precision *5 (0.2 precision)
uint8_t mode1
uint8_t mode2
uint8_t msg_id hex value 0x02 ( = decimal 2)
uint8_t num_sat Number of satellites in fix.
uint32_t tow time of week in seconds * 10^2
int16_t vx x-velocity * 8 in m/s
int16_t vy y-velocity * 8 in m/s
int16_t vz z-velocity * 8 in m/s
uint16_t week
int32_t x_pos x-position in m
int32_t y_pos y-position in m
int32_t z_pos z-position in m
struct sirf_msg_41

Message ID 41 from GPS.

Total payload length should be 91 bytes.

Definition at line 88 of file gps_sirf.h.

Data Fields
uint8_t add_info Additional mode info.
int32_t alt_ellipsoid in meters *10^2
int32_t alt_msl in meters *10^2
int16_t climb_rate in m/s * 10^2
int32_t clock_bias in m * 10^2
uint32_t clock_bias_err in m * 10^2
int32_t clock_drift in m/s * 10^2
uint32_t clock_drift_err in m/s * 10^2
uint16_t cog course over ground, in degrees clockwise from true north * 10^2
uint8_t day
uint32_t distance Distance traveled since reset in m.
uint16_t distance_err in meters
uint32_t ehpe estimated horizontal position error, in meters * 10^2
uint16_t ehve estimated horizontal velocity error in m/s * 10^2
uint32_t ete estimated time error, in seconds * 10^2
uint32_t evpe estimated vertical position error, in meters * 10^2
uint16_t extended_week_number
uint8_t hdop Horizontal dilution of precision x 5 (0.2 precision)
uint16_t heading_err in degrees * 10^2
int16_t heading_rate in deg/s * 10^2
uint8_t hour
int32_t latitude in degrees (+= North) *10^7
int32_t longitude in degrees (+= East) *10*7
int16_t mag_var not implemented
int8_t map_datum
uint8_t minute
uint8_t month
uint8_t msg_id hex value 0x29 (= decimal 41)
uint16_t nav_type
uint16_t nav_valid if equal to 0x0000, then navigation solution is valid
uint8_t num_sat Number of satellites used for solution.
uint32_t sat_id satellites used in solution. Each satellite corresponds with a bit, e.g. bit 1 ON = SV 1 is used in solution
uint16_t second
uint16_t sog speed over ground, in m/s * 10^2
uint32_t tow time of week in seconds *10^3]
uint16_t year

Macro Definition Documentation

#define GOT_A0   1

Definition at line 39 of file gps_sirf.h.

Referenced by sirf_parse_char().

#define GOT_A2   2

Definition at line 40 of file gps_sirf.h.

Referenced by sirf_parse_char().

#define GOT_B0   3

Definition at line 41 of file gps_sirf.h.

Referenced by sirf_parse_char().

#define GPS_NB_CHANNELS   16

Definition at line 34 of file gps_sirf.h.

#define Invert2Bytes (   x)    ((x>>8) | (x<<8))

Definition at line 54 of file gps_sirf.h.

Referenced by sirf_parse_2(), and sirf_parse_41().

#define Invert4Bytes (   x)    ((x>>24) | ((x<<8) & 0x00FF0000) | ((x>>8) & 0x0000FF00) | (x<<24))

Definition at line 55 of file gps_sirf.h.

Referenced by sirf_parse_2(), and sirf_parse_41().

#define SIRF_MAXLEN   255

Definition at line 35 of file gps_sirf.h.

#define UNINIT   0

Definition at line 38 of file gps_sirf.h.

Function Documentation

void gps_sirf_msg ( void  )
static void GpsEvent ( void  )
inlinestatic

Definition at line 137 of file gps_sirf.h.

References link_device::char_available, dev, link_device::get_byte, gps_sirf, gps_sirf_msg(), GpsSirf::msg_available, link_device::periph, and sirf_parse_char().

+ Here is the call graph for this function:

void sirf_parse_char ( uint8_t  c)

Definition at line 68 of file gps_sirf.c.

References GOT_A0, GOT_A2, GOT_B0, gps_sirf, GpsSirf::msg_available, GpsSirf::msg_buf, GpsSirf::msg_len, GpsSirf::read_state, TRUE, and UNINIT.

Referenced by GpsEvent().

+ Here is the caller graph for this function:

void sirf_parse_msg ( void  )

Definition at line 193 of file gps_sirf.c.

References FALSE, gps_sirf, GpsSirf::msg_buf, GpsSirf::msg_len, sys_time::nb_sec, GpsSirf::pos_available, sirf_parse_2(), sirf_parse_41(), start_time2, and ticks2.

Referenced by gps_sirf_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct GpsSirf gps_sirf