39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define GNSS2_RSP_START "$"
74#define GNSS2_RSP_DELIMITER ","
75#define GNSS2_RSP_END_SEQ "\r\n"
76#define GNSS2_RSP_GPGGA "$GPGGA"
82#define GNSS2_GPGGA_ELEMENT_SIZE 15
83#define GNSS2_GPGGA_TIME 1
84#define GNSS2_GPGGA_LATITUDE 2
85#define GNSS2_GPGGA_LATITUDE_SIDE 3
86#define GNSS2_GPGGA_LONGITUDE 4
87#define GNSS2_GPGGA_LONGITUDE_SIDE 5
88#define GNSS2_GPGGA_QUALITY_INDICATOR 6
89#define GNSS2_GPGGA_NUMBER_OF_SATELLITES 7
90#define GNSS2_GPGGA_H_DILUTION_OF_POS 8
91#define GNSS2_GPGGA_ALTITUDE 9
92#define GNSS2_GPGGA_ALTITUDE_UNIT 10
93#define GNSS2_GPGGA_GEOIDAL_SEPARATION 11
94#define GNSS2_GPGGA_GEOIDAL_SEPARATION_UNIT 12
95#define GNSS2_GPGGA_TIME_SINCE_LAST_DGPS 13
96#define GNSS2_GPGGA_DGPS_REFERENCE_STATION_ID 14
103#define GNSS2_DRV_TX_BUFFER_SIZE 100
104#define GNSS2_DRV_RX_BUFFER_SIZE 1000
122#define GNSS2_MAP_MIKROBUS( cfg, mikrobus ) \
123 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
124 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
125 cfg.fon = MIKROBUS( mikrobus, MIKROBUS_AN ); \
126 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
127 cfg.stb = MIKROBUS( mikrobus, MIKROBUS_PWM )
gnss2_return_value_t
GNSS 2 Click return value data.
Definition gnss2.h:183
@ GNSS2_OK
Definition gnss2.h:184
@ GNSS2_ERROR
Definition gnss2.h:185
#define GNSS2_DRV_TX_BUFFER_SIZE
GNSS 2 driver buffer size.
Definition gnss2.h:103
#define GNSS2_DRV_RX_BUFFER_SIZE
Definition gnss2.h:104
void gnss2_clear_ring_buffers(gnss2_t *ctx)
GNSS 2 clear ring buffers function.
err_t gnss2_init(gnss2_t *ctx, gnss2_cfg_t *cfg)
GNSS 2 initialization function.
err_t gnss2_parse_gpgga(char *rsp_buf, uint8_t gpgga_element, char *element_data)
GNSS 2 parse GPGGA function.
void gnss2_cfg_setup(gnss2_cfg_t *cfg)
GNSS 2 configuration object setup function.
uint8_t gnss2_get_fon_pin(gnss2_t *ctx)
GNSS 2 get FON pin function.
uint8_t gnss2_get_stb_pin(gnss2_t *ctx)
GNSS 2 get STB pin function.
err_t gnss2_generic_read(gnss2_t *ctx, char *data_out, uint16_t len)
GNSS 2 data reading function.
void gnss2_set_rst_pin(gnss2_t *ctx, uint8_t state)
GNSS 2 set RST pin function.
err_t gnss2_generic_write(gnss2_t *ctx, char *data_in, uint16_t len)
GNSS 2 data writing function.
GNSS 2 Click configuration object.
Definition gnss2.h:159
pin_name_t fon
Definition gnss2.h:166
uint32_t baud_rate
Definition gnss2.h:170
bool uart_blocking
Definition gnss2.h:171
uart_data_bits_t data_bit
Definition gnss2.h:172
pin_name_t tx_pin
Definition gnss2.h:162
pin_name_t rx_pin
Definition gnss2.h:161
uart_stop_bits_t stop_bit
Definition gnss2.h:174
uart_parity_t parity_bit
Definition gnss2.h:173
pin_name_t rst
Definition gnss2.h:165
pin_name_t stb
Definition gnss2.h:167
GNSS 2 Click context object.
Definition gnss2.h:137
digital_in_t fon
Definition gnss2.h:142
uart_t uart
Definition gnss2.h:146
digital_in_t stb
Definition gnss2.h:143
digital_out_t rst
Definition gnss2.h:139