39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
98#define NANOGPS3_RSP_START "$"
99#define NANOGPS3_RSP_DELIMITER ","
100#define NANOGPS3_RSP_GNGGA "$GNGGA"
101#define NANOGPS3_RSP_GPGLL "$GPGLL"
107#define NANOGPS3_NMEA_GNGGA 1
108#define NANOGPS3_NMEA_GPGLL 3
109#define NANOGPS3_NMEA_GNGGA_NUM_ELEMENT 15
110#define NANOGPS3_NMEA_GPGLL_NUM_ELEMENT 5
116#define NANOGPS3_GNGGA_TIME 1
117#define NANOGPS3_GNGGA_LATITUDE 2
118#define NANOGPS3_GNGGA_LATITUDE_SIDE 3
119#define NANOGPS3_GNGGA_LONGITUDE 4
120#define NANOGPS3_GNGGA_LONGITUDE_SIDE 5
121#define NANOGPS3_GNGGA_QUALITY_INDICATOR 6
122#define NANOGPS3_GNGGA_NUMBER_OF_SATELLITES 7
123#define NANOGPS3_GNGGA_H_DILUTION_OF_POS 8
124#define NANOGPS3_GNGGA_ALTITUDE 9
125#define NANOGPS3_GNGGA_ALTITUDE_UNIT 10
126#define NANOGPS3_GNGGA_GEOIDAL_SEPARATION 11
127#define NANOGPS3_GNGGA_GEOIDAL_SEPARATION_UNIT 12
128#define NANOGPS3_GNGGA_TIME_SINCE_LAST_DGPS 13
129#define NANOGPS3_GNGGA_DGPS_REFERENCE_STATION_ID 14
135#define NANOGPS3_DUMMY 0xFF
141#define NANOGPS3_PIN_STATE_LOW 0
142#define NANOGPS3_PIN_STATE_HIGH 1
149#define NANOGPS3_TX_DRV_BUFFER_SIZE 100
150#define NANOGPS3_RX_DRV_BUFFER_SIZE 600
157#define NANOGPS3_DEVICE_ADDRESS 0x10
175#define NANOGPS3_MAP_MIKROBUS( cfg, mikrobus ) \
176 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
177 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
178 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
179 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_AN ); \
180 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
181 cfg.fon = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
182 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
183 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
184 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
#define NANOGPS3_RX_DRV_BUFFER_SIZE
Definition nanogps3.h:150
#define NANOGPS3_TX_DRV_BUFFER_SIZE
Nano GPS 3 driver buffer size.
Definition nanogps3.h:149
err_t nanogps3_init(nanogps3_t *ctx, nanogps3_cfg_t *cfg)
Nano GPS 3 initialization function.
uint8_t nanogps3_get_wup_pin(nanogps3_t *ctx)
Nano GPS 3 get wakeup pin function.
void nanogps3_default_cfg(nanogps3_t *ctx)
Nano GPS 3 default configuration function.
err_t nanogps3_generic_write(nanogps3_t *ctx, uint8_t *data_in, uint8_t len)
Nano GPS 3 data writing function.
err_t nanogps3_generic_read(nanogps3_t *ctx, uint8_t *data_out, uint8_t len)
Nano GPS 3 data reading function.
void nanogps3_set_force_on_state(nanogps3_t *ctx, uint8_t pwr_state)
Nano GPS 3 set force on state function.
void nanogps3_set_reset_state(nanogps3_t *ctx, uint8_t rst_state)
Nano GPS 3 set reset state function.
void nanogps3_cfg_setup(nanogps3_cfg_t *cfg)
Nano GPS 3 configuration object setup function.
void nanogps3_request_to_send(nanogps3_t *ctx, uint8_t rts)
Nano GPS 3 request to send function.
err_t nanogps3_parse_gngga(char *rsp_buf, uint8_t gngga_element, char *element_data)
Nano GPS 3 parse GNGGA function.
uint8_t nanogps3_clear_to_send(nanogps3_t *ctx)
Nano GPS 3 clear to send function.
struct nanogps3_s nanogps3_t
Nano GPS 3 Click context object.
nanogps3_drv_t
Nano GPS 3 Click driver selector.
Definition nanogps3.h:194
@ NANOGPS3_DRV_SEL_UART
Definition nanogps3.h:196
@ NANOGPS3_DRV_SEL_I2C
Definition nanogps3.h:195
err_t(* nanogps3_master_io_t)(struct nanogps3_s *, uint8_t *, uint8_t)
Nano GPS 3 Click driver interface.
Definition nanogps3.h:204
nanogps3_return_value_t
Nano GPS 3 Click return value data.
Definition nanogps3.h:276
@ NANOGPS3_ERROR
Definition nanogps3.h:278
@ NANOGPS3_OK
Definition nanogps3.h:277
Nano GPS 3 Click configuration object.
Definition nanogps3.h:243
pin_name_t rts
Definition nanogps3.h:251
pin_name_t fon
Definition nanogps3.h:254
uint32_t baud_rate
Definition nanogps3.h:261
pin_name_t wup
Definition nanogps3.h:252
nanogps3_drv_t drv_sel
Definition nanogps3.h:267
pin_name_t cts
Definition nanogps3.h:255
uint32_t i2c_speed
Definition nanogps3.h:257
bool uart_blocking
Definition nanogps3.h:262
uart_data_bits_t data_bit
Definition nanogps3.h:263
pin_name_t tx_pin
Definition nanogps3.h:249
pin_name_t rx_pin
Definition nanogps3.h:248
uart_stop_bits_t stop_bit
Definition nanogps3.h:265
pin_name_t scl
Definition nanogps3.h:245
uart_parity_t parity_bit
Definition nanogps3.h:264
pin_name_t sda
Definition nanogps3.h:246
pin_name_t rst
Definition nanogps3.h:253
uint8_t i2c_address
Definition nanogps3.h:258
Nano GPS 3 Click context object.
Definition nanogps3.h:211
nanogps3_drv_t drv_sel
Definition nanogps3.h:232
nanogps3_master_io_t read_f
Definition nanogps3.h:234
digital_out_t rts
Definition nanogps3.h:213
uart_t uart
Definition nanogps3.h:223
digital_in_t wup
Definition nanogps3.h:218
digital_out_t fon
Definition nanogps3.h:215
i2c_master_t i2c
Definition nanogps3.h:222
char uart_tx_buffer[NANOGPS3_TX_DRV_BUFFER_SIZE]
Definition nanogps3.h:230
digital_in_t cts
Definition nanogps3.h:219
digital_out_t rst
Definition nanogps3.h:214
uint8_t slave_address
Definition nanogps3.h:226
nanogps3_master_io_t write_f
Definition nanogps3.h:233
char uart_rx_buffer[NANOGPS3_RX_DRV_BUFFER_SIZE]
Definition nanogps3.h:229