Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gps_sirf.c File Reference
#include "modules/gps/gps.h"
#include "modules/core/abi.h"
#include "led.h"
#include "math/pprz_geodetic_float.h"
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include "gps_sirf.h"
#include "pprzlink/pprzlink_device.h"
#include "mcu_periph/uart.h"
+ Include dependency graph for gps_sirf.c:

Go to the source code of this file.

Data Structures

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

Macros

#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)
 
void sirf_parse_2 (void)
 
void sirf_parse_41 (void)
 
void gps_sirf_init (void)
 
void gps_sirf_event (void)
 

Variables

struct GpsSirf gps_sirf
 
int start_time = 0
 
int ticks = 0
 
int start_time2 = 0
 
int ticks2 = 0
 

Data Structure Documentation

◆ sirf_msg_2

struct sirf_msg_2

Message ID 2 from GPS.

Total payload length should be 41 bytes.

Definition at line 43 of file gps_sirf.c.

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

◆ sirf_msg_41

struct sirf_msg_41

Message ID 41 from GPS.

Total payload length should be 91 bytes.

Definition at line 73 of file gps_sirf.c.

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

◆ Invert2Bytes

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

Definition at line 39 of file gps_sirf.c.

◆ Invert4Bytes

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

Definition at line 40 of file gps_sirf.c.

Function Documentation

◆ gps_sirf_event()

void gps_sirf_event ( void  )

Definition at line 287 of file gps_sirf.c.

References dev, gps_sirf, gps_sirf_msg(), GpsSirf::msg_available, and sirf_parse_char().

+ Here is the call graph for this function:

◆ gps_sirf_init()

void gps_sirf_init ( void  )

◆ gps_sirf_msg()

void gps_sirf_msg ( void  )

◆ sirf_parse_2()

◆ sirf_parse_41()

◆ sirf_parse_char()

void sirf_parse_char ( uint8_t  c)

Definition at line 147 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, and UNINIT.

Referenced by gps_sirf_event().

+ Here is the caller graph for this function:

◆ sirf_parse_msg()

void sirf_parse_msg ( void  )

Definition at line 261 of file gps_sirf.c.

References gps_sirf, GpsSirf::msg_buf, GpsSirf::msg_len, GpsSirf::msg_valid, sys_time::nb_sec, 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

◆ gps_sirf

◆ start_time

int start_time = 0

Definition at line 192 of file gps_sirf.c.

Referenced by sirf_parse_2(), and sys_time_register_timer().

◆ start_time2

int start_time2 = 0

Definition at line 194 of file gps_sirf.c.

Referenced by sirf_parse_2(), and sirf_parse_msg().

◆ ticks

int ticks = 0

◆ ticks2

int ticks2 = 0

Definition at line 195 of file gps_sirf.c.

Referenced by sirf_parse_2(), and sirf_parse_msg().