TOP Contributors

  1. MIKROE (2781 codes)
  2. Alcides Ramos (377 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139589 times)
  2. FAT32 Library (72044 times)
  3. Network Ethernet Library (57269 times)
  4. USB Device Library (47633 times)
  5. Network WiFi Library (43231 times)
  6. FT800 Library (42569 times)
  7. GSM click (29933 times)
  8. mikroSDK (28313 times)
  9. PID Library (26934 times)
  10. microSD click (26309 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 6 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: LoRa

Downloaded: 24 times

Not followed.

License: MIT license  

LR 6 Click is a compact add-on board designed for ultra-long-distance spread-spectrum communication. This board features the Ra-01S, a LoRa™ wireless radio frequency module from Ai-Thinker Technology, featuring the SX1268 radio chip. This module provides exceptional sensitivity of over -148dBm, a power output of +22dBm, and supports multiple modulation methods, including LoRa™, within the 433MHz frequency band. The board offers robust anti-interference capabilities and low power consumption, making it ideal for applications requiring reliable long-range communication.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "LR 6 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "LR 6 Click" changes.

Do you want to report abuse regarding "LR 6 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


LR 6 Click

LR 6 Click is a compact add-on board designed for ultra-long-distance spread-spectrum communication. This board features the Ra-01S, a LoRa™ wireless radio frequency module from Ai-Thinker Technology, featuring the SX1268 radio chip. This module provides exceptional sensitivity of over -148dBm, a power output of +22dBm, and supports multiple modulation methods, including LoRa™, within the 433MHz frequency band. The board offers robust anti-interference capabilities and low power consumption, making it ideal for applications requiring reliable long-range communication.

lr6_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Mar 2024.
  • Type : SPI type

Software Support

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

Standard key functions :

  • lr6_cfg_setup Config Object Initialization function.

    void lr6_cfg_setup ( lr6_cfg_t *cfg );
  • lr6_init Initialization function.

    err_t lr6_init ( lr6_t *ctx, lr6_cfg_t *cfg );
  • lr6_default_cfg Click Default Configuration function.

    err_t lr6_default_cfg ( lr6_t *ctx );

Example key functions :

  • lr6_send_data This function sends a desired number of data bytes to the buffer by using the selected mode using the SPI serial interface.

    err_t lr6_send_data ( lr6_t *ctx, uint8_t *send_data, uint8_t len, uint8_t mode );
  • lr6_receive_data This function receives a desired number of data bytes to the buffer by using the SPI serial interface.

    err_t lr6_receive_data ( lr6_t *ctx, uint8_t *receive_data, uint16_t buff_len, uint8_t *rx_len );
  • lr6_set_lr_config This function performs the desired LoRa configuration by using the SPI serial interface.

    err_t lr6_set_lr_config ( lr6_t *ctx, lr6_lora_cfg_t lora_cfg );

Example Description

This example demonstrates the use of LR 6 Click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

Initialization of SPI module and log UART. After driver initialization, the app executes a default configuration.

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    lr6_cfg_t lr6_cfg;  /**< Click config object. */

    /** 
     * 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.
    lr6_cfg_setup( &lr6_cfg );
    LR6_MAP_MIKROBUS( lr6_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == lr6_init( &lr6, &lr6_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( LR6_ERROR == lr6_default_cfg ( &lr6 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
    log_printf( &logger, " --------------------\r\n" );
}

Application Task

The demo application is an echo example that sends a demo LoRa packet string and receives and processes all incoming data. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
    uint8_t rx_data[ 255 ] = { 0 };
    if ( LR6_OK == lr6_send_data( &lr6, LR6_DEMO_TEXT, strlen( LR6_DEMO_TEXT ), LR6_TX_MODE_SYNC ) ) 
    {
        log_info( &logger, " Send - success" );
        uint8_t rx_len = 0;
        do 
        {
            if ( LR6_OK == lr6_receive_data( &lr6, rx_data, strlen( LR6_DEMO_TEXT ), &rx_len ) )
            {
                if ( rx_len > 0 )
                { 
                    log_info( &logger, " Receive - success" );
                    log_printf( &logger, " > Receive: " );
                    for ( uint8_t cnt = 0; cnt < strlen( LR6_DEMO_TEXT ); cnt++ )
                    {
                        log_printf( &logger, "%c", rx_data[ cnt ] );
                    }

                    int8_t rssi, snr;
                    if ( LR6_OK == lr6_get_packet_status( &lr6, &rssi, &snr ) )
                    {
                        log_printf( &logger, " Rssi Pkt: %d dBm\r\n", ( int16_t ) rssi );
                        log_printf( &logger, " Snr Pkt : %d dB\r\n", ( int16_t ) snr );
                        log_printf( &logger, " --------------------\r\n" );
                        break;
                    }
                }
            }
        } 
        while ( rx_len == 0 );
    }
    else
    {
        log_info( &logger, "Send - fail" );
    }
    Delay_ms ( 1000 );
}

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

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.


ALSO FROM THIS AUTHOR

Temp-Log 2 Click

0

Temp-Log 2 Click is a precise ambient temperature measurement device, equipped with the additional non-volatile (EEPROM) memory that can be used to permanently store system configuration, and 64 bits of general-purpose EEPROM, used for logging application specific or user preference data. This Click covers a range of temperatures from -55°C to +125°C with the highest accuracy of ±0.2°C.

[Learn More]

Motion 4 Click

0

Motion 4 Click is a long distance PaPIR's motion sensor with plastic lense and controllable output. This Click board features EKMC1603111, a PIR motion sensor from Panasonic Corporation which can be used as human motion detector and is able to detect movement up to 12m with 170uA current consumption. Also featured on Motion 4 Click bord is TLP241A photorelay from Toshiba that is used to provide a reinforced galvanic isolation for the external signals used to drive some external high power electronic equipment when motion is detected. It's allowing up to 40V between the SSR contacts in OFF state, and currents up to 2A while in ON state, thanks to a very low ON-state resistance. Motion 4 Click board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.

[Learn More]

Charger 19 Click

0

Charger 19 Click is a compact add-on board that contains a battery charger. This board features the nPM1100, an integrated power management IC from Nordic Semiconductor. It has a highly efficient DC/DC buck regulator with automatic selection between hysteretic and PWM modes.

[Learn More]