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 RTKROVER_RSP_START "$"
74#define RTKROVER_RSP_DELIMITER ","
75#define RTKROVER_RSP_END_SEQ "\r\n"
76#define RTKROVER_RSP_GNGGA "$GNGGA"
82#define RTKROVER_GNGGA_ELEMENT_SIZE 15
83#define RTKROVER_GNGGA_TIME 1
84#define RTKROVER_GNGGA_LATITUDE 2
85#define RTKROVER_GNGGA_LATITUDE_SIDE 3
86#define RTKROVER_GNGGA_LONGITUDE 4
87#define RTKROVER_GNGGA_LONGITUDE_SIDE 5
88#define RTKROVER_GNGGA_QUALITY_INDICATOR 6
89#define RTKROVER_GNGGA_NUMBER_OF_SATELLITES 7
90#define RTKROVER_GNGGA_H_DILUTION_OF_POS 8
91#define RTKROVER_GNGGA_ALTITUDE 9
92#define RTKROVER_GNGGA_ALTITUDE_UNIT 10
93#define RTKROVER_GNGGA_GEOIDAL_SEPARATION 11
94#define RTKROVER_GNGGA_GEOIDAL_SEPARATION_UNIT 12
95#define RTKROVER_GNGGA_TIME_SINCE_LAST_DGPS 13
96#define RTKROVER_GNGGA_DGPS_REFERENCE_STATION_ID 14
103#define DRV_TX_BUFFER_SIZE 100
104#define DRV_RX_BUFFER_SIZE 1000
122#define RTKROVER_MAP_MIKROBUS( cfg, mikrobus ) \
123 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
124 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
125 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_AN ); \
126 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
127 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_CS ); \
128 cfg.bt = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
129 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
#define DRV_RX_BUFFER_SIZE
Definition rtkrover.h:104
#define DRV_TX_BUFFER_SIZE
RTK Rover driver buffer size.
Definition rtkrover.h:103
void rtkrover_set_wup_pin(rtkrover_t *ctx, uint8_t state)
RTK Rover set WUP pin function.
void rtkrover_cfg_setup(rtkrover_cfg_t *cfg)
RTK Rover configuration object setup function.
void rtkrover_clear_ring_buffers(rtkrover_t *ctx)
RTK Rover clear ring buffers function.
err_t rtkrover_init(rtkrover_t *ctx, rtkrover_cfg_t *cfg)
RTK Rover initialization function.
void rtkrover_set_rst_pin(rtkrover_t *ctx, uint8_t state)
RTK Rover set RST pin function.
err_t rtkrover_generic_read(rtkrover_t *ctx, char *data_out, uint16_t len)
RTK Rover data reading function.
err_t rtkrover_generic_write(rtkrover_t *ctx, char *data_in, uint16_t len)
RTK Rover data writing function.
err_t rtkrover_parse_gngga(char *rsp_buf, uint8_t gngga_element, char *element_data)
RTK Rover parse GNGGA function.
void rtkrover_set_boot_pin(rtkrover_t *ctx, uint8_t state)
RTK Rover set BOOT pin function.
void rtkrover_set_shd_pin(rtkrover_t *ctx, uint8_t state)
RTK Rover set SHD pin function.
uint8_t rtkrover_get_int_pin(rtkrover_t *ctx)
RTK Rover get INT pin function.
rtkrover_return_value_t
RTK Rover Click return value data.
Definition rtkrover.h:189
@ RTKROVER_OK
Definition rtkrover.h:190
@ RTKROVER_ERROR
Definition rtkrover.h:191
RTK Rover Click configuration object.
Definition rtkrover.h:163
uint32_t baud_rate
Definition rtkrover.h:176
pin_name_t wup
Definition rtkrover.h:171
pin_name_t bt
Definition rtkrover.h:172
bool uart_blocking
Definition rtkrover.h:177
uart_data_bits_t data_bit
Definition rtkrover.h:178
pin_name_t tx_pin
Definition rtkrover.h:166
pin_name_t rx_pin
Definition rtkrover.h:165
pin_name_t shd
Definition rtkrover.h:169
uart_stop_bits_t stop_bit
Definition rtkrover.h:180
pin_name_t int_pin
Definition rtkrover.h:173
uart_parity_t parity_bit
Definition rtkrover.h:179
pin_name_t rst
Definition rtkrover.h:170
RTK Rover Click context object.
Definition rtkrover.h:139
uart_t uart
Definition rtkrover.h:150
digital_in_t int_pin
Definition rtkrover.h:147
digital_out_t wup
Definition rtkrover.h:143
digital_out_t rst
Definition rtkrover.h:142
digital_out_t bt
Definition rtkrover.h:144
digital_out_t shd
Definition rtkrover.h:141