gnssrtk 2.1.0.0
gnssrtk.h File Reference

This file contains API for GNSS RTK Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"
#include "drv_uart.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  gnssrtk_s
 GNSS RTK Click context object. More...
 
struct  gnssrtk_cfg_t
 GNSS RTK Click configuration object. More...
 

Macros

#define GNSSRTK_RSP_START   "$"
 GNSS RTK response buffer commands.
 
#define GNSSRTK_RSP_DELIMITER   ","
 
#define GNSSRTK_RSP_GNGGA   "$GNGGA"
 
#define GNSSRTK_GNGGA_ELEMENT_SIZE   15
 GNSS RTK GNGGA command elements.
 
#define GNSSRTK_GNGGA_TIME   1
 
#define GNSSRTK_GNGGA_LATITUDE   2
 
#define GNSSRTK_GNGGA_LATITUDE_SIDE   3
 
#define GNSSRTK_GNGGA_LONGITUDE   4
 
#define GNSSRTK_GNGGA_LONGITUDE_SIDE   5
 
#define GNSSRTK_GNGGA_QUALITY_INDICATOR   6
 
#define GNSSRTK_GNGGA_NUMBER_OF_SATELLITES   7
 
#define GNSSRTK_GNGGA_H_DILUTION_OF_POS   8
 
#define GNSSRTK_GNGGA_ALTITUDE   9
 
#define GNSSRTK_GNGGA_ALTITUDE_UNIT   10
 
#define GNSSRTK_GNGGA_GEOIDAL_SEPARATION   11
 
#define GNSSRTK_GNGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GNSSRTK_GNGGA_TIME_SINCE_LAST_DGPS   13
 
#define GNSSRTK_GNGGA_DGPS_REFERENCE_STATION_ID   14
 
#define GNSSRTK_DUMMY   0xFF
 GNSS RTK dummy data.
 
#define GNSSRTK_SET_DEV_ADDR   0x42
 GNSS RTK device address setting.
 
#define GNSSRTK_DRV_TX_BUFFER_SIZE   100
 GNSS RTK driver buffer size.
 
#define GNSSRTK_DRV_RX_BUFFER_SIZE   300
 
#define GNSSRTK_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define GNSSRTK_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define GNSSRTK_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* gnssrtk_master_io_t) (struct gnssrtk_s *, uint8_t *, uint8_t)
 GNSS RTK Click driver interface.
 
typedef struct gnssrtk_s gnssrtk_t
 GNSS RTK Click context object.
 

Enumerations

enum  gnssrtk_drv_t { GNSSRTK_DRV_SEL_UART , GNSSRTK_DRV_SEL_SPI , GNSSRTK_DRV_SEL_I2C }
 GNSS RTK Click driver selector. More...
 
enum  gnssrtk_return_value_t { GNSSRTK_OK = 0 , GNSSRTK_ERROR = -1 }
 GNSS RTK Click return value data. More...
 

Functions

void gnssrtk_cfg_setup (gnssrtk_cfg_t *cfg)
 GNSS RTK configuration object setup function.
 
void gnssrtk_drv_interface_selection (gnssrtk_cfg_t *cfg, gnssrtk_drv_t drv_sel)
 GNSS RTK driver interface setup function.
 
err_t gnssrtk_init (gnssrtk_t *ctx, gnssrtk_cfg_t *cfg)
 GNSS RTK initialization function.
 
err_t gnssrtk_generic_write (gnssrtk_t *ctx, uint8_t *data_in, uint8_t len)
 GNSS RTK data writing function.
 
err_t gnssrtk_generic_read (gnssrtk_t *ctx, uint8_t *data_out, uint8_t len)
 GNSS RTK data reading function.
 
void gnssrtk_set_rst_pin (gnssrtk_t *ctx, uint8_t state)
 GNSS RTK set RST pin function.
 
uint8_t gnssrtk_get_rdy_pin (gnssrtk_t *ctx)
 GNSS RTK get RDY pin function.
 
uint8_t gnssrtk_get_rtk_pin (gnssrtk_t *ctx)
 GNSS RTK get RTK pin function.
 
uint8_t gnssrtk_get_tmp_pin (gnssrtk_t *ctx)
 GNSS RTK get TMP pin function.
 
void gnssrtk_reset_device (gnssrtk_t *ctx)
 GNSS RTK reset device function.
 
err_t gnssrtk_parse_gngga (char *rsp_buf, uint8_t gngga_element, char *element_data)
 GNSS RTK parse GNGGA function.
 

Detailed Description

This file contains API for GNSS RTK Click Driver.

Typedef Documentation

◆ gnssrtk_master_io_t

typedef err_t(* gnssrtk_master_io_t) (struct gnssrtk_s *, uint8_t *, uint8_t)

GNSS RTK Click driver interface.

Definition of driver interface of GNSS RTK Click driver. Driver serial interface.

◆ gnssrtk_t

typedef struct gnssrtk_s gnssrtk_t

GNSS RTK Click context object.

Context object definition of GNSS RTK Click driver.

Enumeration Type Documentation

◆ gnssrtk_drv_t

GNSS RTK Click driver selector.

Selects target driver interface of GNSS RTK Click driver.

Enumerator
GNSSRTK_DRV_SEL_UART 

UART driver descriptor.

GNSSRTK_DRV_SEL_SPI 

SPI driver descriptor.

GNSSRTK_DRV_SEL_I2C 

I2C driver descriptor.

◆ gnssrtk_return_value_t

GNSS RTK Click return value data.

Predefined enum values for driver return values.

Enumerator
GNSSRTK_OK 
GNSSRTK_ERROR