gnss12 2.0.0.0
gnss12.h File Reference

This file contains API for GNSS 12 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  gnss12_s
 GNSS 12 Click context object. More...
 
struct  gnss12_cfg_t
 GNSS 12 Click configuration object. More...
 

Macros

#define GNSS12_RSP_START   "$"
 GNSS 12 response buffer commands.
 
#define GNSS12_RSP_DELIMITER   ","
 
#define GNSS12_RSP_GNGGA   "$GNGGA"
 
#define GNSS12_GNGGA_ELEMENT_SIZE   15
 GNSS 12 GNGGA command elements.
 
#define GNSS12_GNGGA_TIME   1
 
#define GNSS12_GNGGA_LATITUDE   2
 
#define GNSS12_GNGGA_LATITUDE_SIDE   3
 
#define GNSS12_GNGGA_LONGITUDE   4
 
#define GNSS12_GNGGA_LONGITUDE_SIDE   5
 
#define GNSS12_GNGGA_QUALITY_INDICATOR   6
 
#define GNSS12_GNGGA_NUMBER_OF_SATELLITES   7
 
#define GNSS12_GNGGA_H_DILUTION_OF_POS   8
 
#define GNSS12_GNGGA_ALTITUDE   9
 
#define GNSS12_GNGGA_ALTITUDE_UNIT   10
 
#define GNSS12_GNGGA_GEOIDAL_SEPARATION   11
 
#define GNSS12_GNGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GNSS12_GNGGA_TIME_SINCE_LAST_DGPS   13
 
#define GNSS12_GNGGA_DGPS_REFERENCE_STATION_ID   14
 
#define GNSS12_DUMMY   0xFF
 GNSS 12 dummy data.
 
#define GNSS12_SET_DEV_ADDR   0x42
 GNSS 12 device address setting.
 
#define GNSS12_DRV_BUFFER_SIZE   200
 GNSS 12 driver buffer size.
 
#define GNSS12_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define GNSS12_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define GNSS12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* gnss12_master_io_t) (struct gnss12_s *, uint8_t *, uint8_t)
 GNSS 12 Click driver interface.
 
typedef struct gnss12_s gnss12_t
 GNSS 12 Click context object.
 

Enumerations

enum  gnss12_drv_t { GNSS12_DRV_SEL_UART , GNSS12_DRV_SEL_SPI , GNSS12_DRV_SEL_I2C }
 GNSS 12 Click driver selector. More...
 
enum  gnss12_return_value_t { GNSS12_OK = 0 , GNSS12_ERROR = -1 }
 GNSS 12 Click return value data. More...
 

Functions

void gnss12_cfg_setup (gnss12_cfg_t *cfg)
 GNSS 12 configuration object setup function.
 
void gnss12_drv_interface_selection (gnss12_cfg_t *cfg, gnss12_drv_t drv_sel)
 GNSS 12 driver interface setup function.
 
err_t gnss12_init (gnss12_t *ctx, gnss12_cfg_t *cfg)
 GNSS 12 initialization function.
 
err_t gnss12_generic_write (gnss12_t *ctx, uint8_t *data_in, uint8_t len)
 GNSS 12 data writing function.
 
err_t gnss12_generic_read (gnss12_t *ctx, uint8_t *data_out, uint8_t len)
 GNSS 12 data reading function.
 
void gnss12_set_rst_pin (gnss12_t *ctx, uint8_t state)
 GNSS 12 set RST pin function.
 
uint8_t gnss12_get_lna_en_pin (gnss12_t *ctx)
 GNSS 12 get LNA EN pin function.
 
uint8_t gnss12_get_eint_pin (gnss12_t *ctx)
 GNSS 12 get Ext INT pin function.
 
void gnss12_reset_device (gnss12_t *ctx)
 GNSS 12 reset device function.
 
err_t gnss12_parse_gngga (char *rsp_buf, uint8_t gngga_element, char *element_data)
 GNSS 12 parse GNGGA function.
 

Detailed Description

This file contains API for GNSS 12 Click Driver.

Typedef Documentation

◆ gnss12_master_io_t

typedef err_t(* gnss12_master_io_t) (struct gnss12_s *, uint8_t *, uint8_t)

GNSS 12 Click driver interface.

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

◆ gnss12_t

typedef struct gnss12_s gnss12_t

GNSS 12 Click context object.

Context object definition of GNSS 12 Click driver.

Enumeration Type Documentation

◆ gnss12_drv_t

GNSS 12 Click driver selector.

Selects target driver interface of GNSS 12 Click driver.

Enumerator
GNSS12_DRV_SEL_UART 

UART driver descriptor.

GNSS12_DRV_SEL_SPI 

SPI driver descriptor.

GNSS12_DRV_SEL_I2C 

I2C driver descriptor.

◆ gnss12_return_value_t

GNSS 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
GNSS12_OK 
GNSS12_ERROR