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 GNSS_RSP_START "$"
74#define GNSS_RSP_DELIMITER ","
75#define GNSS_RSP_END_SEQ "\r\n"
76#define GNSS_RSP_GPGGA "$GPGGA"
82#define GNSS_GPGGA_ELEMENT_SIZE 15
83#define GNSS_GPGGA_TIME 1
84#define GNSS_GPGGA_LATITUDE 2
85#define GNSS_GPGGA_LATITUDE_SIDE 3
86#define GNSS_GPGGA_LONGITUDE 4
87#define GNSS_GPGGA_LONGITUDE_SIDE 5
88#define GNSS_GPGGA_QUALITY_INDICATOR 6
89#define GNSS_GPGGA_NUMBER_OF_SATELLITES 7
90#define GNSS_GPGGA_H_DILUTION_OF_POS 8
91#define GNSS_GPGGA_ALTITUDE 9
92#define GNSS_GPGGA_ALTITUDE_UNIT 10
93#define GNSS_GPGGA_GEOIDAL_SEPARATION 11
94#define GNSS_GPGGA_GEOIDAL_SEPARATION_UNIT 12
95#define GNSS_GPGGA_TIME_SINCE_LAST_DGPS 13
96#define GNSS_GPGGA_DGPS_REFERENCE_STATION_ID 14
103#define GNSS_DRV_TX_BUFFER_SIZE 100
104#define GNSS_DRV_RX_BUFFER_SIZE 1000
122#define GNSS_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_CS ); \
126 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
gnss_return_value_t
GNSS Click return value data.
Definition gnss.h:178
@ GNSS_OK
Definition gnss.h:179
@ GNSS_ERROR
Definition gnss.h:180
#define GNSS_DRV_RX_BUFFER_SIZE
Definition gnss.h:104
#define GNSS_DRV_TX_BUFFER_SIZE
GNSS driver buffer size.
Definition gnss.h:103
void gnss_clear_ring_buffers(gnss_t *ctx)
GNSS clear ring buffers function.
void gnss_set_fon_pin(gnss_t *ctx, uint8_t state)
GNSS set FON pin function.
err_t gnss_init(gnss_t *ctx, gnss_cfg_t *cfg)
GNSS initialization function.
err_t gnss_generic_read(gnss_t *ctx, char *data_out, uint16_t len)
GNSS data reading function.
void gnss_set_rst_pin(gnss_t *ctx, uint8_t state)
GNSS set RST pin function.
err_t gnss_parse_gpgga(char *rsp_buf, uint8_t gpgga_element, char *element_data)
GNSS parse GPGGA function.
err_t gnss_generic_write(gnss_t *ctx, char *data_in, uint16_t len)
GNSS data writing function.
void gnss_cfg_setup(gnss_cfg_t *cfg)
GNSS configuration object setup function.
GNSS Click configuration object.
Definition gnss.h:155
pin_name_t fon
Definition gnss.h:162
uint32_t baud_rate
Definition gnss.h:165
bool uart_blocking
Definition gnss.h:166
uart_data_bits_t data_bit
Definition gnss.h:167
pin_name_t tx_pin
Definition gnss.h:158
pin_name_t rx_pin
Definition gnss.h:157
uart_stop_bits_t stop_bit
Definition gnss.h:169
uart_parity_t parity_bit
Definition gnss.h:168
pin_name_t rst
Definition gnss.h:161
GNSS Click context object.
Definition gnss.h:136
uart_t uart
Definition gnss.h:142
digital_out_t fon
Definition gnss.h:139
digital_out_t rst
Definition gnss.h:138