42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define NANOGPS2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.wkp = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.fon = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define NANOGPS2_RETVAL uint8_t
82#define NANOGPS2_OK 0x00
83#define NANOGPS2_INIT_ERROR 0xFF
90#define NANOGPS2_NEMA_GNGGA 1
91#define NANOGPS2_NEMA_GPGLL 3
92#define NANOGPS2_NEMA_GNGGA_NUM_ELEMENT 15
93#define NANOGPS2_NEMA_GPGLL_NUM_ELEMENT 5
100#define NANOGPS2_GNGGA_TIME 1
101#define NANOGPS2_GNGGA_LATITUDE 2
102#define NANOGPS2_GNGGA_LATITUDE_SIDE 3
103#define NANOGPS2_GNGGA_LONGITUDE 4
104#define NANOGPS2_GNGGA_LONGITUDE_SIDE 5
105#define NANOGPS2_GNGGA_QUALITY_INDICATOR 6
106#define NANOGPS2_GNGGA_NUMBER_OF_SATELLITES 7
107#define NANOGPS2_GNGGA_H_DILUTION_OF_POS 8
108#define NANOGPS2_GNGGA_ALTITUDE 9
109#define NANOGPS2_GNGGA_ALTITUDE_UNIT 10
110#define NANOGPS2_GNGGA_GEOIDAL_SEPARATION 11
111#define NANOGPS2_GNGGA_GEOIDAL_SEPARATION_UNIT 12
112#define NANOGPS2_GNGGA_TIME_SINCE_LAST_DGPS 13
113#define NANOGPS2_GNGGA_DGPS_REFERENCE_STATION_ID 14
120#define NANOGPS2_GPGLL_LATITUDE 1
121#define NANOGPS2_GPGLL_LATITUDE_SIDE 2
122#define NANOGPS2_GPGLL_LONGITUDE 3
123#define NANOGPS2_GPGLL_LONGITUDE_SIDE 4
130#define NANOGPS2_ERROR_COMMAND_OR_ELEMENT 0xFF
131#define NANOGPS2_ERROR_START_OR_END_COMMAND 0x8F
132#define NANOGPS2_ERROR_NEXT_ELEMENT 0x4F
133#define NANOGPS2_ERROR_CURRENT_ELEMENT 0x2F
134#define NANOGPS2_NO_ERROR 0x00
141#define DRV_RX_BUFFER_SIZE 600
142#define DRV_TX_BUFFER_SIZE 50
319 char *rsp, uint8_t command,
320 uint8_t element,
char *parser_buf
#define DRV_RX_BUFFER_SIZE
Definition nanogps2.h:141
#define DRV_TX_BUFFER_SIZE
Definition nanogps2.h:142
#define NANOGPS2_RETVAL
Definition nanogps2.h:80
void nanogps2_cfg_setup(nanogps2_cfg_t *cfg)
Config Object Initialization function.
void nanogps2_set_cts_pin_state(nanogps2_t *ctx, uint8_t state)
Generic function for setting cts pin status.
int32_t nanogps2_generic_read(nanogps2_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void nanogps2_generic_write(nanogps2_t *ctx, char *data_buf, uint16_t len)
Generic write function.
uint8_t nanogps2_get_rts_pin(nanogps2_t *ctx)
Get RTS pin state.
void nanogps2_set_fon_pin_state(nanogps2_t *ctx, uint8_t state)
Generic function for setting fon pin status.
nanogps2_error_t nanogps2_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
void nanogps2_module_wakeup(nanogps2_t *ctx)
Wake-up module.
NANOGPS2_RETVAL nanogps2_init(nanogps2_t *ctx, nanogps2_cfg_t *cfg)
Initialization function.
uint8_t nanogps2_get_wkp_pin(nanogps2_t *ctx)
Get WKP pin state.
void nanogps2_set_en_pin_state(nanogps2_t *ctx, uint8_t state)
Generic function for setting en pin status.
uint8_t nanogps2_error_t
Error type.
Definition nanogps2.h:207
Click configuration structure definition.
Definition nanogps2.h:180
pin_name_t rts
Definition nanogps2.h:192
pin_name_t fon
Definition nanogps2.h:190
uint32_t baud_rate
Definition nanogps2.h:196
pin_name_t wkp
Definition nanogps2.h:188
pin_name_t cts
Definition nanogps2.h:191
bool uart_blocking
Definition nanogps2.h:197
uart_data_bits_t data_bit
Definition nanogps2.h:198
pin_name_t tx_pin
Definition nanogps2.h:184
pin_name_t rx_pin
Definition nanogps2.h:183
uart_stop_bits_t stop_bit
Definition nanogps2.h:200
pin_name_t en
Definition nanogps2.h:189
uart_parity_t parity_bit
Definition nanogps2.h:199
Click ctx object definition.
Definition nanogps2.h:155
digital_in_t wkp
Definition nanogps2.h:164
uart_t uart
Definition nanogps2.h:169
digital_out_t fon
Definition nanogps2.h:159
digital_in_t rts
Definition nanogps2.h:165
digital_out_t en
Definition nanogps2.h:158
digital_out_t cts
Definition nanogps2.h:160