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

Implementation of GNSS Interface. More...

#include <stdlib.h>
#include <errno.h>
#include "no_os_gnss.h"
#include "no_os_alloc.h"
#include "no_os_mutex.h"
Include dependency graph for no_os_gnss.c:

Functions

int32_t no_os_gnss_init (struct no_os_gnss_desc **desc, const struct no_os_gnss_init_param *param)
 Initialize the GNSS communication peripheral.
 
int32_t no_os_gnss_remove (struct no_os_gnss_desc *desc)
 Free the resources allocated by no_os_gnss_init().
 
int32_t no_os_gnss_refresh_timing_data (struct no_os_gnss_desc *desc)
 Refresh timing data from GNSS device.
 
int32_t no_os_gnss_is_timing_valid (struct no_os_gnss_desc *desc, bool *valid)
 Check if timing data is valid.
 
int32_t no_os_gnss_get_unified_timing (struct no_os_gnss_desc *desc, struct no_os_gnss_precise_time *timing)
 Get unified timing information with best available precision.
 
int32_t no_os_gnss_get_unix_epoch_unified (struct no_os_gnss_desc *desc, uint32_t *epoch, uint32_t *fractional_seconds)
 Get Unix epoch timestamp with unified precision.
 
int32_t no_os_gnss_get_position_data (struct no_os_gnss_desc *desc, struct no_os_gnss_position_data *position_data)
 Get GPS position and fix quality data.
 

Detailed Description

Implementation of GNSS Interface.

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

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ no_os_gnss_get_position_data()

int32_t no_os_gnss_get_position_data ( struct no_os_gnss_desc * desc,
struct no_os_gnss_position_data * position_data )

Get GPS position and fix quality data.

Parameters
desc- The GNSS descriptor.
position_data- Pointer to store position data.
Returns
0 on success, negative error code otherwise.

◆ no_os_gnss_get_unified_timing()

int32_t no_os_gnss_get_unified_timing ( struct no_os_gnss_desc * desc,
struct no_os_gnss_precise_time * timing )

Get unified timing information with best available precision.

Parameters
desc- The GNSS descriptor.
timing- Pointer to structure to store timing information.
Returns
0 in case of success, negative error code otherwise.

◆ no_os_gnss_get_unix_epoch_unified()

int32_t no_os_gnss_get_unix_epoch_unified ( struct no_os_gnss_desc * desc,
uint32_t * epoch,
uint32_t * fractional_seconds )

Get Unix epoch timestamp with unified precision.

Parameters
desc- The GNSS descriptor.
epoch- Pointer to store Unix epoch timestamp in seconds.
fractional_seconds- Pointer to store fractional seconds (microseconds).
Returns
0 in case of success, negative error code otherwise.

◆ no_os_gnss_init()

int32_t no_os_gnss_init ( struct no_os_gnss_desc ** desc,
const struct no_os_gnss_init_param * param )

Initialize the GNSS communication peripheral.

Parameters
desc- The GNSS descriptor.
param- The structure that contains the GNSS parameters.
Returns
0 in case of success, negative error code otherwise.

◆ no_os_gnss_is_timing_valid()

int32_t no_os_gnss_is_timing_valid ( struct no_os_gnss_desc * desc,
bool * valid )

Check if timing data is valid.

Parameters
desc- The GNSS descriptor.
valid- Pointer to store timing validity status.
Returns
0 in case of success, negative error code otherwise.

◆ no_os_gnss_refresh_timing_data()

int32_t no_os_gnss_refresh_timing_data ( struct no_os_gnss_desc * desc)

Refresh timing data from GNSS device.

Parameters
desc- The GNSS descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ no_os_gnss_remove()

int32_t no_os_gnss_remove ( struct no_os_gnss_desc * desc)

Free the resources allocated by no_os_gnss_init().

Parameters
desc- The GNSS descriptor.
Returns
0 in case of success, negative error code otherwise.