gsm5 2.1.0.0
GSM 5 Click Driver

API for configuring and manipulating GSM 5 Click driver. More...

Topics

 GSM 5 Device Settings
 Settings for registers of GSM 5 Click driver.
 
 GSM 5 MikroBUS Map
 MikroBUS pin mapping of GSM 5 Click driver.
 

Functions

void gsm5_cfg_setup (gsm5_cfg_t *cfg)
 GSM 5 configuration object setup function.
 
err_t gsm5_init (gsm5_t *ctx, gsm5_cfg_t *cfg)
 GSM 5 initialization function.
 
err_t gsm5_generic_write (gsm5_t *ctx, char *data_buf, uint16_t len)
 GSM 5 data writing function.
 
err_t gsm5_generic_read (gsm5_t *ctx, char *data_buf, uint16_t len)
 GSM 5 data reading function.
 
void gsm5_set_on_pin (gsm5_t *ctx, uint8_t state)
 Sets state of the ON pin.
 
void gsm5_set_off_pin (gsm5_t *ctx, uint8_t state)
 Sets state of the OFF pin.
 
void gsm5_set_rts_pin (gsm5_t *ctx, uint8_t state)
 Sets state of the RTS pin.
 
uint8_t gsm5_get_ring_pin (gsm5_t *ctx)
 RING Pin Get function.
 
uint8_t gsm5_get_cts_pin (gsm5_t *ctx)
 CTS Pin Get function.
 
void gsm5_module_power_on (gsm5_t *ctx)
 Power ON the module function.
 
void gsm5_send_cmd (gsm5_t *ctx, char *cmd)
 Send command function.
 
void gsm5_send_cmd_with_parameter (gsm5_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void gsm5_send_cmd_check (gsm5_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void gsm5_send_cmd_parameter_check (gsm5_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 
void gsm5_set_sim_apn (gsm5_t *ctx, char *sim_apn)
 Set sim card APN.
 
void gsm5_send_sms_text (gsm5_t *ctx, char *phone_number, char *sms_text)
 GSM 5 send SMS in text mode.
 
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.
 

Detailed Description

API for configuring and manipulating GSM 5 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ gsm5_cfg_setup()

void gsm5_cfg_setup ( gsm5_cfg_t * cfg)

GSM 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See gsm5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ gsm5_generic_read()

err_t gsm5_generic_read ( gsm5_t * ctx,
char * data_buf,
uint16_t len )

GSM 5 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ gsm5_generic_write()

err_t gsm5_generic_write ( gsm5_t * ctx,
char * data_buf,
uint16_t len )

GSM 5 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gsm5_get_cts_pin()

uint8_t gsm5_get_cts_pin ( gsm5_t * ctx)

CTS Pin Get function.

This function allows user to check state of the CTS pin.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
Returns
  • 0 logical low.
  • 1 logical high.
Note
None.

◆ gsm5_get_ring_pin()

uint8_t gsm5_get_ring_pin ( gsm5_t * ctx)

RING Pin Get function.

This function allows user to check state of the RING pin.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
Returns
  • 0 logical low.
  • 1 logical high.
Note
None.

◆ gsm5_init()

err_t gsm5_init ( gsm5_t * ctx,
gsm5_cfg_t * cfg )

GSM 5 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See gsm5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gsm5_module_power_on()

void gsm5_module_power_on ( gsm5_t * ctx)

Power ON the module function.

This function powers ON the module.

Parameters
ctxClick object.
Returns
Nothing.
Note
None.

◆ gsm5_send_cmd()

void gsm5_send_cmd ( gsm5_t * ctx,
char * cmd )

Send command function.

This function sends a specified command to the click module.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]cmdCommand variable.
Returns
Nothing.
Note
None.

◆ gsm5_send_cmd_check()

void gsm5_send_cmd_check ( gsm5_t * ctx,
char * at_cmd_buf )

Check the sent command.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.
Note
None.

◆ gsm5_send_cmd_parameter_check()

void gsm5_send_cmd_parameter_check ( gsm5_t * ctx,
char * at_cmd_buf )

Check the command parameters.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.
Note
None.

◆ gsm5_send_cmd_with_parameter()

void gsm5_send_cmd_with_parameter ( gsm5_t * ctx,
char * at_cmd_buf,
char * param_buf )

Send command function with parameter.

This function sends a command with specified parameter to the click module.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
[in]param_bufParameter buffer.
Returns
Nothing.
Note
None.

◆ gsm5_send_sms_pdu()

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.

This function sends text message to a phone number in PDU mode.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]service_center_numberSMSC of the SIM card.
[in]phone_numberPhone number to message.
[in]sms_textMessage to be sent.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gsm5_send_sms_text()

void gsm5_send_sms_text ( gsm5_t * ctx,
char * phone_number,
char * sms_text )

GSM 5 send SMS in text mode.

This function sends text message to a phone number.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]phone_numberPhone number to message.
[in]sms_textMessage to be sent.
Returns
Nothing.
Note
None.

◆ gsm5_set_off_pin()

void gsm5_set_off_pin ( gsm5_t * ctx,
uint8_t state )

Sets state of the OFF pin.

This function sets the OFF pin state.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]statePin state ( 1 or 0 ).
Returns
Nothing.
Note
None.

◆ gsm5_set_on_pin()

void gsm5_set_on_pin ( gsm5_t * ctx,
uint8_t state )

Sets state of the ON pin.

This function sets the ON pin state.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]statePin state ( 1 or 0 ).
Returns
Nothing.
Note
None.

◆ gsm5_set_rts_pin()

void gsm5_set_rts_pin ( gsm5_t * ctx,
uint8_t state )

Sets state of the RTS pin.

This function sets the RTS pin state.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]statePin state ( 1 or 0 ).
Returns
Nothing.
Note
None.

◆ gsm5_set_sim_apn()

void gsm5_set_sim_apn ( gsm5_t * ctx,
char * sim_apn )

Set sim card APN.

This function sets APN for sim card.

Parameters
[in]ctx: Click context object. See gsm5_t object definition for detailed explanation.
[in]sim_apnSIM card APN.
Returns
Nothing.
Note
None.