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 GSM5_CMD_AT "AT"
74#define GSM5_CMD_ATI "ATI"
75#define GSM5_CMD_CGMR "AT+CGMR"
76#define GSM5_CMD_CFUN "AT+CFUN"
77#define GSM5_CMD_CREG "AT+CREG"
78#define GSM5_CMD_CGREG "AT+CGREG"
79#define GSM5_CMD_CGDCONT "AT+CGDCONT"
80#define GSM5_CMD_CIMI "AT+CIMI"
81#define GSM5_CMD_CMEE "AT+CMEE"
82#define GSM5_CMD_CGATT "AT+CGATT"
83#define GSM5_CMD_CSQ "AT+CSQ"
84#define GSM5_CMD_COPS "AT+COPS"
85#define GSM5_CMD_CMGS "AT+CMGS"
86#define GSM5_CMD_CMGF "AT+CMGF"
87#define GSM5_CMD_CGACT "AT+CGACT"
88#define GSM5_CMD_UPSDA "AT+UPSDA"
89#define GSM5_CMD_USOCR "AT+USOCR"
90#define GSM5_CMD_USOCO "AT+USOCO"
91#define GSM5_CMD_USOWR "AT+USOWR"
92#define GSM5_CMD_USORD "AT+USORD"
93#define GSM5_CMD_USORF "AT+USORF"
94#define GSM5_CMD_USOCL "AT+USOCL"
100#define GSM5_RSP_OK "OK"
101#define GSM5_RSP_ERROR "ERROR"
108#define DRV_BUFFER_SIZE 256
126#define GSM5_MAP_MIKROBUS( cfg, mikrobus ) \
127 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
128 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
129 cfg.on = MIKROBUS( mikrobus, MIKROBUS_AN ); \
130 cfg.off = MIKROBUS( mikrobus, MIKROBUS_RST ); \
131 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
132 cfg.ring = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
133 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
#define DRV_BUFFER_SIZE
GSM 5 driver buffer size.
Definition gsm5.h:108
uint8_t gsm5_get_cts_pin(gsm5_t *ctx)
CTS Pin Get function.
err_t gsm5_generic_write(gsm5_t *ctx, char *data_buf, uint16_t len)
GSM 5 data writing function.
void gsm5_set_on_pin(gsm5_t *ctx, uint8_t state)
Sets state of the ON pin.
uint8_t gsm5_get_ring_pin(gsm5_t *ctx)
RING Pin Get function.
void gsm5_send_cmd_with_parameter(gsm5_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void gsm5_module_power_on(gsm5_t *ctx)
Power ON the module function.
void gsm5_send_sms_text(gsm5_t *ctx, char *phone_number, char *sms_text)
GSM 5 send SMS in text mode.
void gsm5_set_sim_apn(gsm5_t *ctx, char *sim_apn)
Set sim card APN.
void gsm5_set_off_pin(gsm5_t *ctx, uint8_t state)
Sets state of the OFF pin.
void gsm5_send_cmd_check(gsm5_t *ctx, char *at_cmd_buf)
Check the sent command.
err_t gsm5_init(gsm5_t *ctx, gsm5_cfg_t *cfg)
GSM 5 initialization function.
err_t gsm5_generic_read(gsm5_t *ctx, char *data_buf, uint16_t len)
GSM 5 data reading function.
err_t gsm5_send_sms_pdu(gsm5_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
GSM 5 send SMS in PDU mode.
void gsm5_send_cmd(gsm5_t *ctx, char *cmd)
Send command function.
void gsm5_cfg_setup(gsm5_cfg_t *cfg)
GSM 5 configuration object setup function.
void gsm5_send_cmd_parameter_check(gsm5_t *ctx, char *at_cmd_buf)
Check the command parameters.
void gsm5_set_rts_pin(gsm5_t *ctx, uint8_t state)
Sets state of the RTS pin.
gsm5_return_value_t
GSM 5 Click return value data.
Definition gsm5.h:193
@ GSM5_ERROR_UNKNOWN
Definition gsm5.h:198
@ GSM5_OK
Definition gsm5.h:194
@ GSM5_ERROR
Definition gsm5.h:195
@ GSM5_ERROR_CMD
Definition gsm5.h:197
@ GSM5_ERROR_TIMEOUT
Definition gsm5.h:196
GSM 5 Click configuration object.
Definition gsm5.h:167
pin_name_t rts
Definition gsm5.h:175
uint32_t baud_rate
Definition gsm5.h:180
pin_name_t cts
Definition gsm5.h:177
pin_name_t ring
Definition gsm5.h:176
bool uart_blocking
Definition gsm5.h:181
uart_data_bits_t data_bit
Definition gsm5.h:182
pin_name_t on
Definition gsm5.h:173
pin_name_t tx_pin
Definition gsm5.h:170
pin_name_t off
Definition gsm5.h:174
pin_name_t rx_pin
Definition gsm5.h:169
uart_stop_bits_t stop_bit
Definition gsm5.h:184
uart_parity_t parity_bit
Definition gsm5.h:183
GSM 5 Click context object.
Definition gsm5.h:143
digital_out_t on
Definition gsm5.h:145
digital_out_t rts
Definition gsm5.h:147
uart_t uart
Definition gsm5.h:154
digital_out_t off
Definition gsm5.h:146
digital_in_t cts
Definition gsm5.h:151
digital_in_t ring
Definition gsm5.h:150