gnssrtk2 2.1.0.0
gnssrtk2.h File Reference

This file contains API for GNSS RTK 2 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  gnssrtk2_s
 GNSS RTK 2 Click context object. More...
 
struct  gnssrtk2_cfg_t
 GNSS RTK 2 Click configuration object. More...
 

Macros

#define GNSSRTK2_RSP_START   "$"
 GNSS RTK 2 response buffer commands.
 
#define GNSSRTK2_RSP_DELIMITER   ","
 
#define GNSSRTK2_RSP_GNGGA   "$GNGGA"
 
#define GNSSRTK2_GNGGA_ELEMENT_SIZE   15
 GNSS RTK 2 GNGGA command elements.
 
#define GNSSRTK2_GNGGA_TIME   1
 
#define GNSSRTK2_GNGGA_LATITUDE   2
 
#define GNSSRTK2_GNGGA_LATITUDE_SIDE   3
 
#define GNSSRTK2_GNGGA_LONGITUDE   4
 
#define GNSSRTK2_GNGGA_LONGITUDE_SIDE   5
 
#define GNSSRTK2_GNGGA_QUALITY_INDICATOR   6
 
#define GNSSRTK2_GNGGA_NUMBER_OF_SATELLITES   7
 
#define GNSSRTK2_GNGGA_H_DILUTION_OF_POS   8
 
#define GNSSRTK2_GNGGA_ALTITUDE   9
 
#define GNSSRTK2_GNGGA_ALTITUDE_UNIT   10
 
#define GNSSRTK2_GNGGA_GEOIDAL_SEPARATION   11
 
#define GNSSRTK2_GNGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GNSSRTK2_GNGGA_TIME_SINCE_LAST_DGPS   13
 
#define GNSSRTK2_GNGGA_DGPS_REFERENCE_STATION_ID   14
 
#define GNSSRTK2_DUMMY   0xFF
 GNSS RTK 2 dummy data.
 
#define GNSSRTK2_SET_DEV_ADDR   0x42
 GNSS RTK 2 device address setting.
 
#define DRV_TX_BUFFER_SIZE   100
 GNSS RTK 2 driver buffer size.
 
#define DRV_RX_BUFFER_SIZE   300
 
#define GNSSRTK2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define GNSSRTK2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define GNSSRTK2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* gnssrtk2_master_io_t) (struct gnssrtk2_s *, uint8_t *, uint8_t)
 GNSS RTK 2 Click driver interface.
 
typedef struct gnssrtk2_s gnssrtk2_t
 GNSS RTK 2 Click context object.
 

Enumerations

enum  gnssrtk2_drv_t { GNSSRTK2_DRV_SEL_UART , GNSSRTK2_DRV_SEL_SPI , GNSSRTK2_DRV_SEL_I2C }
 GNSS RTK 2 Click driver selector. More...
 
enum  gnssrtk2_return_value_t { GNSSRTK2_OK = 0 , GNSSRTK2_ERROR = -1 }
 GNSS RTK 2 Click return value data. More...
 

Functions

void gnssrtk2_cfg_setup (gnssrtk2_cfg_t *cfg)
 GNSS RTK 2 configuration object setup function.
 
void gnssrtk2_drv_interface_selection (gnssrtk2_cfg_t *cfg, gnssrtk2_drv_t drv_sel)
 GNSS RTK 2 driver interface setup function.
 
err_t gnssrtk2_init (gnssrtk2_t *ctx, gnssrtk2_cfg_t *cfg)
 GNSS RTK 2 initialization function.
 
err_t gnssrtk2_generic_write (gnssrtk2_t *ctx, uint8_t *data_in, uint8_t len)
 GNSS RTK 2 data writing function.
 
err_t gnssrtk2_generic_read (gnssrtk2_t *ctx, uint8_t *data_out, uint8_t len)
 GNSS RTK 2 data reading function.
 
void gnssrtk2_set_rst_pin (gnssrtk2_t *ctx, uint8_t state)
 GNSS RTK 2 set RST pin function.
 
uint8_t gnssrtk2_get_rdy_pin (gnssrtk2_t *ctx)
 GNSS RTK 2 get RDY pin function.
 
uint8_t gnssrtk2_get_rtk_pin (gnssrtk2_t *ctx)
 GNSS RTK 2 get RTK pin function.
 
uint8_t gnssrtk2_get_tmp_pin (gnssrtk2_t *ctx)
 GNSS RTK 2 get TMP pin function.
 
void gnssrtk2_reset_device (gnssrtk2_t *ctx)
 GNSS RTK 2 reset device function.
 
err_t gnssrtk2_parse_gngga (char *rsp_buf, uint8_t gngga_element, char *element_data)
 GNSS RTK 2 parse GNGGA function.
 

Detailed Description

This file contains API for GNSS RTK 2 Click Driver.

Typedef Documentation

◆ gnssrtk2_master_io_t

typedef err_t(* gnssrtk2_master_io_t) (struct gnssrtk2_s *, uint8_t *, uint8_t)

GNSS RTK 2 Click driver interface.

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

◆ gnssrtk2_t

typedef struct gnssrtk2_s gnssrtk2_t

GNSS RTK 2 Click context object.

Context object definition of GNSS RTK 2 Click driver.

Enumeration Type Documentation

◆ gnssrtk2_drv_t

GNSS RTK 2 Click driver selector.

Selects target driver interface of GNSS RTK 2 Click driver.

Enumerator
GNSSRTK2_DRV_SEL_UART 

UART driver descriptor.

GNSSRTK2_DRV_SEL_SPI 

SPI driver descriptor.

GNSSRTK2_DRV_SEL_I2C 

I2C driver descriptor.

◆ gnssrtk2_return_value_t

GNSS RTK 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
GNSSRTK2_OK 
GNSSRTK2_ERROR