Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
#include "subsystems/gps/gps_ubx.h"
#include "subsystems/abi.h"
#include "led.h"
#include "ubx_protocol.h"
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) |
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 |
#define DEBUG_PRINT | ( | ... | ) | {} |
Definition at line 45 of file gps_ubx.c.
Referenced by gps_ubx_parse_rxm_rtcm().
#define GOT_CHECKSUM1 8 |
Definition at line 60 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_CLASS 3 |
Definition at line 55 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_ID 4 |
Definition at line 56 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_LEN1 5 |
Definition at line 57 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_LEN2 6 |
Definition at line 58 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_PAYLOAD 7 |
Definition at line 59 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_SYNC1 1 |
Definition at line 53 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GOT_SYNC2 2 |
Definition at line 54 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GPS_UBX_ERR_CHECKSUM 3 |
Definition at line 68 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GPS_UBX_ERR_MSG_TOO_LONG 2 |
Definition at line 67 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GPS_UBX_ERR_NONE 0 |
Definition at line 65 of file gps_ubx.c.
Referenced by gps_ubx_init().
#define GPS_UBX_ERR_OUT_OF_SYNC 5 |
Definition at line 70 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GPS_UBX_ERR_OVERRUN 1 |
Definition at line 66 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define GPS_UBX_ERR_UNEXPECTED 4 |
Definition at line 69 of file gps_ubx.c.
Referenced by gps_ubx_parse().
#define gps_ubx_ucenter_event | ( | void | ) | {} |
Definition at line 631 of file gps_ubx.c.
Referenced by gps_ubx_msg().
#define NAV_RELPOSNED_VERSION 0x00 |
Definition at line 63 of file gps_ubx.c.
Referenced by gps_ubx_parse_nav_relposned().
#define RXM_RTCM_VERSION 0x02 |
Definition at line 62 of file gps_ubx.c.
Referenced by gps_ubx_parse_rxm_rtcm().
#define UNINIT 0 |
Includes macros generated from ubx.xml.
Definition at line 52 of file gps_ubx.c.
Referenced by gps_ubx_init(), and gps_ubx_parse().
#define UTM_HEM_SOUTH 1 |
Definition at line 73 of file gps_ubx.c.
Referenced by gps_ubx_parse_nav_posutm().
void gps_ubx_event | ( | void | ) |
Definition at line 108 of file gps_ubx.c.
References dev, gps_ubx, gps_ubx_msg(), gps_ubx_parse(), and GpsUbx::msg_available.
void gps_ubx_init | ( | void | ) |
Definition at line 98 of file gps_ubx.c.
References GpsState::comp_id, GpsUbx::error_cnt, GpsUbx::error_last, gps_ubx, GPS_UBX_ERR_NONE, GPS_UBX_ID, GpsUbx::msg_available, GpsUbx::state, GpsUbx::status, and UNINIT.
void gps_ubx_msg | ( | void | ) |
Definition at line 636 of file gps_ubx.c.
References GpsState::fix, get_sys_time_usec(), GPS_FIX_3D, gps_ubx, GPS_UBX_ID, gps_ubx_read_message(), gps_ubx_ucenter_event, GPS_VALID_VEL_NED_BIT, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, LED_ON, LED_TOGGLE, GpsUbx::msg_class, GpsUbx::msg_id, sys_time::nb_sec, sys_time::nb_sec_rem, GpsUbx::state, and GpsState::valid_fields.
Referenced by gps_ubx_event().
void gps_ubx_parse | ( | uint8_t | c | ) |
Definition at line 505 of file gps_ubx.c.
References GpsUbx::ck_a, GpsUbx::ck_b, GpsUbx::error_cnt, GpsUbx::error_last, GOT_CHECKSUM1, GOT_CLASS, GOT_ID, GOT_LEN1, GOT_LEN2, GOT_PAYLOAD, GOT_SYNC1, GOT_SYNC2, gps_ubx, GPS_UBX_ERR_CHECKSUM, GPS_UBX_ERR_MSG_TOO_LONG, GPS_UBX_ERR_OUT_OF_SYNC, GPS_UBX_ERR_OVERRUN, GPS_UBX_ERR_UNEXPECTED, GPS_UBX_MAX_PAYLOAD, GpsUbx::len, GpsUbx::msg_available, GpsUbx::msg_buf, GpsUbx::msg_class, GpsUbx::msg_id, GpsUbx::msg_idx, pprzLogFile, GpsUbx::status, and UNINIT.
Referenced by gps_ubx_event().
|
static |
Definition at line 214 of file gps_ubx.c.
References GpsState::ecef_pos, gps_ubx, GPS_VALID_POS_ECEF_BIT, GpsUbx::msg_buf, GpsState::pacc, GpsUbx::state, GpsState::tow, GpsState::valid_fields, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 228 of file gps_ubx.c.
References LlaCoor_i::alt, gps_ubx, GPS_VALID_HMSL_BIT, GPS_VALID_POS_LLA_BIT, GpsState::hacc, GpsState::hmsl, LlaCoor_i::lat, GpsState::lla_pos, LlaCoor_i::lon, GpsUbx::msg_buf, GpsUbx::state, GpsState::vacc, and GpsState::valid_fields.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 245 of file gps_ubx.c.
References UtmCoor_i::alt, UtmCoor_i::east, gps_ubx, GPS_VALID_HMSL_BIT, GPS_VALID_POS_UTM_BIT, GpsState::hmsl, GpsUbx::msg_buf, UtmCoor_i::north, GpsUbx::state, UTM_HEM_SOUTH, GpsState::utm_pos, GpsState::valid_fields, and UtmCoor_i::zone.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 120 of file gps_ubx.c.
References LlaCoor_i::alt, GpsState::cacc, GpsState::course, GpsState::fix, gps_ubx, GPS_VALID_COURSE_BIT, GPS_VALID_HMSL_BIT, GPS_VALID_POS_LLA_BIT, GPS_VALID_VEL_NED_BIT, gps_week_number(), GpsState::gspeed, GpsState::hacc, GpsState::hmsl, LlaCoor_i::lat, GpsState::lla_pos, LlaCoor_i::lon, GpsUbx::msg_buf, GpsState::ned_vel, GpsState::num_sv, GpsState::pdop, GpsState::sacc, GpsUbx::state, GpsState::tow, GpsState::vacc, GpsState::valid_fields, GpsState::week, NedCoor_i::x, NedCoor_i::y, and NedCoor_i::z.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 348 of file gps_ubx.c.
References GpsRelposNED::accD, GpsRelposNED::accE, GpsRelposNED::accN, GpsRelposNED::carrSoln, GpsRelposNED::diffSoln, GpsState::fix, GpsRelposNED::gnssFixOK, gps_relposned, gps_ubx, GpsRelposNED::iTOW, GpsUbx::msg_buf, NAV_RELPOSNED_VERSION, GpsRelposNED::refStationId, GpsRelposNED::relPosD, GpsRelposNED::relPosE, GpsRelposNED::relPosHPD, GpsRelposNED::relPosHPE, GpsRelposNED::relPosHPN, GpsRelposNED::relPosN, GpsRelposNED::relPosValid, RTCMgetbitu(), and GpsUbx::state.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 315 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, GpsState::svinfos, and GpsState::tow.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 186 of file gps_ubx.c.
References GpsState::ecef_pos, GpsState::ecef_vel, GpsState::fix, gps_ubx, GPS_VALID_POS_ECEF_BIT, GPS_VALID_VEL_ECEF_BIT, GpsUbx::msg_buf, GpsState::num_sv, GpsState::pacc, GpsState::pdop, GpsState::sacc, GpsUbx::state, GpsState::tow, GpsState::valid_fields, GpsState::week, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 339 of file gps_ubx.c.
References GpsState::fix, gps_ubx, GpsUbx::msg_buf, GpsUbx::state, GpsUbx::status_flags, and GpsState::tow.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 299 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().
|
static |
Definition at line 278 of file gps_ubx.c.
References GpsState::cacc, GpsState::course, gps_ubx, GPS_VALID_COURSE_BIT, GPS_VALID_VEL_NED_BIT, GpsState::gspeed, GpsUbx::msg_buf, GpsState::ned_vel, GpsState::speed_3d, GpsUbx::state, GpsState::tow, GpsState::valid_fields, NedCoor_i::x, NedCoor_i::y, and NedCoor_i::z.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 386 of file gps_ubx.c.
References gps_ubx, GPS_UBX_NB_CHANNELS, Min, and GpsUbx::msg_buf.
Referenced by gps_ubx_read_message().
|
static |
Definition at line 406 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().
|
static |
Definition at line 264 of file gps_ubx.c.
References GpsState::ecef_vel, gps_ubx, GPS_VALID_VEL_ECEF_BIT, GpsUbx::msg_buf, GpsState::sacc, GpsUbx::state, GpsState::tow, GpsState::valid_fields, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_ubx_read_message().
void gps_ubx_read_message | ( | void | ) |
Definition at line 443 of file gps_ubx.c.
References gps_ubx, gps_ubx_parse_nav_posecef(), gps_ubx_parse_nav_posllh(), gps_ubx_parse_nav_posutm(), gps_ubx_parse_nav_pvt(), gps_ubx_parse_nav_relposned(), gps_ubx_parse_nav_sat(), gps_ubx_parse_nav_sol(), gps_ubx_parse_nav_status(), gps_ubx_parse_nav_svinfo(), gps_ubx_parse_nav_velned(), gps_ubx_parse_rxm_raw(), gps_ubx_parse_rxm_rtcm(), gps_ubx_parse_velecef(), GpsUbx::msg_class, and GpsUbx::msg_id.
Referenced by gps_ubx_msg().
Definition at line 596 of file gps_ubx.c.
References gps_ubx, GpsUbx::send_ck_a, GpsUbx::send_ck_b, and ubx_send_1byte().
|
static |
Definition at line 589 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().
Definition at line 615 of file gps_ubx.c.
References ubx_send_1byte().
void ubx_trailer | ( | struct link_device * | dev | ) |
Definition at line 608 of file gps_ubx.c.
References gps_ubx, GpsUbx::send_ck_a, and GpsUbx::send_ck_b.
struct GpsUbx gps_ubx |
Definition at line 75 of file gps_ubx.c.
Referenced by ArduIMU_periodicGPS(), gps_ubx_event(), gps_ubx_init(), gps_ubx_msg(), gps_ubx_parse(), gps_ubx_parse_nav_posecef(), gps_ubx_parse_nav_posllh(), gps_ubx_parse_nav_posutm(), gps_ubx_parse_nav_pvt(), gps_ubx_parse_nav_relposned(), gps_ubx_parse_nav_sat(), gps_ubx_parse_nav_sol(), gps_ubx_parse_nav_status(), gps_ubx_parse_nav_svinfo(), gps_ubx_parse_nav_velned(), gps_ubx_parse_rxm_raw(), gps_ubx_parse_rxm_rtcm(), gps_ubx_parse_velecef(), gps_ubx_read_message(), gps_ubx_ucenter_event(), ubx_header(), ubx_send_1byte(), and ubx_trailer().