42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define GSMGPS_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \
71 cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_RST ); \
72 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
74 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
81#define GSMGPS_RETVAL uint8_t
88#define GSMGPS_NEMA_GPGGA 1
89#define GSMGPS_NEMA_GPGLL 3
90#define GSMGPS_NEMA_GPGGA_NUM_ELEMENT 15
91#define GSMGPS_NEMA_GPGLL_NUM_ELEMENT 5
98#define GSMGPS_GPGGA_TIME 1
99#define GSMGPS_GPGGA_LATITUDE 2
100#define GSMGPS_GPGGA_LATITUDE_SIDE 3
101#define GSMGPS_GPGGA_LONGITUDE 4
102#define GSMGPS_GPGGA_LONGITUDE_SIDE 5
103#define GSMGPS_GPGGA_QUALITY_INDICATOR 6
104#define GSMGPS_GPGGA_NUMBER_OF_SATELLITES 7
105#define GSMGPS_GPGGA_H_DILUTION_OF_POS 8
106#define GSMGPS_GPGGA_ALTITUDE 9
107#define GSMGPS_GPGGA_ALTITUDE_UNIT 10
108#define GSMGPS_GPGGA_GEOIDAL_SEPARATION 11
109#define GSMGPS_GPGGA_GEOIDAL_SEPARATION_UNIT 12
110#define GSMGPS_GPGGA_TIME_SINCE_LAST_DGPS 13
111#define GSMGPS_GPGGA_DGPS_REFERENCE_STATION_ID 14
118#define GSMGPS_GPGLL_LATITUDE 1
119#define GSMGPS_GPGLL_LATITUDE_SIDE 2
120#define GSMGPS_GPGLL_LONGITUDE 3
121#define GSMGPS_GPGLL_LONGITUDE_SIDE 4
128#define GSMGPS_ERROR_COMMAND_OR_ELEMENT 0xFF
129#define GSMGPS_ERROR_START_OR_END_COMMAND 0x8F
130#define GSMGPS_ERROR_NEXT_ELEMENT 0x4F
131#define GSMGPS_ERROR_CURRENT_ELEMENT 0x2F
132#define GSMGPS_NO_ERROR 0x00
139#define GSMGPS_MODULE_POWER_ON 1
140#define GSMGPS_MODULE_POWER_OFF 0
147#define GSMGPS_CMD_AT "AT"
148#define GSMGPS_CMD_ATI "ATI"
149#define GSMGPS_CMD_CGMR "AT+CGMR"
151#define GSMGPS_CMD_CFUN "AT+CFUN"
152#define GSMGPS_CMD_CREG "AT+CREG"
153#define GSMGPS_CMD_CGDCONT "AT+CGDCONT"
154#define GSMGPS_CMD_CIMI "AT+CIMI"
155#define GSMGPS_CMD_CGATT "AT+CGATT"
156#define GSMGPS_CMD_CSQ "AT+CSQ"
157#define GSMGPS_CMD_COPS "AT+COPS"
158#define GSMGPS_CMD_CMGS "AT+CMGS"
159#define GSMGPS_CMD_CMGF "AT+CMGF"
160#define GSMGPS_CMD_CGNSPWR "AT+CGNSPWR"
161#define GSMGPS_CMD_CGPSINF "AT+CGPSINF"
168#define DRV_RX_BUFFER_SIZE 256
169#define DRV_TX_BUFFER_SIZE 256
404 char *phone_number,
char *sms_text );
416 char *rsp, uint8_t command,
417 uint8_t element,
char *parser_buf
#define DRV_RX_BUFFER_SIZE
Definition gsmgps.h:168
#define DRV_TX_BUFFER_SIZE
Definition gsmgps.h:169
#define GSMGPS_RETVAL
Definition gsmgps.h:81
void gsmgps_set_sim_apn(gsmgps_t *ctx, char *sim_apn)
Set sim card APN.
uint8_t gsmgps_get_cts(gsmgps_t *ctx)
CTS Pin Get function.
void gsmgps_module_power(gsmgps_t *ctx, uint8_t state)
Power ON/OFF the module.
void gsmgps_generic_write(gsmgps_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void gsmgps_send_cmd_parameter_check(gsmgps_t *ctx, char *at_cmd_buf)
Check the command parameters.
GSMGPS_RETVAL gsmgps_init(gsmgps_t *ctx, gsmgps_cfg_t *cfg)
Initialization function.
gsmgps_error_t gsmgps_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
int32_t gsmgps_generic_read(gsmgps_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void gsmgps_send_sms_text(gsmgps_t *ctx, char *phone_number, char *sms_text)
GSM-GPS send SMS in text mode.
void gsmgps_send_cmd_with_parameter(gsmgps_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
err_t gsmgps_send_sms_pdu(gsmgps_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
GSM-GPS send SMS in PDU mode.
void gsmgps_send_cmd(gsmgps_t *ctx, char *cmd)
Send command function.
void gsmgps_send_cmd_check(gsmgps_t *ctx, char *at_cmd_buf)
Check the sent command.
void gsmgps_set_rts(gsmgps_t *ctx, uint8_t state)
Sets state of the RTS pin.
void gsmgps_cfg_setup(gsmgps_cfg_t *cfg)
Config Object Initialization function.
gsmgps_return_value_t
GSM-GPS Click return value data.
Definition gsmgps.h:236
uint8_t gsmgps_error_t
Error type.
Definition gsmgps.h:245
@ GSMGPS_ERROR
Definition gsmgps.h:238
@ GSMGPS_OK
Definition gsmgps.h:237
Click configuration structure definition.
Definition gsmgps.h:207
pin_name_t sta
Definition gsmgps.h:215
pin_name_t rts
Definition gsmgps.h:217
uint32_t baud_rate
Definition gsmgps.h:223
pin_name_t pwk
Definition gsmgps.h:216
pin_name_t cts
Definition gsmgps.h:219
bool uart_blocking
Definition gsmgps.h:224
pin_name_t ri
Definition gsmgps.h:218
uart_data_bits_t data_bit
Definition gsmgps.h:225
pin_name_t tx_pin
Definition gsmgps.h:211
pin_name_t rx_pin
Definition gsmgps.h:210
uart_stop_bits_t stop_bit
Definition gsmgps.h:227
uart_parity_t parity_bit
Definition gsmgps.h:226
Click ctx object definition.
Definition gsmgps.h:182
digital_in_t sta
Definition gsmgps.h:190
digital_out_t rts
Definition gsmgps.h:186
digital_in_t ri
Definition gsmgps.h:191
uart_t uart
Definition gsmgps.h:196
digital_in_t cts
Definition gsmgps.h:192
digital_out_t pwk
Definition gsmgps.h:185