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 GPS5_RSP_START "$"
74#define GPS5_RSP_DELIMITER ","
75#define GPS5_RSP_GNGGA "$GNGGA"
81#define GPS5_GNGGA_ELEMENT_SIZE 15
82#define GPS5_GNGGA_TIME 1
83#define GPS5_GNGGA_LATITUDE 2
84#define GPS5_GNGGA_LATITUDE_SIDE 3
85#define GPS5_GNGGA_LONGITUDE 4
86#define GPS5_GNGGA_LONGITUDE_SIDE 5
87#define GPS5_GNGGA_QUALITY_INDICATOR 6
88#define GPS5_GNGGA_NUMBER_OF_SATELLITES 7
89#define GPS5_GNGGA_H_DILUTION_OF_POS 8
90#define GPS5_GNGGA_ALTITUDE 9
91#define GPS5_GNGGA_ALTITUDE_UNIT 10
92#define GPS5_GNGGA_GEOIDAL_SEPARATION 11
93#define GPS5_GNGGA_GEOIDAL_SEPARATION_UNIT 12
94#define GPS5_GNGGA_TIME_SINCE_LAST_DGPS 13
95#define GPS5_GNGGA_DGPS_REFERENCE_STATION_ID 14
102#define DRV_RX_BUFFER_SIZE 300
103#define DRV_TX_BUFFER_SIZE 100
121#define GPS5_MAP_MIKROBUS( cfg, mikrobus ) \
122 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
123 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
124 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
125 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
126 cfg.stb = MIKROBUS( mikrobus, MIKROBUS_PWM )
gps5_return_value_t
GPS 5 Click return value data.
Definition gps5.h:180
@ GPS5_ERROR
Definition gps5.h:182
@ GPS5_OK
Definition gps5.h:181
#define DRV_RX_BUFFER_SIZE
GPS 5 driver buffer size.
Definition gps5.h:102
#define DRV_TX_BUFFER_SIZE
Definition gps5.h:103
void gps5_set_rst_pin(gps5_t *ctx, uint8_t state)
GPS 5 set RST pin function.
void gps5_cfg_setup(gps5_cfg_t *cfg)
GPS 5 configuration object setup function.
err_t gps5_init(gps5_t *ctx, gps5_cfg_t *cfg)
GPS 5 initialization function.
void gps5_set_stb_pin(gps5_t *ctx, uint8_t state)
GPS 5 set STB pin function.
err_t gps5_generic_read(gps5_t *ctx, char *data_buf, uint16_t max_len)
GPS 5 data reading function.
err_t gps5_generic_write(gps5_t *ctx, char *data_buf, uint16_t len)
GPS 5 data writing function.
void gps5_set_en_pin(gps5_t *ctx, uint8_t state)
GPS 5 set EN pin function.
err_t gps5_parse_gngga(char *rsp_buf, uint8_t gngga_element, char *element_data)
GPS 5 parse GNGGA function.
GPS 5 Click configuration object.
Definition gps5.h:156
uint32_t baud_rate
Definition gps5.h:167
bool uart_blocking
Definition gps5.h:168
uart_data_bits_t data_bit
Definition gps5.h:169
pin_name_t tx_pin
Definition gps5.h:159
pin_name_t rx_pin
Definition gps5.h:158
uart_stop_bits_t stop_bit
Definition gps5.h:171
pin_name_t en
Definition gps5.h:162
uart_parity_t parity_bit
Definition gps5.h:170
pin_name_t rst
Definition gps5.h:163
pin_name_t stb
Definition gps5.h:164
GPS 5 Click context object.
Definition gps5.h:136
digital_out_t stb
Definition gps5.h:140
uart_t uart
Definition gps5.h:143
digital_out_t en
Definition gps5.h:138
digital_out_t rst
Definition gps5.h:139