Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
69 #define MOSAIC_CMD_SET_NMEA_OUTPUT "setNMEAOutput"
70 #define MOSAIC_CMD_GET_NMEA_VERSION "getNMEAVersion"
76 #define MOSAIC_PROMPT_CMD "COM1>"
77 #define MOSAIC_PARAM_DELIMITER ","
78 #define MOSAIC_END_CMD "\r\n"
84 #define MOSAIC_SNO_STREAM_1 "Stream1"
85 #define MOSAIC_SNO_STREAM_2 "Stream2"
86 #define MOSAIC_SNO_STREAM_3 "Stream3"
87 #define MOSAIC_SNO_STREAM_4 "Stream4"
88 #define MOSAIC_SNO_STREAM_5 "Stream5"
89 #define MOSAIC_SNO_STREAM_6 "Stream6"
90 #define MOSAIC_SNO_STREAM_7 "Stream7"
91 #define MOSAIC_SNO_STREAM_8 "Stream8"
92 #define MOSAIC_SNO_STREAM_9 "Stream9"
93 #define MOSAIC_SNO_STREAM_10 "Stream10"
94 #define MOSAIC_SNO_STREAM_ALL "all"
95 #define MOSAIC_SNO_CD_NONE "none"
96 #define MOSAIC_SNO_CD_COM1 "COM1"
97 #define MOSAIC_SNO_MESSAGES_NONE "none"
98 #define MOSAIC_SNO_MESSAGES_ALM "ALM"
99 #define MOSAIC_SNO_MESSAGES_DTM "DTM"
100 #define MOSAIC_SNO_MESSAGES_GBS "GBS"
101 #define MOSAIC_SNO_MESSAGES_GGA "GGA"
102 #define MOSAIC_SNO_MESSAGES_GLL "GLL"
103 #define MOSAIC_SNO_MESSAGES_GNS "GNS"
104 #define MOSAIC_SNO_MESSAGES_GRS "GRS"
105 #define MOSAIC_SNO_MESSAGES_GSA "GSA"
106 #define MOSAIC_SNO_MESSAGES_GST "GST"
107 #define MOSAIC_SNO_MESSAGES_GSV "GSV"
108 #define MOSAIC_SNO_MESSAGES_HDT "HDT"
109 #define MOSAIC_SNO_MESSAGES_RMC "RMC"
110 #define MOSAIC_SNO_MESSAGES_ROT "ROT"
111 #define MOSAIC_SNO_MESSAGES_VTG "VTG"
112 #define MOSAIC_SNO_MESSAGES_ZDA "ZDA"
113 #define MOSAIC_SNO_MESSAGES_HRP "HRP"
114 #define MOSAIC_SNO_MESSAGES_LLQ "LLQ"
115 #define MOSAIC_SNO_MESSAGES_RBP "RBP"
116 #define MOSAIC_SNO_MESSAGES_RBV "RBV"
117 #define MOSAIC_SNO_MESSAGES_RBD "RBD"
118 #define MOSAIC_SNO_MESSAGES_AVR "AVR"
119 #define MOSAIC_SNO_MESSAGES_GGK "GGK"
120 #define MOSAIC_SNO_MESSAGES_GFA "GFA"
121 #define MOSAIC_SNO_MESSAGES_GGQ "GGQ"
122 #define MOSAIC_SNO_MESSAGES_LLK "LLK"
123 #define MOSAIC_SNO_MESSAGES_GMP "GMP"
124 #define MOSAIC_SNO_MESSAGES_TXT_BASE "TXTbase"
125 #define MOSAIC_SNO_MESSAGES_TFM "TFM"
126 #define MOSAIC_SNO_MESSAGES_SNC "SNC"
127 #define MOSAIC_SNO_MESSAGES_THS "THS"
128 #define MOSAIC_SNO_INTERVAL_OFF "off"
129 #define MOSAIC_SNO_INTERVAL_ON_CHANGE "OnChange"
130 #define MOSAIC_SNO_INTERVAL_MSEC10 "msec10"
131 #define MOSAIC_SNO_INTERVAL_MSEC20 "msec20"
132 #define MOSAIC_SNO_INTERVAL_MSEC40 "msec40"
133 #define MOSAIC_SNO_INTERVAL_MSEC50 "msec50"
134 #define MOSAIC_SNO_INTERVAL_MSEC100 "msec100"
135 #define MOSAIC_SNO_INTERVAL_MSEC200 "msec200"
136 #define MOSAIC_SNO_INTERVAL_MSEC500 "msec500"
137 #define MOSAIC_SNO_INTERVAL_SEC1 "sec1"
138 #define MOSAIC_SNO_INTERVAL_SEC2 "sec2"
139 #define MOSAIC_SNO_INTERVAL_SEC5 "sec5"
140 #define MOSAIC_SNO_INTERVAL_SEC10 "sec10"
141 #define MOSAIC_SNO_INTERVAL_SEC15 "sec15"
142 #define MOSAIC_SNO_INTERVAL_SEC30 "sec30"
143 #define MOSAIC_SNO_INTERVAL_SEC60 "sec60"
144 #define MOSAIC_SNO_INTERVAL_MIN2 "min2"
145 #define MOSAIC_SNO_INTERVAL_MIN5 "min5"
146 #define MOSAIC_SNO_INTERVAL_MIN10 "min10"
147 #define MOSAIC_SNO_INTERVAL_MIN15 "min15"
148 #define MOSAIC_SNO_INTERVAL_MIN30 "min30"
149 #define MOSAIC_SNO_INTERVAL_MIN60 "min60"
155 #define MOSAIC_NMEA_START "$"
156 #define MOSAIC_NMEA_DELIMITER ","
157 #define MOSAIC_NMEA_END "\r\n"
158 #define MOSAIC_NMEA_GGA "GGA"
164 #define MOSAIC_GGA_ELEMENT_SIZE 15
165 #define MOSAIC_GGA_TIME 1
166 #define MOSAIC_GGA_LATITUDE 2
167 #define MOSAIC_GGA_LATITUDE_SIDE 3
168 #define MOSAIC_GGA_LONGITUDE 4
169 #define MOSAIC_GGA_LONGITUDE_SIDE 5
170 #define MOSAIC_GGA_QUALITY_INDICATOR 6
171 #define MOSAIC_GGA_NUMBER_OF_SATELLITES 7
172 #define MOSAIC_GGA_H_DILUTION_OF_POS 8
173 #define MOSAIC_GGA_ALTITUDE 9
174 #define MOSAIC_GGA_ALTITUDE_UNIT 10
175 #define MOSAIC_GGA_GEOIDAL_SEPARATION 11
176 #define MOSAIC_GGA_GEOIDAL_SEPARATION_UNIT 12
177 #define MOSAIC_GGA_TIME_SINCE_LAST_DGPS 13
178 #define MOSAIC_GGA_DGPS_REFERENCE_STATION_ID 14
185 #define MOSAIC_RX_DRV_BUFFER_SIZE 400
186 #define MOSAIC_TX_DRV_BUFFER_SIZE 200
204 #define MOSAIC_MAP_MIKROBUS( cfg, mikrobus ) \
205 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
206 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
207 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
208 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
209 cfg.rdy = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
210 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
uart_stop_bits_t stop_bit
Definition: mosaic.h:259
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:243
uart_t uart
Definition: mosaic.h:230
pin_name_t rx_pin
Definition: mosaic.h:245
@ MOSAIC_ERROR
Definition: mosaic.h:270
void mosaic_disable_nmea_output(mosaic_t *ctx)
Mosaic disable nmea output function.
pin_name_t rst
Definition: mosaic.h:249
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:246
digital_out_t cts
Definition: mosaic.h:223
pin_name_t rdy
Definition: mosaic.h:251
uint32_t baud_rate
Definition: mosaic.h:255
bool uart_blocking
Definition: mosaic.h:256
uart_data_bits_t data_bit
Definition: mosaic.h:257
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:186
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:252
void mosaic_send_cmd(mosaic_t *ctx, uint8_t *cmd)
Send command function.
digital_out_t rst
Definition: mosaic.h:222
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:271
#define MOSAIC_RX_DRV_BUFFER_SIZE
Mosaic driver buffer size.
Definition: mosaic.h:185
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:268
uart_parity_t parity_bit
Definition: mosaic.h:258
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:227
Mosaic Click context object.
Definition: mosaic.h:220
@ MOSAIC_OK
Definition: mosaic.h:269
pin_name_t cts
Definition: mosaic.h:250
digital_in_t rdy
Definition: mosaic.h:226