gsm5 2.1.0.0
|
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. | |
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.
void gsm5_cfg_setup | ( | gsm5_cfg_t * | cfg | ) |
GSM 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See gsm5_cfg_t object definition for detailed explanation. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. uint8_t gsm5_get_cts_pin | ( | gsm5_t * | ctx | ) |
CTS Pin Get function.
This function allows user to check state of the CTS pin.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
0
logical low. 1
logical high. uint8_t gsm5_get_ring_pin | ( | gsm5_t * | ctx | ) |
RING Pin Get function.
This function allows user to check state of the RING pin.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
0
logical low. 1
logical high. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void gsm5_module_power_on | ( | gsm5_t * | ctx | ) |
Power ON the module function.
This function powers ON the module.
ctx | Click object. |
void gsm5_send_cmd | ( | gsm5_t * | ctx, |
char * | cmd ) |
Send command function.
This function sends a specified command to the click module.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | cmd | Command variable. |
void gsm5_send_cmd_check | ( | gsm5_t * | ctx, |
char * | at_cmd_buf ) |
Check the sent command.
This function checks the command that is sent.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
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.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
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.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
[in] | param_buf | Parameter buffer. |
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.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | service_center_number | SMSC of the SIM card. |
[in] | phone_number | Phone number to message. |
[in] | sms_text | Message to be sent. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | phone_number | Phone number to message. |
[in] | sms_text | Message to be sent. |
void gsm5_set_off_pin | ( | gsm5_t * | ctx, |
uint8_t | state ) |
Sets state of the OFF pin.
This function sets the OFF pin state.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | state | Pin state ( 1 or 0 ). |
void gsm5_set_on_pin | ( | gsm5_t * | ctx, |
uint8_t | state ) |
Sets state of the ON pin.
This function sets the ON pin state.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | state | Pin state ( 1 or 0 ). |
void gsm5_set_rts_pin | ( | gsm5_t * | ctx, |
uint8_t | state ) |
Sets state of the RTS pin.
This function sets the RTS pin state.
[in] | ctx | : Click context object. See gsm5_t object definition for detailed explanation. |
[in] | state | Pin state ( 1 or 0 ). |