Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
gps_ubx.c File Reference
#include "modules/gps/gps_ubx.h"
#include "modules/core/abi.h"
#include "pprzlink/dl_protocol.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   0x01
 
#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_parse_HITL_UBX (uint8_t *buf)
 
static void gps_ubx_parse_nav_pvt (void)
 
static void gps_ubx_parse_nav_sol (void)
 
static void gps_ubx_parse_nav_posecef (void)
 
static void gps_ubx_parse_nav_posllh (void)
 
static void gps_ubx_parse_nav_posutm (void)
 
static void gps_ubx_parse_velecef (void)
 
static void gps_ubx_parse_nav_velned (void)
 
static void gps_ubx_parse_nav_svinfo (void)
 
static void gps_ubx_parse_nav_sat (void)
 
static void gps_ubx_parse_nav_status (void)
 
static void gps_ubx_parse_nav_relposned (void)
 
static void gps_ubx_parse_rxm_raw (void)
 
static void gps_ubx_parse_rxm_rtcm (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
 

Macro Definition Documentation

◆ DEBUG_PRINT

#define DEBUG_PRINT (   ...)    {}

Definition at line 46 of file gps_ubx.c.

◆ GOT_CHECKSUM1

#define GOT_CHECKSUM1   8

Definition at line 61 of file gps_ubx.c.

◆ GOT_CLASS

#define GOT_CLASS   3

Definition at line 56 of file gps_ubx.c.

◆ GOT_ID

#define GOT_ID   4

Definition at line 57 of file gps_ubx.c.

◆ GOT_LEN1

#define GOT_LEN1   5

Definition at line 58 of file gps_ubx.c.

◆ GOT_LEN2

#define GOT_LEN2   6

Definition at line 59 of file gps_ubx.c.

◆ GOT_PAYLOAD

#define GOT_PAYLOAD   7

Definition at line 60 of file gps_ubx.c.

◆ GOT_SYNC1

#define GOT_SYNC1   1

Definition at line 54 of file gps_ubx.c.

◆ GOT_SYNC2

#define GOT_SYNC2   2

Definition at line 55 of file gps_ubx.c.

◆ GPS_UBX_ERR_CHECKSUM

#define GPS_UBX_ERR_CHECKSUM   3

Definition at line 69 of file gps_ubx.c.

◆ GPS_UBX_ERR_MSG_TOO_LONG

#define GPS_UBX_ERR_MSG_TOO_LONG   2

Definition at line 68 of file gps_ubx.c.

◆ GPS_UBX_ERR_NONE

#define GPS_UBX_ERR_NONE   0

Definition at line 66 of file gps_ubx.c.

◆ GPS_UBX_ERR_OUT_OF_SYNC

#define GPS_UBX_ERR_OUT_OF_SYNC   5

Definition at line 71 of file gps_ubx.c.

◆ GPS_UBX_ERR_OVERRUN

#define GPS_UBX_ERR_OVERRUN   1

Definition at line 67 of file gps_ubx.c.

◆ GPS_UBX_ERR_UNEXPECTED

#define GPS_UBX_ERR_UNEXPECTED   4

Definition at line 70 of file gps_ubx.c.

◆ gps_ubx_ucenter_event

#define gps_ubx_ucenter_event ( )    {}

Definition at line 663 of file gps_ubx.c.

◆ NAV_RELPOSNED_VERSION

#define NAV_RELPOSNED_VERSION   0x01

Definition at line 64 of file gps_ubx.c.

◆ RXM_RTCM_VERSION

#define RXM_RTCM_VERSION   0x02

Definition at line 63 of file gps_ubx.c.

◆ UNINIT

#define UNINIT   0

Includes macros generated from ubx.xml.

Definition at line 53 of file gps_ubx.c.

◆ USE_GPS_UBX_RTCM

#define USE_GPS_UBX_RTCM   0

Definition at line 29 of file gps_ubx.c.

◆ UTM_HEM_NORTH

#define UTM_HEM_NORTH   0

Definition at line 73 of file gps_ubx.c.

◆ UTM_HEM_SOUTH

#define UTM_HEM_SOUTH   1

Definition at line 74 of file gps_ubx.c.

Function Documentation

◆ gps_ublox_write()

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

Definition at line 703 of file gps_ubx.c.

References buff, and dev.

◆ gps_ubx_event()

void gps_ubx_event ( void  )

Definition at line 110 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:

◆ gps_ubx_init()

◆ gps_ubx_msg()

◆ gps_ubx_parse()

◆ gps_ubx_parse_HITL_UBX()

void gps_ubx_parse_HITL_UBX ( uint8_t buf)

◆ gps_ubx_parse_nav_posecef()

static void gps_ubx_parse_nav_posecef ( void  )
static

◆ gps_ubx_parse_nav_posllh()

static void gps_ubx_parse_nav_posllh ( void  )
static

◆ gps_ubx_parse_nav_posutm()

static void gps_ubx_parse_nav_posutm ( void  )
static

◆ gps_ubx_parse_nav_pvt()

◆ gps_ubx_parse_nav_relposned()

◆ gps_ubx_parse_nav_sat()

static void gps_ubx_parse_nav_sat ( void  )
static

◆ gps_ubx_parse_nav_sol()

◆ gps_ubx_parse_nav_status()

static void gps_ubx_parse_nav_status ( void  )
static

Definition at line 363 of file gps_ubx.c.

References GpsState::fix, GPS_FIX_3D, gps_ubx, GpsUbx::msg_buf, GpsUbx::state, GpsUbx::status_flags, and GpsState::tow.

Referenced by gps_ubx_read_message().

+ Here is the caller graph for this function:

◆ gps_ubx_parse_nav_svinfo()

static void gps_ubx_parse_nav_svinfo ( void  )
static

Definition at line 323 of file gps_ubx.c.

References SVinfo::azim, SVinfo::cno, SVinfo::elev, SVinfo::flags, GPS_NB_CHANNELS, gps_ubx, Min, GpsUbx::msg_buf, GpsState::nb_channels, SVinfo::qi, GpsUbx::state, SVinfo::svid, and GpsState::svinfos.

Referenced by gps_ubx_read_message().

+ Here is the caller graph for this function:

◆ gps_ubx_parse_nav_velned()

static void gps_ubx_parse_nav_velned ( void  )
static

◆ gps_ubx_parse_rxm_raw()

static void gps_ubx_parse_rxm_raw ( void  )
static

Definition at line 418 of file gps_ubx.c.

References gps_ubx, GPS_UBX_NB_CHANNELS, Min, and GpsUbx::msg_buf.

Referenced by gps_ubx_read_message().

+ Here is the caller graph for this function:

◆ gps_ubx_parse_rxm_rtcm()

static void gps_ubx_parse_rxm_rtcm ( void  )
static

Definition at line 438 of file gps_ubx.c.

References RtcmMan::Cnt105, RtcmMan::Cnt177, RtcmMan::Cnt187, RtcmMan::Crc105, RtcmMan::Crc177, RtcmMan::Crc187, DEBUG_PRINT, gps_ubx, GpsUbx::msg_buf, RtcmMan::MsgType, RtcmMan::RefStation, rtcm_man, RTCMgetbitu(), and RXM_RTCM_VERSION.

Referenced by gps_ubx_read_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gps_ubx_parse_velecef()

static void gps_ubx_parse_velecef ( void  )
static

◆ gps_ubx_read_message()

◆ ubx_header()

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

Definition at line 628 of file gps_ubx.c.

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

+ Here is the call graph for this function:

◆ ubx_send_1byte()

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

Definition at line 621 of file gps_ubx.c.

References byte, dev, 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:

◆ ubx_send_bytes()

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

Definition at line 647 of file gps_ubx.c.

References dev, and ubx_send_1byte().

+ Here is the call graph for this function:

◆ ubx_send_cfg_rst()

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

Definition at line 655 of file gps_ubx.c.

References dev.

◆ ubx_trailer()

void ubx_trailer ( struct link_device *  dev)

Definition at line 640 of file gps_ubx.c.

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

Variable Documentation

◆ gps_ubx