Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Configure Ublox GPS. More...
#include "modules/gps/gps_ubx_ucenter.h"
#include "subsystems/gps/gps_ubx.h"
#include "ubx_protocol.h"
#include "subsystems/datalink/downlink.h"
#include <stdio.h>
Go to the source code of this file.
Functions | |
static bool_t | gps_ubx_ucenter_autobaud (uint8_t nr) |
Automatically determine the baudrate of the u-blox module. More... | |
static bool_t | gps_ubx_ucenter_configure (uint8_t nr) |
void | gps_ubx_ucenter_init (void) |
void | gps_ubx_ucenter_periodic (void) |
void | gps_ubx_ucenter_event (void) |
static void | gps_ubx_ucenter_config_port_poll (void) |
Polls the u-blox port configuration When the payload is omitted (zero length), the configuration for the incoming (currently used) port is reported. More... | |
static void | gps_ubx_ucenter_enable_msg (uint8_t class, uint8_t id, uint8_t rate) |
Enable u-blox message at desired period. More... | |
static void | gps_ubx_ucenter_config_nav (void) |
static void | gps_ubx_ucenter_config_port (void) |
static void | gps_ubx_ucenter_config_sbas (void) |
Variables | |
struct gps_ubx_ucenter_struct | gps_ubx_ucenter |
Configure Ublox GPS.
Definition in file gps_ubx_ucenter.c.
#define DEBUG_PRINT | ( | ... | ) | {} |
Definition at line 39 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port(), gps_ubx_ucenter_configure(), gps_ubx_ucenter_event(), and gps_ubx_ucenter_periodic().
#define GPS_PORT_DDC 0x00 |
Definition at line 379 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define GPS_PORT_RESERVED 0x05 |
Definition at line 384 of file gps_ubx_ucenter.c.
#define GPS_PORT_SPI 0x04 |
Definition at line 383 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define GPS_PORT_UART1 0x01 |
Definition at line 380 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define GPS_PORT_UART2 0x02 |
Definition at line 381 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define GPS_PORT_USB 0x03 |
Definition at line 382 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define GPS_SBAS_AUTOSCAN 0x00 |
Definition at line 432 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_SBAS_CORRECTIONS 0x02 |
Definition at line 427 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_SBAS_ENABLED 0x01 |
Definition at line 424 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_SBAS_INTEGRITY 0x04 |
Definition at line 428 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_SBAS_MAX_SBAS 1 |
Definition at line 430 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_SBAS_RANGING 0x01 |
Definition at line 426 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_sbas().
#define GPS_UBX_NAV5_DYNAMICS NAV5_DYN_AIRBORNE_2G |
Definition at line 326 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define GPS_UBX_UCENTER_RATE 0x00FA |
Definition at line 387 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_configure().
#define GPS_UBX_UCENTER_REPLY_ACK 1 |
Definition at line 55 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_configure(), and gps_ubx_ucenter_event().
#define GPS_UBX_UCENTER_REPLY_CFG_PRT 4 |
Definition at line 58 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_event().
#define GPS_UBX_UCENTER_REPLY_NACK 2 |
Definition at line 56 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_event().
#define GPS_UBX_UCENTER_REPLY_NONE 0 |
Definition at line 54 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_configure(), and gps_ubx_ucenter_init().
#define GPS_UBX_UCENTER_REPLY_VERSION 3 |
Definition at line 57 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_event().
#define GPS_UBX_UCENTER_STATUS_AUTOBAUD 1 |
Definition at line 51 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_init(), and gps_ubx_ucenter_periodic().
#define GPS_UBX_UCENTER_STATUS_CONFIG 2 |
Definition at line 52 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_periodic().
#define GPS_UBX_UCENTER_STATUS_STOPPED 0 |
Definition at line 50 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_event(), and gps_ubx_ucenter_periodic().
#define IGNORED 0 |
Definition at line 342 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_2D_ONLY 1 |
Definition at line 331 of file gps_ubx_ucenter.c.
#define NAV5_3D_ONLY 2 |
Definition at line 332 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_AUTO 3 |
Definition at line 333 of file gps_ubx_ucenter.c.
#define NAV5_DEFAULT_MIN_ELEV 5 |
Definition at line 335 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DEFAULT_P_ACC 100 |
Definition at line 338 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DEFAULT_PDOP_MASK 25 |
Definition at line 336 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DEFAULT_STATIC_HOLD_THRES 0 |
Definition at line 340 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DEFAULT_T_ACC 300 |
Definition at line 339 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DEFAULT_TDOP_MASK 25 |
Definition at line 337 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV5_DYN_AIRBORNE_1G 6 |
Definition at line 321 of file gps_ubx_ucenter.c.
#define NAV5_DYN_AIRBORNE_2G 7 |
Definition at line 322 of file gps_ubx_ucenter.c.
#define NAV5_DYN_AIRBORNE_4G 8 |
Definition at line 323 of file gps_ubx_ucenter.c.
#define NAV5_DYN_AUTOMOTIVE 4 |
Definition at line 319 of file gps_ubx_ucenter.c.
#define NAV5_DYN_FIXED 1 |
Definition at line 316 of file gps_ubx_ucenter.c.
#define NAV5_DYN_PEDESTRIAN 3 |
Definition at line 318 of file gps_ubx_ucenter.c.
#define NAV5_DYN_PORTABLE 0 |
Definition at line 315 of file gps_ubx_ucenter.c.
#define NAV5_DYN_SEA 5 |
Definition at line 320 of file gps_ubx_ucenter.c.
#define NAV5_DYN_STATIONARY 2 |
Definition at line 317 of file gps_ubx_ucenter.c.
#define NAV5_MASK 0x05 |
Definition at line 329 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV_DYN_AIRBORNE_1G 5 |
Definition at line 311 of file gps_ubx_ucenter.c.
#define NAV_DYN_AIRBORNE_2G 6 |
Definition at line 312 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define NAV_DYN_AIRBORNE_4G 7 |
Definition at line 313 of file gps_ubx_ucenter.c.
#define NAV_DYN_AUTOMOTIVE 3 |
Definition at line 309 of file gps_ubx_ucenter.c.
#define NAV_DYN_PEDESTRIAN 2 |
Definition at line 308 of file gps_ubx_ucenter.c.
#define NAV_DYN_SEA 4 |
Definition at line 310 of file gps_ubx_ucenter.c.
#define NAV_DYN_STATIONARY 1 |
Definition at line 307 of file gps_ubx_ucenter.c.
#define NMEA_PROTO_MASK 0x0002 |
Definition at line 376 of file gps_ubx_ucenter.c.
#define RESERVED 0 |
Definition at line 343 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_nav().
#define RTCM_PROTO_MASK 0x0004 |
Definition at line 377 of file gps_ubx_ucenter.c.
#define UBX_GPS_BAUD (GPS_LINK).baudrate |
Definition at line 61 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_init().
#define UBX_PROTO_MASK 0x0001 |
Definition at line 375 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
#define UBX_UART_MODE_MASK 0x000008D0 |
Definition at line 373 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_config_port().
|
static |
Automatically determine the baudrate of the u-blox module.
Only needed when connecting to a UART port on the u-blox. The discovered baudrate is copied to gps_ubx_ucenter.baud_init.
nr | Autobaud step number to perform |
Definition at line 229 of file gps_ubx_ucenter.c.
References B115200, B230400, B38400, B4800, B57600, B9600, gps_ubx_ucenter_struct::baud_init, gps_ubx_ucenter_struct::baud_run, FALSE, gps_ubx_ucenter, gps_ubx_ucenter_config_port_poll(), GPS_UBX_UCENTER_REPLY_ACK, GPS_UBX_UCENTER_REPLY_NONE, gps_ubx_ucenter_struct::reply, TRUE, and uart_periph_set_baudrate().
Referenced by gps_ubx_ucenter_periodic().
|
inlinestatic |
Definition at line 345 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::dev, GPS_UBX_NAV5_DYNAMICS, gps_ubx_ucenter, gps_ubx_ucenter_struct::hw_ver_h, IGNORED, NAV5_3D_ONLY, NAV5_DEFAULT_MIN_ELEV, NAV5_DEFAULT_P_ACC, NAV5_DEFAULT_PDOP_MASK, NAV5_DEFAULT_STATIC_HOLD_THRES, NAV5_DEFAULT_T_ACC, NAV5_DEFAULT_TDOP_MASK, NAV5_MASK, NAV_DYN_AIRBORNE_2G, RESERVED, and gps_ubx_ucenter_struct::sw_ver_h.
Referenced by gps_ubx_ucenter_configure().
|
inlinestatic |
Definition at line 390 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::baud_target, DEBUG_PRINT, gps_ubx_ucenter_struct::dev, GPS_I2C_SLAVE_ADDR, GPS_PORT_DDC, GPS_PORT_SPI, GPS_PORT_UART1, GPS_PORT_UART2, GPS_PORT_USB, gps_ubx_ucenter, gps_ubx_ucenter_struct::port_id, UART_SPEED, UBX_PROTO_MASK, and UBX_UART_MODE_MASK.
Referenced by gps_ubx_ucenter_configure().
|
inlinestatic |
Polls the u-blox port configuration When the payload is omitted (zero length), the configuration for the incoming (currently used) port is reported.
Definition at line 199 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::dev, and gps_ubx_ucenter.
Referenced by gps_ubx_ucenter_autobaud().
|
inlinestatic |
Definition at line 434 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::dev, GPS_SBAS_AUTOSCAN, GPS_SBAS_CORRECTIONS, GPS_SBAS_ENABLED, GPS_SBAS_INTEGRITY, GPS_SBAS_MAX_SBAS, GPS_SBAS_RANGING, and gps_ubx_ucenter.
Referenced by gps_ubx_ucenter_configure().
|
static |
Definition at line 445 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::baud_init, gps_ubx_ucenter_struct::baud_run, gps_ubx_ucenter_struct::baud_target, DEBUG_PRINT, DefaultChannel, DefaultDevice, gps_ubx_ucenter_struct::dev, FALSE, gps_ubx_ucenter, gps_ubx_ucenter_config_nav(), gps_ubx_ucenter_config_port(), gps_ubx_ucenter_config_sbas(), GPS_UBX_UCENTER_CONFIG_STEPS, gps_ubx_ucenter_enable_msg(), GPS_UBX_UCENTER_RATE, GPS_UBX_UCENTER_REPLY_ACK, GPS_UBX_UCENTER_REPLY_NONE, gps_ubx_ucenter_struct::hw_ver_h, gps_ubx_ucenter_struct::hw_ver_l, gps_ubx_ucenter_struct::replies, gps_ubx_ucenter_struct::reply, gps_ubx_ucenter_struct::sw_ver_h, gps_ubx_ucenter_struct::sw_ver_l, TRUE, uart_periph_set_baudrate(), and UART_SPEED.
Referenced by gps_ubx_ucenter_periodic().
Enable u-blox message at desired period.
Will enable the message on the port that this command is received on. For example, sending this configuration message over UART1 will cause the desired message to be published on UART1.
For more information on u-blox messages, see the protocol specification. http://www.ublox.com/en/download/documents-a-resources.html
class | u-blox message class |
id | u-blox message ID |
rate | Desired period to send message. Example: Setting 3 would send the message on every 3rd navigation solution. |
Definition at line 216 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::dev, and gps_ubx_ucenter.
Referenced by gps_ubx_ucenter_configure().
void gps_ubx_ucenter_event | ( | void | ) |
Definition at line 140 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::baud_run, DEBUG_PRINT, gps_ubx, gps_ubx_ucenter, GPS_UBX_UCENTER_REPLY_ACK, GPS_UBX_UCENTER_REPLY_CFG_PRT, GPS_UBX_UCENTER_REPLY_NACK, GPS_UBX_UCENTER_REPLY_VERSION, GPS_UBX_UCENTER_STATUS_STOPPED, gps_ubx_ucenter_struct::hw_ver_h, gps_ubx_ucenter_struct::hw_ver_l, GpsUbx::msg_buf, GpsUbx::msg_class, GpsUbx::msg_id, gps_ubx_ucenter_struct::port_id, gps_ubx_ucenter_struct::reply, gps_ubx_ucenter_struct::status, gps_ubx_ucenter_struct::sw_ver_h, and gps_ubx_ucenter_struct::sw_ver_l.
void gps_ubx_ucenter_init | ( | void | ) |
Definition at line 70 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::baud_init, gps_ubx_ucenter_struct::baud_run, gps_ubx_ucenter_struct::baud_target, gps_ubx_ucenter_struct::cnt, gps_ubx_ucenter_struct::dev, gps_ubx_ucenter, GPS_UBX_UCENTER_CONFIG_STEPS, GPS_UBX_UCENTER_REPLY_NONE, GPS_UBX_UCENTER_STATUS_AUTOBAUD, gps_ubx_ucenter_struct::hw_ver_h, gps_ubx_ucenter_struct::hw_ver_l, gps_ubx_ucenter_struct::replies, gps_ubx_ucenter_struct::reply, gps_ubx_ucenter_struct::status, gps_ubx_ucenter_struct::sw_ver_h, gps_ubx_ucenter_struct::sw_ver_l, and UBX_GPS_BAUD.
void gps_ubx_ucenter_periodic | ( | void | ) |
Definition at line 98 of file gps_ubx_ucenter.c.
References gps_ubx_ucenter_struct::baud_init, gps_ubx_ucenter_struct::cnt, DEBUG_PRINT, FALSE, gps_ubx_ucenter, gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_configure(), GPS_UBX_UCENTER_STATUS_AUTOBAUD, GPS_UBX_UCENTER_STATUS_CONFIG, GPS_UBX_UCENTER_STATUS_STOPPED, and gps_ubx_ucenter_struct::status.
struct gps_ubx_ucenter_struct gps_ubx_ucenter |
Definition at line 64 of file gps_ubx_ucenter.c.
Referenced by gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_config_nav(), gps_ubx_ucenter_config_port(), gps_ubx_ucenter_config_port_poll(), gps_ubx_ucenter_config_sbas(), gps_ubx_ucenter_configure(), gps_ubx_ucenter_enable_msg(), gps_ubx_ucenter_event(), gps_ubx_ucenter_init(), and gps_ubx_ucenter_periodic().