no-OS
Loading...
Searching...
No Matches
nmea_ubx.c File Reference

Implementation of GNSS Driver. More...

#include "nmea_ubx.h"
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "no_os_util.h"
#include "no_os_uart.h"
#include "no_os_gpio.h"
#include "no_os_irq.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
#include "no_os_print_log.h"
#include <stdlib.h>
#include <errno.h>
Include dependency graph for nmea_ubx.c:

Functions

void gnss_calculate_checksum (uint8_t *data, uint16_t length, uint8_t *checksumA, uint8_t *checksumB)
 Calculate UBX checksum.
 
int gnss_verify_checksum (uint8_t *data, uint16_t length, uint8_t checksumA, uint8_t checksumB)
 Verify UBX checksum.
 
int gnss_init (struct gnss_dev **device, struct gnss_init_param init_param)
 Initialize the GNSS device and configure communication.
 
int gnss_remove (struct gnss_dev *dev)
 Remove the GNSS device and release allocated resources.
 
int gnss_hw_reset (struct gnss_dev *dev)
 Reset the GNSS device using hardware reset pin.
 
int gnss_ubx_sw_reset (struct gnss_dev *dev)
 Reset the device using SW reset.
 
int gnss_write (struct gnss_dev *dev, uint8_t *data, uint16_t size)
 Write data to the device.
 
int gnss_read (struct gnss_dev *dev, uint8_t *data, uint16_t size)
 Read data from the device.
 
int gnss_ubx_send_packet (struct gnss_dev *dev, uint8_t cls, uint8_t id, uint8_t *payload, uint16_t length)
 Send UBX binary protocol packet to the GNSS device.
 
int gnss_ubx_receive_packet (struct gnss_dev *dev, struct gnss_ubx_packet *packet)
 UBX packet receive.
 
int gnss_ubx_wait_for_ack (struct gnss_dev *dev, uint8_t cls, uint8_t id)
 Wait for ACK/NAK.
 
int gnss_ubx_set_val_no_ack (struct gnss_dev *dev, uint32_t key_id, uint64_t value, uint8_t value_size, uint8_t layer)
 Set configuration value by key (no ACK version)
 
int gnss_ubx_set_val (struct gnss_dev *dev, uint32_t key_id, uint64_t value, uint8_t value_size, uint8_t layer)
 Set configuration value by key.
 
int gnss_ubx_get_val (struct gnss_dev *dev, uint32_t key_id, uint64_t *value, uint8_t value_size, uint8_t layer)
 Get configuration value by key.
 
int gnss_ubx_clr_save_load_config (struct gnss_dev *dev, uint8_t mask)
 Clear save load configuration from flash/BBR.
 
int gnss_ubx_set_input_protocol_uart1 (struct gnss_dev *dev, enum gnss_protocol protocol, uint8_t enable, uint8_t layer)
 Configure input protocol on UART1.
 
int gnss_ubx_set_output_protocol_uart1 (struct gnss_dev *dev, enum gnss_protocol protocol, uint8_t enable, uint8_t layer)
 Configure output protocol on UART1.
 
int gnss_ubx_set_output_protocol_usb (struct gnss_dev *dev, enum gnss_protocol protocol, uint8_t enable, uint8_t layer)
 Configure output protocol USB.
 
int gnss_ubx_set_input_protocol_uart2 (struct gnss_dev *dev, enum gnss_protocol protocol, uint8_t enable, uint8_t layer)
 Configure input protocol on UART2.
 
int gnss_ubx_set_output_protocol_uart2 (struct gnss_dev *dev, enum gnss_protocol protocol, uint8_t enable, uint8_t layer)
 Configure output protocol on UART2.
 
int gnss_ubx_configure_baudrate (struct gnss_dev *dev, uint32_t baudrate)
 Configure UBX device baudrate via UBX commands.
 
int gnss_ubx_poll_nav_pvt (struct gnss_dev *dev, struct gnss_ubx_nav_pvt *nav_data)
 Poll navigation data (NAV-PVT)
 
int gnss_ubx_poll_nav_timeutc (struct gnss_dev *dev, struct gnss_ubx_nav_timeutc *time_data)
 Poll time data (NAV-TIMEUTC)
 
int gnss_get_nav_data (struct gnss_dev *dev, struct gnss_ubx_nav_pvt *nav_data)
 Get latest navigation data.
 
int gnss_get_time_data (struct gnss_dev *dev, struct gnss_ubx_nav_timeutc *time_data)
 Get latest time data.
 
float gnss_coord_to_degrees (int32_t coord)
 Convert coordinates from 1e-7 degrees to float degrees.
 
float gnss_velocity_to_ms (int32_t vel)
 Convert velocity from cm/s to m/s.
 
float gnss_time_acc_to_ms (uint32_t acc)
 Convert time accuracy from ns to ms.
 
float gnss_pos_acc_to_m (uint32_t acc)
 Convert position accuracy from mm to m.
 
int32_t gnss_ubx_get_nanoseconds (struct gnss_dev *dev)
 Get nanosecond fraction of current time from NAV-PVT data.
 
int gnss_ubx_get_time_valid (struct gnss_dev *dev, bool *valid)
 Check if the current time is valid.
 
int gnss_ubx_get_time_fully_resolved (struct gnss_dev *dev, bool *resolved)
 Check if the current time is fully resolved.
 
uint32_t gnss_calculate_unix_epoch (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second)
 Calculate Unix epoch from date/time components.
 
int gnss_ubx_get_unix_epoch_with_micros (struct gnss_dev *dev, uint32_t *epoch, uint32_t *microseconds)
 Get Unix epoch time with microsecond precision.
 
int gnss_ubx_get_precise_time (struct gnss_dev *dev, struct gnss_precise_time *precise_time)
 Get comprehensive precise time information.
 
int gnss_ubx_configure_time_pulse (struct gnss_dev *dev, bool enable)
 Configure time pulse output for PPS (Pulse Per Second)
 
int gnss_init_pps (struct gnss_dev *dev, bool enable)
 Configure PPS output with optimal settings for timing sync.
 
int gnss_ubx_is_time_pulse_enabled (struct gnss_dev *dev, bool *enabled)
 Check if time pulse is currently enabled.
 
int gnss_configure_baudrate_via_nmea (struct gnss_dev *dev, uint32_t baudrate)
 Configure baudrate via standard NMEA command for NMEA-only devices.
 
int gnss_configure_messages_via_nmea (struct gnss_dev *dev, uint8_t rate_hz)
 Enable GPRMC/GNRMC message and disable others for clean timing via NMEA commands.
 
int gnss_configure_nmea_device (struct gnss_dev *dev, uint32_t baudrate, uint8_t message_rate_hz)
 Configure NMEA-only device for timing operation.
 
int gnss_parse_gprmc_sentence (const char *sentence, struct gnss_nmea_time *rmc_time)
 Parse GPRMC sentence for time and date information.
 
int gnss_get_nmea_timing_data (struct gnss_dev *dev, struct gnss_nmea_time *rmc_time)
 Get timing data from NMEA-only device via GPRMC parsing.
 
int gnss_refresh_timing_data (struct gnss_dev *dev)
 Refresh timing data from device (unified API for both UBX and NMEA devices)
 
int gnss_get_unified_timing (struct gnss_dev *dev, struct gnss_precise_time *precise_time)
 Get comprehensive timing information (unified API for both device types)
 
int gnss_is_timing_valid (struct gnss_dev *dev, bool *valid)
 Check if timing data is valid (unified API for both device types)
 
int gnss_get_unix_epoch_unified (struct gnss_dev *dev, uint32_t *epoch, uint32_t *fractional_seconds)
 Get Unix epoch time with best available precision (unified API)
 
int gnss_parse_gpgga_sentence (const char *sentence, struct gnss_nmea_position *position_data)
 Parse GPGGA sentence for position and fix information.
 
int gnss_get_nmea_position_data (struct gnss_dev *dev, struct gnss_nmea_position *position_data)
 Get GPS fix quality and position data (NMEA-only devices)
 

Detailed Description

Implementation of GNSS Driver.

Author
Radu Etz (radu..nosp@m.etz@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright 2025(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ gnss_calculate_checksum()

void gnss_calculate_checksum ( uint8_t * data,
uint16_t length,
uint8_t * checksumA,
uint8_t * checksumB )

Calculate UBX checksum.

Parameters
data- Data buffer
length- Data length
checksumA- Checksum A output
checksumB- Checksum B output
Here is the caller graph for this function:

◆ gnss_calculate_unix_epoch()

uint32_t gnss_calculate_unix_epoch ( uint16_t year,
uint8_t month,
uint8_t day,
uint8_t hour,
uint8_t minute,
uint8_t second )

Calculate Unix epoch from date/time components.

Parameters
year- Year (must be >= 1970)
month- Month (1-12)
day- Day of month
hour- Hour (0-23)
minute- Minute (0-59)
second- Second (0-59)
Returns
Unix epoch in seconds, or 0 if year < 1970
Here is the caller graph for this function:

◆ gnss_configure_baudrate_via_nmea()

int gnss_configure_baudrate_via_nmea ( struct gnss_dev * dev,
uint32_t baudrate )

Configure baudrate via standard NMEA command for NMEA-only devices.

Parameters
dev- The device structure
baudrate- Desired baudrate
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_configure_messages_via_nmea()

int gnss_configure_messages_via_nmea ( struct gnss_dev * dev,
uint8_t rate_hz )

Enable GPRMC/GNRMC message and disable others for clean timing via NMEA commands.

Parameters
dev- The device structure
rate_hz- GPRMC/GNRMC message rate in Hz (typically 1)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_configure_nmea_device()

int gnss_configure_nmea_device ( struct gnss_dev * dev,
uint32_t baudrate,
uint8_t message_rate_hz )

Configure NMEA-only device for timing operation.

Parameters
dev- The device structure
baudrate- Desired baudrate
message_rate_hz- GPRMC message rate
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_coord_to_degrees()

float gnss_coord_to_degrees ( int32_t coord)

Convert coordinates from 1e-7 degrees to float degrees.

Parameters
coord- Coordinate in 1e-7 degrees
Returns
Coordinate in degrees

◆ gnss_get_nav_data()

int gnss_get_nav_data ( struct gnss_dev * dev,
struct gnss_ubx_nav_pvt * nav_data )

Get latest navigation data.

Parameters
dev- The device structure
nav_data- Navigation data structure to fill
Returns
0 in case of success, negative error code otherwise

◆ gnss_get_nmea_position_data()

int gnss_get_nmea_position_data ( struct gnss_dev * dev,
struct gnss_nmea_position * position_data )

Get GPS fix quality and position data (NMEA-only devices)

Parameters
dev- The device structure
position_data- Output structure for position data
Returns
0 in case of success, negative error code otherwise

◆ gnss_get_nmea_timing_data()

int gnss_get_nmea_timing_data ( struct gnss_dev * dev,
struct gnss_nmea_time * rmc_time )

Get timing data from NMEA-only device via GPRMC parsing.

Parameters
dev- The device structure
rmc_time- Output structure for time data
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_get_time_data()

int gnss_get_time_data ( struct gnss_dev * dev,
struct gnss_ubx_nav_timeutc * time_data )

Get latest time data.

Parameters
dev- The device structure
time_data- Time data structure to fill
Returns
0 in case of success, negative error code otherwise

◆ gnss_get_unified_timing()

int gnss_get_unified_timing ( struct gnss_dev * dev,
struct gnss_precise_time * precise_time )

Get comprehensive timing information (unified API for both device types)

Parameters
dev- The device structure
precise_time- Structure to store precise time data
Returns
0 in case of success, negative error code otherwise

◆ gnss_get_unix_epoch_unified()

int gnss_get_unix_epoch_unified ( struct gnss_dev * dev,
uint32_t * epoch,
uint32_t * fractional_seconds )

Get Unix epoch time with best available precision (unified API)

Parameters
dev- The device structure
epoch- Pointer to store Unix epoch time in seconds
fractional_seconds- Pointer to store fractional seconds (microseconds)
Returns
0 in case of success, negative error code otherwise

◆ gnss_hw_reset()

int gnss_hw_reset ( struct gnss_dev * dev)

Reset the GNSS device using hardware reset pin.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ gnss_init()

int gnss_init ( struct gnss_dev ** device,
struct gnss_init_param init_param )

Initialize the GNSS device and configure communication.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, negative error code otherwise.

◆ gnss_init_pps()

int gnss_init_pps ( struct gnss_dev * dev,
bool enable )

Configure PPS output with optimal settings for timing sync.

Parameters
dev- The device structure
enable- Enable/disable PPS output
Returns
0 in case of success, negative error code otherwise

◆ gnss_is_timing_valid()

int gnss_is_timing_valid ( struct gnss_dev * dev,
bool * valid )

Check if timing data is valid (unified API for both device types)

Parameters
dev- The device structure
valid- Pointer to store validity status
Returns
0 in case of success, negative error code otherwise

◆ gnss_parse_gpgga_sentence()

int gnss_parse_gpgga_sentence ( const char * sentence,
struct gnss_nmea_position * position_data )

Parse GPGGA sentence for position and fix information.

Parameters
sentence- Complete GPGGA sentence string
position_data- Output structure for parsed position data
Returns
0 in case of success, negative error code otherwise

◆ gnss_parse_gprmc_sentence()

int gnss_parse_gprmc_sentence ( const char * sentence,
struct gnss_nmea_time * rmc_time )

Parse GPRMC sentence for time and date information.

Parameters
sentence- Complete GPRMC sentence string
rmc_time- Output structure for parsed time data
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_pos_acc_to_m()

float gnss_pos_acc_to_m ( uint32_t acc)

Convert position accuracy from mm to m.

Parameters
acc- Position accuracy in mm
Returns
Position accuracy in m

◆ gnss_read()

int gnss_read ( struct gnss_dev * dev,
uint8_t * data,
uint16_t size )

Read data from the device.

Parameters
dev- The device structure
data- Data buffer to read into
size- Number of bytes to read
Returns
number of bytes read in case of succes, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_refresh_timing_data()

int gnss_refresh_timing_data ( struct gnss_dev * dev)

Refresh timing data from device (unified API for both UBX and NMEA devices)

Parameters
dev- The device structure
Returns
0 in case of success, negative error code otherwise

◆ gnss_remove()

int gnss_remove ( struct gnss_dev * dev)

Remove the GNSS device and release allocated resources.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ gnss_time_acc_to_ms()

float gnss_time_acc_to_ms ( uint32_t acc)

Convert time accuracy from ns to ms.

Parameters
acc- Time accuracy in ns
Returns
Time accuracy in ms

◆ gnss_ubx_clr_save_load_config()

int gnss_ubx_clr_save_load_config ( struct gnss_dev * dev,
uint8_t mask )

Clear save load configuration from flash/BBR.

Parameters
dev- The device structure
mask- Load mask (which layers to load)
Returns
0 in case of success, negative error code otherwise

◆ gnss_ubx_configure_baudrate()

int gnss_ubx_configure_baudrate ( struct gnss_dev * dev,
uint32_t baudrate )

Configure UBX device baudrate via UBX commands.

Parameters
dev- The device structure
baudrate- Desired baudrate
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_configure_time_pulse()

int gnss_ubx_configure_time_pulse ( struct gnss_dev * dev,
bool enable )

Configure time pulse output for PPS (Pulse Per Second)

Parameters
dev- The device structure
enable- Enable/disable time pulse
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_get_nanoseconds()

int32_t gnss_ubx_get_nanoseconds ( struct gnss_dev * dev)

Get nanosecond fraction of current time from NAV-PVT data.

Parameters
dev- The device structure
Returns
Nanosecond fraction (can be negative), 0 on error

◆ gnss_ubx_get_precise_time()

int gnss_ubx_get_precise_time ( struct gnss_dev * dev,
struct gnss_precise_time * precise_time )

Get comprehensive precise time information.

Parameters
dev- The device structure
precise_time- Structure to store precise time data
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_get_time_fully_resolved()

int gnss_ubx_get_time_fully_resolved ( struct gnss_dev * dev,
bool * resolved )

Check if the current time is fully resolved.

Parameters
dev- The device structure
resolved- Pointer to store resolved status
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_get_time_valid()

int gnss_ubx_get_time_valid ( struct gnss_dev * dev,
bool * valid )

Check if the current time is valid.

Parameters
dev- The device structure
valid- Pointer to store validity status
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_get_unix_epoch_with_micros()

int gnss_ubx_get_unix_epoch_with_micros ( struct gnss_dev * dev,
uint32_t * epoch,
uint32_t * microseconds )

Get Unix epoch time with microsecond precision.

Parameters
dev- The device structure
epoch- Pointer to store Unix epoch time in seconds
microseconds- Pointer to store microsecond fraction
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_get_val()

int gnss_ubx_get_val ( struct gnss_dev * dev,
uint32_t key_id,
uint64_t * value,
uint8_t value_size,
uint8_t layer )

Get configuration value by key.

Parameters
dev- The device structure
key_id- Configuration key ID
value- Pointer to store the value
value_size- Size of value (1, 2, 4, or 8 bytes)
layer- Configuration layer (RAM, BBR, Flash)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_is_time_pulse_enabled()

int gnss_ubx_is_time_pulse_enabled ( struct gnss_dev * dev,
bool * enabled )

Check if time pulse is currently enabled.

Parameters
dev- The device structure
enabled- Pointer to store enabled status
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_poll_nav_pvt()

int gnss_ubx_poll_nav_pvt ( struct gnss_dev * dev,
struct gnss_ubx_nav_pvt * nav_data )

Poll navigation data (NAV-PVT)

Parameters
dev- The device structure
nav_data- Navigation data structure to fill
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_poll_nav_timeutc()

int gnss_ubx_poll_nav_timeutc ( struct gnss_dev * dev,
struct gnss_ubx_nav_timeutc * time_data )

Poll time data (NAV-TIMEUTC)

Parameters
dev- The device structure
time_data- Time data structure to fill
Returns
0 in case of success, negative error code otherwise

◆ gnss_ubx_receive_packet()

int gnss_ubx_receive_packet ( struct gnss_dev * dev,
struct gnss_ubx_packet * packet )

UBX packet receive.

Parameters
dev- The device structure
packet- Packet structure to fill
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_send_packet()

int gnss_ubx_send_packet ( struct gnss_dev * dev,
uint8_t cls,
uint8_t id,
uint8_t * payload,
uint16_t length )

Send UBX binary protocol packet to the GNSS device.

Parameters
dev- The device structure.
cls- UBX message class.
id- UBX message ID.
payload- Pointer to payload data buffer.
length- Payload length in bytes.
Returns
ret 0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ gnss_ubx_set_input_protocol_uart1()

int gnss_ubx_set_input_protocol_uart1 ( struct gnss_dev * dev,
enum gnss_protocol protocol,
uint8_t enable,
uint8_t layer )

Configure input protocol on UART1.

Parameters
dev- The device structure
protocol- Protocol type
enable- Enable/disable
layer- Configuration layer
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_set_input_protocol_uart2()

int gnss_ubx_set_input_protocol_uart2 ( struct gnss_dev * dev,
enum gnss_protocol protocol,
uint8_t enable,
uint8_t layer )

Configure input protocol on UART2.

Parameters
dev- The device structure
protocol- Protocol type
enable- Enable/disable
layer- Configuration layer
Returns
0 in case of success, negative error code otherwise

◆ gnss_ubx_set_output_protocol_uart1()

int gnss_ubx_set_output_protocol_uart1 ( struct gnss_dev * dev,
enum gnss_protocol protocol,
uint8_t enable,
uint8_t layer )

Configure output protocol on UART1.

Parameters
dev- The device structure
protocol- Protocol type
enable- Enable/disable
layer- Configuration layer
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_set_output_protocol_uart2()

int gnss_ubx_set_output_protocol_uart2 ( struct gnss_dev * dev,
enum gnss_protocol protocol,
uint8_t enable,
uint8_t layer )

Configure output protocol on UART2.

Parameters
dev- The device structure
protocol- Protocol type
enable- Enable/disable
layer- Configuration layer
Returns
0 in case of success, negative error code otherwise

◆ gnss_ubx_set_output_protocol_usb()

int gnss_ubx_set_output_protocol_usb ( struct gnss_dev * dev,
enum gnss_protocol protocol,
uint8_t enable,
uint8_t layer )

Configure output protocol USB.

Parameters
dev- The device structure
protocol- Protocol type
enable- Enable/disable
layer- Configuration layer
Returns
0 in case of success, negative error code otherwise

◆ gnss_ubx_set_val()

int gnss_ubx_set_val ( struct gnss_dev * dev,
uint32_t key_id,
uint64_t value,
uint8_t value_size,
uint8_t layer )

Set configuration value by key.

Parameters
dev- The device structure
key_id- Configuration key ID
value- Value to set
value_size- Size of value (1, 2, 4, or 8 bytes)
layer- Configuration layer (RAM, BBR, Flash)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_set_val_no_ack()

int gnss_ubx_set_val_no_ack ( struct gnss_dev * dev,
uint32_t key_id,
uint64_t value,
uint8_t value_size,
uint8_t layer )

Set configuration value by key (no ACK version)

Parameters
dev- The device structure
key_id- Configuration key ID
value- Value to set
value_size- Size of value (1, 2, 4, or 8 bytes)
layer- Configuration layer (RAM, BBR, Flash)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_sw_reset()

int gnss_ubx_sw_reset ( struct gnss_dev * dev)

Reset the device using SW reset.

Parameters
dev- The device structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_ubx_wait_for_ack()

int gnss_ubx_wait_for_ack ( struct gnss_dev * dev,
uint8_t cls,
uint8_t id )

Wait for ACK/NAK.

Parameters
dev- The device structure
cls- Expected class
id- Expected message ID
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_velocity_to_ms()

float gnss_velocity_to_ms ( int32_t vel)

Convert velocity from cm/s to m/s.

Parameters
vel- Velocity in cm/s
Returns
Velocity in m/s

◆ gnss_verify_checksum()

int gnss_verify_checksum ( uint8_t * data,
uint16_t length,
uint8_t checksumA,
uint8_t checksumB )

Verify UBX checksum.

Parameters
data- Data buffer
length- Data length
checksumA- Expected checksum A
checksumB- Expected checksum B
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ gnss_write()

int gnss_write ( struct gnss_dev * dev,
uint8_t * data,
uint16_t size )

Write data to the device.

Parameters
dev- The device structure
data- Data buffer to write
size- Number of bytes to write
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: