dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ubx_cfg.c File Reference
#include "openpilot.h"
#include "pios_com.h"
#include "pios_thread.h"
#include "GPS.h"
#include "UBX.h"
#include "gpsposition.h"
#include "modulesettings.h"

Go to the source code of this file.

Macros

#define UBLOX_SYNC1   0xB5
 
#define UBLOX_SYNC2   0x62
 
#define UBLOX_NAV_CLASS   0x01
 
#define UBLOX_RXM_CLASS   0x02
 
#define UBLOX_CFG_CLASS   0x06
 
#define UBLOX_MON_CLASS   0x0a
 
#define UBLOX_AID_CLASS   0x0b
 
#define UBLOX_TIM_CLASS   0x0d
 
#define UBLOX_NAV_POSLLH   0x02
 
#define UBLOX_NAV_STATUS   0x03
 
#define UBLOX_NAV_DOP   0x04
 
#define UBLOX_NAV_SOL   0x06
 
#define UBLOX_NAV_VELNED   0x12
 
#define UBLOX_NAV_TIMEUTC   0x21
 
#define UBLOX_NAV_SBAS   0x32
 
#define UBLOX_NAV_SVINFO   0x30
 
#define UBLOX_AID_REQ   0x00
 
#define UBLOX_RXM_RAW   0x10
 
#define UBLOX_RXM_SFRB   0x11
 
#define UBLOX_MON_VER   0x04
 
#define UBLOX_MON_HW   0x09
 
#define UBLOX_TIM_TP   0x01
 
#define UBLOX_CFG_MSG   0x01
 
#define UBLOX_CFG_TP   0x07
 
#define UBLOX_CFG_RATE   0x08
 
#define UBLOX_CFG_CFG   0x09
 
#define UBLOX_CFG_SBAS   0x16
 
#define UBLOX_CFG_NAV5   0x24
 
#define UBLOX_CFG_GNSS   0x3E
 
#define UBLOX_SBAS_AUTO   0x00000000
 
#define UBLOX_SBAS_WAAS   0x0004E004
 
#define UBLOX_SBAS_EGNOS   0x00000851
 
#define UBLOX_SBAS_MSAS   0x00020200
 
#define UBLOX_SBAS_GAGAN   0x00000108
 
#define UBLOX_DYN_PORTABLE   0
 
#define UBLOX_DYN_STATIONARY   2
 
#define UBLOX_DYN_PED   3
 
#define UBLOX_DYN_AUTOMOTIVE   4
 
#define UBLOX_DYN_SEA   5
 
#define UBLOX_DYN_AIR1G   6
 
#define UBLOX_DYN_AIR2G   7
 
#define UBLOX_DYN_AIR4G   8
 
#define UBLOX_GNSSID_GPS   0
 
#define UBLOX_GNSSID_SBAS   1
 
#define UBLOX_GNSSID_BEIDOU   3
 
#define UBLOX_GNSSID_QZSS   5
 
#define UBLOX_GNSSID_GLONASS   6
 
#define UBLOX_MAX_PAYLOAD   384
 
#define UBLOX_WAIT_MS   50
 
#define MAX_CH_PER_CATEGORY   16
 

Functions

static void ubx_cfg_send_checksummed (uintptr_t gps_port, const uint8_t *dat, uint16_t len)
 Send a stream of data followed by checksum. More...
 
static void ubloxTxChecksumReset (void)
 Reset the TX checksum calculation. More...
 
static void ubloxTxChecksum (uint8_t c)
 Update the checksum calculation. More...
 
static void ubx_cfg_enable_message (uintptr_t gps_port, uint8_t c, uint8_t i, uint8_t rate)
 Enable the selected UBX message at the specified rate. More...
 
static void ubx_cfg_set_rate (uintptr_t gps_port, uint16_t ms)
 Set the rate of all messages. More...
 
static void ubx_cfg_set_mode (uintptr_t gps_port, ModuleSettingsGPSDynamicsModeOptions dyn_mode)
 Configure the navigation mode and minimum fix. More...
 
static void ubx_cfg_set_timepulse (uintptr_t gps_port)
 Configure the timepulse output pin. More...
 
static void ubx_cfg_set_sbas (uintptr_t gps_port, ModuleSettingsGPSSBASConstellationOptions sbas_const)
 Enable or disable SBAS satellites. More...
 
static void ubx_cfg_clear_cfg (uintptr_t gps_port)
 
static void ubx_cfg_poll_version (uintptr_t gps_port)
 Request a MON-VER message with the firmware version. More...
 
static void ubx_cfg_set_constellation (uintptr_t gps_port, ModuleSettingsGPSConstellationOptions constellation, ModuleSettingsGPSSBASConstellationOptions sbas_const)
 
static void ubx_cfg_version_specific (uintptr_t gps_port, uint8_t ver, ModuleSettingsGPSConstellationOptions constellation, ModuleSettingsGPSSBASConstellationOptions sbas_const)
 Apply firmware version specific configuration tweaks. More...
 
static void ubx_cfg_pause_parse (uintptr_t gps_port, uint32_t delay_ticks)
 Parse incoming data while paused. More...
 
void ubx_cfg_send_configuration (uintptr_t gps_port, char *buffer, ModuleSettingsGPSConstellationOptions constellation, ModuleSettingsGPSSBASConstellationOptions sbas_const, ModuleSettingsGPSDynamicsModeOptions dyn_mode)
 
void ubx_cfg_set_baudrate (uintptr_t gps_port, ModuleSettingsGPSSpeedOptions baud_rate)
 Make sure the GPS is set to the same baud. More...
 

Variables

uint8_t ubloxTxCK_A
 
uint8_t ubloxTxCK_B
 
static char * gps_rx_buffer