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 GNSS15_RSP_START "$"
75#define GNSS15_RSP_DELIMITER ","
76#define GNSS15_RSP_END_SEQ "\r\n"
77#define GNSS15_RSP_GPGGA "$GPGGA"
78#define GNSS15_RSP_NO_FIX "0000.00000"
84#define GNSS15_GPGGA_ELEMENT_SIZE 15
85#define GNSS15_GPGGA_TIME 1
86#define GNSS15_GPGGA_LATITUDE 2
87#define GNSS15_GPGGA_LATITUDE_SIDE 3
88#define GNSS15_GPGGA_LONGITUDE 4
89#define GNSS15_GPGGA_LONGITUDE_SIDE 5
90#define GNSS15_GPGGA_QUALITY_INDICATOR 6
91#define GNSS15_GPGGA_NUMBER_OF_SATELLITES 7
92#define GNSS15_GPGGA_H_DILUTION_OF_POS 8
93#define GNSS15_GPGGA_ALTITUDE 9
94#define GNSS15_GPGGA_ALTITUDE_UNIT 10
95#define GNSS15_GPGGA_GEOIDAL_SEPARATION 11
96#define GNSS15_GPGGA_GEOIDAL_SEPARATION_UNIT 12
97#define GNSS15_GPGGA_TIME_SINCE_LAST_DGPS 13
98#define GNSS15_GPGGA_DGPS_REFERENCE_STATION_ID 14
105#define GNSS15_DUMMY 0xFF
112#define GNSS15_DEVICE_ADDRESS 0x3A
119#define GNSS15_TX_DRV_BUFFER_SIZE 100
120#define GNSS15_RX_DRV_BUFFER_SIZE 300
138#define GNSS15_MAP_MIKROBUS( cfg, mikrobus ) \
139 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
140 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
141 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
142 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
143 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
144 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
145 cfg.irq = MIKROBUS( mikrobus, MIKROBUS_INT )
gnss15_return_value_t
GNSS 15 Click return value data.
Definition gnss15.h:232
@ GNSS15_ERROR
Definition gnss15.h:234
@ GNSS15_OK
Definition gnss15.h:233
gnss15_drv_t
GNSS 15 Click driver selector.
Definition gnss15.h:155
@ GNSS15_DRV_SEL_I2C
Definition gnss15.h:157
@ GNSS15_DRV_SEL_UART
Definition gnss15.h:156
err_t(* gnss15_master_io_t)(struct gnss15_s *, uint8_t *, uint8_t)
GNSS 15 Click driver interface.
Definition gnss15.h:165
struct gnss15_s gnss15_t
GNSS 15 Click context object.
#define GNSS15_RX_DRV_BUFFER_SIZE
Definition gnss15.h:120
#define GNSS15_TX_DRV_BUFFER_SIZE
GNSS 15 driver buffer size.
Definition gnss15.h:119
void gnss15_reset_device(gnss15_t *ctx)
GNSS 15 reset device function.
void gnss15_set_rst_pin(gnss15_t *ctx, uint8_t state)
GNSS 15 set RST pin function.
err_t gnss15_init(gnss15_t *ctx, gnss15_cfg_t *cfg)
GNSS 15 initialization function.
void gnss15_set_wup_pin(gnss15_t *ctx, uint8_t state)
GNSS 15 set WUP pin function.
err_t gnss15_generic_write(gnss15_t *ctx, uint8_t *data_in, uint16_t len)
GNSS 15 data writing function.
err_t gnss15_parse_gpgga(uint8_t *rsp_buf, uint8_t gpgga_element, uint8_t *element_data)
GNSS 15 parse GPGGA function.
uint8_t gnss15_get_interrupt(gnss15_t *ctx)
GNSS 15 get interrupt pin state function.
void gnss15_cfg_setup(gnss15_cfg_t *cfg)
GNSS 15 configuration object setup function.
err_t gnss15_generic_read(gnss15_t *ctx, uint8_t *data_out, uint16_t len)
GNSS 15 data reading function.
GNSS 15 Click configuration object.
Definition gnss15.h:201
uint32_t baud_rate
Definition gnss15.h:214
gnss15_drv_t drv_sel
Definition gnss15.h:223
pin_name_t wup
Definition gnss15.h:210
uint32_t i2c_speed
Definition gnss15.h:220
pin_name_t irq
Definition gnss15.h:211
bool uart_blocking
Definition gnss15.h:215
uart_data_bits_t data_bit
Definition gnss15.h:216
pin_name_t tx_pin
Definition gnss15.h:204
pin_name_t rx_pin
Definition gnss15.h:203
uart_stop_bits_t stop_bit
Definition gnss15.h:218
pin_name_t scl
Definition gnss15.h:205
uart_parity_t parity_bit
Definition gnss15.h:217
pin_name_t sda
Definition gnss15.h:206
pin_name_t rst
Definition gnss15.h:209
uint8_t i2c_address
Definition gnss15.h:221
GNSS 15 Click context object.
Definition gnss15.h:172
gnss15_master_io_t write_f
Definition gnss15.h:191
gnss15_drv_t drv_sel
Definition gnss15.h:189
digital_in_t irq
Definition gnss15.h:178
uart_t uart
Definition gnss15.h:182
i2c_master_t i2c
Definition gnss15.h:181
digital_out_t wup
Definition gnss15.h:175
uint8_t uart_rx_buffer[GNSS15_RX_DRV_BUFFER_SIZE]
Definition gnss15.h:185
uint8_t uart_tx_buffer[GNSS15_TX_DRV_BUFFER_SIZE]
Definition gnss15.h:186
digital_out_t rst
Definition gnss15.h:174
uint8_t slave_address
Definition gnss15.h:188
gnss15_master_io_t read_f
Definition gnss15.h:192