TOP Contributors

  1. MIKROE (2664 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137126 times)
  2. FAT32 Library (70240 times)
  3. Network Ethernet Library (56131 times)
  4. USB Device Library (46447 times)
  5. Network WiFi Library (42101 times)
  6. FT800 Library (41410 times)
  7. GSM click (29125 times)
  8. mikroSDK (26567 times)
  9. PID Library (26510 times)
  10. microSD click (25497 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

LR 5 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: LoRa

Downloaded: 141 times

Not followed.

License: MIT license  

LR 5 Click is a compact add-on board that contains a long-range transceiver. This board features the 32001409, RF technology-based SRD transceiver, which operates at a frequency of 915MHz from Mipot.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "LR 5 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "LR 5 click" changes.

Do you want to report abuse regarding "LR 5 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


LR 5 click

LR 5 Click is a compact add-on board that contains a long-range transceiver. This board features the 32001409, RF technology-based SRD transceiver, which operates at a frequency of 915MHz from Mipot.

lr5_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : jun 2020.
  • Type : UART GSM/IOT type

Software Support

We provide a library for the LR5 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 LR5 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void lr5_cfg_setup ( lr5_cfg_t *cfg );

  • Initialization function.

    LR5_RETVAL lr5_init ( lr5_t ctx, lr5_cfg_t cfg );

Example key functions :

  • This command allows user to get the 32bit firmware version.

    void lr5_get_fw_version_cmd ( lr5_t *ctx );

  • This command allows user to get the 32bit Mipot serial number.

    void lr5_get_serial_no_cmd ( lr5_t *ctx );

  • This command allows user to get the module current status.

    void lr5_get_session_status_cmd ( lr5_t *ctx );

Examples Description

This example reads and processes data from LR 5 clicks.

The demo application is composed of two sections :

Application Init

Initializes UART interface and UART interrupt, and performs a module reset commands.


void application_init ( void )
{
    log_cfg_t log_cfg;
    lr5_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    lr5_cfg_setup( &cfg );
    LR5_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    lr5_init( &lr5, &cfg );

    lr5_response_handler_set( &lr5, &make_response );
    Delay_ms ( 1000 );

    lr5_reset_cmd( &lr5 );
    wait_response( );
    Delay_ms ( 1000 );
    lr5_factory_reset_cmd( &lr5 );
    wait_response( );

    log_printf( &logger, "** LR 5 (MIPOT 32001409) reset is done **\r\n" );
    log_printf( &logger, "\r\n" );
    Delay_ms ( 1000 );
}

Application Task

Performs a group of commands to get FW version, the serial number provided by Mipot, DevEUI, the session status, the activation status and the parameters for the selected channel. Also sets the next transmission data rate to the desired value. The responses from the Mipot module to the host will be sent to the uart terminal.


void application_task ( void )
{
    lr5_process(  );

    log_printf( &logger, "** FW version reading...\r\n" );
    lr5_get_fw_version_cmd( &lr5 );
    wait_response( );

    log_printf( &logger, "** Serial number reading...\r\n" );
    lr5_get_serial_no_cmd( &lr5 );
    wait_response( );

    log_printf( &logger, "** DevEUI reading...\r\n" );
    lr5_get_dev_eui_cmd( &lr5 );
    wait_response( );

    log_printf( &logger, "** Session status reading...\r\n" );
    lr5_get_session_status_cmd( &lr5 );
    wait_response( );
    switch ( response.cmd_data[ 0 ] )
    {
        case 0x00 :
        {
            log_printf( &logger, "Idle.\r\n" );
        break;
        }
        case 0x01 :
        {
            log_printf( &logger, "Busy (LR session running).\r\n" );
        break;
        }
        case 0x02 :
        {
            log_printf( &logger, "Device not activated.\r\n" );
        break;
        }
        case 0x03 :
        {
            log_printf( &logger, "Delayed.\r\n" );
        break;
        }
        default :
        {
        break;
        }
    }
    log_printf( &logger, "***********************************************\r\n" );
    Delay_ms ( 1000 );

    log_printf( &logger, "** Activation status reading...\r\n" );
    lr5_get_activation_status_cmd( &lr5 );
    wait_response( );
    switch ( response.cmd_data[ 0 ] )
    {
        case 0x00 :
        {
            log_printf( &logger, "Not activated.\r\n" );
        break;
        }
        case 0x01 :
        {
            log_printf( &logger, "Joining...\r\n" );
        break;
        }
        case 0x02 :
        {
            log_printf( &logger, "Joined.\r\n" );
        break;
        }
        case 0x03 :
        {
            log_printf( &logger, "MAC ERROR.\r\n" );
        break;
        }
        default :
        {
        break;
        }
    }
    log_printf( &logger, "***********************************************\r\n" );
    Delay_ms ( 1000 );

    log_printf( &logger, "** Next TX Data Rate setting...\r\n" );
    lr5_set_next_dr_cmd( &lr5, LR5_SF10_125KHZ );
    wait_response( );
    if ( response.cmd_data[ 0 ] == 0x00 )
    {
        log_printf( &logger, "Success!\r\n" );
    }
    else
    {
        log_printf( &logger, "Error!\r\n" );
    }
    log_printf( &logger, "***********************************************\r\n" );
    Delay_ms ( 1000 );

    log_printf( &logger, "** Channel parameters reading...\r\n" );
    lr5_get_ch_param_cmd( &lr5, LR5_CH_IDX_15 );
    wait_response( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
} 

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.LR5

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.


ALSO FROM THIS AUTHOR

EEPROM 6 click

0

EEPROM 6 Click is a compact add-on board that contains a serial EEPROM memory that operates from the 1-Wire interface. This board features the DS28EC20, a 20480-bit EEPROM organized as 80 memory pages of 256 bits each from Analog Devices. As a specific feature, blocks of eight memory pages can be write-protected or put in “EPROM-Emulation” Mode, where bits can only be changed from a 1 to a 0 state. It communicates with MCU at 15.4kbps or 90kbps over the 1-Wire protocol and has a 64-bit registration number that ensures error-free device selection.

[Learn More]

AnyNet 2G click

0

AnyNet 2G Click is a cellular to AWS gateway device, which provides developers with the complete solution for various IoT applications, by using the AWS IoT and Cloud Storage services for the data storage, analyzing and processing.

[Learn More]

Boost click

2

Boost click carries Microchip’s MIC2606, a 2MHz, PWM DC/DC boost switching regulator available in a 2mm x 2mm MLF package. The input voltage can be set to 5V from mikroBUS or in range 7-20V from an external DC source connected to VIN screw terminal. The output voltage can be set up to 38V.

[Learn More]