Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
gps_ubx_ucenter.c File Reference

Configure Ublox GPS. More...

#include "modules/gps/gps_ubx_ucenter.h"
#include "modules/gps/gps_ubx.h"
#include "ubx_protocol.h"
#include "modules/datalink/downlink.h"
#include "modules/datalink/telemetry.h"
Include dependency graph for gps_ubx_ucenter.c:

Go to the source code of this file.

Macros

#define GPS_UBX_UCENTER_RATE_LEGACY   200
 Measurement period [ms]: 5 Hz by default, 10 Hz with the configuration interface (X20).
#define GPS_UBX_UCENTER_RATE_VALSET   100
#define GPS_UBX_UCENTER_RATE_LEGACY_FALLBACK   250
#define GPS_UBX_UCENTER_RATE_VALSET_FALLBACK   200
#define NAV5_DYN_PORTABLE   0
 Dynamic platform model (same values for CFG-NAV5 and CFG-NAVSPG-DYNMODEL).
#define NAV5_DYN_FIXED   1
#define NAV5_DYN_STATIONARY   2
#define NAV5_DYN_PEDESTRIAN   3
#define NAV5_DYN_AUTOMOTIVE   4
#define NAV5_DYN_SEA   5
#define NAV5_DYN_AIRBORNE_1G   6
#define NAV5_DYN_AIRBORNE_2G   7
#define NAV5_DYN_AIRBORNE_4G   8
#define GPS_UBX_NAV5_DYNAMICS   NAV5_DYN_AIRBORNE_2G
#define NAV5_2D_ONLY   1
 Position fix mode (CFG-NAV5 and CFG-NAVSPG-FIXMODE).
#define NAV5_3D_ONLY   2
#define NAV5_AUTO   3
#define GPS_UBX_ENABLE_NMEA_DATA_MASK   0x00
 NMEA output next to UBX, disabled by default.
#define GPS_UBX_UCENTER_SAVE   TRUE
 Save the configuration to battery backed RAM and flash (UBX-CFG-CFG).
#define GPS_PORT_DDC   0x00
 Receiver port numbers (UBX-CFG-PRT), also the offset of the CFG-MSGOUT keys.
#define GPS_PORT_UART1   0x01
#define GPS_PORT_UART2   0x02
#define GPS_PORT_USB   0x03
#define GPS_PORT_SPI   0x04
#define GPS_UBX_UCENTER_STATUS_STOPPED   0
#define GPS_UBX_UCENTER_STATUS_AUTOBAUD   1
#define GPS_UBX_UCENTER_STATUS_CONFIG   2
#define GPS_UBX_UCENTER_STATUS_WAITING   3
#define GPS_UBX_UCENTER_REPLY_NONE   0
#define GPS_UBX_UCENTER_REPLY_ACK   1
#define GPS_UBX_UCENTER_REPLY_NACK   2
#define GPS_UBX_UCENTER_REPLY_VERSION   3
#define GPS_UBX_UCENTER_REPLY_CFG_PRT   4
#define UBX_GPS_BAUD   (UBX_GPS_PORT).baudrate
#define GPS_UBX_UCENTER_NB_BAUDS   (sizeof(gps_ubx_ucenter_bauds) / sizeof(gps_ubx_ucenter_bauds[0]))
#define NAV_DYN_AIRBORNE_2G   6
#define NAV5_MASK   0x05
#define NAV5_DEFAULT_MIN_ELEV   5
#define NAV5_DEFAULT_PDOP_MASK   25
#define NAV5_DEFAULT_TDOP_MASK   25
#define NAV5_DEFAULT_P_ACC   100
#define NAV5_DEFAULT_T_ACC   300
#define NAV5_DEFAULT_STATIC_HOLD_THRES   0
#define IGNORED   0
#define RESERVED   0
#define UBX_UART_MODE_MASK   0x000008D0
#define UBX_PROTO_MASK   0x0001
#define NMEA_PROTO_MASK   0x0002
#define RTCM_PROTO_MASK   0x0004
#define RTCM3_PROTO_MASK   0x0020
#define GPS_SBAS_ENABLED   0x01
#define GPS_SBAS_RANGING   0x01
#define GPS_SBAS_CORRECTIONS   0x02
#define GPS_SBAS_INTEGRITY   0x04
#define GPS_SBAS_MAX_SBAS   3
#define GPS_SBAS_AUTOSCAN   0x00
#define VALSET_LAYER_RAM   0x01
 Written to RAM only, saved afterwards like with the legacy messages (UBX-CFG-CFG): flash is not on every receiver, the whole message would be refused then.
#define CFG_RATE_MEAS   0x30210001
#define CFG_RATE_NAV   0x30210002
#define CFG_NAVSPG_FIXMODE   0x20110011
#define CFG_NAVSPG_DYNMODEL   0x20110021
#define CFG_UART1_BAUDRATE   0x40520001
#define CFG_UART2_BAUDRATE   0x40530001
#define CFG_UART1INPROT_RTCM3X   0x10730004
#define CFG_UART2INPROT_RTCM3X   0x10750004
#define CFG_UART1OUTPROT_NMEA   0x10740002
#define CFG_UART2OUTPROT_NMEA   0x10760002
#define CFG_MSGOUT_NAV_PVT   0x20910006
#define CFG_MSGOUT_NAV_POSLLH   0x20910029
#define CFG_MSGOUT_NAV_VELNED   0x20910042
#define CFG_MSGOUT_NAV_STATUS   0x2091001a
#define CFG_MSGOUT_NAV_SAT   0x20910015
#define CFG_MSGOUT_NAV_RELPOSNED   0x2091008d
#define CFG_MSGOUT_NAV_DAHEADING   0x209103df
#define VALSET_RELPOSNED_RATE   0
#define VALSET_RECEIVER   0
 What a configuration item applies to.
#define VALSET_UART   1
#define VALSET_MSGOUT   2
#define VALSET_CFG_NB   (sizeof(gps_ubx_ucenter_valset_cfg) / sizeof(gps_ubx_ucenter_valset_cfg[0]))

Functions

static bool gps_ubx_ucenter_autobaud (uint8_t nr)
 Automatically determine the baudrate of the u-blox module and its configuration interface.
static bool gps_ubx_ucenter_configure (uint8_t nr)
 Configure the receiver with the legacy UBX-CFG messages, one step per call (4 Hz).
static bool gps_ubx_ucenter_configure_valset (uint8_t nr)
 Configure the receiver with UBX-CFG-VALSET, one step per call (4 Hz).
static uint8_t gps_ubx_ucenter_gnss (void)
 Satellite systems in use: from the satellites in the solution (UBX-NAV-SAT), else as reported by UBX-MON-GNSS.
static void send_ublox_info (struct transport_tx *trans, struct link_device *dev)
 Receiver information, slowly for the GCS and the logs (the configuration itself is only done at start).
void gps_ubx_ucenter_init (void)
static bool gps_ubx_ucenter_configure_step (uint8_t nr)
 One configuration step with the interface the receiver supports, false when done.
void gps_ubx_ucenter_periodic (void)
static void gps_ubx_ucenter_parse_sw_version (uint8_t *payload)
 Parse "major.minor" from a version string (e.g.
static uint8_t gps_ubx_ucenter_parse_protver (uint8_t *payload, uint16_t len)
 Parse the protocol version major from the extensions (30 characters each, after the software and hardware versions), e.g.
static uint8_t gps_ubx_ucenter_hex (char c)
 Value of a hexadecimal character (0 when it isn't one).
void gps_ubx_ucenter_event (void)
static void gps_ubx_ucenter_autobaud_poll (void)
 Poll the port configuration (legacy UBX-CFG-PRT), the version (UBX-MON-VER, all receivers) and the port information (UBX-MON-COMMS, generation 9 and later).
static void gps_ubx_ucenter_send_info (uint8_t sbas)
 Send the configuration replies (DEBUG message) and the receiver information to the ground.
static void gps_ubx_ucenter_enable_msg (uint8_t class, uint8_t id, uint8_t rate)
 Enable u-blox message at desired period.
static void gps_ubx_ucenter_config_nav (void)
static void gps_ubx_ucenter_config_port (void)
static void gps_ubx_ucenter_config_sbas (void)
static uint32_t gps_ubx_ucenter_valset_key (uint8_t type, uint32_t key, uint32_t key_uart2)
 Key of a configuration item for the port the autopilot is connected to, 0 when it doesn't apply.
static void gps_ubx_ucenter_valset (uint32_t key, uint32_t value)
 Set one configuration item in RAM.
int gps_ubx_ucenter_get_status (void)

Variables

struct gps_ubx_ucenter_struct gps_ubx_ucenter
static const uint32_t gps_ubx_ucenter_bauds []
 Baudrates tried, after the target one: the common one, the factory default, the high-rate default, the NMEA default and the higher ones.
struct { 
uint8_t type
uint32_t key
uint32_t key_uart2
uint32_t value
} gps_ubx_ucenter_valset_cfg []
 Configuration, one item per step: the receiver refuses the whole message when it doesn't know one key.

Detailed Description

Configure Ublox GPS.

After finding the baudrate, the receiver is configured with the legacy UBX-CFG messages, or with the configuration interface (UBX-CFG-VALSET) when it doesn't have them anymore (e.g. X20).

Definition in file gps_ubx_ucenter.c.

Macro Definition Documentation

◆ CFG_MSGOUT_NAV_DAHEADING

#define CFG_MSGOUT_NAV_DAHEADING   0x209103df

Definition at line 736 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_POSLLH

#define CFG_MSGOUT_NAV_POSLLH   0x20910029

Definition at line 731 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_PVT

#define CFG_MSGOUT_NAV_PVT   0x20910006

Definition at line 730 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_RELPOSNED

#define CFG_MSGOUT_NAV_RELPOSNED   0x2091008d

Definition at line 735 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_SAT

#define CFG_MSGOUT_NAV_SAT   0x20910015

Definition at line 734 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_STATUS

#define CFG_MSGOUT_NAV_STATUS   0x2091001a

Definition at line 733 of file gps_ubx_ucenter.c.

◆ CFG_MSGOUT_NAV_VELNED

#define CFG_MSGOUT_NAV_VELNED   0x20910042

Definition at line 732 of file gps_ubx_ucenter.c.

◆ CFG_NAVSPG_DYNMODEL

#define CFG_NAVSPG_DYNMODEL   0x20110021

Definition at line 721 of file gps_ubx_ucenter.c.

◆ CFG_NAVSPG_FIXMODE

#define CFG_NAVSPG_FIXMODE   0x20110011

Definition at line 720 of file gps_ubx_ucenter.c.

◆ CFG_RATE_MEAS

#define CFG_RATE_MEAS   0x30210001

Definition at line 718 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure_valset().

◆ CFG_RATE_NAV

#define CFG_RATE_NAV   0x30210002

Definition at line 719 of file gps_ubx_ucenter.c.

◆ CFG_UART1_BAUDRATE

#define CFG_UART1_BAUDRATE   0x40520001

Definition at line 722 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure_valset().

◆ CFG_UART1INPROT_RTCM3X

#define CFG_UART1INPROT_RTCM3X   0x10730004

Definition at line 724 of file gps_ubx_ucenter.c.

◆ CFG_UART1OUTPROT_NMEA

#define CFG_UART1OUTPROT_NMEA   0x10740002

Definition at line 726 of file gps_ubx_ucenter.c.

◆ CFG_UART2_BAUDRATE

#define CFG_UART2_BAUDRATE   0x40530001

Definition at line 723 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure_valset().

◆ CFG_UART2INPROT_RTCM3X

#define CFG_UART2INPROT_RTCM3X   0x10750004

Definition at line 725 of file gps_ubx_ucenter.c.

◆ CFG_UART2OUTPROT_NMEA

#define CFG_UART2OUTPROT_NMEA   0x10760002

Definition at line 727 of file gps_ubx_ucenter.c.

◆ GPS_PORT_DDC

#define GPS_PORT_DDC   0x00

Receiver port numbers (UBX-CFG-PRT), also the offset of the CFG-MSGOUT keys.

Definition at line 96 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_autobaud(), and gps_ubx_ucenter_config_port().

◆ GPS_PORT_SPI

#define GPS_PORT_SPI   0x04

Definition at line 100 of file gps_ubx_ucenter.c.

◆ GPS_PORT_UART1

#define GPS_PORT_UART1   0x01

◆ GPS_PORT_UART2

#define GPS_PORT_UART2   0x02

Definition at line 98 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port(), and gps_ubx_ucenter_valset_key().

◆ GPS_PORT_USB

#define GPS_PORT_USB   0x03

Definition at line 99 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ GPS_SBAS_AUTOSCAN

#define GPS_SBAS_AUTOSCAN   0x00

Definition at line 547 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_sbas().

◆ GPS_SBAS_CORRECTIONS

#define GPS_SBAS_CORRECTIONS   0x02

Definition at line 542 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_sbas(), and gps_ubx_ucenter_configure().

◆ GPS_SBAS_ENABLED

#define GPS_SBAS_ENABLED   0x01

Definition at line 539 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_sbas().

◆ GPS_SBAS_INTEGRITY

#define GPS_SBAS_INTEGRITY   0x04

Definition at line 543 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure().

◆ GPS_SBAS_MAX_SBAS

#define GPS_SBAS_MAX_SBAS   3

Definition at line 545 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_sbas().

◆ GPS_SBAS_RANGING

#define GPS_SBAS_RANGING   0x01

Definition at line 541 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_sbas(), and gps_ubx_ucenter_configure().

◆ GPS_UBX_ENABLE_NMEA_DATA_MASK

#define GPS_UBX_ENABLE_NMEA_DATA_MASK   0x00

NMEA output next to UBX, disabled by default.

Definition at line 87 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ GPS_UBX_NAV5_DYNAMICS

#define GPS_UBX_NAV5_DYNAMICS   NAV5_DYN_AIRBORNE_2G

Definition at line 75 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ GPS_UBX_UCENTER_NB_BAUDS

#define GPS_UBX_UCENTER_NB_BAUDS   (sizeof(gps_ubx_ucenter_bauds) / sizeof(gps_ubx_ucenter_bauds[0]))

Definition at line 373 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_autobaud().

◆ GPS_UBX_UCENTER_RATE_LEGACY

#define GPS_UBX_UCENTER_RATE_LEGACY   200

Measurement period [ms]: 5 Hz by default, 10 Hz with the configuration interface (X20).

When the receiver refuses it, the fallback (4 Hz legacy, e.g. LEA-4, and 5 Hz with the configuration interface)

Definition at line 57 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure().

◆ GPS_UBX_UCENTER_RATE_LEGACY_FALLBACK

#define GPS_UBX_UCENTER_RATE_LEGACY_FALLBACK   250

Definition at line 60 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure().

◆ GPS_UBX_UCENTER_RATE_VALSET

#define GPS_UBX_UCENTER_RATE_VALSET   100

Definition at line 58 of file gps_ubx_ucenter.c.

◆ GPS_UBX_UCENTER_RATE_VALSET_FALLBACK

#define GPS_UBX_UCENTER_RATE_VALSET_FALLBACK   200

Definition at line 61 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure_valset().

◆ GPS_UBX_UCENTER_REPLY_ACK

#define GPS_UBX_UCENTER_REPLY_ACK   1

Definition at line 117 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_event().

◆ GPS_UBX_UCENTER_REPLY_CFG_PRT

#define GPS_UBX_UCENTER_REPLY_CFG_PRT   4

Definition at line 120 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_event().

◆ GPS_UBX_UCENTER_REPLY_NACK

#define GPS_UBX_UCENTER_REPLY_NACK   2

◆ GPS_UBX_UCENTER_REPLY_NONE

#define GPS_UBX_UCENTER_REPLY_NONE   0

◆ GPS_UBX_UCENTER_REPLY_VERSION

#define GPS_UBX_UCENTER_REPLY_VERSION   3

Definition at line 119 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_event().

◆ GPS_UBX_UCENTER_SAVE

#define GPS_UBX_UCENTER_SAVE   TRUE

Save the configuration to battery backed RAM and flash (UBX-CFG-CFG).

Definition at line 92 of file gps_ubx_ucenter.c.

◆ GPS_UBX_UCENTER_STATUS_AUTOBAUD

#define GPS_UBX_UCENTER_STATUS_AUTOBAUD   1

Definition at line 112 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_init(), and gps_ubx_ucenter_periodic().

◆ GPS_UBX_UCENTER_STATUS_CONFIG

#define GPS_UBX_UCENTER_STATUS_CONFIG   2

Definition at line 113 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_periodic().

◆ GPS_UBX_UCENTER_STATUS_STOPPED

#define GPS_UBX_UCENTER_STATUS_STOPPED   0

Definition at line 111 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_event(), and gps_ubx_ucenter_periodic().

◆ GPS_UBX_UCENTER_STATUS_WAITING

#define GPS_UBX_UCENTER_STATUS_WAITING   3

Definition at line 114 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_periodic().

◆ IGNORED

#define IGNORED   0

Definition at line 480 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_2D_ONLY

#define NAV5_2D_ONLY   1

Position fix mode (CFG-NAV5 and CFG-NAVSPG-FIXMODE).

Definition at line 79 of file gps_ubx_ucenter.c.

◆ NAV5_3D_ONLY

#define NAV5_3D_ONLY   2

Definition at line 80 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_AUTO

#define NAV5_AUTO   3

Definition at line 81 of file gps_ubx_ucenter.c.

◆ NAV5_DEFAULT_MIN_ELEV

#define NAV5_DEFAULT_MIN_ELEV   5

Definition at line 473 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DEFAULT_P_ACC

#define NAV5_DEFAULT_P_ACC   100

Definition at line 476 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DEFAULT_PDOP_MASK

#define NAV5_DEFAULT_PDOP_MASK   25

Definition at line 474 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DEFAULT_STATIC_HOLD_THRES

#define NAV5_DEFAULT_STATIC_HOLD_THRES   0

Definition at line 478 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DEFAULT_T_ACC

#define NAV5_DEFAULT_T_ACC   300

Definition at line 477 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DEFAULT_TDOP_MASK

#define NAV5_DEFAULT_TDOP_MASK   25

Definition at line 475 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV5_DYN_AIRBORNE_1G

#define NAV5_DYN_AIRBORNE_1G   6

Definition at line 70 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_AIRBORNE_2G

#define NAV5_DYN_AIRBORNE_2G   7

Definition at line 71 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_AIRBORNE_4G

#define NAV5_DYN_AIRBORNE_4G   8

Definition at line 72 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_AUTOMOTIVE

#define NAV5_DYN_AUTOMOTIVE   4

Definition at line 68 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_FIXED

#define NAV5_DYN_FIXED   1

Definition at line 65 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_PEDESTRIAN

#define NAV5_DYN_PEDESTRIAN   3

Definition at line 67 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_PORTABLE

#define NAV5_DYN_PORTABLE   0

Dynamic platform model (same values for CFG-NAV5 and CFG-NAVSPG-DYNMODEL).

Definition at line 64 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_SEA

#define NAV5_DYN_SEA   5

Definition at line 69 of file gps_ubx_ucenter.c.

◆ NAV5_DYN_STATIONARY

#define NAV5_DYN_STATIONARY   2

Definition at line 66 of file gps_ubx_ucenter.c.

◆ NAV5_MASK

#define NAV5_MASK   0x05

Definition at line 471 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NAV_DYN_AIRBORNE_2G

#define NAV_DYN_AIRBORNE_2G   6

Definition at line 469 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_nav().

◆ NMEA_PROTO_MASK

#define NMEA_PROTO_MASK   0x0002

Definition at line 505 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ RESERVED

◆ RTCM3_PROTO_MASK

#define RTCM3_PROTO_MASK   0x0020

Definition at line 507 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ RTCM_PROTO_MASK

#define RTCM_PROTO_MASK   0x0004

Definition at line 506 of file gps_ubx_ucenter.c.

◆ UBX_GPS_BAUD

#define UBX_GPS_BAUD   (UBX_GPS_PORT).baudrate

Definition at line 123 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_init().

◆ UBX_PROTO_MASK

#define UBX_PROTO_MASK   0x0001

Definition at line 504 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ UBX_UART_MODE_MASK

#define UBX_UART_MODE_MASK   0x000008D0

Definition at line 502 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_config_port().

◆ VALSET_CFG_NB

#define VALSET_CFG_NB   (sizeof(gps_ubx_ucenter_valset_cfg) / sizeof(gps_ubx_ucenter_valset_cfg[0]))

Definition at line 774 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_configure_valset().

◆ VALSET_LAYER_RAM

#define VALSET_LAYER_RAM   0x01

Written to RAM only, saved afterwards like with the legacy messages (UBX-CFG-CFG): flash is not on every receiver, the whole message would be refused then.

Definition at line 715 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_valset().

◆ VALSET_MSGOUT

#define VALSET_MSGOUT   2

Definition at line 747 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_valset_key().

◆ VALSET_RECEIVER

#define VALSET_RECEIVER   0

What a configuration item applies to.

Definition at line 745 of file gps_ubx_ucenter.c.

◆ VALSET_RELPOSNED_RATE

#define VALSET_RELPOSNED_RATE   0

Definition at line 741 of file gps_ubx_ucenter.c.

◆ VALSET_UART

#define VALSET_UART   1

Function Documentation

◆ gps_ubx_ucenter_autobaud()

bool gps_ubx_ucenter_autobaud ( uint8_t nr)
static

Automatically determine the baudrate of the u-blox module and its configuration interface.

Only needed when connecting to a UART port on the u-blox. The discovered baudrate is copied to gps_ubx_ucenter.baud_init.

Parameters
nrAutobaud step number to perform
Returns
FALSE when completed

Definition at line 398 of file gps_ubx_ucenter.c.

References B9600, GPS_PORT_DDC, GPS_PORT_UART1, gps_ubx_ucenter, gps_ubx_ucenter_autobaud_poll(), gps_ubx_ucenter_bauds, GPS_UBX_UCENTER_NB_BAUDS, uart_periph_set_baudrate(), and UART_SPEED.

Referenced by gps_ubx_ucenter_periodic().

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

◆ gps_ubx_ucenter_autobaud_poll()

void gps_ubx_ucenter_autobaud_poll ( void )
static

Poll the port configuration (legacy UBX-CFG-PRT), the version (UBX-MON-VER, all receivers) and the port information (UBX-MON-COMMS, generation 9 and later).

Any reply tells that the baudrate is right. The port the autopilot is connected to is reported by CFG-PRT (without a payload: the port the poll was received on) or, on receivers without CFG-PRT (X20), by MON-COMMS.

Definition at line 381 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter.

Referenced by gps_ubx_ucenter_autobaud().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_config_nav()

void gps_ubx_ucenter_config_nav ( void )
inlinestatic

◆ gps_ubx_ucenter_config_port()

void gps_ubx_ucenter_config_port ( void )
inlinestatic

◆ gps_ubx_ucenter_config_sbas()

void gps_ubx_ucenter_config_sbas ( void )
inlinestatic

Definition at line 549 of file gps_ubx_ucenter.c.

References GPS_SBAS_AUTOSCAN, GPS_SBAS_CORRECTIONS, GPS_SBAS_ENABLED, GPS_SBAS_MAX_SBAS, GPS_SBAS_RANGING, and gps_ubx_ucenter.

Referenced by gps_ubx_ucenter_configure().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_configure()

bool gps_ubx_ucenter_configure ( uint8_t nr)
static

◆ gps_ubx_ucenter_configure_step()

bool gps_ubx_ucenter_configure_step ( uint8_t nr)
static

One configuration step with the interface the receiver supports, false when done.

Definition at line 197 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter, gps_ubx_ucenter_configure(), and gps_ubx_ucenter_configure_valset().

Referenced by gps_ubx_ucenter_periodic().

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

◆ gps_ubx_ucenter_configure_valset()

bool gps_ubx_ucenter_configure_valset ( uint8_t nr)
static

◆ gps_ubx_ucenter_enable_msg()

void gps_ubx_ucenter_enable_msg ( uint8_t class,
uint8_t id,
uint8_t rate )
inlinestatic

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.

Parameters
classu-blox message class
idu-blox message ID
rateDesired period to send message. Example: Setting 3 would send the message on every 3rd navigation solution.

Definition at line 464 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter.

Referenced by gps_ubx_ucenter_configure().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_event()

◆ gps_ubx_ucenter_get_status()

int gps_ubx_ucenter_get_status ( void )

Definition at line 862 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter.

◆ gps_ubx_ucenter_gnss()

uint8_t gps_ubx_ucenter_gnss ( void )
inlinestatic

Satellite systems in use: from the satellites in the solution (UBX-NAV-SAT), else as reported by UBX-MON-GNSS.

The X20 reports only GPS in UBX-MON-GNSS while it uses more systems.

Definition at line 133 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter_struct::gnss_in_use, gps_ubx, and gps_ubx_ucenter.

Referenced by gps_ubx_ucenter_send_info(), and send_ublox_info().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_hex()

uint8_t gps_ubx_ucenter_hex ( char c)
static

Value of a hexadecimal character (0 when it isn't one).

Definition at line 297 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_event().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_init()

void gps_ubx_ucenter_init ( void )

◆ gps_ubx_ucenter_parse_protver()

uint8_t gps_ubx_ucenter_parse_protver ( uint8_t * payload,
uint16_t len )
static

Parse the protocol version major from the extensions (30 characters each, after the software and hardware versions), e.g.

"PROTVER=27.31" (generation 8 and later), 0 when not found

Definition at line 272 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter_struct::protver.

Referenced by gps_ubx_ucenter_event().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_parse_sw_version()

void gps_ubx_ucenter_parse_sw_version ( uint8_t * payload)
static

Parse "major.minor" from a version string (e.g.

"ROM CORE 3.01 (107888)" or "5.00 (28462)")

Definition at line 257 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter.

Referenced by gps_ubx_ucenter_event().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_periodic()

◆ gps_ubx_ucenter_send_info()

void gps_ubx_ucenter_send_info ( uint8_t sbas)
static

Send the configuration replies (DEBUG message) and the receiver information to the ground.

Definition at line 437 of file gps_ubx_ucenter.c.

References DefaultChannel, DefaultDevice, gps_ubx_ucenter, GPS_UBX_UCENTER_CONFIG_STEPS, and gps_ubx_ucenter_gnss().

Referenced by gps_ubx_ucenter_configure(), and gps_ubx_ucenter_configure_valset().

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

◆ gps_ubx_ucenter_valset()

void gps_ubx_ucenter_valset ( uint32_t key,
uint32_t value )
static

Set one configuration item in RAM.

Definition at line 795 of file gps_ubx_ucenter.c.

References gps_ubx_ucenter, RESERVED, and VALSET_LAYER_RAM.

Referenced by gps_ubx_ucenter_configure_valset().

Here is the caller graph for this function:

◆ gps_ubx_ucenter_valset_key()

uint32_t gps_ubx_ucenter_valset_key ( uint8_t type,
uint32_t key,
uint32_t key_uart2 )
static

Key of a configuration item for the port the autopilot is connected to, 0 when it doesn't apply.

Definition at line 777 of file gps_ubx_ucenter.c.

References GPS_PORT_UART1, GPS_PORT_UART2, gps_ubx_ucenter, VALSET_MSGOUT, and VALSET_UART.

Referenced by gps_ubx_ucenter_configure_valset().

Here is the caller graph for this function:

◆ send_ublox_info()

void send_ublox_info ( struct transport_tx * trans,
struct link_device * dev )
static

Receiver information, slowly for the GCS and the logs (the configuration itself is only done at start).

Definition at line 140 of file gps_ubx_ucenter.c.

References dev, gps_ubx_ucenter, and gps_ubx_ucenter_gnss().

Referenced by gps_ubx_ucenter_init().

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

Variable Documentation

◆ gps_ubx_ucenter

◆ gps_ubx_ucenter_bauds

const uint32_t gps_ubx_ucenter_bauds[]
static
Initial value:
}
#define B4800
Definition uart_arch.h:42
#define B57600
Definition uart_arch.h:46
#define B230400
Definition uart_arch.h:49
#define B38400
Definition uart_arch.h:45
#define B9600
Definition uart_arch.h:43
#define B115200
Definition uart_arch.h:48

Baudrates tried, after the target one: the common one, the factory default, the high-rate default, the NMEA default and the higher ones.

Definition at line 365 of file gps_ubx_ucenter.c.

Referenced by gps_ubx_ucenter_autobaud().

◆ [struct]

const struct { ... } gps_ubx_ucenter_valset_cfg[]
Initial value:
= {
}
#define CFG_MSGOUT_NAV_PVT
#define CFG_UART2INPROT_RTCM3X
#define CFG_UART1INPROT_RTCM3X
#define CFG_MSGOUT_NAV_VELNED
#define CFG_MSGOUT_NAV_POSLLH
#define CFG_MSGOUT_NAV_RELPOSNED
#define CFG_NAVSPG_FIXMODE
#define GPS_UBX_UCENTER_RATE_VALSET
#define CFG_RATE_NAV
#define GPS_UBX_ENABLE_NMEA_DATA_MASK
NMEA output next to UBX, disabled by default.
#define VALSET_RELPOSNED_RATE
#define CFG_MSGOUT_NAV_SAT
#define CFG_NAVSPG_DYNMODEL
#define CFG_RATE_MEAS
#define VALSET_RECEIVER
What a configuration item applies to.
#define CFG_UART1OUTPROT_NMEA
#define CFG_MSGOUT_NAV_STATUS
#define VALSET_MSGOUT
#define VALSET_UART
#define CFG_MSGOUT_NAV_DAHEADING
#define GPS_UBX_NAV5_DYNAMICS
#define NAV5_3D_ONLY
#define CFG_UART2OUTPROT_NMEA

Configuration, one item per step: the receiver refuses the whole message when it doesn't know one key.

Referenced by gps_ubx_ucenter_configure_valset().