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 C4GLTEGNSS_CMD_AT "AT"
74#define C4GLTEGNSS_CMD_ATI "ATI"
75#define C4GLTEGNSS_CMD_CGMR "AT+CGMR"
76#define C4GLTEGNSS_CMD_CFUN "AT+CFUN"
77#define C4GLTEGNSS_CMD_CREG "AT+CREG"
78#define C4GLTEGNSS_CMD_CGREG "AT+CGREG"
79#define C4GLTEGNSS_CMD_CGDCONT "AT+CGDCONT"
80#define C4GLTEGNSS_CMD_CIMI "AT+CIMI"
81#define C4GLTEGNSS_CMD_CMEE "AT+CMEE"
82#define C4GLTEGNSS_CMD_CGATT "AT+CGATT"
83#define C4GLTEGNSS_CMD_CSQ "AT+CSQ"
84#define C4GLTEGNSS_CMD_COPS "AT+COPS"
85#define C4GLTEGNSS_CMD_CMGS "AT+CMGS"
86#define C4GLTEGNSS_CMD_CMGF "AT+CMGF"
87#define C4GLTEGNSS_CMD_CGACT "AT+CGACT"
88#define C4GLTEGNSS_CMD_UPSDA "AT+UPSDA"
89#define C4GLTEGNSS_CMD_USOCR "AT+USOCR"
90#define C4GLTEGNSS_CMD_USOCO "AT+USOCO"
91#define C4GLTEGNSS_CMD_USOWR "AT+USOWR"
92#define C4GLTEGNSS_CMD_USORD "AT+USORD"
93#define C4GLTEGNSS_CMD_USORF "AT+USORF"
94#define C4GLTEGNSS_CMD_USOCL "AT+USOCL"
95#define C4GLTEGNSS_CMD_UGPS "AT+UGPS"
96#define C4GLTEGNSS_CMD_UGGGA "AT+UGGGA"
102#define C4GLTEGNSS_RSP_OK "OK"
103#define C4GLTEGNSS_RSP_ERROR "ERROR"
109#define C4GLTEGNSS_POWER_STATE_OFF 0
110#define C4GLTEGNSS_POWER_STATE_ON 1
116#define C4GLTEGNSS_RSP_START "$"
117#define C4GLTEGNSS_RSP_DELIMITER ","
118#define C4GLTEGNSS_RSP_END "\r\n"
119#define C4GLTEGNSS_RSP_GGA "GGA"
125#define C4GLTEGNSS_GGA_ELEMENT_SIZE 15
126#define C4GLTEGNSS_GGA_TIME 1
127#define C4GLTEGNSS_GGA_LATITUDE 2
128#define C4GLTEGNSS_GGA_LATITUDE_SIDE 3
129#define C4GLTEGNSS_GGA_LONGITUDE 4
130#define C4GLTEGNSS_GGA_LONGITUDE_SIDE 5
131#define C4GLTEGNSS_GGA_QUALITY_INDICATOR 6
132#define C4GLTEGNSS_GGA_NUMBER_OF_SATELLITES 7
133#define C4GLTEGNSS_GGA_H_DILUTION_OF_POS 8
134#define C4GLTEGNSS_GGA_ALTITUDE 9
135#define C4GLTEGNSS_GGA_ALTITUDE_UNIT 10
136#define C4GLTEGNSS_GGA_GEOIDAL_SEPARATION 11
137#define C4GLTEGNSS_GGA_GEOIDAL_SEPARATION_UNIT 12
138#define C4GLTEGNSS_GGA_TIME_SINCE_LAST_DGPS 13
139#define C4GLTEGNSS_GGA_DGPS_REFERENCE_STATION_ID 14
146#define C4GLTEGNSS_TX_DRV_BUFFER_SIZE 256
147#define C4GLTEGNSS_RX_DRV_BUFFER_SIZE 256
165#define C4GLTEGNSS_MAP_MIKROBUS( cfg, mikrobus ) \
166 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
167 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
168 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
169 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
170 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
171 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
c4gltegnss_return_value_t
4G LTE GNSS Click return value data.
Definition c4gltegnss.h:229
@ C4GLTEGNSS_ERROR_CMD
Definition c4gltegnss.h:233
@ C4GLTEGNSS_ERROR_TIMEOUT
Definition c4gltegnss.h:232
@ C4GLTEGNSS_ERROR
Definition c4gltegnss.h:231
@ C4GLTEGNSS_ERROR_UNKNOWN
Definition c4gltegnss.h:234
@ C4GLTEGNSS_OK
Definition c4gltegnss.h:230
#define C4GLTEGNSS_TX_DRV_BUFFER_SIZE
4G LTE GNSS driver buffer size.
Definition c4gltegnss.h:146
#define C4GLTEGNSS_RX_DRV_BUFFER_SIZE
Definition c4gltegnss.h:147
err_t c4gltegnss_parse_gga(uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
4G LTE GNSS parse GGA function.
void c4gltegnss_set_power_state(c4gltegnss_t *ctx, uint8_t state)
4G LTE GNSS set power state function.
void c4gltegnss_send_cmd_with_par(c4gltegnss_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void c4gltegnss_set_pwr_pin(c4gltegnss_t *ctx, uint8_t state)
4G LTE GNSS set PWR pin function.
err_t c4gltegnss_send_sms_pdu(c4gltegnss_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
4G LTE GNSS send SMS in PDU mode.
err_t c4gltegnss_generic_read(c4gltegnss_t *ctx, uint8_t *data_out, uint16_t len)
4G LTE GNSS data reading function.
uint8_t c4gltegnss_get_cts_pin(c4gltegnss_t *ctx)
4G LTE GNSS get cts pin function.
void c4gltegnss_send_cmd(c4gltegnss_t *ctx, uint8_t *cmd)
Send command function.
void c4gltegnss_send_sms_text(c4gltegnss_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
4G LTE GNSS send SMS in text mode.
void c4gltegnss_set_rts_pin(c4gltegnss_t *ctx, uint8_t state)
4G LTE GNSS set rts pin function.
void c4gltegnss_send_cmd_par_check(c4gltegnss_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
void c4gltegnss_send_cmd_check(c4gltegnss_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void c4gltegnss_set_sim_apn(c4gltegnss_t *ctx, uint8_t *sim_apn)
Set sim card APN.
err_t c4gltegnss_generic_write(c4gltegnss_t *ctx, uint8_t *data_in, uint16_t len)
4G LTE GNSS data writing function.
uint8_t c4gltegnss_get_ri_pin(c4gltegnss_t *ctx)
4G LTE GNSS get RI pin function.
void c4gltegnss_cfg_setup(c4gltegnss_cfg_t *cfg)
4G LTE GNSS configuration object setup function.
err_t c4gltegnss_init(c4gltegnss_t *ctx, c4gltegnss_cfg_t *cfg)
4G LTE GNSS initialization function.
4G LTE GNSS Click configuration object.
Definition c4gltegnss.h:204
pin_name_t rts
Definition c4gltegnss.h:211
uint32_t baud_rate
Definition c4gltegnss.h:216
pin_name_t cts
Definition c4gltegnss.h:213
bool uart_blocking
Definition c4gltegnss.h:217
pin_name_t ri
Definition c4gltegnss.h:212
uart_data_bits_t data_bit
Definition c4gltegnss.h:218
pin_name_t tx_pin
Definition c4gltegnss.h:207
pin_name_t pwr
Definition c4gltegnss.h:210
pin_name_t rx_pin
Definition c4gltegnss.h:206
uart_stop_bits_t stop_bit
Definition c4gltegnss.h:220
uart_parity_t parity_bit
Definition c4gltegnss.h:219
4G LTE GNSS Click context object.
Definition c4gltegnss.h:181
digital_out_t pwr
Definition c4gltegnss.h:183
digital_out_t rts
Definition c4gltegnss.h:184
digital_in_t ri
Definition c4gltegnss.h:187
uart_t uart
Definition c4gltegnss.h:191
digital_in_t cts
Definition c4gltegnss.h:188