39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
52#include "drv_i2c_master.h"
74#define GNSS14_RSP_START "$"
75#define GNSS14_RSP_DELIMITER ","
76#define GNSS14_RSP_GNGGA "$GNGGA"
82#define GNSS14_GNGGA_ELEMENT_SIZE 15
83#define GNSS14_GNGGA_TIME 1
84#define GNSS14_GNGGA_LATITUDE 2
85#define GNSS14_GNGGA_LATITUDE_SIDE 3
86#define GNSS14_GNGGA_LONGITUDE 4
87#define GNSS14_GNGGA_LONGITUDE_SIDE 5
88#define GNSS14_GNGGA_QUALITY_INDICATOR 6
89#define GNSS14_GNGGA_NUMBER_OF_SATELLITES 7
90#define GNSS14_GNGGA_H_DILUTION_OF_POS 8
91#define GNSS14_GNGGA_ALTITUDE 9
92#define GNSS14_GNGGA_ALTITUDE_UNIT 10
93#define GNSS14_GNGGA_GEOIDAL_SEPARATION 11
94#define GNSS14_GNGGA_GEOIDAL_SEPARATION_UNIT 12
95#define GNSS14_GNGGA_TIME_SINCE_LAST_DGPS 13
96#define GNSS14_GNGGA_DGPS_REFERENCE_STATION_ID 14
102#define GNSS14_DUMMY 0xFF
109#define GNSS14_SET_DEV_ADDR 0x42
116#define GNSS14_DRV_BUFFER_SIZE 200
134#define GNSS14_MAP_MIKROBUS( cfg, mikrobus ) \
135 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
136 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
137 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
138 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
139 cfg.io6 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
140 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
141 cfg.eit = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
142 cfg.tp = MIKROBUS( mikrobus, MIKROBUS_INT )
gnss14_return_value_t
GNSS 14 Click return value data.
Definition gnss14.h:232
@ GNSS14_ERROR
Definition gnss14.h:234
@ GNSS14_OK
Definition gnss14.h:233
gnss14_drv_t
GNSS 14 Click driver selector.
Definition gnss14.h:152
@ GNSS14_DRV_SEL_I2C
Definition gnss14.h:154
@ GNSS14_DRV_SEL_UART
Definition gnss14.h:153
err_t(* gnss14_master_io_t)(struct gnss14_s *, uint8_t *, uint8_t)
GNSS 14 Click driver interface.
Definition gnss14.h:162
struct gnss14_s gnss14_t
GNSS 14 Click context object.
#define GNSS14_DRV_BUFFER_SIZE
GNSS 14 driver buffer size.
Definition gnss14.h:116
void gnss14_set_io6_pin(gnss14_t *ctx, uint8_t state)
GNSS 14 set IO6 pin function.
err_t gnss14_generic_write(gnss14_t *ctx, uint8_t *data_in, uint16_t len)
GNSS 14 data writing function.
err_t gnss14_init(gnss14_t *ctx, gnss14_cfg_t *cfg)
GNSS 14 initialization function.
err_t gnss14_parse_gngga(char *rsp_buf, uint8_t gngga_element, char *element_data)
GNSS 14 parse GNGGA function.
void gnss14_cfg_setup(gnss14_cfg_t *cfg)
GNSS 14 configuration object setup function.
void gnss14_set_rst_pin(gnss14_t *ctx, uint8_t state)
GNSS 14 set RST pin function.
void gnss14_reset_device(gnss14_t *ctx)
GNSS 14 reset device function.
uint8_t gnss14_get_eit_pin(gnss14_t *ctx)
GNSS 14 get external interrupt pin state function.
uint8_t gnss14_get_tp_pin(gnss14_t *ctx)
GNSS 14 get time pulse signal pin state function.
err_t gnss14_generic_read(gnss14_t *ctx, uint8_t *data_out, uint16_t len)
GNSS 14 data reading function.
GNSS 14 Click configuration object.
Definition gnss14.h:200
gnss14_drv_t drv_sel
Definition gnss14.h:223
uint32_t baud_rate
Definition gnss14.h:217
pin_name_t io6
Definition gnss14.h:208
uint32_t i2c_speed
Definition gnss14.h:213
pin_name_t tp
Definition gnss14.h:211
bool uart_blocking
Definition gnss14.h:218
uart_data_bits_t data_bit
Definition gnss14.h:219
pin_name_t tx_pin
Definition gnss14.h:205
pin_name_t eit
Definition gnss14.h:210
pin_name_t rx_pin
Definition gnss14.h:204
uart_stop_bits_t stop_bit
Definition gnss14.h:221
pin_name_t scl
Definition gnss14.h:202
uart_parity_t parity_bit
Definition gnss14.h:220
pin_name_t sda
Definition gnss14.h:203
pin_name_t rst
Definition gnss14.h:209
uint8_t i2c_address
Definition gnss14.h:214
GNSS 14 Click context object.
Definition gnss14.h:169
gnss14_master_io_t write_f
Definition gnss14.h:190
gnss14_drv_t drv_sel
Definition gnss14.h:188
digital_in_t tp
Definition gnss14.h:176
uart_t uart
Definition gnss14.h:180
digital_out_t io6
Definition gnss14.h:171
i2c_master_t i2c
Definition gnss14.h:179
digital_out_t rst
Definition gnss14.h:172
uint8_t slave_address
Definition gnss14.h:186
gnss14_master_io_t read_f
Definition gnss14.h:191
pin_name_t chip_select
Definition gnss14.h:187
uint8_t uart_rx_buffer[GNSS14_DRV_BUFFER_SIZE]
Definition gnss14.h:183
uint8_t uart_tx_buffer[GNSS14_DRV_BUFFER_SIZE]
Definition gnss14.h:184
digital_in_t eit
Definition gnss14.h:175