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 GNSS13_RSP_START "$"
75#define GNSS13_RSP_DELIMITER ","
76#define GNSS13_RSP_END_SEQ "\r\n"
77#define GNSS13_RSP_GNGGA "$GNGGA"
83#define GNSS13_GNGGA_ELEMENT_SIZE 15
84#define GNSS13_GNGGA_TIME 1
85#define GNSS13_GNGGA_LATITUDE 2
86#define GNSS13_GNGGA_LATITUDE_SIDE 3
87#define GNSS13_GNGGA_LONGITUDE 4
88#define GNSS13_GNGGA_LONGITUDE_SIDE 5
89#define GNSS13_GNGGA_QUALITY_INDICATOR 6
90#define GNSS13_GNGGA_NUMBER_OF_SATELLITES 7
91#define GNSS13_GNGGA_H_DILUTION_OF_POS 8
92#define GNSS13_GNGGA_ALTITUDE 9
93#define GNSS13_GNGGA_ALTITUDE_UNIT 10
94#define GNSS13_GNGGA_GEOIDAL_SEPARATION 11
95#define GNSS13_GNGGA_GEOIDAL_SEPARATION_UNIT 12
96#define GNSS13_GNGGA_TIME_SINCE_LAST_DGPS 13
97#define GNSS13_GNGGA_DGPS_REFERENCE_STATION_ID 14
104#define GNSS13_DEVICE_ADDRESS 0x10
111#define GNSS13_DRV_TX_BUFFER_SIZE 100
112#define GNSS13_DRV_RX_BUFFER_SIZE 1200
130#define GNSS13_MAP_MIKROBUS( cfg, mikrobus ) \
131 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
132 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
133 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
134 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
135 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
136 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_PWM );
gnss13_drv_t
GNSS 13 Click driver selector.
Definition gnss13.h:146
@ GNSS13_DRV_SEL_I2C
Definition gnss13.h:148
@ GNSS13_DRV_SEL_UART
Definition gnss13.h:147
err_t(* gnss13_master_io_t)(struct gnss13_s *, uint8_t *, uint8_t)
GNSS 13 Click driver interface.
Definition gnss13.h:156
gnss13_return_value_t
GNSS 13 Click return value data.
Definition gnss13.h:219
@ GNSS13_OK
Definition gnss13.h:220
@ GNSS13_ERROR
Definition gnss13.h:221
struct gnss13_s gnss13_t
GNSS 13 Click context object.
#define GNSS13_DRV_TX_BUFFER_SIZE
GNSS 13 driver buffer size.
Definition gnss13.h:111
#define GNSS13_DRV_RX_BUFFER_SIZE
Definition gnss13.h:112
err_t gnss13_generic_read(gnss13_t *ctx, uint8_t *data_out, uint8_t len)
GNSS 13 generic read function.
err_t gnss13_parse_gngga(uint8_t *rsp_buf, uint8_t gngga_element, uint8_t *element_data)
GNSS 13 parse GNGGA function.
void gnss13_drv_interface_selection(gnss13_cfg_t *cfg, gnss13_drv_t drv_sel)
GNSS 13 driver interface setup function.
void gnss13_set_wup_pin(gnss13_t *ctx, uint8_t state)
GNSS 13 set WUP pin function.
err_t gnss13_init(gnss13_t *ctx, gnss13_cfg_t *cfg)
GNSS 13 initialization function.
void gnss13_set_rst_pin(gnss13_t *ctx, uint8_t state)
GNSS 13 set RST pin function.
err_t gnss13_generic_write(gnss13_t *ctx, uint8_t *data_in, uint8_t len)
GNSS 13 generic write function.
void gnss13_cfg_setup(gnss13_cfg_t *cfg)
GNSS 13 configuration object setup function.
void gnss13_clear_ring_buffers(gnss13_t *ctx)
GNSS 13 clear ring buffers function.
GNSS 13 Click configuration object.
Definition gnss13.h:189
uint32_t baud_rate
Definition gnss13.h:201
gnss13_drv_t drv_sel
Definition gnss13.h:210
pin_name_t wup
Definition gnss13.h:198
uint32_t i2c_speed
Definition gnss13.h:207
bool uart_blocking
Definition gnss13.h:202
uart_data_bits_t data_bit
Definition gnss13.h:203
pin_name_t tx_pin
Definition gnss13.h:194
pin_name_t rx_pin
Definition gnss13.h:193
uart_stop_bits_t stop_bit
Definition gnss13.h:205
pin_name_t scl
Definition gnss13.h:191
uart_parity_t parity_bit
Definition gnss13.h:204
pin_name_t sda
Definition gnss13.h:192
pin_name_t rst
Definition gnss13.h:197
uint8_t i2c_address
Definition gnss13.h:208
GNSS 13 Click context object.
Definition gnss13.h:163
gnss13_drv_t drv_sel
Definition gnss13.h:177
gnss13_master_io_t write_f
Definition gnss13.h:179
char uart_rx_buffer[GNSS13_DRV_RX_BUFFER_SIZE]
Definition gnss13.h:173
uart_t uart
Definition gnss13.h:169
i2c_master_t i2c
Definition gnss13.h:170
char uart_tx_buffer[GNSS13_DRV_TX_BUFFER_SIZE]
Definition gnss13.h:174
digital_out_t wup
Definition gnss13.h:166
digital_out_t rst
Definition gnss13.h:165
uint8_t slave_address
Definition gnss13.h:176
gnss13_master_io_t read_f
Definition gnss13.h:180