From df441ac20222e314e0b08bd2c5a896655f3775b5 Mon Sep 17 00:00:00 2001 From: Igor Misic Date: Fri, 16 Dec 2022 17:25:14 +0100 Subject: [PATCH] drivers/gps: add param for enabling protocols at i2c interface --- src/drivers/gps/devices | 2 +- src/drivers/gps/gps.cpp | 9 +++++++++ src/drivers/gps/params.c | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/drivers/gps/devices b/src/drivers/gps/devices index b76fc1df459..5882667129f 160000 --- a/src/drivers/gps/devices +++ b/src/drivers/gps/devices @@ -1 +1 @@ -Subproject commit b76fc1df45952abbc76c7eb9f5a5ab3ae994bef2 +Subproject commit 5882667129f7ba8e6d5933757a77d52ed585d49b diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 2526b303f64..4bfe697a942 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -904,6 +904,15 @@ GPS::run() gpsConfig.output_mode = GPSHelper::OutputMode::GPS; } + int32_t gps_ubx_cfg_intf = static_cast(GPSHelper::InterfaceProtocolsMask::ALL_DISABLED); + handle = param_find("GPS_UBX_CFG_INTF"); + + if (handle != PARAM_INVALID) { + param_get(handle, &gps_ubx_cfg_intf); + } + + gpsConfig.interface_protocols = static_cast(gps_ubx_cfg_intf); + if (_helper && _helper->configure(_baudrate, gpsConfig) == 0) { /* reset report */ diff --git a/src/drivers/gps/params.c b/src/drivers/gps/params.c index 256099c485e..f0aaab3f1b6 100644 --- a/src/drivers/gps/params.c +++ b/src/drivers/gps/params.c @@ -125,6 +125,22 @@ PARAM_DEFINE_INT32(GPS_UBX_MODE, 0); */ PARAM_DEFINE_INT32(GPS_UBX_BAUD2, 230400); +/** + * u-blox protocol configuration for interfaces + * + * @min 0 + * @max 32 + * @bit 0 Enable I2C input protocol UBX + * @bit 1 Enable I2C input protocol NMEA + * @bit 2 Enable I2C input protocol RTCM3X + * @bit 3 Enable I2C output protocol UBX + * @bit 4 Enable I2C output protocol NMEA + * @bit 5 Enable I2C output protocol RTCM3X + * + * @reboot_required true + * @group GPS + */ +PARAM_DEFINE_INT32(GPS_UBX_CFG_INTF, 0); /** * Heading/Yaw offset for dual antenna GPS