Paparazzi UAS  v5.15_devel-109-gee85905
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_ubx.c File Reference
#include "subsystems/gps/gps_ubx.h"
#include "subsystems/abi.h"
#include "led.h"
#include "ubx_protocol.h"
+ Include dependency graph for gps_ubx.c:

Go to the source code of this file.

Macros

#define USE_GPS_UBX_RTCM   0
 
#define DEBUG_PRINT(...)   {}
 
#define UNINIT   0
 Includes macros generated from ubx.xml. More...
 
#define GOT_SYNC1   1
 
#define GOT_SYNC2   2
 
#define GOT_CLASS   3
 
#define GOT_ID   4
 
#define GOT_LEN1   5
 
#define GOT_LEN2   6
 
#define GOT_PAYLOAD   7
 
#define GOT_CHECKSUM1   8
 
#define RXM_RTCM_VERSION   0x02
 
#define NAV_RELPOSNED_VERSION   0x00
 
#define GPS_UBX_ERR_NONE   0
 
#define GPS_UBX_ERR_OVERRUN   1
 
#define GPS_UBX_ERR_MSG_TOO_LONG   2
 
#define GPS_UBX_ERR_CHECKSUM   3
 
#define GPS_UBX_ERR_UNEXPECTED   4
 
#define GPS_UBX_ERR_OUT_OF_SYNC   5
 
#define UTM_HEM_NORTH   0
 
#define UTM_HEM_SOUTH   1
 
#define gps_ubx_ucenter_event()   {}
 

Functions

void gps_ubx_init (void)
 
void gps_ubx_event (void)
 
void gps_ubx_read_message (void)
 
void gps_ubx_parse (uint8_t c)
 
static void ubx_send_1byte (struct link_device *dev, uint8_t byte)
 
void ubx_header (struct link_device *dev, uint8_t nav_id, uint8_t msg_id, uint16_t len)
 
void ubx_trailer (struct link_device *dev)
 
void ubx_send_bytes (struct link_device *dev, uint8_t len, uint8_t *bytes)
 
void ubx_send_cfg_rst (struct link_device *dev, uint16_t bbr, uint8_t reset_mode)
 
void gps_ubx_msg (void)
 
void gps_ublox_write (struct link_device *dev, uint8_t *buff, uint32_t n)
 

Variables

struct GpsUbx gps_ubx
 
bool safeToInject = true
 
struct GpsTimeSync gps_ubx_time_sync
 

Macro Definition Documentation

#define DEBUG_PRINT (   ...)    {}

Definition at line 43 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

#define GOT_CHECKSUM1   8

Definition at line 58 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_CLASS   3

Definition at line 53 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_ID   4

Definition at line 54 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_LEN1   5

Definition at line 55 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_LEN2   6

Definition at line 56 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_PAYLOAD   7

Definition at line 57 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_SYNC1   1

Definition at line 51 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_SYNC2   2

Definition at line 52 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_CHECKSUM   3

Definition at line 66 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_MSG_TOO_LONG   2

Definition at line 65 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_NONE   0

Definition at line 63 of file gps_ubx.c.

Referenced by gps_ubx_init().

#define GPS_UBX_ERR_OUT_OF_SYNC   5

Definition at line 68 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_OVERRUN   1

Definition at line 64 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_UNEXPECTED   4

Definition at line 67 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define gps_ubx_ucenter_event (   void)    {}

Definition at line 433 of file gps_ubx.c.

Referenced by gps_ubx_msg().

#define NAV_RELPOSNED_VERSION   0x00

Definition at line 61 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

#define RXM_RTCM_VERSION   0x02

Definition at line 60 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

#define UNINIT   0

Includes macros generated from ubx.xml.

Definition at line 50 of file gps_ubx.c.

Referenced by gps_ubx_init(), and gps_ubx_parse().

#define USE_GPS_UBX_RTCM   0

Definition at line 28 of file gps_ubx.c.

#define UTM_HEM_NORTH   0

Definition at line 70 of file gps_ubx.c.

#define UTM_HEM_SOUTH   1

Definition at line 71 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

Function Documentation

void gps_ublox_write ( struct link_device *  dev,
uint8_t buff,
uint32_t  n 
)

Definition at line 465 of file gps_ubx.c.

void gps_ubx_event ( void  )

Definition at line 109 of file gps_ubx.c.

References dev, gps_ubx, gps_ubx_msg(), gps_ubx_parse(), and GpsUbx::msg_available.

+ Here is the call graph for this function:

void gps_ubx_read_message ( void  )

Definition at line 121 of file gps_ubx.c.

References GpsRelposNED::accD, GpsRelposNED::accE, GpsRelposNED::accN, LlaCoor_i::alt, UtmCoor_i::alt, SVinfo::azim, GpsState::cacc, GpsRelposNED::carrSoln, SVinfo::cno, RtcmMan::Cnt105, RtcmMan::Cnt177, RtcmMan::Cnt187, GpsState::course, RtcmMan::Crc105, RtcmMan::Crc177, RtcmMan::Crc187, DEBUG_PRINT, GpsRelposNED::diffSoln, UtmCoor_i::east, GpsState::ecef_pos, GpsState::ecef_vel, SVinfo::elev, GpsState::fix, SVinfo::flags, GpsRelposNED::gnssFixOK, GPS_FIX_3D, GPS_NB_CHANNELS, gps_relposned, gps_ubx, GPS_UBX_NB_CHANNELS, gps_ubx_time_sync, GPS_VALID_COURSE_BIT, GPS_VALID_HMSL_BIT, GPS_VALID_POS_ECEF_BIT, GPS_VALID_POS_LLA_BIT, GPS_VALID_POS_UTM_BIT, GPS_VALID_VEL_ECEF_BIT, GPS_VALID_VEL_NED_BIT, GpsState::gspeed, GpsState::hacc, GpsState::hmsl, GpsRelposNED::iTOW, LlaCoor_i::lat, LED_ON, LED_TOGGLE, GpsState::lla_pos, LlaCoor_i::lon, Min, GpsUbx::msg_buf, GpsUbx::msg_class, GpsUbx::msg_id, RtcmMan::MsgType, NAV_RELPOSNED_VERSION, GpsState::nb_channels, sys_time::nb_tick, GpsState::ned_vel, UtmCoor_i::north, GpsState::num_sv, GpsState::pacc, GpsState::pdop, SVinfo::qi, RtcmMan::RefStation, GpsRelposNED::refStationId, GpsRelposNED::relPosD, GpsRelposNED::relPosE, GpsRelposNED::relPosHPD, GpsRelposNED::relPosHPE, GpsRelposNED::relPosHPN, GpsRelposNED::relPosN, GpsRelposNED::relPosValid, rtcm_man, RTCMgetbitu(), RXM_RTCM_VERSION, GpsState::sacc, GpsUbx::sol_flags, GpsState::speed_3d, GpsUbx::state, GpsUbx::status_flags, SVinfo::svid, GpsState::svinfos, GpsTimeSync::t0_ticks, GpsTimeSync::t0_tow, GpsTimeSync::t0_tow_frac, GpsState::tow, UTM_HEM_SOUTH, GpsState::utm_pos, GpsState::vacc, GpsState::valid_fields, GpsState::week, EcefCoor_i::x, NedCoor_i::x, EcefCoor_i::y, NedCoor_i::y, EcefCoor_i::z, NedCoor_i::z, and UtmCoor_i::zone.

Referenced by gps_ubx_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ubx_header ( struct link_device *  dev,
uint8_t  nav_id,
uint8_t  msg_id,
uint16_t  len 
)

Definition at line 398 of file gps_ubx.c.

References gps_ubx, GpsUbx::send_ck_a, GpsUbx::send_ck_b, and ubx_send_1byte().

+ Here is the call graph for this function:

static void ubx_send_1byte ( struct link_device *  dev,
uint8_t  byte 
)
static

Definition at line 391 of file gps_ubx.c.

References byte, gps_ubx, GpsUbx::send_ck_a, and GpsUbx::send_ck_b.

Referenced by ubx_header(), and ubx_send_bytes().

+ Here is the caller graph for this function:

void ubx_send_bytes ( struct link_device *  dev,
uint8_t  len,
uint8_t bytes 
)

Definition at line 417 of file gps_ubx.c.

References ubx_send_1byte().

+ Here is the call graph for this function:

void ubx_send_cfg_rst ( struct link_device *  dev,
uint16_t  bbr,
uint8_t  reset_mode 
)

Definition at line 425 of file gps_ubx.c.

void ubx_trailer ( struct link_device *  dev)

Definition at line 410 of file gps_ubx.c.

References gps_ubx, GpsUbx::send_ck_a, and GpsUbx::send_ck_b.

Variable Documentation

struct GpsTimeSync gps_ubx_time_sync

Definition at line 97 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

bool safeToInject = true

Definition at line 96 of file gps_ubx.c.