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 NANOGPS_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.wkp = MIKROBUS( mikrobus, MIKROBUS_AN ); \
71 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
72 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_PWM )
79#define NANOGPS_RETVAL uint8_t
81#define NANOGPS_OK 0x00
82#define NANOGPS_INIT_ERROR 0xFF
89#define NANOGPS_NEMA_GPGGA 1
90#define NANOGPS_NEMA_GPGLL 3
91#define NANOGPS_NEMA_GPGGA_NUM_ELEMENT 15
92#define NANOGPS_NEMA_GPGLL_NUM_ELEMENT 5
99#define NANOGPS_GPGGA_TIME 1
100#define NANOGPS_GPGGA_LATITUDE 2
101#define NANOGPS_GPGGA_LATITUDE_SIDE 3
102#define NANOGPS_GPGGA_LONGITUDE 4
103#define NANOGPS_GPGGA_LONGITUDE_SIDE 5
104#define NANOGPS_GPGGA_QUALITY_INDICATOR 6
105#define NANOGPS_GPGGA_NUMBER_OF_SATELLITES 7
106#define NANOGPS_GPGGA_H_DILUTION_OF_POS 8
107#define NANOGPS_GPGGA_ALTITUDE 9
108#define NANOGPS_GPGGA_ALTITUDE_UNIT 10
109#define NANOGPS_GPGGA_GEOIDAL_SEPARATION 11
110#define NANOGPS_GPGGA_GEOIDAL_SEPARATION_UNIT 12
111#define NANOGPS_GPGGA_TIME_SINCE_LAST_DGPS 13
112#define NANOGPS_GPGGA_DGPS_REFERENCE_STATION_ID 14
119#define NANOGPS_GPGLL_LATITUDE 1
120#define NANOGPS_GPGLL_LATITUDE_SIDE 2
121#define NANOGPS_GPGLL_LONGITUDE 3
122#define NANOGPS_GPGLL_LONGITUDE_SIDE 4
129#define NANOGPS_ERROR_COMMAND_OR_ELEMENT 0xFF
130#define NANOGPS_ERROR_START_OR_END_COMMAND 0x8F
131#define NANOGPS_ERROR_NEXT_ELEMENT 0x4F
132#define NANOGPS_ERROR_CURRENT_ELEMENT 0x2F
133#define NANOGPS_NO_ERROR 0x00
140#define NANOGPS_DRV_RX_BUFFER_SIZE 500
141#define NANOGPS_DRV_TX_BUFFER_SIZE 100
289 char *rsp, uint8_t command,
290 uint8_t element,
char *parser_buf
#define NANOGPS_DRV_RX_BUFFER_SIZE
Definition nanogps.h:140
#define NANOGPS_DRV_TX_BUFFER_SIZE
Definition nanogps.h:141
#define NANOGPS_RETVAL
Definition nanogps.h:79
uint8_t nanogps_get_wkp_pin(nanogps_t *ctx)
Get WKP pin state.
nanogps_error_t nanogps_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
void nanogps_module_wakeup(nanogps_t *ctx)
Wake-up module.
void nanogps_generic_write(nanogps_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void nanogps_set_pwr_pin(nanogps_t *ctx, uint8_t state)
Set PWR ( powerS ) pin state.
void nanogps_cfg_setup(nanogps_cfg_t *cfg)
Config Object Initialization function.
NANOGPS_RETVAL nanogps_init(nanogps_t *ctx, nanogps_cfg_t *cfg)
Initialization function.
int32_t nanogps_generic_read(nanogps_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void nanogps_set_rst_pin(nanogps_t *ctx, uint8_t state)
Set RST ( reset ) pin state.
uint8_t nanogps_error_t
Error type.
Definition nanogps.h:202
Click configuration structure definition.
Definition nanogps.h:177
uint32_t baud_rate
Definition nanogps.h:191
pin_name_t wkp
Definition nanogps.h:185
bool uart_blocking
Definition nanogps.h:192
uart_data_bits_t data_bit
Definition nanogps.h:193
pin_name_t tx_pin
Definition nanogps.h:181
pin_name_t pwr
Definition nanogps.h:187
pin_name_t rx_pin
Definition nanogps.h:180
uart_stop_bits_t stop_bit
Definition nanogps.h:195
uart_parity_t parity_bit
Definition nanogps.h:194
pin_name_t rst
Definition nanogps.h:186
Click ctx object definition.
Definition nanogps.h:154
digital_in_t wkp
Definition nanogps.h:162
digital_out_t pwr
Definition nanogps.h:158
uart_t uart
Definition nanogps.h:166
digital_out_t rst
Definition nanogps.h:157