Skip to content

Commit

Permalink
Release v2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smtc-bot committed Jul 24, 2024
1 parent e0fa771 commit 0155da3
Show file tree
Hide file tree
Showing 7 changed files with 639 additions and 33 deletions.
70 changes: 38 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.5.0] 2024-07-24

### Added

- [radio] `lr11xx_radio_set_lna_mode` function to configure usage of antenna for LNA and corresponding helper functions `lr11xx_radio_set_rx_and_lna_mode` and `lr11xx_radio_set_rx_with_timeout_in_rtc_step_and_lna_mode`

## [v2.4.1] 2023-11-16

### Changed
Expand Down Expand Up @@ -70,56 +76,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Added

* [radio] `lr11xx_radio_set_lora_sync_timeout_with_mantissa_exponent()` function
* [radio] `LR11XX_RADIO_PKT_TYPE_BPSK` packet type, with `lr11xx_radio_set_bpsk_pkt_params` and `lr11xx_radio_set_bpsk_mod_params` functions
* [GNSS] `lr11xx_gnss_apply_mixer_cfg_workaround()` function
* [GNSS] Add function `lr11xx_gnss_read_gnss_rssi_test` to read RSSI on GNSS path
* [GNSS] Add function `lr11xx_gnss_read_freq_search_space`
* [GNSS] Add function `lr11xx_gnss_set_freq_search_space`
* [GNSS] Add function `lr11xx_gnss_get_nb_visible_satellites`
* [GNSS] Add function `lr11xx_gnss_get_visible_satellites`
* [GNSS] add structure `lr11xx_gnss_visible_satellite_t` to support `lr11xx_gnss_get_visible_satellites` function
* [lr-fhss] Add function `lr11xx_lr_fhss_get_bit_delay_in_us` to compute the delay between the last LR-FHSS bit sent and the TX done interrupt
* [radio] Add function `lr11xx_radio_set_lr_fhss_sync_word` to configure the LR-FHSS syncword
* [radio] Add function `lr11xx_radio_set_lr_fhss_mod_params` to configure the LR-FHSS modulation parameters
* [radio] Add helper function `lr11xx_radio_convert_nb_symb_to_mant_exp` to convert a number of symbols into mantissa/exponent representation
* [crypto] Add functions `lr11xx_crypto_check_encrypted_firmware_image` and `lr11xx_crypto_get_check_encrypted_firmware_image_result`; and helper function `lr11xx_crypto_check_encrypted_firmware_image_full` to check suitability of encrypted firmware image prior to actual flashing
* [ranging] Add `lr11xx_ranging_*` functions as part of new ranging component `lr11xx_ranging`
- [radio] `lr11xx_radio_set_lora_sync_timeout_with_mantissa_exponent()` function
- [radio] `LR11XX_RADIO_PKT_TYPE_BPSK` packet type, with `lr11xx_radio_set_bpsk_pkt_params` and `lr11xx_radio_set_bpsk_mod_params` functions
- [GNSS] `lr11xx_gnss_apply_mixer_cfg_workaround()` function
- [GNSS] Add function `lr11xx_gnss_read_gnss_rssi_test` to read RSSI on GNSS path
- [GNSS] Add function `lr11xx_gnss_read_freq_search_space`
- [GNSS] Add function `lr11xx_gnss_set_freq_search_space`
- [GNSS] Add function `lr11xx_gnss_get_nb_visible_satellites`
- [GNSS] Add function `lr11xx_gnss_get_visible_satellites`
- [GNSS] add structure `lr11xx_gnss_visible_satellite_t` to support `lr11xx_gnss_get_visible_satellites` function
- [lr-fhss] Add function `lr11xx_lr_fhss_get_bit_delay_in_us` to compute the delay between the last LR-FHSS bit sent and the TX done interrupt
- [radio] Add function `lr11xx_radio_set_lr_fhss_sync_word` to configure the LR-FHSS syncword
- [radio] Add function `lr11xx_radio_set_lr_fhss_mod_params` to configure the LR-FHSS modulation parameters
- [radio] Add helper function `lr11xx_radio_convert_nb_symb_to_mant_exp` to convert a number of symbols into mantissa/exponent representation
- [crypto] Add functions `lr11xx_crypto_check_encrypted_firmware_image` and `lr11xx_crypto_get_check_encrypted_firmware_image_result`; and helper function `lr11xx_crypto_check_encrypted_firmware_image_full` to check suitability of encrypted firmware image prior to actual flashing
- [ranging] Add `lr11xx_ranging_*` functions as part of new ranging component `lr11xx_ranging`

### Changed

* [GNSS] Call to `lr11xx_gnss_apply_mixer_cfg_workaround()` in `lr11xx_gnss_scan_autonomous()` and `lr11xx_gnss_scan_assisted()` (can be removed by defining `LR11XX_DISABLE_MIXER_CFG_WORKAROUND`)
* [system] Field `type` of `lr11xx_system_version_t` is now an enumerated type named `lr11xx_system_version_type_t`
* [system] Add IRQ raised on LoRa symbol received over-the-air
* [radio] `lr11xx_radio_set_lora_sync_timeout` takes argument `nb_symbol` as `uint16_t`
* [regmem] `lr11xx_regmem_write_regmem32` and `lr11xx_regmem_read_regmem32` test the number of words to write/read before actually requesting the chip, and raise an error status if it is higher than 64
- [GNSS] Call to `lr11xx_gnss_apply_mixer_cfg_workaround()` in `lr11xx_gnss_scan_autonomous()` and `lr11xx_gnss_scan_assisted()` (can be removed by defining `LR11XX_DISABLE_MIXER_CFG_WORKAROUND`)
- [system] Field `type` of `lr11xx_system_version_t` is now an enumerated type named `lr11xx_system_version_type_t`
- [system] Add IRQ raised on LoRa symbol received over-the-air
- [radio] `lr11xx_radio_set_lora_sync_timeout` takes argument `nb_symbol` as `uint16_t`
- [regmem] `lr11xx_regmem_write_regmem32` and `lr11xx_regmem_read_regmem32` test the number of words to write/read before actually requesting the chip, and raise an error status if it is higher than 64

## [v2.1.1] 2022-04-06

### Fixed

* [radio] Order of the parameters in `lr11xx_radio_set_rssi_calibration()` function
- [radio] Order of the parameters in `lr11xx_radio_set_rssi_calibration()` function

## [v2.1.0] 2022-03-28

### Added

* [radio] `lr11xx_radio_apply_high_acp_workaround()` function
* [radio] `lr11xx_radio_set_rssi_calibration()` function
* [radio] `LR11XX_RADIO_LORA_BW_200`, `LR11XX_RADIO_LORA_BW_400` and `LR11XX_RADIO_LORA_BW_800` entries to `lr11xx_radio_lora_bw_t`
* [radio] `LR11XX_RADIO_GFSK_PKT_VAR_LEN_SX128X_COMP` entry in `lr11xx_radio_gfsk_pkt_len_modes_t` to support compatibility with SX128x
* [radio] `LR11XX_RADIO_GFSK_DC_FREE_WHITENING_SX128X_COMP` entry in `lr11xx_radio_gfsk_dc_free_t` to support compatibility with SX128x
* [GNSS] `lr11xx_gnss_get_consumption` function
* [Wi-Fi] `lr11xx_wifi_get_consumption` function
* [Wi-Fi] `lr11xx_wifi_are_scan_mode_result_format_compatible` function
- [radio] `lr11xx_radio_apply_high_acp_workaround()` function
- [radio] `lr11xx_radio_set_rssi_calibration()` function
- [radio] `LR11XX_RADIO_LORA_BW_200`, `LR11XX_RADIO_LORA_BW_400` and `LR11XX_RADIO_LORA_BW_800` entries to `lr11xx_radio_lora_bw_t`
- [radio] `LR11XX_RADIO_GFSK_PKT_VAR_LEN_SX128X_COMP` entry in `lr11xx_radio_gfsk_pkt_len_modes_t` to support compatibility with SX128x
- [radio] `LR11XX_RADIO_GFSK_DC_FREE_WHITENING_SX128X_COMP` entry in `lr11xx_radio_gfsk_dc_free_t` to support compatibility with SX128x
- [GNSS] `lr11xx_gnss_get_consumption` function
- [Wi-Fi] `lr11xx_wifi_get_consumption` function
- [Wi-Fi] `lr11xx_wifi_are_scan_mode_result_format_compatible` function

### Changed

* [radio] Call to `lr11xx_radio_apply_high_acp_workaround()` in `lr11xx_radio_set_tx_with_timeout_in_rtc_step()`, `lr11xx_radio_set_rx_with_timeout_in_rtc_step()`, `lr11xx_radio_set_cad()` and `lr11xx_radio_set_tx_infinite_preamble()` (can be removed by defining `LR11XX_DISABLE_HIGH_ACP_WORKAROUND`)
* [Wi-Fi] Define type `lr11xx_wifi_country_code_str_t` for Wi-Fi country code data and update `lr11xx_wifi_extended_full_result_t` and `lr11xx_wifi_country_code_t` to use it.
- [radio] Call to `lr11xx_radio_apply_high_acp_workaround()` in `lr11xx_radio_set_tx_with_timeout_in_rtc_step()`, `lr11xx_radio_set_rx_with_timeout_in_rtc_step()`, `lr11xx_radio_set_cad()` and `lr11xx_radio_set_tx_infinite_preamble()` (can be removed by defining `LR11XX_DISABLE_HIGH_ACP_WORKAROUND`)
- [Wi-Fi] Define type `lr11xx_wifi_country_code_str_t` for Wi-Fi country code data and update `lr11xx_wifi_extended_full_result_t` and `lr11xx_wifi_country_code_t` to use it.

## [v1.0.0] Unreleased

### Added

* [all] Initial version - based on LR1110 driver v7.0.0
- [all] Initial version - based on LR1110 driver v7.0.0
32 changes: 31 additions & 1 deletion src/lr11xx_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,22 @@ lr11xx_status_t lr11xx_radio_set_rx( const void* context, const uint32_t timeout
return lr11xx_radio_set_rx_with_timeout_in_rtc_step( context, timeout_in_rtc_step );
}

lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step( const void* context, const uint32_t timeout )
lr11xx_status_t lr11xx_radio_set_rx_and_lna_mode( const void* context, const uint32_t timeout_in_ms,
lr11xx_radio_lna_mode_t lna_mode )
{
const uint32_t timeout_in_rtc_step = lr11xx_radio_convert_time_in_ms_to_rtc_step( timeout_in_ms );

return lr11xx_radio_set_rx_with_timeout_in_rtc_step_and_lna_mode( context, timeout_in_rtc_step, lna_mode );
}

lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step( const void* context, const uint32_t timeout_in_ms )
{
return lr11xx_radio_set_rx_with_timeout_in_rtc_step_and_lna_mode( context, timeout_in_ms,
LR11XX_RADIO_LNA_MODE_DIFFERENTIAL_LF0 );
}

lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step_and_lna_mode( const void* context, const uint32_t timeout,
lr11xx_radio_lna_mode_t lna_mode )
{
lr11xx_status_t status = LR11XX_STATUS_ERROR;
const uint8_t cbuffer[LR11XX_RADIO_SET_RX_CMD_LENGTH] = {
Expand All @@ -433,6 +448,17 @@ lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step( const void* contex
{
break;
}

if( ( lna_mode == LR11XX_RADIO_LNA_MODE_SINGLE_RFI_P_LF0 ) ||
( lna_mode == LR11XX_RADIO_LNA_MODE_SINGLE_RFI_N_LF0 ) )
{
status = lr11xx_radio_set_lna_mode( context, lna_mode );
if( status != LR11XX_STATUS_OK )
{
break;
}
}

} while( 0 );

return status;
Expand Down Expand Up @@ -1292,6 +1318,10 @@ uint16_t lr11xx_radio_convert_nb_symb_to_mant_exp( const uint16_t nb_symbol, uin
return mant_loc << ( 2 * exp_loc + 1 );
}

lr11xx_status_t lr11xx_radio_set_lna_mode( const void* context, lr11xx_radio_lna_mode_t lna_config )
{
return lr11xx_regmem_write_regmem32_mask( context, 0x00F3008C, 0xF0, lna_config << 4 );
}
/*
* -----------------------------------------------------------------------------
* --- PRIVATE FUNCTIONS DEFINITION --------------------------------------------
Expand Down
81 changes: 81 additions & 0 deletions src/lr11xx_radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,33 @@ lr11xx_status_t lr11xx_radio_set_lora_public_network( const void*
*/
lr11xx_status_t lr11xx_radio_set_rx( const void* context, const uint32_t timeout_in_ms );

/*!
* @brief Start RX operations with a timeout in millisecond and configure the LNA LF0 mode
*
* This command sets the LR11XX to RX mode and configures the LNA LF0 mode. The radio must have been configured before
* using this command with @ref lr11xx_radio_set_pkt_type
*
* This command must be issued only for sub-GHz RX operations as it configures the LNA LF0, which is only used for
* sub-GHz Rx operations.
*
* 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 @ref lr11xx_radio_set_rx_tx_fallback_mode and @ref
* lr11xx_radio_auto_tx_rx.
*
* @remark To set the radio in Rx continuous mode, the function @ref lr11xx_radio_set_rx_with_timeout_in_rtc_step has to
* be called with \p timeout_in_rtc_step set to 0xFFFFFF
*
* @param [in] context Chip implementation context
* @param [in] timeout_in_ms The timeout configuration for RX operation
* @param [in] lna_mode Path to use for reception
*
* @returns Operation status
*
* @see lr11xx_radio_set_pkt_type, lr11xx_radio_set_rx_tx_fallback_mode, lr11xx_radio_set_lna_mode
*/
lr11xx_status_t lr11xx_radio_set_rx_and_lna_mode( const void* context, const uint32_t timeout_in_ms,
lr11xx_radio_lna_mode_t lna_mode );

/*!
* @brief Start RX operations with a timeout in RTC step
*
Expand Down Expand Up @@ -318,6 +345,44 @@ lr11xx_status_t lr11xx_radio_set_rx( const void* context, const uint32_t timeout
*/
lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step( const void* context, const uint32_t timeout_in_rtc_step );

/*!
* @brief Start RX operations with a timeout in RTC step and configure the LNA LF0 mode
*
* This command sets the LR11XX to RX mode and configures the LNA LF0 mode. The radio must have been configured before
* using this command with @ref lr11xx_radio_set_pkt_type It internally calls lr11xx_radio_set_lna_mode. This command
* must be issued only for sub-GHz RX operations as it configures the LNA LF0, which is only used for sub-GHz Rx
* operations.
*
* 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 @ref lr11xx_radio_set_rx_tx_fallback_mode and @ref
* lr11xx_radio_auto_tx_rx.
*
* The timeout duration is obtained by:
* \f$ timeout\_duration\_ms = timeout \times \frac{1}{32.768} \f$
*
* Maximal timeout value is 0xFFFFFF, which gives a maximal timeout of 511 seconds.
*
* The timeout argument can also have the following special values:
* <table>
* <tr><th> Special values </th><th> Meaning </th>
* <tr><td> 0x000000 </td><td> RX single: LR11XX stays in RX mode until a
* packet is received, then switch to standby RC mode <tr><td> 0xFFFFFF
* </td><td> RX continuous: LR11XX stays in RX mode even after reception of a
* packet
* </table>
*
* @param [in] context Chip implementation context
* @param [in] timeout_in_rtc_step The timeout configuration for RX operation
* @param [in] lna_mode Path to use for reception
*
* @returns Operation status
*
* @see lr11xx_radio_set_pkt_type, lr11xx_radio_set_rx_tx_fallback_mode
*/
lr11xx_status_t lr11xx_radio_set_rx_with_timeout_in_rtc_step_and_lna_mode( const void* context,
const uint32_t timeout_in_rtc_step,
lr11xx_radio_lna_mode_t lna_mode );

/*!
* @brief Start TX operations
*
Expand Down Expand Up @@ -954,6 +1019,22 @@ lr11xx_status_t lr11xx_radio_apply_high_acp_workaround( const void* context );
*/
uint16_t lr11xx_radio_convert_nb_symb_to_mant_exp( const uint16_t nb_symbol, uint8_t* mant, uint8_t* exp );

/**
* @brief Configure LNA LF0 mode
*
* @remark This function shall be called after each call to lr11xx_radio_set_rx or
* lr11xx_radio_set_rx_with_timeout_in_rtc_step to be taken into account. Helper functions
* lr11xx_radio_set_rx_on_lna_path or lr11xx_radio_set_rx_with_timeout_in_rtc_step_on_lna_path can be used instead.
*
* @param [in] context Chip implementation context
* @param [in] lna_mode Value to put in the register, enum type
*
* @returns Operation status
*
* @see lr11xx_radio_set_rx_on_lna_path, lr11xx_radio_set_rx_with_timeout_in_rtc_step_on_lna_path
*/
lr11xx_status_t lr11xx_radio_set_lna_mode( const void* context, lr11xx_radio_lna_mode_t lna_mode );

#ifdef __cplusplus
}
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/lr11xx_radio_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,18 @@ typedef struct lr11xx_radio_rssi_calibration_table_s
int16_t gain_offset; //!< Used to set gain offset value for RSSI calibration
} lr11xx_radio_rssi_calibration_table_t;

/*!
* @brief Values to use to setup LNA LF0 configuration
*
* LNA can be configured in either of the 3 modes: Single N, Single P or differential (which is default)
*
*/
typedef enum
{
LR11XX_RADIO_LNA_MODE_SINGLE_RFI_N_LF0 = 1, //!< Use only RFI_N_LF0 antenna
LR11XX_RADIO_LNA_MODE_SINGLE_RFI_P_LF0 = 2, //!< Use only RFI_P_LF0 antenna
LR11XX_RADIO_LNA_MODE_DIFFERENTIAL_LF0 = 3 //!< Configure LNA LF0 in differential mode (default)
} lr11xx_radio_lna_mode_t;
/*
* -----------------------------------------------------------------------------
* --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
Expand Down
Loading

0 comments on commit 0155da3

Please sign in to comment.