gsm2  2.0.0.0
Main Page

GSM 2 click

GSM2 click is a compact quad-band GSM cellular network communication solution, featuring the GSM/GPRS Quectel M95.

click Product page


Click library

  • Author : MikroE Team
  • Date : Apr 2020.
  • Type : UART GPS/GNSS type

Software Support

We provide a library for the Gsm2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Gsm2 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void gsm2_cfg_setup ( gsm2_cfg_t *cfg );

  • Initialization function.

    GSM2_RETVAL gsm2_init ( gsm2_t *ctx, gsm2_cfg_t *cfg );

Example key functions :

Examples Description

This example reads and processes data from GSM 2 clicks.

The demo application is composed of two sections :

Application Init

Initializes driver and wake-up module.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 57600;
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
gsm2_cfg_setup( &cfg );
GSM2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
gsm2_init( &gsm2, &cfg );
gsm2_process( );
gsm2_process( );
gsm2_process( );
gsm2_process( );
gsm2_process( );
gsm2_send_command( &gsm2, "AT+IFC=2,2" );
gsm2_process( );
gsm2_send_command( &gsm2, "AT+CMGF=1" );
gsm2_process( );
Delay_ms( 2000 );
}

Application Task

Reads the received data and parses it.

void application_task ( void )
{
gsm2_process( );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Gsm2

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


gsm2_send_command
void gsm2_send_command(gsm2_t *ctx, char *command)
Command function.
GSM2_MAP_MIKROBUS
#define GSM2_MAP_MIKROBUS(cfg, mikrobus)
Definition: gsm2.h:53
gsm2_cfg_setup
void gsm2_cfg_setup(gsm2_cfg_t *cfg)
Config Object Initialization function.
GSM2_SINGLE_CMD_AT
#define GSM2_SINGLE_CMD_AT
Definition: gsm2.h:107
application_task
void application_task(void)
Definition: main.c:142
GSM2_SINGLE_CMD_ATE0
#define GSM2_SINGLE_CMD_ATE0
Definition: gsm2.h:110
gsm2_module_power
void gsm2_module_power(gsm2_t *ctx)
Enables or disables module power.
gsm2_cfg_t
Click configuration structure definition.
Definition: gsm2.h:194
application_init
void application_init(void)
Definition: main.c:98
gsm2_init
GSM2_RETVAL gsm2_init(gsm2_t *ctx, gsm2_cfg_t *cfg)
Initialization function.