drivers/gps: add param for enabling protocols at i2c interface

This commit is contained in:
Igor Misic
2022-12-16 17:25:14 +01:00
committed by Beat Küng
parent e5255b173a
commit df441ac202
3 changed files with 26 additions and 1 deletions

View File

@@ -904,6 +904,15 @@ GPS::run()
gpsConfig.output_mode = GPSHelper::OutputMode::GPS;
}
int32_t gps_ubx_cfg_intf = static_cast<int32_t>(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<GPSHelper::InterfaceProtocolsMask>(gps_ubx_cfg_intf);
if (_helper && _helper->configure(_baudrate, gpsConfig) == 0) {
/* reset report */

View File

@@ -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