Go to the documentation of this file.
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 MOSAIC_CMD_SET_NMEA_OUTPUT "setNMEAOutput"
74 #define MOSAIC_CMD_GET_NMEA_VERSION "getNMEAVersion"
80 #define MOSAIC_PROMPT_CMD "COM1>"
81 #define MOSAIC_PARAM_DELIMITER ","
82 #define MOSAIC_END_CMD "\r\n"
88 #define MOSAIC_SNO_STREAM_1 "Stream1"
89 #define MOSAIC_SNO_STREAM_2 "Stream2"
90 #define MOSAIC_SNO_STREAM_3 "Stream3"
91 #define MOSAIC_SNO_STREAM_4 "Stream4"
92 #define MOSAIC_SNO_STREAM_5 "Stream5"
93 #define MOSAIC_SNO_STREAM_6 "Stream6"
94 #define MOSAIC_SNO_STREAM_7 "Stream7"
95 #define MOSAIC_SNO_STREAM_8 "Stream8"
96 #define MOSAIC_SNO_STREAM_9 "Stream9"
97 #define MOSAIC_SNO_STREAM_10 "Stream10"
98 #define MOSAIC_SNO_STREAM_ALL "all"
99 #define MOSAIC_SNO_CD_NONE "none"
100 #define MOSAIC_SNO_CD_COM1 "COM1"
101 #define MOSAIC_SNO_MESSAGES_NONE "none"
102 #define MOSAIC_SNO_MESSAGES_ALM "ALM"
103 #define MOSAIC_SNO_MESSAGES_DTM "DTM"
104 #define MOSAIC_SNO_MESSAGES_GBS "GBS"
105 #define MOSAIC_SNO_MESSAGES_GGA "GGA"
106 #define MOSAIC_SNO_MESSAGES_GLL "GLL"
107 #define MOSAIC_SNO_MESSAGES_GNS "GNS"
108 #define MOSAIC_SNO_MESSAGES_GRS "GRS"
109 #define MOSAIC_SNO_MESSAGES_GSA "GSA"
110 #define MOSAIC_SNO_MESSAGES_GST "GST"
111 #define MOSAIC_SNO_MESSAGES_GSV "GSV"
112 #define MOSAIC_SNO_MESSAGES_HDT "HDT"
113 #define MOSAIC_SNO_MESSAGES_RMC "RMC"
114 #define MOSAIC_SNO_MESSAGES_ROT "ROT"
115 #define MOSAIC_SNO_MESSAGES_VTG "VTG"
116 #define MOSAIC_SNO_MESSAGES_ZDA "ZDA"
117 #define MOSAIC_SNO_MESSAGES_HRP "HRP"
118 #define MOSAIC_SNO_MESSAGES_LLQ "LLQ"
119 #define MOSAIC_SNO_MESSAGES_RBP "RBP"
120 #define MOSAIC_SNO_MESSAGES_RBV "RBV"
121 #define MOSAIC_SNO_MESSAGES_RBD "RBD"
122 #define MOSAIC_SNO_MESSAGES_AVR "AVR"
123 #define MOSAIC_SNO_MESSAGES_GGK "GGK"
124 #define MOSAIC_SNO_MESSAGES_GFA "GFA"
125 #define MOSAIC_SNO_MESSAGES_GGQ "GGQ"
126 #define MOSAIC_SNO_MESSAGES_LLK "LLK"
127 #define MOSAIC_SNO_MESSAGES_GMP "GMP"
128 #define MOSAIC_SNO_MESSAGES_TXT_BASE "TXTbase"
129 #define MOSAIC_SNO_MESSAGES_TFM "TFM"
130 #define MOSAIC_SNO_MESSAGES_SNC "SNC"
131 #define MOSAIC_SNO_MESSAGES_THS "THS"
132 #define MOSAIC_SNO_INTERVAL_OFF "off"
133 #define MOSAIC_SNO_INTERVAL_ON_CHANGE "OnChange"
134 #define MOSAIC_SNO_INTERVAL_MSEC10 "msec10"
135 #define MOSAIC_SNO_INTERVAL_MSEC20 "msec20"
136 #define MOSAIC_SNO_INTERVAL_MSEC40 "msec40"
137 #define MOSAIC_SNO_INTERVAL_MSEC50 "msec50"
138 #define MOSAIC_SNO_INTERVAL_MSEC100 "msec100"
139 #define MOSAIC_SNO_INTERVAL_MSEC200 "msec200"
140 #define MOSAIC_SNO_INTERVAL_MSEC500 "msec500"
141 #define MOSAIC_SNO_INTERVAL_SEC1 "sec1"
142 #define MOSAIC_SNO_INTERVAL_SEC2 "sec2"
143 #define MOSAIC_SNO_INTERVAL_SEC5 "sec5"
144 #define MOSAIC_SNO_INTERVAL_SEC10 "sec10"
145 #define MOSAIC_SNO_INTERVAL_SEC15 "sec15"
146 #define MOSAIC_SNO_INTERVAL_SEC30 "sec30"
147 #define MOSAIC_SNO_INTERVAL_SEC60 "sec60"
148 #define MOSAIC_SNO_INTERVAL_MIN2 "min2"
149 #define MOSAIC_SNO_INTERVAL_MIN5 "min5"
150 #define MOSAIC_SNO_INTERVAL_MIN10 "min10"
151 #define MOSAIC_SNO_INTERVAL_MIN15 "min15"
152 #define MOSAIC_SNO_INTERVAL_MIN30 "min30"
153 #define MOSAIC_SNO_INTERVAL_MIN60 "min60"
159 #define MOSAIC_NMEA_START "$"
160 #define MOSAIC_NMEA_DELIMITER ","
161 #define MOSAIC_NMEA_END "\r\n"
162 #define MOSAIC_NMEA_GGA "GGA"
168 #define MOSAIC_GGA_ELEMENT_SIZE 15
169 #define MOSAIC_GGA_TIME 1
170 #define MOSAIC_GGA_LATITUDE 2
171 #define MOSAIC_GGA_LATITUDE_SIDE 3
172 #define MOSAIC_GGA_LONGITUDE 4
173 #define MOSAIC_GGA_LONGITUDE_SIDE 5
174 #define MOSAIC_GGA_QUALITY_INDICATOR 6
175 #define MOSAIC_GGA_NUMBER_OF_SATELLITES 7
176 #define MOSAIC_GGA_H_DILUTION_OF_POS 8
177 #define MOSAIC_GGA_ALTITUDE 9
178 #define MOSAIC_GGA_ALTITUDE_UNIT 10
179 #define MOSAIC_GGA_GEOIDAL_SEPARATION 11
180 #define MOSAIC_GGA_GEOIDAL_SEPARATION_UNIT 12
181 #define MOSAIC_GGA_TIME_SINCE_LAST_DGPS 13
182 #define MOSAIC_GGA_DGPS_REFERENCE_STATION_ID 14
189 #define MOSAIC_RX_DRV_BUFFER_SIZE 400
190 #define MOSAIC_TX_DRV_BUFFER_SIZE 200
208 #define MOSAIC_MAP_MIKROBUS( cfg, mikrobus ) \
209 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
210 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
211 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
212 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
213 cfg.rdy = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
214 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
uart_stop_bits_t stop_bit
Definition: mosaic.h:263
err_t mosaic_generic_write(mosaic_t *ctx, uint8_t *data_in, uint16_t len)
Mosaic data writing function.
Mosaic Click configuration object.
Definition: mosaic.h:247
uart_t uart
Definition: mosaic.h:234
pin_name_t rx_pin
Definition: mosaic.h:249
@ MOSAIC_ERROR
Definition: mosaic.h:274
void mosaic_disable_nmea_output(mosaic_t *ctx)
Mosaic disable nmea output function.
pin_name_t rst
Definition: mosaic.h:253
err_t mosaic_generic_read(mosaic_t *ctx, uint8_t *data_out, uint16_t len)
Mosaic data reading function.
pin_name_t tx_pin
Definition: mosaic.h:250
digital_out_t cts
Definition: mosaic.h:227
pin_name_t rdy
Definition: mosaic.h:255
uint32_t baud_rate
Definition: mosaic.h:259
bool uart_blocking
Definition: mosaic.h:260
uart_data_bits_t data_bit
Definition: mosaic.h:261
void mosaic_cfg_setup(mosaic_cfg_t *cfg)
Mosaic configuration object setup function.
err_t mosaic_init(mosaic_t *ctx, mosaic_cfg_t *cfg)
Mosaic initialization function.
void mosaic_set_cts_pin(mosaic_t *ctx, uint8_t state)
Mosaic set cts pin function.
#define MOSAIC_TX_DRV_BUFFER_SIZE
Definition: mosaic.h:190
void mosaic_set_rst_pin(mosaic_t *ctx, uint8_t state)
Mosaic set rst pin function.
uint8_t mosaic_get_rts_pin(mosaic_t *ctx)
Mosaic get rts pin function.
pin_name_t rts
Definition: mosaic.h:256
void mosaic_send_cmd(mosaic_t *ctx, uint8_t *cmd)
Send command function.
digital_out_t rst
Definition: mosaic.h:226
void mosaic_enable_nmea_output(mosaic_t *ctx, uint8_t *msg_param, uint8_t *interval)
Mosaic enable nmea output function.
@ MOSAIC_ERROR_TIMEOUT
Definition: mosaic.h:275
#define MOSAIC_RX_DRV_BUFFER_SIZE
Mosaic driver buffer size.
Definition: mosaic.h:189
uint8_t mosaic_get_rdy_pin(mosaic_t *ctx)
Mosaic get rdy pin function.
mosaic_return_value_t
Mosaic Click return value data.
Definition: mosaic.h:272
uart_parity_t parity_bit
Definition: mosaic.h:262
void mosaic_send_cmd_with_par(mosaic_t *ctx, uint8_t *cmd_buf, uint8_t *param_buf)
Send command function with parameter.
err_t mosaic_parse_gga(uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
Mosaic parse GGA function.
digital_in_t rts
Definition: mosaic.h:231
Mosaic Click context object.
Definition: mosaic.h:224
@ MOSAIC_OK
Definition: mosaic.h:273
pin_name_t cts
Definition: mosaic.h:254
digital_in_t rdy
Definition: mosaic.h:230