\mainpage Main Page
4G LTE click is an LTE Cat 1 / 2G multimode cellular network solution, featuring the compact LARA-R2 series modem from u-blox.
- Author : MikroE Team
- Date : Apr 2020.
- Type : UART GPS/GNSS type
We provide a library for the 4gLte 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.
This library contains API for 4gLte Click driver.
- Config Object Initialization function.
void c4glte_cfg_setup ( c4glte_cfg_t *cfg );
- Initialization function.
C4GLTE_RETVAL c4glte_init ( c4glte_t *ctx, c4glte_cfg_t *cfg );
- Power module.
void c4glte_module_power ( c4glte_t *ctx, uint8_t power_state );
- Send command.
void c4glte_send_command ( c4glte_t *ctx, char *command );
This example reads and processes data from 4G LTE clicks.
The demo application is composed of two sections :
Initializes driver and power module.
void application_init ( void )
{
log_cfg_t log_cfg;
c4glte_cfg_t cfg;
// Logger initialization.
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 115200;
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
c4glte_cfg_setup( &cfg );
C4GLTE_MAP_MIKROBUS( cfg, MIKROBUS_1 );
c4glte_init( &c4glte, &cfg );
c4glte_module_power( &c4glte, C4GLTE_MODULE_POWER_ON );
// MODULE INIT
c4glte_send_command( &c4glte, C4GLTE_AT );
c4glte_process( );
c4glte_send_command( &c4glte, C4GLTE_ATE1 );
c4glte_process( );
c4glte_send_command( &c4glte, C4GLTE_AT_IFC );
c4glte_process( );
c4glte_send_command( &c4glte, C4GLTE_AT_CMGF );
c4glte_process( );
}
Reads the received data.
void application_task ( void )
{
c4glte_process( );
if ( send_data_cnt == 5 )
{
c4glte_send_command ( &c4glte, C4GLTE_ATH );
c4glte_process( );
send_data_cnt = 0;
}
else
{
send_data_cnt++;
}
}
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.4gLte
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.