Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
GNSS Interface

GNSS Interface. More...

Data Structures

struct  gnss_info
 GNSS info data structure. More...
 
struct  gnss_time
 GNSS time data structure. More...
 
struct  gnss_driver_api
 GNSS API structure. More...
 
struct  gnss_data
 GNSS data structure. More...
 
struct  gnss_data_callback
 GNSS callback structure. More...
 
struct  gnss_satellite
 GNSS satellite structure. More...
 
struct  gnss_satellites_callback
 GNSS callback structure. More...
 

Macros

#define GNSS_DATA_CALLBACK_DEFINE(_dev, _callback)
 Register a callback structure for GNSS data published.
 
#define GNSS_SATELLITES_CALLBACK_DEFINE(_dev, _callback)
 Register a callback structure for GNSS satellites published.
 

Typedefs

typedef int(* gnss_set_fix_rate_t) (const struct device *dev, uint32_t fix_interval_ms)
 API for setting fix rate.
 
typedef int(* gnss_get_fix_rate_t) (const struct device *dev, uint32_t *fix_interval_ms)
 API for getting fix rate.
 
typedef int(* gnss_set_navigation_mode_t) (const struct device *dev, enum gnss_navigation_mode mode)
 API for setting navigation mode.
 
typedef int(* gnss_get_navigation_mode_t) (const struct device *dev, enum gnss_navigation_mode *mode)
 API for getting navigation mode.
 
typedef uint32_t gnss_systems_t
 Type storing bitmask of GNSS systems.
 
typedef int(* gnss_set_enabled_systems_t) (const struct device *dev, gnss_systems_t systems)
 API for enabling systems.
 
typedef int(* gnss_get_enabled_systems_t) (const struct device *dev, gnss_systems_t *systems)
 API for getting enabled systems.
 
typedef int(* gnss_get_supported_systems_t) (const struct device *dev, gnss_systems_t *systems)
 API for getting enabled systems.
 
typedef int(* gnss_get_latest_timepulse_t) (const struct device *dev, k_ticks_t *timestamp)
 API for getting timestamp of last PPS pulse.
 
typedef void(* gnss_data_callback_t) (const struct device *dev, const struct gnss_data *data)
 Template for GNSS data callback.
 
typedef void(* gnss_satellites_callback_t) (const struct device *dev, const struct gnss_satellite *satellites, uint16_t size)
 Template for GNSS satellites callback.
 

Enumerations

enum  gnss_pps_mode { GNSS_PPS_MODE_DISABLED = 0 , GNSS_PPS_MODE_ENABLED = 1 , GNSS_PPS_MODE_ENABLED_AFTER_LOCK = 2 , GNSS_PPS_MODE_ENABLED_WHILE_LOCKED = 3 }
 GNSS PPS modes. More...
 
enum  gnss_navigation_mode { GNSS_NAVIGATION_MODE_ZERO_DYNAMICS = 0 , GNSS_NAVIGATION_MODE_LOW_DYNAMICS = 1 , GNSS_NAVIGATION_MODE_BALANCED_DYNAMICS = 2 , GNSS_NAVIGATION_MODE_HIGH_DYNAMICS = 3 }
 GNSS navigation modes. More...
 
enum  gnss_system {
  GNSS_SYSTEM_GPS = BIT(0) , GNSS_SYSTEM_GLONASS = BIT(1) , GNSS_SYSTEM_GALILEO = BIT(2) , GNSS_SYSTEM_BEIDOU = BIT(3) ,
  GNSS_SYSTEM_QZSS = BIT(4) , GNSS_SYSTEM_IRNSS = BIT(5) , GNSS_SYSTEM_SBAS = BIT(6) , GNSS_SYSTEM_IMES = BIT(7)
}
 Systems contained in gnss_systems_t. More...
 
enum  gnss_fix_status { GNSS_FIX_STATUS_NO_FIX = 0 , GNSS_FIX_STATUS_GNSS_FIX = 1 , GNSS_FIX_STATUS_DGNSS_FIX = 2 , GNSS_FIX_STATUS_ESTIMATED_FIX = 3 }
 GNSS fix status. More...
 
enum  gnss_fix_quality {
  GNSS_FIX_QUALITY_INVALID = 0 , GNSS_FIX_QUALITY_GNSS_SPS = 1 , GNSS_FIX_QUALITY_DGNSS = 2 , GNSS_FIX_QUALITY_GNSS_PPS = 3 ,
  GNSS_FIX_QUALITY_RTK = 4 , GNSS_FIX_QUALITY_FLOAT_RTK = 5 , GNSS_FIX_QUALITY_ESTIMATED = 6
}
 GNSS fix quality. More...
 

Functions

int gnss_set_fix_rate (const struct device *dev, uint32_t fix_interval_ms)
 Set the GNSS fix rate.
 
int gnss_get_fix_rate (const struct device *dev, uint32_t *fix_interval_ms)
 Get the GNSS fix rate.
 
int gnss_set_navigation_mode (const struct device *dev, enum gnss_navigation_mode mode)
 Set the GNSS navigation mode.
 
int gnss_get_navigation_mode (const struct device *dev, enum gnss_navigation_mode *mode)
 Get the GNSS navigation mode.
 
int gnss_set_enabled_systems (const struct device *dev, gnss_systems_t systems)
 Set enabled GNSS systems.
 
int gnss_get_enabled_systems (const struct device *dev, gnss_systems_t *systems)
 Get enabled GNSS systems.
 
int gnss_get_supported_systems (const struct device *dev, gnss_systems_t *systems)
 Get supported GNSS systems.
 
int gnss_get_latest_timepulse (const struct device *dev, k_ticks_t *timestamp)
 Get the timestamp of the latest PPS timepulse.
 

Detailed Description

GNSS Interface.

Since
3.6
Version
0.1.0

Macro Definition Documentation

◆ GNSS_DATA_CALLBACK_DEFINE

#define GNSS_DATA_CALLBACK_DEFINE (   _dev,
  _callback 
)

#include <include/zephyr/drivers/gnss.h>

Register a callback structure for GNSS data published.

Parameters
_devDevice pointer
_callbackThe callback function

◆ GNSS_SATELLITES_CALLBACK_DEFINE

#define GNSS_SATELLITES_CALLBACK_DEFINE (   _dev,
  _callback 
)

#include <include/zephyr/drivers/gnss.h>

Register a callback structure for GNSS satellites published.

Parameters
_devDevice pointer
_callbackThe callback function

Typedef Documentation

◆ gnss_data_callback_t

typedef void(* gnss_data_callback_t) (const struct device *dev, const struct gnss_data *data)

#include <include/zephyr/drivers/gnss.h>

Template for GNSS data callback.

◆ gnss_get_enabled_systems_t

typedef int(* gnss_get_enabled_systems_t) (const struct device *dev, gnss_systems_t *systems)

#include <include/zephyr/drivers/gnss.h>

API for getting enabled systems.

◆ gnss_get_fix_rate_t

typedef int(* gnss_get_fix_rate_t) (const struct device *dev, uint32_t *fix_interval_ms)

#include <include/zephyr/drivers/gnss.h>

API for getting fix rate.

◆ gnss_get_latest_timepulse_t

typedef int(* gnss_get_latest_timepulse_t) (const struct device *dev, k_ticks_t *timestamp)

#include <include/zephyr/drivers/gnss.h>

API for getting timestamp of last PPS pulse.

◆ gnss_get_navigation_mode_t

typedef int(* gnss_get_navigation_mode_t) (const struct device *dev, enum gnss_navigation_mode *mode)

#include <include/zephyr/drivers/gnss.h>

API for getting navigation mode.

◆ gnss_get_supported_systems_t

typedef int(* gnss_get_supported_systems_t) (const struct device *dev, gnss_systems_t *systems)

#include <include/zephyr/drivers/gnss.h>

API for getting enabled systems.

◆ gnss_satellites_callback_t

typedef void(* gnss_satellites_callback_t) (const struct device *dev, const struct gnss_satellite *satellites, uint16_t size)

#include <include/zephyr/drivers/gnss.h>

Template for GNSS satellites callback.

◆ gnss_set_enabled_systems_t

typedef int(* gnss_set_enabled_systems_t) (const struct device *dev, gnss_systems_t systems)

#include <include/zephyr/drivers/gnss.h>

API for enabling systems.

◆ gnss_set_fix_rate_t

typedef int(* gnss_set_fix_rate_t) (const struct device *dev, uint32_t fix_interval_ms)

#include <include/zephyr/drivers/gnss.h>

API for setting fix rate.

◆ gnss_set_navigation_mode_t

typedef int(* gnss_set_navigation_mode_t) (const struct device *dev, enum gnss_navigation_mode mode)

#include <include/zephyr/drivers/gnss.h>

API for setting navigation mode.

◆ gnss_systems_t

#include <include/zephyr/drivers/gnss.h>

Type storing bitmask of GNSS systems.

Enumeration Type Documentation

◆ gnss_fix_quality

#include <include/zephyr/drivers/gnss.h>

GNSS fix quality.

Enumerator
GNSS_FIX_QUALITY_INVALID 

Invalid fix.

GNSS_FIX_QUALITY_GNSS_SPS 

Standard positioning service.

GNSS_FIX_QUALITY_DGNSS 

Differential GNSS.

GNSS_FIX_QUALITY_GNSS_PPS 

Precise positioning service.

GNSS_FIX_QUALITY_RTK 

Real-time kinematic.

GNSS_FIX_QUALITY_FLOAT_RTK 

Floating real-time kinematic.

GNSS_FIX_QUALITY_ESTIMATED 

Estimated fix.

◆ gnss_fix_status

#include <include/zephyr/drivers/gnss.h>

GNSS fix status.

Enumerator
GNSS_FIX_STATUS_NO_FIX 

No GNSS fix acquired.

GNSS_FIX_STATUS_GNSS_FIX 

GNSS fix acquired.

GNSS_FIX_STATUS_DGNSS_FIX 

Differential GNSS fix acquired.

GNSS_FIX_STATUS_ESTIMATED_FIX 

Estimated fix acquired.

◆ gnss_navigation_mode

#include <include/zephyr/drivers/gnss.h>

GNSS navigation modes.

Enumerator
GNSS_NAVIGATION_MODE_ZERO_DYNAMICS 

Dynamics have no impact on tracking.

GNSS_NAVIGATION_MODE_LOW_DYNAMICS 

Low dynamics have higher impact on tracking.

GNSS_NAVIGATION_MODE_BALANCED_DYNAMICS 

Low and high dynamics have equal impact on tracking.

GNSS_NAVIGATION_MODE_HIGH_DYNAMICS 

High dynamics have higher impact on tracking.

◆ gnss_pps_mode

#include <include/zephyr/drivers/gnss.h>

GNSS PPS modes.

Enumerator
GNSS_PPS_MODE_DISABLED 

PPS output disabled.

GNSS_PPS_MODE_ENABLED 

PPS output always enabled.

GNSS_PPS_MODE_ENABLED_AFTER_LOCK 

PPS output enabled from first lock.

GNSS_PPS_MODE_ENABLED_WHILE_LOCKED 

PPS output enabled while locked.

◆ gnss_system

#include <include/zephyr/drivers/gnss.h>

Systems contained in gnss_systems_t.

Enumerator
GNSS_SYSTEM_GPS 

Global Positioning System (GPS)

GNSS_SYSTEM_GLONASS 

GLObal NAvigation Satellite System (GLONASS)

GNSS_SYSTEM_GALILEO 

Galileo.

GNSS_SYSTEM_BEIDOU 

BeiDou Navigation Satellite System.

GNSS_SYSTEM_QZSS 

Quasi-Zenith Satellite System (QZSS)

GNSS_SYSTEM_IRNSS 

Indian Regional Navigation Satellite System (IRNSS)

GNSS_SYSTEM_SBAS 

Satellite-Based Augmentation System (SBAS)

GNSS_SYSTEM_IMES 

Indoor Messaging System (IMES)

Function Documentation

◆ gnss_get_enabled_systems()

int gnss_get_enabled_systems ( const struct device dev,
gnss_systems_t systems 
)

#include <include/zephyr/drivers/gnss.h>

Get enabled GNSS systems.

Parameters
devDevice instance
systemsDestination for enabled systems
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_get_fix_rate()

int gnss_get_fix_rate ( const struct device dev,
uint32_t fix_interval_ms 
)

#include <include/zephyr/drivers/gnss.h>

Get the GNSS fix rate.

Parameters
devDevice instance
fix_interval_msDestination for fix interval in milliseconds
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_get_latest_timepulse()

int gnss_get_latest_timepulse ( const struct device dev,
k_ticks_t timestamp 
)

#include <include/zephyr/drivers/gnss.h>

Get the timestamp of the latest PPS timepulse.

Note
The timestamp is considered valid when the timepulse pin is actively toggling.
Parameters
devDevice instance
timestampKernel tick count at the time of the PPS pulse
Return values
0if successful
-ENOSYSif driver does not support API
-ENOTSUPif driver does not have PPS pin connected
-EAGAINif PPS pulse is not considered valid

◆ gnss_get_navigation_mode()

int gnss_get_navigation_mode ( const struct device dev,
enum gnss_navigation_mode mode 
)

#include <include/zephyr/drivers/gnss.h>

Get the GNSS navigation mode.

Parameters
devDevice instance
modeDestination for navigation mode
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_get_supported_systems()

int gnss_get_supported_systems ( const struct device dev,
gnss_systems_t systems 
)

#include <include/zephyr/drivers/gnss.h>

Get supported GNSS systems.

Parameters
devDevice instance
systemsDestination for supported systems
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_set_enabled_systems()

int gnss_set_enabled_systems ( const struct device dev,
gnss_systems_t  systems 
)

#include <include/zephyr/drivers/gnss.h>

Set enabled GNSS systems.

Parameters
devDevice instance
systemsSystems to enable
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_set_fix_rate()

int gnss_set_fix_rate ( const struct device dev,
uint32_t  fix_interval_ms 
)

#include <include/zephyr/drivers/gnss.h>

Set the GNSS fix rate.

Parameters
devDevice instance
fix_interval_msFix interval to set in milliseconds
Returns
0 if successful
-errno negative errno code on failure

◆ gnss_set_navigation_mode()

int gnss_set_navigation_mode ( const struct device dev,
enum gnss_navigation_mode  mode 
)

#include <include/zephyr/drivers/gnss.h>

Set the GNSS navigation mode.

Parameters
devDevice instance
modeNavigation mode to set
Returns
0 if successful
-errno negative errno code on failure