39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
74#define GNSS6_RSP_START "$"
75#define GNSS6_RSP_DELIMITER ","
76#define GNSS6_RSP_END_SEQ "\r\n"
77#define GNSS6_RSP_GPGGA "$GPGGA"
78#define GNSS6_RSP_NO_FIX "0000.00000"
84#define GNSS6_GPGGA_ELEMENT_SIZE 15
85#define GNSS6_GPGGA_TIME 1
86#define GNSS6_GPGGA_LATITUDE 2
87#define GNSS6_GPGGA_LATITUDE_SIDE 3
88#define GNSS6_GPGGA_LONGITUDE 4
89#define GNSS6_GPGGA_LONGITUDE_SIDE 5
90#define GNSS6_GPGGA_QUALITY_INDICATOR 6
91#define GNSS6_GPGGA_NUMBER_OF_SATELLITES 7
92#define GNSS6_GPGGA_H_DILUTION_OF_POS 8
93#define GNSS6_GPGGA_ALTITUDE 9
94#define GNSS6_GPGGA_ALTITUDE_UNIT 10
95#define GNSS6_GPGGA_GEOIDAL_SEPARATION 11
96#define GNSS6_GPGGA_GEOIDAL_SEPARATION_UNIT 12
97#define GNSS6_GPGGA_TIME_SINCE_LAST_DGPS 13
98#define GNSS6_GPGGA_DGPS_REFERENCE_STATION_ID 14
104#define GNSS6_DUMMY 0xFF
111#define GNSS6_DEVICE_ADDRESS 0x3A
118#define GNSS6_DRV_TX_BUFFER_SIZE 100
119#define GNSS6_DRV_RX_BUFFER_SIZE 300
137#define GNSS6_MAP_MIKROBUS( cfg, mikrobus ) \
138 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
139 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
140 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
141 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
142 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
143 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
144 cfg.pps = MIKROBUS( mikrobus, MIKROBUS_INT );
gnss6_drv_t
GNSS 6 Click driver selector.
Definition gnss6.h:154
@ GNSS6_DRV_SEL_I2C
Definition gnss6.h:156
@ GNSS6_DRV_SEL_UART
Definition gnss6.h:155
gnss6_return_value_t
GNSS 6 Click return value data.
Definition gnss6.h:232
@ GNSS6_ERROR
Definition gnss6.h:234
@ GNSS6_OK
Definition gnss6.h:233
err_t(* gnss6_master_io_t)(struct gnss6_s *, uint8_t *, uint8_t)
GNSS 6 Click driver interface.
Definition gnss6.h:164
struct gnss6_s gnss6_t
GNSS 6 Click context object.
#define GNSS6_DRV_TX_BUFFER_SIZE
GNSS 6 driver buffer size.
Definition gnss6.h:118
#define GNSS6_DRV_RX_BUFFER_SIZE
Definition gnss6.h:119
err_t gnss6_init(gnss6_t *ctx, gnss6_cfg_t *cfg)
GNSS 6 initialization function.
void gnss6_set_rst_pin(gnss6_t *ctx, uint8_t state)
GNSS 6 set RST pin function.
uint8_t gnss6_get_pps_pin(gnss6_t *ctx)
GNSS 6 get PPS pin function.
err_t gnss6_generic_read(gnss6_t *ctx, uint8_t *data_out, uint8_t len)
GNSS 6 data reading function.
void gnss6_reset_device(gnss6_t *ctx)
GNSS 6 reset device function.
err_t gnss6_parse_gpgga(uint8_t *rsp_buf, uint8_t gpgga_element, uint8_t *element_data)
GNSS 6 parse GPGGA function.
err_t gnss6_generic_write(gnss6_t *ctx, uint8_t *data_in, uint8_t len)
GNSS 6 data writing function.
void gnss6_set_wup_pin(gnss6_t *ctx, uint8_t state)
GNSS 6 set WUP pin function.
void gnss6_cfg_setup(gnss6_cfg_t *cfg)
GNSS 6 configuration object setup function.
void gnss6_drv_interface_selection(gnss6_cfg_t *cfg, gnss6_drv_t drv_sel)
GNSS 6 driver interface setup function.
GNSS 6 Click configuration object.
Definition gnss6.h:200
uint32_t baud_rate
Definition gnss6.h:213
pin_name_t wup
Definition gnss6.h:209
pin_name_t pps
Definition gnss6.h:210
uint32_t i2c_speed
Definition gnss6.h:220
bool uart_blocking
Definition gnss6.h:214
gnss6_drv_t drv_sel
Definition gnss6.h:223
uart_data_bits_t data_bit
Definition gnss6.h:215
pin_name_t tx_pin
Definition gnss6.h:205
pin_name_t rx_pin
Definition gnss6.h:204
uart_stop_bits_t stop_bit
Definition gnss6.h:217
pin_name_t scl
Definition gnss6.h:202
uart_parity_t parity_bit
Definition gnss6.h:216
pin_name_t sda
Definition gnss6.h:203
pin_name_t rst
Definition gnss6.h:208
uint8_t i2c_address
Definition gnss6.h:221
GNSS 6 Click context object.
Definition gnss6.h:171
uint8_t uart_tx_buffer[GNSS6_DRV_TX_BUFFER_SIZE]
Definition gnss6.h:185
digital_in_t pps
Definition gnss6.h:177
uint8_t uart_rx_buffer[GNSS6_DRV_RX_BUFFER_SIZE]
Definition gnss6.h:184
gnss6_master_io_t write_f
Definition gnss6.h:190
gnss6_drv_t drv_sel
Definition gnss6.h:188
gnss6_master_io_t read_f
Definition gnss6.h:191
uart_t uart
Definition gnss6.h:181
i2c_master_t i2c
Definition gnss6.h:180
digital_out_t wup
Definition gnss6.h:174
digital_out_t rst
Definition gnss6.h:173
uint8_t slave_address
Definition gnss6.h:187