lriot 2.1.0.0
LR IoT Click Driver

API for configuring and manipulating LR IoT Click driver. More...

Topics

 LR IoT Registers Settings
 Settings for registers of LR IoT Click driver.
 
 LR IoT MikroBUS Map
 MikroBUS pin mapping of LR IoT Click driver.
 

Functions

void lriot_cfg_setup (lriot_cfg_t *cfg)
 LR IoT configuration object setup function.
 
err_t lriot_init (lriot_t *ctx, lriot_cfg_t *cfg)
 LR IoT initialization function.
 
err_t lriot_default_cfg (lriot_t *ctx)
 LR IoT default configuration function.
 
void lriot_set_rst_pin (lriot_t *ctx, uint8_t state)
 LR IoT set rst pin function.
 
uint8_t lriot_get_busy_pin (lriot_t *ctx)
 LR IoT get busy pin function.
 
uint8_t lriot_get_int_pin (lriot_t *ctx)
 LR IoT get int pin function.
 
err_t lriot_get_chip_info (lriot_t *ctx, lriot_chip_info_t *info)
 LR IoT get chip info function.
 
err_t lriot_get_temperature (lriot_t *ctx, float *temperature)
 LR IoT get temperature function.
 
err_t lriot_send_lora_message (lriot_t *ctx, uint8_t *message)
 LR IoT send lora message function.
 
err_t lriot_read_lora_message (lriot_t *ctx, lriot_lora_packet_status_t *pkt_status, uint8_t *message)
 LR IoT read lora message function.
 
err_t lriot_get_wifi_scan_results (lriot_t *ctx, lriot_wifi_scan_results_t *results)
 LR IoT get wifi scan results function.
 
err_t lriot_get_gnss_scan_results (lriot_t *ctx, lriot_gnss_scan_results_t *results)
 LR IoT get gnss scan results function.
 
err_t lriot_update_firmware (lriot_t *ctx)
 LR IoT update firmware function.
 

Detailed Description

API for configuring and manipulating LR IoT Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ lriot_cfg_setup()

void lriot_cfg_setup ( lriot_cfg_t * cfg)

LR IoT configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See lriot_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ lriot_default_cfg()

err_t lriot_default_cfg ( lriot_t * ctx)

LR IoT default configuration function.

This function executes a default configuration of LR IoT click board.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ lriot_get_busy_pin()

uint8_t lriot_get_busy_pin ( lriot_t * ctx)

LR IoT get busy pin function.

This function returns the BUSY pin logic state.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ lriot_get_chip_info()

err_t lriot_get_chip_info ( lriot_t * ctx,
lriot_chip_info_t * info )

LR IoT get chip info function.

This function reads the chip firmware information.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[out]info: Chip information object. See lriot_chip_info_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lriot_get_gnss_scan_results()

err_t lriot_get_gnss_scan_results ( lriot_t * ctx,
lriot_gnss_scan_results_t * results )

LR IoT get gnss scan results function.

This function performs a GNSS scanning and reads the results.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[out]results: GNSS scan results object. See lriot_gnss_scan_results_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lriot_get_int_pin()

uint8_t lriot_get_int_pin ( lriot_t * ctx)

LR IoT get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ lriot_get_temperature()

err_t lriot_get_temperature ( lriot_t * ctx,
float * temperature )

LR IoT get temperature function.

This function reads the chip internal temperature in degrees Celsius.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[out]temperature: Chip internal temperature in degrees Celsius.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function is supported in transceiver firmware only.

◆ lriot_get_wifi_scan_results()

err_t lriot_get_wifi_scan_results ( lriot_t * ctx,
lriot_wifi_scan_results_t * results )

LR IoT get wifi scan results function.

This function performs a WiFi scanning and reads the results.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[out]results: WiFi scan results object. See lriot_wifi_scan_results_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lriot_init()

err_t lriot_init ( lriot_t * ctx,
lriot_cfg_t * cfg )

LR IoT initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See lriot_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See lriot_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lriot_read_lora_message()

err_t lriot_read_lora_message ( lriot_t * ctx,
lriot_lora_packet_status_t * pkt_status,
uint8_t * message )

LR IoT read lora message function.

This function waits for a LoRa packet to arrive and reads its payload message and packet status.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[out]pkt_status: A received LoRa packet status. See lriot_lora_packet_status_t object definition for detailed explanation.
[out]message: A received LoRa message buffer. Limited to LRIOT_LORA_PKT_PAYLOAD_LEN size in bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function is supported in transceiver firmware only.

◆ lriot_send_lora_message()

err_t lriot_send_lora_message ( lriot_t * ctx,
uint8_t * message )

LR IoT send lora message function.

This function sends a LoRa message to the receiver.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[in]message: A message buffer to send. Should be of LRIOT_LORA_PKT_PAYLOAD_LEN size in bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function is supported in transceiver firmware only.

◆ lriot_set_rst_pin()

void lriot_set_rst_pin ( lriot_t * ctx,
uint8_t state )

LR IoT set rst pin function.

This function sets the RST pin logic state.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ lriot_update_firmware()

err_t lriot_update_firmware ( lriot_t * ctx)

LR IoT update firmware function.

This function performs a firmware update depending on the LRIOT_UPDATE_FIRMWARE and LRIOT_FIRMWARE_SELECTOR macro definitions.

Parameters
[in]ctx: Click context object. See lriot_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.