gnssrtk3 2.1.0.0
gnssrtk3.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  gnssrtk3_s
 GNSS RTK 3 Click context object. More...
 
struct  gnssrtk3_cfg_t
 GNSS RTK 3 Click configuration object. More...
 

Macros

#define GNSSRTK3_RSP_START   "$"
 GNSS RTK 3 response buffer commands.
 
#define GNSSRTK3_RSP_DELIMITER   ","
 
#define GNSSRTK3_RSP_END   "\r\n"
 
#define GNSSRTK3_RSP_GGA   "GGA"
 
#define GNSSRTK3_GGA_ELEMENT_SIZE   15
 GNSS RTK 3 GGA command elements.
 
#define GNSSRTK3_GGA_TIME   1
 
#define GNSSRTK3_GGA_LATITUDE   2
 
#define GNSSRTK3_GGA_LATITUDE_SIDE   3
 
#define GNSSRTK3_GGA_LONGITUDE   4
 
#define GNSSRTK3_GGA_LONGITUDE_SIDE   5
 
#define GNSSRTK3_GGA_QUALITY_INDICATOR   6
 
#define GNSSRTK3_GGA_NUMBER_OF_SATELLITES   7
 
#define GNSSRTK3_GGA_H_DILUTION_OF_POS   8
 
#define GNSSRTK3_GGA_ALTITUDE   9
 
#define GNSSRTK3_GGA_ALTITUDE_UNIT   10
 
#define GNSSRTK3_GGA_GEOIDAL_SEPARATION   11
 
#define GNSSRTK3_GGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GNSSRTK3_GGA_TIME_SINCE_LAST_DGPS   13
 
#define GNSSRTK3_GGA_DGPS_REFERENCE_STATION_ID   14
 
#define GNSSRTK3_I2C_SLAVE_CR_CMD   0xAA51u
 GNSS RTK 3 I2C settings.
 
#define GNSSRTK3_I2C_SLAVE_CW_CMD   0xAA53u
 
#define GNSSRTK3_I2C_SLAVE_CMD_LEN   8
 
#define GNSSRTK3_I2C_SLAVE_RX_LEN   4
 
#define GNSSRTK3_I2C_SLAVE_TX_LEN_REG_OFFSET   0x0008u
 
#define GNSSRTK3_I2C_SLAVE_TX_BUF_REG_OFFSET   0x2000u
 
#define GNSSRTK3_I2C_SLAVE_RX_LEN_REG_OFFSET   0x0004u
 
#define GNSSRTK3_I2C_SLAVE_RX_BUF_REG_OFFSET   0x1000u
 
#define GNSSRTK3_I2C_SLAVE_ADDRESS_CR_OR_CW   0x50
 
#define GNSSRTK3_I2C_SLAVE_ADDRESS_R   0x54
 
#define GNSSRTK3_I2C_SLAVE_ADDRESS_W   0x58
 
#define GNSSRTK3_I2C_SLAVE_MAX_ERRORS   10
 
#define GNSSRTK3_TX_DRV_BUFFER_SIZE   100
 GNSS RTK 3 driver buffer size.
 
#define GNSSRTK3_RX_DRV_BUFFER_SIZE   1000u
 
#define GNSSRTK3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* gnssrtk3_master_io_t) (struct gnssrtk3_s *, uint8_t *, uint16_t)
 
typedef struct gnssrtk3_s gnssrtk3_t
 GNSS RTK 3 Click context object.
 

Enumerations

enum  gnssrtk3_drv_t { GNSSRTK3_DRV_SEL_UART , GNSSRTK3_DRV_SEL_I2C }
 GNSS RTK 3 Click driver selector. More...
 
enum  gnssrtk3_return_value_t { GNSSRTK3_OK = 0 , GNSSRTK3_ERROR = -1 }
 GNSS RTK 3 Click return value data. More...
 

Functions

void gnssrtk3_cfg_setup (gnssrtk3_cfg_t *cfg)
 GNSS RTK 3 configuration object setup function.
 
void gnssrtk3_drv_interface_sel (gnssrtk3_cfg_t *cfg, gnssrtk3_drv_t drv_sel)
 GNSS RTK 3 driver interface setup function.
 
err_t gnssrtk3_init (gnssrtk3_t *ctx, gnssrtk3_cfg_t *cfg)
 GNSS RTK 3 initialization function.
 
err_t gnssrtk3_generic_write (gnssrtk3_t *ctx, uint8_t *data_in, uint16_t len)
 GNSS RTK 3 data writing function.
 
err_t gnssrtk3_generic_read (gnssrtk3_t *ctx, uint8_t *data_out, uint16_t len)
 GNSS RTK 3 data reading function.
 
void gnssrtk3_set_rst_pin (gnssrtk3_t *ctx, uint8_t state)
 GNSS RTK 3 set RST pin function.
 
void gnssrtk3_set_cen_pin (gnssrtk3_t *ctx, uint8_t state)
 GNSS RTK 3 set CEN pin function.
 
void gnssrtk3_set_wup_pin (gnssrtk3_t *ctx, uint8_t state)
 GNSS RTK 3 set WUP pin function.
 
uint8_t gnssrtk3_get_pps_pin (gnssrtk3_t *ctx)
 GNSS RTK 3 get PPS pin function.
 
void gnssrtk3_enable_device (gnssrtk3_t *ctx)
 GNSS RTK 3 enable device function.
 
void gnssrtk3_disable_device (gnssrtk3_t *ctx)
 GNSS RTK 3 disable device function.
 
void gnssrtk3_reset_device (gnssrtk3_t *ctx)
 GNSS RTK 3 reset device function.
 
err_t gnssrtk3_parse_gga (uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
 GNSS RTK 3 parse GGA function.
 

Detailed Description

This file contains API for GNSS RTK 3 Click Driver.

Typedef Documentation

◆ gnssrtk3_master_io_t

typedef err_t(* gnssrtk3_master_io_t) (struct gnssrtk3_s *, uint8_t *, uint16_t)

Driver serial interface.

◆ gnssrtk3_t

typedef struct gnssrtk3_s gnssrtk3_t

GNSS RTK 3 Click context object.

Context object definition of GNSS RTK 3 Click driver.

Enumeration Type Documentation

◆ gnssrtk3_drv_t

GNSS RTK 3 Click driver selector.

Selects target driver interface of GNSS RTK 3 Click driver.

Enumerator
GNSSRTK3_DRV_SEL_UART 

UART driver descriptor.

GNSSRTK3_DRV_SEL_I2C 

I2C driver descriptor.

◆ gnssrtk3_return_value_t

GNSS RTK 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
GNSSRTK3_OK 
GNSSRTK3_ERROR