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 GSM3_CMD_AT "AT"
74#define GSM3_CMD_CFUN "AT+CFUN"
75#define GSM3_CMD_CREG "AT+CREG"
76#define GSM3_CMD_CGDCONT "AT+CGDCONT"
77#define GSM3_CMD_CSQ "AT+CSQ"
78#define GSM3_CMD_COPS "AT+COPS"
79#define GSM3_CMD_CMGS "AT+CMGS"
80#define GSM3_CMD_CMGF "AT+CMGF"
81#define GSM3_CMD_CIPMUX "AT+CIPMUX"
82#define GSM3_CMD_CIPSTART "AT+CIPSTART"
83#define GSM3_CMD_CIPCLOSE "AT+CIPCLOSE"
84#define GSM3_CMD_CIPSEND "AT+CIPSEND"
85#define GSM3_CMD_CIPHEAD "AT+CIPHEAD"
91#define GSM3_RSP_OK "OK"
92#define GSM3_RSP_ERROR "ERROR"
99#define GSM3_RX_DRV_BUFFER_SIZE 256
100#define GSM3_TX_DRV_BUFFER_SIZE 256
118#define GSM3_MAP_MIKROBUS( cfg, mikrobus ) \
119 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
120 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
121 cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \
122 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
123 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
124 cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
125 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
#define GSM3_RX_DRV_BUFFER_SIZE
GSM 3 driver buffer size.
Definition gsm3.h:99
#define GSM3_TX_DRV_BUFFER_SIZE
Definition gsm3.h:100
void gsm3_send_cmd_check(gsm3_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void gsm3_send_cmd_par_check(gsm3_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
uint8_t gsm3_get_cts_pin(gsm3_t *ctx)
GSM 3 get cts pin function.
void gsm3_send_cmd_with_par(gsm3_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void gsm3_set_sim_apn(gsm3_t *ctx, uint8_t *sim_apn)
Set sim card APN.
err_t gsm3_init(gsm3_t *ctx, gsm3_cfg_t *cfg)
GSM 3 initialization function.
void gsm3_set_rst_pin(gsm3_t *ctx, uint8_t state)
GSM 3 set rst pin function.
void gsm3_set_rts_pin(gsm3_t *ctx, uint8_t state)
GSM 3 set rts pin function.
err_t gsm3_send_sms_pdu(gsm3_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
GSM 3 send SMS in PDU mode.
uint8_t gsm3_get_sta_pin(gsm3_t *ctx)
GSM 3 get sta pin function.
void gsm3_send_sms_text(gsm3_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
GSM 3 send SMS in text mode.
void gsm3_set_pwk_pin(gsm3_t *ctx, uint8_t state)
GSM 3 set pwk pin function.
void gsm3_cfg_setup(gsm3_cfg_t *cfg)
GSM 3 configuration object setup function.
err_t gsm3_generic_write(gsm3_t *ctx, uint8_t *data_in, uint16_t len)
GSM 3 data writing function.
void gsm3_send_cmd(gsm3_t *ctx, uint8_t *cmd)
Send command function.
err_t gsm3_generic_read(gsm3_t *ctx, uint8_t *data_out, uint16_t len)
GSM 3 data reading function.
gsm3_return_value_t
GSM 3 Click return value data.
Definition gsm3.h:185
@ GSM3_ERROR
Definition gsm3.h:187
@ GSM3_OK
Definition gsm3.h:186
@ GSM3_ERROR_TIMEOUT
Definition gsm3.h:188
@ GSM3_ERROR_CMD
Definition gsm3.h:189
@ GSM3_ERROR_UNKNOWN
Definition gsm3.h:190
GSM 3 Click configuration object.
Definition gsm3.h:159
pin_name_t sta
Definition gsm3.h:168
pin_name_t rts
Definition gsm3.h:167
uint32_t baud_rate
Definition gsm3.h:172
pin_name_t pwk
Definition gsm3.h:166
pin_name_t cts
Definition gsm3.h:169
bool uart_blocking
Definition gsm3.h:173
uart_data_bits_t data_bit
Definition gsm3.h:174
pin_name_t tx_pin
Definition gsm3.h:162
pin_name_t rx_pin
Definition gsm3.h:161
uart_stop_bits_t stop_bit
Definition gsm3.h:176
uart_parity_t parity_bit
Definition gsm3.h:175
pin_name_t rst
Definition gsm3.h:165
GSM 3 Click context object.
Definition gsm3.h:135
digital_in_t sta
Definition gsm3.h:142
digital_out_t rts
Definition gsm3.h:139
uart_t uart
Definition gsm3.h:146
digital_in_t cts
Definition gsm3.h:143
digital_out_t pwk
Definition gsm3.h:138
digital_out_t rst
Definition gsm3.h:137