lriot 2.1.0.0
lr1110_modem_system.h File Reference

System driver for LR1110 modem. More...

#include <stdbool.h>
#include <stdint.h>
#include "modem/lr1110_modem_system_types.h"
#include "modem/lr1110_modem_common.h"
#include "lriot.h"

Go to the source code of this file.

Functions

err_t lr1110_modem_system_write_regmem32 (lriot_t *ctx, uint32_t address, uint32_t *buffer, uint8_t length)
 Write words into register memory space of LR1110.
 
err_t lr1110_modem_system_read_regmem32 (lriot_t *ctx, uint32_t address, uint32_t *buffer, uint8_t length)
 Read words into register memory space of LR1110.
 
err_t lr1110_modem_system_calibrate (lriot_t *ctx, uint8_t calib_param)
 lr1110_modem_system_calibrate the requested blocks
 
err_t lr1110_modem_system_set_reg_mode (lriot_t *ctx, lr1110_modem_system_reg_mode_t reg_mode)
 Configure the regulator mode to be used in specific modes.
 
err_t lr1110_modem_system_set_dio_as_rf_switch (lriot_t *ctx, lr1110_modem_system_rf_switch_cfg_t *rf_switch_cfg)
 Set the RF switch configurations for each RF setup.
 
err_t lr1110_modem_system_cfg_lfclk (lriot_t *ctx, lr1110_modem_system_lfclk_cfg_t lfclock_cfg, bool wait_for_32k_ready)
 Defines which clock is used as Low Frequency (LF) clock.
 
err_t lr1110_modem_system_set_tcxo_mode (lriot_t *ctx, lr1110_modem_system_tcxo_supply_voltage_t tune, uint32_t timeout)
 Enable and configure TCXO supply voltage and detection timeout.
 
err_t lr1110_modem_system_reboot (lriot_t *ctx, bool stay_in_bootloader)
 Software reset of the chip.
 

Detailed Description

System driver for LR1110 modem.

Revised BSD License Copyright Semtech Corporation 2020. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Semtech corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ lr1110_modem_system_calibrate()

err_t lr1110_modem_system_calibrate ( lriot_t * ctx,
uint8_t calib_param )

lr1110_modem_system_calibrate the requested blocks

This function can be called in any mode of the chip.

Parameters
[in]ctxChip implementation context
[in]calib_paramStructure holding the reference to blocks to be calibrated
Returns
Operation status

◆ lr1110_modem_system_cfg_lfclk()

err_t lr1110_modem_system_cfg_lfclk ( lriot_t * ctx,
lr1110_modem_system_lfclk_cfg_t lfclock_cfg,
bool wait_for_32k_ready )

Defines which clock is used as Low Frequency (LF) clock.

Parameters
[in]ctxChip implementation context
[in]lfclock_cfgLow frequency clock configuration
[in]wait_for_32k_ready
Returns
Operation status

◆ lr1110_modem_system_read_regmem32()

err_t lr1110_modem_system_read_regmem32 ( lriot_t * ctx,
uint32_t address,
uint32_t * buffer,
uint8_t length )

Read words into register memory space of LR1110.

The words are 32 bits long. The reading operations read contiguously from register memory, starting at the address provided.

Parameters
[in]ctxChip implementation context
[in]addressThe register memory address to start reading operation
[in]lengthNumber of words to read from memory
[out]bufferPointer to a words array to be filled with content from memory. Its size must be enough to contain at least length words. A word is 32 bits long
Returns
Operation status
See also
lr1110_modem_system_write_regmem32

◆ lr1110_modem_system_reboot()

err_t lr1110_modem_system_reboot ( lriot_t * ctx,
bool stay_in_bootloader )

Software reset of the chip.

This function should be used to reboot the chip in a specified mode. Rebooting in flash mode presumes that the content in flash memory is not corrupted (i.e. the integrity check performed by the bootloader before executing the first instruction in flash is OK).

Parameters
[in]ctxcontext abstraction
[in]stay_in_bootloaderSelector to stay in bootloader or execute flash code after reboot. If true, the bootloader will not execute the flash code but activate SPI interface to allow firmware upgrade
Returns
Operation status

◆ lr1110_modem_system_set_dio_as_rf_switch()

err_t lr1110_modem_system_set_dio_as_rf_switch ( lriot_t * ctx,
lr1110_modem_system_rf_switch_cfg_t * rf_switch_cfg )

Set the RF switch configurations for each RF setup.

This function shall only be called in standby RC mode.

By default, no DIO is used to control a RF switch. All DIOs are set in High-Z mode.

Parameters
[in]ctxChip implementation context
[in]rf_switch_cfgPointer to a structure that holds the switches configuration
Returns
Operation status

◆ lr1110_modem_system_set_reg_mode()

err_t lr1110_modem_system_set_reg_mode ( lriot_t * ctx,
lr1110_modem_system_reg_mode_t reg_mode )

Configure the regulator mode to be used in specific modes.

This function shall only be called in standby RC mode.

The reg_mode parameter defines if the DC-DC converter is switched on in the following modes: STANDBY XOSC, FS, RX, TX and RX_CAPTURE.

Parameters
[in]ctxChip implementation context
[in]reg_modeRegulator mode configuration
Returns
Operation status

◆ lr1110_modem_system_set_tcxo_mode()

err_t lr1110_modem_system_set_tcxo_mode ( lriot_t * ctx,
lr1110_modem_system_tcxo_supply_voltage_t tune,
uint32_t timeout )

Enable and configure TCXO supply voltage and detection timeout.

This function shall only be called in standby RC mode.

The timeout parameter is the maximum time the firmware waits for the TCXO to be ready. The timeout duration is given by: $ timeout\_duration\_us = timeout \times 30.52 $

The TCXO mode can be disabled by setting timeout parameter to 0.

Parameters
[in]ctxChip implementation context
[in]tuneSupply voltage value
[in]timeout
Returns
Operation status

◆ lr1110_modem_system_write_regmem32()

err_t lr1110_modem_system_write_regmem32 ( lriot_t * ctx,
uint32_t address,
uint32_t * buffer,
uint8_t length )

Write words into register memory space of LR1110.

The words are 32 bits long. The writing operations write contiguously in register memory, starting at the address provided.

Parameters
[in]ctxChip implementation context
[in]addressThe register memory address to start writing operation
[in]bufferThe buffer of words to write into memory. Its size must be enough to contain length words. A word is 32 bits long
[in]lengthNumber of words to write into memory
Returns
Operation status
See also
lr1110_modem_system_read_regmem32