42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define GPS_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.reset = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.tmpls = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define GPS_RETVAL uint8_t
81#define GPS_INIT_ERROR 0xFF
88#define GPS_NEMA_GPGGA 1
89#define GPS_NEMA_GPGLL 3
90#define GPS_NEMA_GPGGA_NUM_ELEMENT 15
91#define GPS_NEMA_GPGLL_NUM_ELEMENT 5
98#define GPS_GPGGA_TIME 1
99#define GPS_GPGGA_LATITUDE 2
100#define GPS_GPGGA_LATITUDE_SIDE 3
101#define GPS_GPGGA_LONGITUDE 4
102#define GPS_GPGGA_LONGITUDE_SIDE 5
103#define GPS_GPGGA_QUALITY_INDICATOR 6
104#define GPS_GPGGA_NUMBER_OF_SATELLITES 7
105#define GPS_GPGGA_H_DILUTION_OF_POS 8
106#define GPS_GPGGA_ALTITUDE 9
107#define GPS_GPGGA_ALTITUDE_UNIT 10
108#define GPS_GPGGA_GEOIDAL_SEPARATION 11
109#define GPS_GPGGA_GEOIDAL_SEPARATION_UNIT 12
110#define GPS_GPGGA_TIME_SINCE_LAST_DGPS 13
111#define GPS_GPGGA_DGPS_REFERENCE_STATION_ID 14
118#define GPS_GPGLL_LATITUDE 1
119#define GPS_GPGLL_LATITUDE_SIDE 2
120#define GPS_GPGLL_LONGITUDE 3
121#define GPS_GPGLL_LONGITUDE_SIDE 4
128#define GPS_ERROR_COMMAND_OR_ELEMENT 0xFF
129#define GPS_ERROR_START_OR_END_COMMAND 0x8F
130#define GPS_ERROR_NEXT_ELEMENT 0x4F
131#define GPS_ERROR_CURRENT_ELEMENT 0x2F
132#define GPS_NO_ERROR 0x00
139#define DRV_RX_BUFFER_SIZE 600
140#define DRV_TX_BUFFER_SIZE 100
279 char *rsp, uint8_t command,
280 uint8_t element,
char *parser_buf
#define DRV_RX_BUFFER_SIZE
Definition gps.h:139
#define DRV_TX_BUFFER_SIZE
Definition gps.h:140
#define GPS_RETVAL
Definition gps.h:78
void gps_set_rst_pin(gps_t *ctx, uint8_t state)
Set RST ( reset ) pin state.
uint8_t gps_get_tmpls_pin(gps_t *ctx)
uint8_t gps_get_tmpls_pin ( gps_t *ctx );
void gps_module_wakeup(gps_t *ctx)
Wake-up module.
gps_error_t gps_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
void gps_cfg_setup(gps_cfg_t *cfg)
Config Object Initialization function.
void gps_generic_write(gps_t *ctx, char *data_buf, uint16_t len)
Generic write function.
GPS_RETVAL gps_init(gps_t *ctx, gps_cfg_t *cfg)
Initialization function.
int32_t gps_generic_read(gps_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
uint8_t gps_error_t
Error type.
Definition gps.h:199
Click configuration structure definition.
Definition gps.h:175
uint32_t baud_rate
Definition gps.h:188
pin_name_t reset
Definition gps.h:183
bool uart_blocking
Definition gps.h:189
pin_name_t tmpls
Definition gps.h:184
uart_data_bits_t data_bit
Definition gps.h:190
pin_name_t tx_pin
Definition gps.h:179
pin_name_t rx_pin
Definition gps.h:178
uart_stop_bits_t stop_bit
Definition gps.h:192
uart_parity_t parity_bit
Definition gps.h:191
Click ctx object definition.
Definition gps.h:153
digital_in_t tmpls
Definition gps.h:160
digital_out_t reset
Definition gps.h:156
uart_t uart
Definition gps.h:164