Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_ubx.h File Reference

UBX protocol specific code. More...

#include "subsystems/gps.h"
#include "mcu_periph/uart.h"
#include "pprzlink/pprzlink_device.h"
+ Include dependency graph for gps_ubx.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GpsUbx
 

Macros

#define PRIMARY_GPS   GPS_UBX
 
#define gps_ubx_periodic_check()   gps_periodic_check(&gps_ubx.state)
 
#define GPS_UBX_NB_CHANNELS   16
 
#define GPS_UBX_MAX_PAYLOAD   255
 
#define CFG_RST_Reset_Hardware   0x00
 
#define CFG_RST_Reset_Controlled   0x01
 
#define CFG_RST_Reset_Controlled_GPS_only   0x02
 
#define CFG_RST_Reset_Controlled_GPS_stop   0x08
 
#define CFG_RST_Reset_Controlled_GPS_start   0x09
 
#define CFG_RST_BBR_Hotstart   0x0000
 
#define CFG_RST_BBR_Warmstart   0x0001
 
#define CFG_RST_BBR_Coldstart   0xffff
 
#define gps_ubx_Reset(_val)
 

Functions

void gps_ubx_init (void)
 
void gps_ubx_event (void)
 
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_read_message (void)
 
void gps_ubx_parse (uint8_t c)
 
void gps_ubx_msg (void)
 

Variables

struct GpsUbx gps_ubx
 

Detailed Description

UBX protocol specific code.

Definition in file gps_ubx.h.


Data Structure Documentation

struct GpsUbx

Definition at line 54 of file gps_ubx.h.

+ Collaboration diagram for GpsUbx:
Data Fields
uint8_t ck_a
uint8_t ck_b
uint8_t error_cnt
uint8_t error_last
uint16_t len
bool msg_available
uint8_t msg_buf[GPS_UBX_MAX_PAYLOAD]
uint8_t msg_class
uint8_t msg_id
uint8_t msg_idx
uint8_t send_ck_a
uint8_t send_ck_b
uint8_t sol_flags
struct GpsState state
uint8_t status
uint8_t status_flags

Macro Definition Documentation

#define CFG_RST_BBR_Coldstart   0xffff

Definition at line 123 of file gps_ubx.h.

#define CFG_RST_BBR_Hotstart   0x0000

Definition at line 121 of file gps_ubx.h.

#define CFG_RST_BBR_Warmstart   0x0001

Definition at line 122 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled   0x01

Definition at line 116 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_only   0x02

Definition at line 117 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_start   0x09

Definition at line 119 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_stop   0x08

Definition at line 118 of file gps_ubx.h.

#define CFG_RST_Reset_Hardware   0x00

Definition at line 115 of file gps_ubx.h.

#define GPS_UBX_MAX_PAYLOAD   255

Definition at line 53 of file gps_ubx.h.

Referenced by gps_ubx_parse().

#define GPS_UBX_NB_CHANNELS   16

Definition at line 51 of file gps_ubx.h.

Referenced by gps_ubx_read_message().

#define gps_ubx_periodic_check ( )    gps_periodic_check(&gps_ubx.state)

Definition at line 49 of file gps_ubx.h.

#define gps_ubx_Reset (   _val)
Value:
{ \
gps_ubx.reset = _val; \
ubx_send_cfg_rst(&(UBX_GPS_LINK).device, gps_ubx.reset, CFG_RST_Reset_Controlled); \
}
#define CFG_RST_Reset_Controlled
Definition: gps_ubx.h:116
void ubx_send_cfg_rst(struct link_device *dev, uint16_t bbr, uint8_t reset_mode)
Definition: gps_ubx.c:423
struct GpsUbx gps_ubx
Definition: gps_ubx.c:73
#define CFG_RST_BBR_Coldstart
Definition: gps_ubx.h:123
#define CFG_RST_BBR_Warmstart
Definition: gps_ubx.h:122
if(PrimarySpektrumState.SpektrumTimer)

Definition at line 125 of file gps_ubx.h.

#define PRIMARY_GPS   GPS_UBX

Definition at line 43 of file gps_ubx.h.

Function Documentation

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::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::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 396 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:

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

Definition at line 415 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 423 of file gps_ubx.c.

void ubx_trailer ( struct link_device *  dev)

Definition at line 408 of file gps_ubx.c.

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

Variable Documentation