lriot 2.1.0.0
lr1110_radio.h File Reference

Radio driver definition for LR1110. More...

Go to the source code of this file.

Macros

#define LR1110_RADIO_GFSK_SYNC_WORD_LENGTH   8
 Length in byte of the GFSK sync word.
 
#define LR11110_RADIO_GFSK_SYNC_WORD_DEFAULT
 Default GFSK sync word value.
 

Functions

err_t lr1110_radio_reset_stats (lriot_t *ctx)
 Reset internal statistics of the received packets.
 
err_t lr1110_radio_get_gfsk_stats (lriot_t *ctx, lr1110_radio_stats_gfsk_t *stats)
 Get the internal statistics of the GFSK received packets.
 
err_t lr1110_radio_get_lora_stats (lriot_t *ctx, lr1110_radio_stats_lora_t *stats)
 Get the internal statistics of the LoRa received packets.
 
err_t lr1110_radio_get_pkt_type (lriot_t *ctx, uint8_t *pkt_type)
 Get the packet type currently configured.
 
err_t lr1110_radio_get_rx_buffer_status (lriot_t *ctx, lr1110_radio_rx_buffer_status_t *rx_buffer_status)
 Get the length of last received packet, and the offset in the RX internal buffer of the first byte of the received payload.
 
err_t lr1110_radio_get_gfsk_pkt_status (lriot_t *ctx, lr1110_radio_pkt_status_gfsk_t *pkt_status)
 Get the status of last GFSK received packet.
 
err_t lr1110_radio_get_lora_pkt_status (lriot_t *ctx, lr1110_radio_pkt_status_lora_t *pkt_status)
 Get the status of last LoRa received packet.
 
err_t lr1110_radio_get_rssi_inst (lriot_t *ctx, int8_t *rssi_in_dbm)
 Get the instantaneous RSSI.
 
err_t lr1110_radio_set_gfsk_sync_word (lriot_t *ctx, uint8_t gfsk_sync_word[LR1110_RADIO_GFSK_SYNC_WORD_LENGTH])
 Set the GFSK modem sync word.
 
err_t lr1110_radio_set_lora_sync_word (lriot_t *ctx, uint8_t sync_word)
 Set the LoRa modem sync word.
 
err_t lr1110_radio_set_lora_public_network (lriot_t *ctx, lr1110_radio_lora_network_type_t network_type)
 Set the LoRa modem sync word to private / public.
 
err_t lr1110_radio_set_rx (lriot_t *ctx, uint32_t timeout_in_ms)
 Start RX operations.
 
err_t lr1110_radio_set_rx_with_timeout_in_rtc_step (lriot_t *ctx, uint32_t timeout_in_rtc_step)
 Start RX operations.
 
err_t lr1110_radio_set_tx (lriot_t *ctx, uint32_t timeout_in_ms)
 Start TX operations.
 
err_t lr1110_radio_set_tx_with_timeout_in_rtc_step (lriot_t *ctx, uint32_t timeout_in_rtc_step)
 Start TX operations.
 
err_t lr1110_radio_set_rf_freq (lriot_t *ctx, uint32_t freq_in_hz)
 Set the frequency for future radio operations.
 
err_t lr1110_radio_auto_tx_rx (lriot_t *ctx, uint32_t delay, lr1110_radio_intermediary_mode_t intermediary_mode, uint32_t timeout)
 Configure automatic TX after RX or automatic RX after TX.
 
err_t lr1110_radio_set_cad_params (lriot_t *ctx, lr1110_radio_cad_params_t *cad_params)
 Set Channel Activity Detection configuration.
 
err_t lr1110_radio_set_pkt_type (lriot_t *ctx, uint8_t pkt_type)
 Set the packet type.
 
err_t lr1110_radio_set_gfsk_mod_params (lriot_t *ctx, lr1110_radio_mod_params_gfsk_t *mod_params)
 Set the modulation parameters for GFSK packets.
 
err_t lr1110_radio_set_lora_mod_params (lriot_t *ctx, lr1110_radio_mod_params_lora_t *mod_params)
 Set the modulation parameters for LoRa packets.
 
err_t lr1110_radio_set_gfsk_pkt_params (lriot_t *ctx, lr1110_radio_pkt_params_gfsk_t *pkt_params)
 Set the packet parameters for GFSK packets.
 
err_t lr1110_radio_set_lora_pkt_params (lriot_t *ctx, lr1110_radio_pkt_params_lora_t *pkt_params)
 Set the packet parameters for LoRa packets.
 
err_t lr1110_radio_set_tx_params (lriot_t *ctx, int8_t pwr_in_dbm, lr1110_radio_ramp_time_t ramp_time)
 Set the parameters for TX power and power amplifier ramp time.
 
err_t lr1110_radio_set_pkt_address (lriot_t *ctx, uint8_t node_address, uint8_t broadcast_address)
 Sets the Node and Broadcast address used for GFSK.
 
err_t lr1110_radio_set_rx_tx_fallback_mode (lriot_t *ctx, lr1110_radio_fallback_modes_t fallback_mode)
 Alter the chip mode after successfull transmission or reception operation.
 
err_t lr1110_radio_set_rx_duty_cycle (lriot_t *ctx, uint32_t rx_period_in_ms, uint32_t sleep_period_in_ms, lr1110_radio_rx_duty_cycle_mode_t mode)
 Configure and start a Rx Duty Cycle operation.
 
err_t lr1110_radio_set_rx_duty_cycle_with_timings_in_rtc_step (lriot_t *ctx, uint32_t rx_period_in_rtc_step, uint32_t sleep_period_in_rtc_step, lr1110_radio_rx_duty_cycle_mode_t mode)
 Configure and start a Rx Duty Cycle operation.
 
err_t lr1110_radio_set_pa_cfg (lriot_t *ctx, lr1110_radio_pa_cfg_t *pa_cfg)
 Set the Power Amplifier configuration.
 
err_t lr1110_radio_stop_timeout_on_preamble (lriot_t *ctx, bool stop_timeout_on_preamble)
 Define on which event the Rx timeout shall be stopped.
 
err_t lr1110_radio_set_cad (lriot_t *ctx)
 Start the CAD mode.
 
err_t lr1110_radio_set_tx_cw (lriot_t *ctx)
 Set the device into Tx continuous wave (RF tone).
 
err_t lr1110_radio_set_tx_infinite_preamble (lriot_t *ctx)
 Set the device into Tx continuous preamble (modulated signal).
 
err_t lr1110_radio_set_lora_sync_timeout (lriot_t *ctx, uint8_t nb_symbol)
 Configure the LoRa modem to issue a RX timeout after an exact number of symbols given in parameter if no LoRa modulation is detected.
 
err_t lr1110_radio_set_gfsk_crc_params (lriot_t *ctx, uint32_t seed, uint32_t polynomial)
 Configure the seed and the polynomial used to compute CRC in GFSK packet.
 
err_t lr1110_radio_set_gfsk_whitening_seed (lriot_t *ctx, uint16_t seed)
 Configure the whitening seed used in GFSK packet.
 
err_t lr1110_radio_cfg_rx_boosted (lriot_t *ctx, bool enable_boost_mode)
 Configure the boost mode in reception.
 
err_t lr1110_radio_get_gfsk_rx_bandwidth (uint32_t bw_in_hz, lr1110_radio_gfsk_bw_t *bw_parameter)
 Gets the radio bw parameter for a given bandwidth in Hz.
 
uint32_t lr1110_radio_get_lora_time_on_air_numerator (lr1110_radio_pkt_params_lora_t *pkt_p, lr1110_radio_mod_params_lora_t *mod_p)
 Compute the numerator for LoRa time-on-air computation.
 
uint32_t lr1110_radio_get_lora_bw_in_hz (lr1110_radio_lora_bw_t bw)
 Get the actual value in Hertz of a given LoRa bandwidth.
 
uint32_t lr1110_radio_get_lora_time_on_air_in_ms (lr1110_radio_pkt_params_lora_t *pkt_p, lr1110_radio_mod_params_lora_t *mod_p)
 Get the time on air in ms for LoRa transmission.
 
uint32_t lr1110_radio_get_gfsk_time_on_air_numerator (lr1110_radio_pkt_params_gfsk_t *pkt_p)
 Compute the numerator for GFSK time-on-air computation.
 
uint32_t lr1110_radio_get_gfsk_time_on_air_in_ms (lr1110_radio_pkt_params_gfsk_t *pkt_p, lr1110_radio_mod_params_gfsk_t *mod_p)
 Get the time on air in ms for GFSK transmission.
 
uint32_t lr1110_radio_convert_time_in_ms_to_rtc_step (uint32_t time_in_ms)
 Get the number of RTC steps for a given time in millisecond.
 
err_t lr1110_radio_get_lora_rx_info (lriot_t *ctx, bool *is_crc_present, uint8_t *cr)
 Get the information from the last received LoRa packet header (if LR1110_RADIO_LORA_PKT_EXPLICIT) or the locally configured settings (if LR1110_RADIO_LORA_PKT_IMPLICIT)
 

Detailed Description

Radio driver definition for LR1110.

The Clear BSD License Copyright Semtech Corporation 2021. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) 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.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. 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.

Macro Definition Documentation

◆ LR1110_RADIO_GFSK_SYNC_WORD_LENGTH

#define LR1110_RADIO_GFSK_SYNC_WORD_LENGTH   8

Length in byte of the GFSK sync word.

◆ LR11110_RADIO_GFSK_SYNC_WORD_DEFAULT

#define LR11110_RADIO_GFSK_SYNC_WORD_DEFAULT
Value:
{ \
0x97, 0x23, 0x52, 0x25, 0x56, 0x53, 0x65, 0x64 \
}

Default GFSK sync word value.

Function Documentation

◆ lr1110_radio_auto_tx_rx()

err_t lr1110_radio_auto_tx_rx ( lriot_t * ctx,
uint32_t delay,
lr1110_radio_intermediary_mode_t intermediary_mode,
uint32_t timeout )

Configure automatic TX after RX or automatic RX after TX.

After issuing this command, using the command SetTx will make the LR1110 doing the following:

  • Enter TX mode as usual
  • Enter configurable Intermediary mode during configurable delay
  • Enter RX mode

Similarly, after a SetRx command, the LR1110 will do the following:

  • Enter RX mode as usual
  • Enter configurable Intermediary mode during configurable delay
  • Enter TX mode

In case delay is 0, the LR1110 does not enter Intermediary mode and directly enter the following mode.

To disable this behavior, use this function with delay set to 0xFFFFFFFF.

Parameters
[in]ctxChip implementation context
[in]delayTime to spend in Intermediary mode expressed as steps of $\frac{1}{32.768 KHz}$ steps.
[in]intermediary_modeThe mode the LR1110 enters after first mode completion during delay time
[in]timeoutThe timeout duration of the automatic RX or TX, expressed as steps of $ \frac{1}{32.768KHz} $
Returns
Operation status

◆ lr1110_radio_cfg_rx_boosted()

err_t lr1110_radio_cfg_rx_boosted ( lriot_t * ctx,
bool enable_boost_mode )

Configure the boost mode in reception.

Parameters
[in]ctxChip implementation context
[in]enable_boost_modeBoost mode activation
Returns
Operation status

◆ lr1110_radio_convert_time_in_ms_to_rtc_step()

uint32_t lr1110_radio_convert_time_in_ms_to_rtc_step ( uint32_t time_in_ms)

Get the number of RTC steps for a given time in millisecond.

Parameters
[in]time_in_msTimeout in millisecond
Returns
Number of RTC steps

◆ lr1110_radio_get_gfsk_pkt_status()

err_t lr1110_radio_get_gfsk_pkt_status ( lriot_t * ctx,
lr1110_radio_pkt_status_gfsk_t * pkt_status )

Get the status of last GFSK received packet.

The value depends on the received packet type

Parameters
[in]ctxChip implementation context
[out]pkt_statusThe last received packet status
Returns
Operation status

◆ lr1110_radio_get_gfsk_rx_bandwidth()

err_t lr1110_radio_get_gfsk_rx_bandwidth ( uint32_t bw_in_hz,
lr1110_radio_gfsk_bw_t * bw_parameter )

Gets the radio bw parameter for a given bandwidth in Hz.

Parameters
[in]bw_in_hzRequested GFSK Rx bandwidth
[out]bw_parameterRadio parameter immediately above requested bw_in_hz
Returns
Operation status

◆ lr1110_radio_get_gfsk_stats()

err_t lr1110_radio_get_gfsk_stats ( lriot_t * ctx,
lr1110_radio_stats_gfsk_t * stats )

Get the internal statistics of the GFSK received packets.

Internal statistics are reset on Power on Reset, by entering sleep mode without memory retention, or by calling lr1110_radio_reset_stats.

Parameters
[in]ctxChip implementation context
[out]statsThe statistics structure of the received packets
Returns
Operation status
See also
lr1110_radio_reset_stats

◆ lr1110_radio_get_gfsk_time_on_air_in_ms()

uint32_t lr1110_radio_get_gfsk_time_on_air_in_ms ( lr1110_radio_pkt_params_gfsk_t * pkt_p,
lr1110_radio_mod_params_gfsk_t * mod_p )

Get the time on air in ms for GFSK transmission.

Parameters
[in]pkt_pPointer to a structure holding the GFSK packet parameters
[in]mod_pPointer to a structure holding the GFSK modulation parameters
Returns
Time-on-air value in ms for GFSK transmission

◆ lr1110_radio_get_gfsk_time_on_air_numerator()

uint32_t lr1110_radio_get_gfsk_time_on_air_numerator ( lr1110_radio_pkt_params_gfsk_t * pkt_p)

Compute the numerator for GFSK time-on-air computation.

Remarks
To get the actual time-on-air in seconds, this value has to be divided by the GFSK bitrate in bits per second.
Parameters
[in]pkt_pPointer to the structure holding the GFSK packet parameters
Returns
GFSK time-on-air numerator

◆ lr1110_radio_get_lora_bw_in_hz()

uint32_t lr1110_radio_get_lora_bw_in_hz ( lr1110_radio_lora_bw_t bw)

Get the actual value in Hertz of a given LoRa bandwidth.

Parameters
[in]bwLoRa bandwidth parameter
Returns
Actual LoRa bandwidth in Hertz

◆ lr1110_radio_get_lora_pkt_status()

err_t lr1110_radio_get_lora_pkt_status ( lriot_t * ctx,
lr1110_radio_pkt_status_lora_t * pkt_status )

Get the status of last LoRa received packet.

The value depends on the received packet type

Parameters
[in]ctxChip implementation context
[out]pkt_statusThe last received packet status
Returns
Operation status

◆ lr1110_radio_get_lora_rx_info()

err_t lr1110_radio_get_lora_rx_info ( lriot_t * ctx,
bool * is_crc_present,
uint8_t * cr )

Get the information from the last received LoRa packet header (if LR1110_RADIO_LORA_PKT_EXPLICIT) or the locally configured settings (if LR1110_RADIO_LORA_PKT_IMPLICIT)

Remarks
This function can be called only if LR1110_RADIO_PKT_TYPE_LORA is selected with lr1110_radio_set_pkt_type
Parameters
[in]ctxChip implementation context
[out]is_crc_presentCRC configuration
[out]crLoRa coding rate
Returns
Operation status

◆ lr1110_radio_get_lora_stats()

err_t lr1110_radio_get_lora_stats ( lriot_t * ctx,
lr1110_radio_stats_lora_t * stats )

Get the internal statistics of the LoRa received packets.

Internal statistics are reset on Power on Reset, by entering sleep mode without memory retention, or by calling lr1110_radio_reset_stats.

Parameters
[in]ctxChip implementation context
[out]statsThe statistics structure of the received packets
Returns
Operation status
See also
lr1110_radio_reset_stats

◆ lr1110_radio_get_lora_time_on_air_in_ms()

uint32_t lr1110_radio_get_lora_time_on_air_in_ms ( lr1110_radio_pkt_params_lora_t * pkt_p,
lr1110_radio_mod_params_lora_t * mod_p )

Get the time on air in ms for LoRa transmission.

Parameters
[in]pkt_pPointer to a structure holding the LoRa packet parameters
[in]mod_pPointer to a structure holding the LoRa modulation parameters
Returns
Time-on-air value in ms for LoRa transmission

◆ lr1110_radio_get_lora_time_on_air_numerator()

uint32_t lr1110_radio_get_lora_time_on_air_numerator ( lr1110_radio_pkt_params_lora_t * pkt_p,
lr1110_radio_mod_params_lora_t * mod_p )

Compute the numerator for LoRa time-on-air computation.

Remarks
To get the actual time-on-air in seconds, this value has to be divided by the LoRa bandwidth in Hertz.
Parameters
[in]pkt_pPointer to the structure holding the LoRa packet parameters
[in]mod_pPointer to the structure holding the LoRa modulation parameters
Returns
LoRa time-on-air numerator

◆ lr1110_radio_get_pkt_type()

err_t lr1110_radio_get_pkt_type ( lriot_t * ctx,
uint8_t * pkt_type )

Get the packet type currently configured.

Parameters
[in]ctxChip implementation context
[out]pkt_typeThe packet type currently configured
Returns
Operation status
See also
lr1110_radio_set_pkt_type

◆ lr1110_radio_get_rssi_inst()

err_t lr1110_radio_get_rssi_inst ( lriot_t * ctx,
int8_t * rssi_in_dbm )

Get the instantaneous RSSI.

This command can be used during reception of a packet

Parameters
[in]ctxChip implementation context
[out]rssi_in_dbmInstantaneous RSSI.
Returns
Operation status

◆ lr1110_radio_get_rx_buffer_status()

err_t lr1110_radio_get_rx_buffer_status ( lriot_t * ctx,
lr1110_radio_rx_buffer_status_t * rx_buffer_status )

Get the length of last received packet, and the offset in the RX internal buffer of the first byte of the received payload.

Parameters
[in]ctxChip implementation context
[out]rx_buffer_statusThe structure of RX buffer status
Returns
Operation status

◆ lr1110_radio_reset_stats()

err_t lr1110_radio_reset_stats ( lriot_t * ctx)

Reset internal statistics of the received packets.

Parameters
[in]ctxChip implementation context
Returns
Operation status
See also
lr1110_radio_get_gfsk_stats, lr1110_radio_get_lora_stats

◆ lr1110_radio_set_cad()

err_t lr1110_radio_set_cad ( lriot_t * ctx)

Start the CAD mode.

The LoRa packet type shall be selected before this function is called. The fallback mode is configured with lr1110_radio_set_cad_params.

Parameters
[in]ctxChip implementation context
Returns
Operation status
See also
lr1110_radio_set_cad_params, lr1110_radio_set_pkt_type

◆ lr1110_radio_set_cad_params()

err_t lr1110_radio_set_cad_params ( lriot_t * ctx,
lr1110_radio_cad_params_t * cad_params )

Set Channel Activity Detection configuration.

Parameters
[in]ctxChip implementation context
[in]cad_paramsThe structure defining CAD configuration
Returns
Operation status

◆ lr1110_radio_set_gfsk_crc_params()

err_t lr1110_radio_set_gfsk_crc_params ( lriot_t * ctx,
uint32_t seed,
uint32_t polynomial )

Configure the seed and the polynomial used to compute CRC in GFSK packet.

Parameters
[in]ctxChip implementation context
[in]seedSeed used to compute the CRC value
[in]polynomialPolynomial used to compute the CRC value
Returns
Operation status

◆ lr1110_radio_set_gfsk_mod_params()

err_t lr1110_radio_set_gfsk_mod_params ( lriot_t * ctx,
lr1110_radio_mod_params_gfsk_t * mod_params )

Set the modulation parameters for GFSK packets.

The command lr1110_radio_set_pkt_type must be called prior this one.

Parameters
[in]ctxChip implementation context
[in]mod_paramsThe structure of modulation configuration
Returns
Operation status
See also
lr1110_radio_set_pkt_type

◆ lr1110_radio_set_gfsk_pkt_params()

err_t lr1110_radio_set_gfsk_pkt_params ( lriot_t * ctx,
lr1110_radio_pkt_params_gfsk_t * pkt_params )

Set the packet parameters for GFSK packets.

The command lr1110_radio_set_pkt_type must be called prior this one.

Parameters
[in]ctxChip implementation context
[in]pkt_paramsThe structure of packet configuration
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_gfsk_mod_params

◆ lr1110_radio_set_gfsk_sync_word()

err_t lr1110_radio_set_gfsk_sync_word ( lriot_t * ctx,
uint8_t gfsk_sync_word[LR1110_RADIO_GFSK_SYNC_WORD_LENGTH] )

Set the GFSK modem sync word.

This command is used to set the GFSK nodem sync word. This command expects a 8-byte long array to be passed as sync word parameter. By default, the value is 0x9723522556536564.

Parameters
[in]ctxChip implementation context
[in]gfsk_sync_wordThe sync word to be configured
Returns
Operation status

◆ lr1110_radio_set_gfsk_whitening_seed()

err_t lr1110_radio_set_gfsk_whitening_seed ( lriot_t * ctx,
uint16_t seed )

Configure the whitening seed used in GFSK packet.

Parameters
[in]ctxChip implementation context
[in]seedWhitening seed value
Returns
Operation status

◆ lr1110_radio_set_lora_mod_params()

err_t lr1110_radio_set_lora_mod_params ( lriot_t * ctx,
lr1110_radio_mod_params_lora_t * mod_params )

Set the modulation parameters for LoRa packets.

The command lr1110_radio_set_pkt_type must be called prior this one.

Parameters
[in]ctxChip implementation context
[in]mod_paramsThe structure of modulation configuration
Returns
Operation status
See also
lr1110_radio_set_pkt_type

◆ lr1110_radio_set_lora_pkt_params()

err_t lr1110_radio_set_lora_pkt_params ( lriot_t * ctx,
lr1110_radio_pkt_params_lora_t * pkt_params )

Set the packet parameters for LoRa packets.

The command lr1110_radio_set_pkt_type must be called prior this one.

Parameters
[in]ctxChip implementation context
[in]pkt_paramsThe structure of packet configuration
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_lora_mod_params

◆ lr1110_radio_set_lora_public_network()

err_t lr1110_radio_set_lora_public_network ( lriot_t * ctx,
lr1110_radio_lora_network_type_t network_type )

Set the LoRa modem sync word to private / public.

This command is used to select which LoRa network is selected

Parameters
[in]ctxChip implementation context
[in]network_typeThe network type to be configured
Returns
Operation status
Warning
This function is deprecated. Use lr1110_radio_set_lora_sync_word for chip firmware equal to or more recent than 0x303.

◆ lr1110_radio_set_lora_sync_timeout()

err_t lr1110_radio_set_lora_sync_timeout ( lriot_t * ctx,
uint8_t nb_symbol )

Configure the LoRa modem to issue a RX timeout after an exact number of symbols given in parameter if no LoRa modulation is detected.

Parameters
[in]ctxChip implementation context
[in]nb_symbolnumber of symbols to compute the timeout
Returns
Operation status

◆ lr1110_radio_set_lora_sync_word()

err_t lr1110_radio_set_lora_sync_word ( lriot_t * ctx,
uint8_t sync_word )

Set the LoRa modem sync word.

Parameters
[in]ctxChip implementation context
[in]sync_wordThe sync word to be configured
Returns
Operation status

◆ lr1110_radio_set_pa_cfg()

err_t lr1110_radio_set_pa_cfg ( lriot_t * ctx,
lr1110_radio_pa_cfg_t * pa_cfg )

Set the Power Amplifier configuration.

It must be called prior using lr1110_radio_set_tx_params.

Parameters
[in]ctxChip implementation context
[in]pa_cfgThe structure for PA configuration
Returns
Operation status

◆ lr1110_radio_set_pkt_address()

err_t lr1110_radio_set_pkt_address ( lriot_t * ctx,
uint8_t node_address,
uint8_t broadcast_address )

Sets the Node and Broadcast address used for GFSK.

This setting is used only when filtering is enabled.

Parameters
[in]ctxChip implementation context
[in]node_addressThe node address used as filter
[in]broadcast_addressThe broadcast address used as filter
Returns
Operation status

◆ lr1110_radio_set_pkt_type()

err_t lr1110_radio_set_pkt_type ( lriot_t * ctx,
uint8_t pkt_type )

Set the packet type.

Parameters
[in]ctxChip implementation context
[in]pkt_typePacket type to set
Returns
Operation status
See also
lr1110_radio_get_pkt_type

◆ lr1110_radio_set_rf_freq()

err_t lr1110_radio_set_rf_freq ( lriot_t * ctx,
uint32_t freq_in_hz )

Set the frequency for future radio operations.

This commands does not set frequency for Wi-Fi and GNSS scan operations.

Parameters
[in]ctxChip implementation context
[in]freq_in_hzThe frequency in Hz to set for radio operations
Returns
Operation status

◆ lr1110_radio_set_rx()

err_t lr1110_radio_set_rx ( lriot_t * ctx,
uint32_t timeout_in_ms )

Start RX operations.

This command sets the LR1110 to RX mode. The radio must have been configured before using this command with lr1110_radio_set_pkt_type

By default, the timeout parameter allows to return automatically to standby RC mode if no packets have been received after a certain amount of time. This behavior can be altered by lr1110_radio_set_rx_tx_fallback_mode and lr1110_radio_auto_tx_rx.

Parameters
[in]ctxChip implementation context
[in]timeout_in_msThe timeout configuration for RX operation
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_rx_tx_fallback_mode

◆ lr1110_radio_set_rx_duty_cycle()

err_t lr1110_radio_set_rx_duty_cycle ( lriot_t * ctx,
uint32_t rx_period_in_ms,
uint32_t sleep_period_in_ms,
lr1110_radio_rx_duty_cycle_mode_t mode )

Configure and start a Rx Duty Cycle operation.

It executes the following steps:

  1. Reception: enters reception state for duration defined by rx_period
    • If mode is LR1110_RADIO_RX_DUTY_CYCLE_MODE_RX: it is standard RX mode
    • If mode is LR1110_RADIO_RX_DUTY_CYCLE_MODE_CAD (only in LoRa) : it is CAD operation
  2. Depending on the over-the-air activity detection:
    • In case of positive over-the-air detection, the rx_period timeout is recomputed to the value $2 \times rx\_period + sleep\_period$
    • If no air activity is detected, the LR1110 goes back to sleep mode with retention for a duration defined by sleep_period
  3. On wake-up, the LR1110 restarts the process with the reception state.
Remarks
If mode is configured to LR1110_RADIO_RX_DUTY_CYCLE_MODE_CAD, then the CAD configuration used in step 1. is the one set from the last call to lr1110_radio_set_cad_params.
Parameters
[in]ctxChip implementation context
[in]rx_period_in_msThe length of Rx period
[in]sleep_period_in_msThe length of sleep period
[in]modeThe operation mode during Rx phase
Returns
Operation status
See also
lr1110_radio_set_cad_params

◆ lr1110_radio_set_rx_duty_cycle_with_timings_in_rtc_step()

err_t lr1110_radio_set_rx_duty_cycle_with_timings_in_rtc_step ( lriot_t * ctx,
uint32_t rx_period_in_rtc_step,
uint32_t sleep_period_in_rtc_step,
lr1110_radio_rx_duty_cycle_mode_t mode )

Configure and start a Rx Duty Cycle operation.

It executes the following steps:

  1. Reception: enters reception state for duration defined by rx_period
    • If mode is LR1110_RADIO_RX_DUTY_CYCLE_MODE_RX: it is standard RX mode
    • If mode is LR1110_RADIO_RX_DUTY_CYCLE_MODE_CAD (only in LoRa) : it is CAD operation
  2. Depending on the over-the-air activity detection:
    • In case of positive over-the-air detection, the rx_period timeout is recomputed to the value $2 \times rx\_period + sleep\_period$
    • If no air activity is detected, the LR1110 goes back to sleep mode with retention for a duration defined by sleep_period
  3. On wake-up, the LR1110 restarts the process with the reception state.
Remarks
If mode is configured to LR1110_RADIO_RX_DUTY_CYCLE_MODE_CAD, then the CAD configuration used in step 1. is the one set from the last call to lr1110_radio_set_cad_params.
Parameters
[in]ctxChip implementation context
[in]rx_period_in_rtc_stepThe length of Rx period
[in]sleep_period_in_rtc_stepThe length of sleep period
[in]modeThe operation mode during Rx phase
Returns
Operation status
See also
lr1110_radio_set_cad_params

◆ lr1110_radio_set_rx_tx_fallback_mode()

err_t lr1110_radio_set_rx_tx_fallback_mode ( lriot_t * ctx,
lr1110_radio_fallback_modes_t fallback_mode )

Alter the chip mode after successfull transmission or reception operation.

This setting is not used during Rx Duty Cycle mode or Auto Tx Rx.

Parameters
[in]ctxChip implementation context
[in]fallback_modeThe chip mode to enter after successfull transmission or reception.
Returns
Operation status

◆ lr1110_radio_set_rx_with_timeout_in_rtc_step()

err_t lr1110_radio_set_rx_with_timeout_in_rtc_step ( lriot_t * ctx,
uint32_t timeout_in_rtc_step )

Start RX operations.

This command sets the LR1110 to RX mode. The radio must have been configured before using this command with lr1110_radio_set_pkt_type

By default, the timeout parameter allows to return automatically to standby RC mode if no packets have been received after a certain amount of time. This behavior can be altered by lr1110_radio_set_rx_tx_fallback_mode and lr1110_radio_auto_tx_rx.

The timeout duration is obtained by: $ timeout\_duration\_ms = timeout \times \frac{1}{32.768} $

Maximal timeout value is 0xFFFFFF, which gives a maximal timeout of 511 seconds.

The timeout argument can also have the following special values:

Special values Meaning
0x000000 RX single: LR1110 stays in RX mode until a packet is received, then switch to standby RC mode
0xFFFFFF RX continuous: LR1110 stays in RX mode even after reception of a packet
Parameters
[in]ctxChip implementation context
[in]timeout_in_rtc_stepThe timeout configuration for RX operation
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_rx_tx_fallback_mode

◆ lr1110_radio_set_tx()

err_t lr1110_radio_set_tx ( lriot_t * ctx,
uint32_t timeout_in_ms )

Start TX operations.

This command sets the LR1110 to TX mode. The radio must have been configured before using this command with lr1110_radio_set_pkt_type

By default, the timeout parameter allows to return automatically to standby RC mode if the packet has not been completely transmitted after a certain amount of time. This behavior can be altered by lr1110_radio_set_rx_tx_fallback_mode and lr1110_radio_auto_tx_rx.

Parameters
[in]ctxChip implementation context
[in]timeout_in_msThe timeout configuration for TX operation
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_rx_tx_fallback_mode

◆ lr1110_radio_set_tx_cw()

err_t lr1110_radio_set_tx_cw ( lriot_t * ctx)

Set the device into Tx continuous wave (RF tone).

A packet type shall be selected before this function is called.

Parameters
[in]ctxChip implementation context
Returns
Operation status
See also
lr1110_radio_set_pkt_type

◆ lr1110_radio_set_tx_infinite_preamble()

err_t lr1110_radio_set_tx_infinite_preamble ( lriot_t * ctx)

Set the device into Tx continuous preamble (modulated signal).

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_radio_set_tx_params()

err_t lr1110_radio_set_tx_params ( lriot_t * ctx,
int8_t pwr_in_dbm,
lr1110_radio_ramp_time_t ramp_time )

Set the parameters for TX power and power amplifier ramp time.

The command lr1110_radio_set_pa_cfg must be called prior calling lr1110_radio_set_tx_params.

The range of possible TX output power values depends on PA selected with lr1110_radio_set_pa_cfg :

  • for LPA: power value goes from -17dBm to +14dBm (ie. from 0xEF to 0x0E)
  • for HPA: power value goes from -9dBm to +22dBm (ie. from 0xF7 to 0x16)

Moreover, to use TX output power value higher than +10dBm, the REGPASUPPLY_VBAT supply must have been selected with lr1110_radio_set_pa_cfg.

Parameters
[in]ctxChip implementation context
[in]pwr_in_dbmThe TX output power in dBm
[in]ramp_timeThe ramping time configuration for the PA
Returns
Operation status

◆ lr1110_radio_set_tx_with_timeout_in_rtc_step()

err_t lr1110_radio_set_tx_with_timeout_in_rtc_step ( lriot_t * ctx,
uint32_t timeout_in_rtc_step )

Start TX operations.

This command sets the LR1110 to TX mode. The radio must have been configured before using this command with lr1110_radio_set_pkt_type

By default, the timeout parameter allows to return automatically to standby RC mode if the packet has not been completely transmitted after a certain amount of time. This behavior can be altered by lr1110_radio_set_rx_tx_fallback_mode and lr1110_radio_auto_tx_rx.

The timeout duration is obtained by: $ timeout\_duration\_ms = timeout \times \frac{1}{32.768} $

Maximal value is 0xFFFFFF.

If the timeout argument is 0, then no timeout is used.

Parameters
[in]ctxChip implementation context
[in]timeout_in_rtc_stepThe timeout configuration for TX operation
Returns
Operation status
See also
lr1110_radio_set_pkt_type, lr1110_radio_set_rx_tx_fallback_mode

◆ lr1110_radio_stop_timeout_on_preamble()

err_t lr1110_radio_stop_timeout_on_preamble ( lriot_t * ctx,
bool stop_timeout_on_preamble )

Define on which event the Rx timeout shall be stopped.

The two options are:

  • Syncword / Header detection
  • Preamble detection
Parameters
[in]ctxChip implementation context
[in]stop_timeout_on_preambleThe choice of the event to be taken into account
Returns
Operation status