gsm2 2.0.0.0
gsm2.h File Reference

This file contains API for GSM 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  gsm2_t
 GSM 2 Click context object. More...
 
struct  gsm2_cfg_t
 GSM 2 Click configuration object. More...
 

Macros

#define GSM2_CMD_AT   "AT"
 GSM 2 control commands.
 
#define GSM2_CMD_ATI   "ATI"
 
#define GSM2_CMD_CFUN   "AT+CFUN"
 
#define GSM2_CMD_CREG   "AT+CREG"
 
#define GSM2_CMD_CGDCONT   "AT+CGDCONT"
 
#define GSM2_CMD_CSQ   "AT+CSQ"
 
#define GSM2_CMD_COPS   "AT+COPS"
 
#define GSM2_CMD_CMGS   "AT+CMGS"
 
#define GSM2_CMD_CMGF   "AT+CMGF"
 
#define GSM2_CMD_CGACT   "AT+CGACT"
 
#define GSM2_CMD_QIMUX   "AT+QIMUX"
 
#define GSM2_CMD_QIOPEN   "AT+QIOPEN"
 
#define GSM2_CMD_QICLOSE   "AT+QICLOSE"
 
#define GSM2_CMD_QISEND   "AT+QISEND"
 
#define GSM2_CMD_QIRD   "AT+QIRD"
 
#define GSM2_RSP_OK   "OK"
 GSM 2 device response for AT commands.
 
#define GSM2_RSP_ERROR   "ERROR"
 
#define GSM2_RX_DRV_BUFFER_SIZE   256
 GSM 2 driver buffer size.
 
#define GSM2_TX_DRV_BUFFER_SIZE   256
 
#define GSM2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  gsm2_return_value_t {
  GSM2_OK = 0 , GSM2_ERROR = -1 , GSM2_ERROR_TIMEOUT = -2 , GSM2_ERROR_CMD = -3 ,
  GSM2_ERROR_UNKNOWN = -4
}
 GSM 2 Click return value data. More...
 

Functions

void gsm2_cfg_setup (gsm2_cfg_t *cfg)
 GSM 2 configuration object setup function.
 
err_t gsm2_init (gsm2_t *ctx, gsm2_cfg_t *cfg)
 GSM 2 initialization function.
 
err_t gsm2_generic_write (gsm2_t *ctx, uint8_t *data_in, uint16_t len)
 GSM 2 data writing function.
 
err_t gsm2_generic_read (gsm2_t *ctx, uint8_t *data_out, uint16_t len)
 GSM 2 data reading function.
 
void gsm2_set_rts_pin (gsm2_t *ctx, uint8_t state)
 GSM 2 set rts pin function.
 
void gsm2_set_pwk_pin (gsm2_t *ctx, uint8_t state)
 GSM 2 set pwk pin function.
 
uint8_t gsm2_get_cts_pin (gsm2_t *ctx)
 GSM 2 get cts pin function.
 
uint8_t gsm2_get_sta_pin (gsm2_t *ctx)
 GSM 2 get sta pin function.
 
uint8_t gsm2_get_ring_pin (gsm2_t *ctx)
 GSM 2 get ring pin function.
 
void gsm2_send_cmd (gsm2_t *ctx, uint8_t *cmd)
 Send command function.
 
void gsm2_send_cmd_with_par (gsm2_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
 Send command function with parameter.
 
void gsm2_send_cmd_check (gsm2_t *ctx, uint8_t *at_cmd_buf)
 Check the sent command.
 
void gsm2_send_cmd_par_check (gsm2_t *ctx, uint8_t *at_cmd_buf)
 Check the command parameters.
 
void gsm2_set_sim_apn (gsm2_t *ctx, uint8_t *sim_apn)
 Set sim card APN.
 
void gsm2_send_sms_text (gsm2_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
 GSM 2 send SMS in text mode.
 
err_t gsm2_send_sms_pdu (gsm2_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
 GSM 2 send SMS in PDU mode.
 

Detailed Description

This file contains API for GSM 2 Click Driver.

Enumeration Type Documentation

◆ gsm2_return_value_t

GSM 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
GSM2_OK 
GSM2_ERROR 
GSM2_ERROR_TIMEOUT 
GSM2_ERROR_CMD 
GSM2_ERROR_UNKNOWN