lr10 2.1.0.0
Main Page

LR 10 click

‍LR 10 Click is a compact add-on board designed for the Internet of Things (IoT) applications requiring low power consumption and long-range connectivity. This board features the Wio-E5, a LoRa wireless module from Seeed Technology. The Wio-E5 integrates the STM32WLE5JC system-level chip and the SX126X LoRa® chip alongside an Arm® Cortex® M4 MCU, ensuring ultra-low power usage and high performance. It supports multi-mode operations, including (G)FSK and LoRa®, and can operate across a frequency range of 868 to 928MHz with robust signal strength and sensitivity. These characteristics make the LR 10 Click ideal for various IoT scenarios, such as wireless sensor networks, remote meter readings, and other applications with crucial low-power, wide-area network connectivity.

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Nov 2023.
  • Type : UART type

Software Support

We provide a library for the LR 10 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for LR 10 Click driver.

Standard key functions :

  • lr10_cfg_setup Config Object Initialization function.
    void lr10_cfg_setup ( lr10_cfg_t *cfg );
    void lr10_cfg_setup(lr10_cfg_t *cfg)
    LR 10 configuration object setup function.
    LR 10 Click configuration object.
    Definition lr10.h:242
  • lr10_init Initialization function.
    err_t lr10_init ( lr10_t *ctx, lr10_cfg_t *cfg );
    err_t lr10_init(lr10_t *ctx, lr10_cfg_t *cfg)
    LR 10 initialization function.
    LR 10 Click context object.
    Definition lr10.h:224

Example key functions :

  • lr10_write_cmd This function writes a desired command by using UART serial interface.
    err_t lr10_write_cmd ( lr10_t *ctx, uint8_t *command );
    err_t lr10_write_cmd(lr10_t *ctx, uint8_t *command)
    LR 10 command writing function.
  • lr10_write_cmd_sub_param This function writes a desired command, subcommands and parameter by using UART serial interface.
    err_t lr10_write_cmd_sub_param ( lr10_t *ctx, uint8_t *command, uint8_t *sub_param,
    uint8_t *param, lr10_en_quote_t en_quote );
    err_t lr10_write_cmd_sub_param(lr10_t *ctx, uint8_t *command, uint8_t *sub_param, uint8_t *param, lr10_en_quote_t en_quote)
    LR 10 command - subcommands - parameter writing function.
    lr10_en_quote_t
    LR 10 Click enable quote value data.
    Definition lr10.h:275

Example Description

‍This example demonstrates the use of LR 10 click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and performs a hardware reset of the device and a group of commands for getting the FW version, the serial number, and the DevEUI. After that, the demo app sets the RF configuration: frequency, SF, bandwidth, TX preamble, RX preamble, and TX power settings.

void application_init ( void )
{
log_cfg_t log_cfg;
lr10_cfg_t lr10_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
lr10_cfg_setup( &lr10_cfg );
LR10_MAP_MIKROBUS( lr10_cfg, MIKROBUS_1 );
if ( UART_ERROR == lr10_init( &lr10, &lr10_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
lr10_hw_reset( &lr10 );
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
#ifdef DEMO_APP_TRANSMITTER
"868,SF7,125,8,8,14,ON,OFF,OFF", LR10_QUOTE_DISABLE );
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
Delay_ms ( 500 );
#endif
}
#define LR10_CMD_AT
LR 10 control commands.
Definition lr10.h:73
#define LR10_SUB_CMD_TEST_RFCFG
Definition lr10.h:163
#define LR10_CMD_MODE
Definition lr10.h:93
#define LR10_CMD_VER
Definition lr10.h:77
#define LR10_SUB_CMD_MODE_TEST
Definition lr10.h:120
#define LR10_CMD_TEST
Definition lr10.h:100
#define LR10_SYMBOL_NULL
Definition lr10.h:181
#define LR10_CMD_ID
Definition lr10.h:94
#define LR10_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition lr10.h:211
err_t lr10_inquire_cmd(lr10_t *ctx, uint8_t *command)
LR 10 inquire command function.
err_t lr10_generic_write(lr10_t *ctx, uint8_t *data_in, uint16_t len)
LR 10 data writing function.
void lr10_hw_reset(lr10_t *ctx)
LR 10 HW reset function.
@ LR10_OK
Definition lr10.h:265
@ LR10_QUOTE_DISABLE
Definition lr10.h:276
void application_init(void)
Definition main.c:85

Application Task

‍Depending on the selected mode, the application demo receives and processes all incoming data or sends the LoRa packet demo string. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_app_buf( );
lr10_clear_app_buf( );
}
#else
if ( LR10_OK == lr10_process( &lr10 ) )
{
lr10_log_receiver( );
lr10_clear_app_buf( );
}
#endif
Delay_ms ( 1000 );
}
#define LR10_SUB_CMD_TEST_RX
Definition lr10.h:164
#define LR10_SUB_CMD_TEST_TX_STR
Definition lr10.h:166
err_t lr10_write_cmd_param(lr10_t *ctx, uint8_t *command, uint8_t *param)
LR 10 command - parameter writing function.
@ LR10_QUOTE_ENABLE
Definition lr10.h:277
void application_task(void)
Definition main.c:177
#define LR10_DEMO_STRING
Definition main.c:44

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.LR10

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. UART terminal is available in all MikroElektronika compilers.