SingingCat 0
application
|
SX126x radio driver definition. More...
#include <stdint.h>
#include <stdbool.h>
#include "networkif.h"
Go to the source code of this file.
Data Structures | |
struct | sx126x_cad_param_s |
SX126X CAD parameters structure definition. More... | |
struct | sx126x_chip_status_s |
SX126X chip status structure definition. More... | |
struct | sx126x_mod_params_gfsk_s |
SX126X GFSK modulation parameters structure definition. More... | |
struct | sx126x_mod_params_lora_s |
SX126X LoRa modulation parameters structure definition. More... | |
struct | sx126x_pa_cfg_params_s |
SX126X power amplifier configuration parameters structure definition. More... | |
struct | sx126x_pkt_params_gfsk_s |
SX126X GFSK packet parameters structure definition. More... | |
struct | sx126x_pkt_params_lora_s |
SX126X LoRa packet parameters structure definition. More... | |
struct | sx126x_pkt_status_gfsk_s |
SX126X GFSK packet status structure definition. More... | |
struct | sx126x_pkt_status_lora_s |
SX126X LoRa packet status structure definition. More... | |
struct | sx126x_rx_buffer_status_s |
SX126X RX buffer status structure definition. More... | |
struct | sx126x_rx_status_gfsk_s |
struct | sx126x_stats_gfsk_s |
SX126X GFSK reception statistics structure definition. More... | |
struct | sx126x_stats_lora_s |
SX126X LoRa reception statistics structure definition. More... | |
Macros | |
#define | SX126X_CHIP_MODES_MASK (0x07UL << SX126X_CHIP_MODES_POS) |
#define | SX126X_CHIP_MODES_POS (4U) |
#define | SX126X_CMD_STATUS_MASK (0x07UL << SX126X_CMD_STATUS_POS) |
#define | SX126X_CMD_STATUS_POS (1U) |
#define | SX126X_GFSK_RX_STATUS_ABORT_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_ABORT_ERROR_POS) |
#define | SX126X_GFSK_RX_STATUS_ABORT_ERROR_POS (2U) |
#define | SX126X_GFSK_RX_STATUS_ADRS_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_ADRS_ERROR_POS) |
#define | SX126X_GFSK_RX_STATUS_ADRS_ERROR_POS (5U) |
#define | SX126X_GFSK_RX_STATUS_CRC_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_CRC_ERROR_POS) |
#define | SX126X_GFSK_RX_STATUS_CRC_ERROR_POS (4U) |
#define | SX126X_GFSK_RX_STATUS_LENGTH_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_LENGTH_ERROR_POS) |
#define | SX126X_GFSK_RX_STATUS_LENGTH_ERROR_POS (3U) |
#define | SX126X_GFSK_RX_STATUS_PKT_RECEIVED_MASK (0x01UL << SX126X_GFSK_RX_STATUS_PKT_RECEIVED_POS) |
#define | SX126X_GFSK_RX_STATUS_PKT_RECEIVED_POS (1U) |
#define | SX126X_GFSK_RX_STATUS_PKT_SENT_MASK (0x01UL << SX126X_GFSK_RX_STATUS_PKT_SENT_POS) |
#define | SX126X_GFSK_RX_STATUS_PKT_SENT_POS (0U) |
#define | SX126X_MAX_TIMEOUT_IN_MS (SX126X_MAX_TIMEOUT_IN_RTC_STEP / 64) |
Maximum value for parameter timeout_in_ms in both functions sx126x_set_rx and sx126x_set_tx. More... | |
#define | SX126X_MAX_TIMEOUT_IN_RTC_STEP 0x00FFFFFE |
Maximum value for parameter timeout_in_rtc_step in both functions sx126x_set_rx_with_timeout_in_rtc_step and sx126x_set_tx_with_timeout_in_rtc_step. More... | |
#define | SX126X_RX_CONTINUOUS 0x00FFFFFF |
Timeout parameter in sx126x_set_rx_with_timeout_in_rtc_step to launch a continuous reception. More... | |
#define | SX126X_RX_SINGLE_MODE 0x00000000 |
Timeout parameter in sx126x_set_rx_with_timeout_in_rtc_step to set the chip in reception until a reception occurs. More... | |
Typedefs | |
typedef enum sx126x_cad_exit_modes_e | sx126x_cad_exit_modes_t |
SX126X LoRa CAD exit modes enumeration definition. More... | |
typedef struct sx126x_cad_param_s | sx126x_cad_params_t |
SX126X CAD parameters structure definition. | |
typedef enum sx126x_cad_symbs_e | sx126x_cad_symbs_t |
SX126X LoRa CAD number of symbols enumeration definition. More... | |
typedef uint8_t | sx126x_cal_mask_t |
typedef enum sx126x_chip_modes_e | sx126x_chip_modes_t |
SX126X chip mode enumeration definition. | |
typedef struct sx126x_chip_status_s | sx126x_chip_status_t |
SX126X chip status structure definition. | |
typedef enum sx126x_cmd_status_e | sx126x_cmd_status_t |
SX126X command status enumeration definition. | |
typedef uint16_t | sx126x_errors_mask_t |
typedef enum sx126x_fallback_modes_e | sx126x_fallback_modes_t |
SX126X fallback modes enumeration definition. | |
typedef enum sx126x_gfsk_address_filtering_e | sx126x_gfsk_address_filtering_t |
SX126X GFSK address filtering configuration enumeration definition. | |
typedef enum sx126x_gfsk_bw_e | sx126x_gfsk_bw_t |
SX126X GFSK Rx bandwidth enumeration definition. | |
typedef enum sx16x_gfsk_crc_types_e | sx126x_gfsk_crc_types_t |
SX126X GFSK CRC type enumeration definition. | |
typedef enum sx126x_gfsk_dc_free_e | sx126x_gfsk_dc_free_t |
SX126X GFSK whitening control enumeration definition. | |
typedef enum sx126x_gfsk_pkt_len_modes_e | sx126x_gfsk_pkt_len_modes_t |
SX126X GFSK packet length enumeration definition. | |
typedef enum sx126x_gfsk_preamble_detector_e | sx126x_gfsk_preamble_detector_t |
SX126X GFSK preamble length Rx detection size enumeration definition. | |
typedef enum sx126x_gfsk_pulse_shape_e | sx126x_gfsk_pulse_shape_t |
SX126X GFSK modulation shaping enumeration definition. | |
typedef uint16_t | sx126x_irq_mask_t |
typedef enum sx126x_lora_bw_e | sx126x_lora_bw_t |
SX126X LoRa bandwidth enumeration definition. | |
typedef enum sx126x_lora_cr_e | sx126x_lora_cr_t |
SX126X LoRa coding rate enumeration definition. | |
typedef enum sx126x_lora_pkt_len_modes_e | sx126x_lora_pkt_len_modes_t |
SX126X LoRa packet length enumeration definition. | |
typedef enum sx126x_lora_sf_e | sx126x_lora_sf_t |
SX126X LoRa spreading factor enumeration definition. | |
typedef struct sx126x_mod_params_gfsk_s | sx126x_mod_params_gfsk_t |
SX126X GFSK modulation parameters structure definition. | |
typedef struct sx126x_mod_params_lora_s | sx126x_mod_params_lora_t |
SX126X LoRa modulation parameters structure definition. | |
typedef struct sx126x_pa_cfg_params_s | sx126x_pa_cfg_params_t |
SX126X power amplifier configuration parameters structure definition. | |
typedef struct sx126x_pkt_params_gfsk_s | sx126x_pkt_params_gfsk_t |
SX126X GFSK packet parameters structure definition. | |
typedef struct sx126x_pkt_params_lora_s | sx126x_pkt_params_lora_t |
SX126X LoRa packet parameters structure definition. | |
typedef struct sx126x_pkt_status_gfsk_s | sx126x_pkt_status_gfsk_t |
SX126X GFSK packet status structure definition. | |
typedef struct sx126x_pkt_status_lora_s | sx126x_pkt_status_lora_t |
SX126X LoRa packet status structure definition. | |
typedef enum sx126x_pkt_types_e | sx126x_pkt_type_t |
SX126X packet types enumeration definition. | |
typedef enum sx126x_ramp_time_e | sx126x_ramp_time_t |
SX126X power amplifier ramp-up timings enumeration definition. | |
typedef enum sx126x_reg_mods_e | sx126x_reg_mod_t |
SX126X power regulator modes enumeration definition. | |
typedef struct sx126x_rx_buffer_status_s | sx126x_rx_buffer_status_t |
SX126X RX buffer status structure definition. | |
typedef struct sx126x_rx_status_gfsk_s | sx126x_rx_status_gfsk_t |
typedef enum sx126x_sleep_cfgs_e | sx126x_sleep_cfgs_t |
SX126X sleep mode configurations definition. | |
typedef uint8_t | sx126x_standby_cfg_t |
typedef enum sx126x_standby_cfgs_e | sx126x_standby_cfgs_t |
SX126X standby modes enumeration definition. | |
typedef struct sx126x_stats_gfsk_s | sx126x_stats_gfsk_t |
SX126X GFSK reception statistics structure definition. | |
typedef struct sx126x_stats_lora_s | sx126x_stats_lora_t |
SX126X LoRa reception statistics structure definition. | |
typedef enum sx126x_status_e | sx126x_status_t |
SX126X APIs return status enumeration definition. | |
typedef enum sx126x_tcxo_ctrl_voltages_e | sx126x_tcxo_ctrl_voltages_t |
SX126X TCXO control voltages enumeration definition. | |
Enumerations | |
enum | sx126x_cad_exit_modes_e { SX126X_CAD_ONLY = 0x00 , SX126X_CAD_RX = 0x01 , SX126X_CAD_LBT = 0x10 } |
SX126X LoRa CAD exit modes enumeration definition. More... | |
enum | sx126x_cad_symbs_e { SX126X_CAD_01_SYMB = 0x00 , SX126X_CAD_02_SYMB = 0x01 , SX126X_CAD_04_SYMB = 0x02 , SX126X_CAD_08_SYMB = 0x03 , SX126X_CAD_16_SYMB = 0x04 } |
SX126X LoRa CAD number of symbols enumeration definition. More... | |
enum | sx126x_cal_mask_e { SX126X_CAL_RC64K = (1 << 0) , SX126X_CAL_RC13M = (1 << 1) , SX126X_CAL_PLL = (1 << 2) , SX126X_CAL_ADC_PULSE = (1 << 3) , SX126X_CAL_ADC_BULK_N = (1 << 4) , SX126X_CAL_ADC_BULK_P = (1 << 5) , SX126X_CAL_IMAGE = (1 << 6) , SX126X_CAL_ALL } |
Calibration settings. More... | |
enum | sx126x_chip_modes_e { SX126X_CHIP_MODE_UNUSED = 0 , SX126X_CHIP_MODE_RFU = 1 , SX126X_CHIP_MODE_STBY_RC = 2 , SX126X_CHIP_MODE_STBY_XOSC = 3 , SX126X_CHIP_MODE_FS = 4 , SX126X_CHIP_MODE_RX = 5 , SX126X_CHIP_MODE_TX = 6 } |
SX126X chip mode enumeration definition. More... | |
enum | sx126x_cmd_status_e { SX126X_CMD_STATUS_RESERVED = 0 , SX126X_CMD_STATUS_RFU = 1 , SX126X_CMD_STATUS_DATA_AVAILABLE = 2 , SX126X_CMD_STATUS_CMD_TIMEOUT = 3 , SX126X_CMD_STATUS_CMD_PROCESS_ERROR = 4 , SX126X_CMD_STATUS_CMD_EXEC_FAILURE = 5 , SX126X_CMD_STATUS_CMD_TX_DONE = 6 } |
SX126X command status enumeration definition. More... | |
enum | sx126x_errors_e { SX126X_ERRORS_RC64K_CALIBRATION = (1 << 0) , SX126X_ERRORS_RC13M_CALIBRATION = (1 << 1) , SX126X_ERRORS_PLL_CALIBRATION = (1 << 2) , SX126X_ERRORS_ADC_CALIBRATION = (1 << 3) , SX126X_ERRORS_IMG_CALIBRATION = (1 << 4) , SX126X_ERRORS_XOSC_START = (1 << 5) , SX126X_ERRORS_PLL_LOCK = (1 << 6) , SX126X_ERRORS_PA_RAMP = (1 << 8) } |
SX126X errors enumeration definition. More... | |
enum | sx126x_fallback_modes_e { SX126X_FALLBACK_STDBY_RC = 0x20 , SX126X_FALLBACK_STDBY_XOSC = 0x30 , SX126X_FALLBACK_FS = 0x40 } |
SX126X fallback modes enumeration definition. More... | |
enum | sx126x_gfsk_address_filtering_e { SX126X_GFSK_ADDRESS_FILTERING_DISABLE = 0x00 , SX126X_GFSK_ADDRESS_FILTERING_NODE_ADDRESS = 0x01 , SX126X_GFSK_ADDRESS_FILTERING_NODE_AND_BROADCAST_ADDRESSES = 0x02 } |
SX126X GFSK address filtering configuration enumeration definition. More... | |
enum | sx126x_gfsk_bw_e { SX126X_GFSK_BW_4800 = 0x1F , SX126X_GFSK_BW_5800 = 0x17 , SX126X_GFSK_BW_7300 = 0x0F , SX126X_GFSK_BW_9700 = 0x1E , SX126X_GFSK_BW_11700 = 0x16 , SX126X_GFSK_BW_14600 = 0x0E , SX126X_GFSK_BW_19500 = 0x1D , SX126X_GFSK_BW_23400 = 0x15 , SX126X_GFSK_BW_29300 = 0x0D , SX126X_GFSK_BW_39000 = 0x1C , SX126X_GFSK_BW_46900 = 0x14 , SX126X_GFSK_BW_58600 = 0x0C , SX126X_GFSK_BW_78200 = 0x1B , SX126X_GFSK_BW_93800 = 0x13 , SX126X_GFSK_BW_117300 = 0x0B , SX126X_GFSK_BW_156200 = 0x1A , SX126X_GFSK_BW_187200 = 0x12 , SX126X_GFSK_BW_234300 = 0x0A , SX126X_GFSK_BW_312000 = 0x19 , SX126X_GFSK_BW_373600 = 0x11 , SX126X_GFSK_BW_467000 = 0x09 } |
SX126X GFSK Rx bandwidth enumeration definition. More... | |
enum | sx126x_gfsk_dc_free_e { SX126X_GFSK_DC_FREE_OFF = 0x00 , SX126X_GFSK_DC_FREE_WHITENING = 0x01 } |
SX126X GFSK whitening control enumeration definition. More... | |
enum | sx126x_gfsk_pkt_len_modes_e { SX126X_GFSK_PKT_FIX_LEN = 0x00 , SX126X_GFSK_PKT_VAR_LEN = 0x01 } |
SX126X GFSK packet length enumeration definition. More... | |
enum | sx126x_gfsk_preamble_detector_e { SX126X_GFSK_PREAMBLE_DETECTOR_OFF = 0x00 , SX126X_GFSK_PREAMBLE_DETECTOR_MIN_8BITS = 0x04 , SX126X_GFSK_PREAMBLE_DETECTOR_MIN_16BITS = 0x05 , SX126X_GFSK_PREAMBLE_DETECTOR_MIN_24BITS = 0x06 , SX126X_GFSK_PREAMBLE_DETECTOR_MIN_32BITS = 0x07 } |
SX126X GFSK preamble length Rx detection size enumeration definition. More... | |
enum | sx126x_gfsk_pulse_shape_e { SX126X_GFSK_PULSE_SHAPE_OFF = 0x00 , SX126X_GFSK_PULSE_SHAPE_BT_03 = 0x08 , SX126X_GFSK_PULSE_SHAPE_BT_05 = 0x09 , SX126X_GFSK_PULSE_SHAPE_BT_07 = 0x0A , SX126X_GFSK_PULSE_SHAPE_BT_1 = 0x0B } |
SX126X GFSK modulation shaping enumeration definition. More... | |
enum | sx126x_irq_masks_e { SX126X_IRQ_NONE = (0 << 0) , SX126X_IRQ_TX_DONE = (1 << 0) , SX126X_IRQ_RX_DONE = (1 << 1) , SX126X_IRQ_PREAMBLE_DETECTED = (1 << 2) , SX126X_IRQ_SYNC_WORD_VALID = (1 << 3) , SX126X_IRQ_HEADER_VALID = (1 << 4) , SX126X_IRQ_HEADER_ERROR = (1 << 5) , SX126X_IRQ_CRC_ERROR = (1 << 6) , SX126X_IRQ_CAD_DONE = (1 << 7) , SX126X_IRQ_CAD_DETECTED = (1 << 8) , SX126X_IRQ_TIMEOUT = (1 << 9) , SX126X_IRQ_ALL } |
SX126X interrupt masks enumeration definition. More... | |
enum | sx126x_lora_bw_e { SX126X_LORA_BW_500 = 6 , SX126X_LORA_BW_250 = 5 , SX126X_LORA_BW_125 = 4 , SX126X_LORA_BW_062 = 3 , SX126X_LORA_BW_041 = 10 , SX126X_LORA_BW_031 = 2 , SX126X_LORA_BW_020 = 9 , SX126X_LORA_BW_015 = 1 , SX126X_LORA_BW_010 = 8 , SX126X_LORA_BW_007 = 0 } |
SX126X LoRa bandwidth enumeration definition. More... | |
enum | sx126x_lora_cr_e { SX126X_LORA_CR_4_5 = 0x01 , SX126X_LORA_CR_4_6 = 0x02 , SX126X_LORA_CR_4_7 = 0x03 , SX126X_LORA_CR_4_8 = 0x04 } |
SX126X LoRa coding rate enumeration definition. More... | |
enum | sx126x_lora_pkt_len_modes_e { SX126X_LORA_PKT_EXPLICIT = 0x00 , SX126X_LORA_PKT_IMPLICIT = 0x01 } |
SX126X LoRa packet length enumeration definition. More... | |
enum | sx126x_lora_sf_e { SX126X_LORA_SF5 = 0x05 , SX126X_LORA_SF6 = 0x06 , SX126X_LORA_SF7 = 0x07 , SX126X_LORA_SF8 = 0x08 , SX126X_LORA_SF9 = 0x09 , SX126X_LORA_SF10 = 0x0A , SX126X_LORA_SF11 = 0x0B , SX126X_LORA_SF12 = 0x0C } |
SX126X LoRa spreading factor enumeration definition. More... | |
enum | sx126x_pkt_types_e { SX126X_PKT_TYPE_GFSK = 0x00 , SX126X_PKT_TYPE_LORA = 0x01 } |
SX126X packet types enumeration definition. More... | |
enum | sx126x_ramp_time_e { SX126X_RAMP_10_US = 0x00 , SX126X_RAMP_20_US = 0x01 , SX126X_RAMP_40_US = 0x02 , SX126X_RAMP_80_US = 0x03 , SX126X_RAMP_200_US = 0x04 , SX126X_RAMP_800_US = 0x05 , SX126X_RAMP_1700_US = 0x06 , SX126X_RAMP_3400_US = 0x07 } |
SX126X power amplifier ramp-up timings enumeration definition. More... | |
enum | sx126x_reg_mods_e { SX126X_REG_MODE_LDO = 0x00 , SX126X_REG_MODE_DCDC = 0x01 } |
SX126X power regulator modes enumeration definition. More... | |
enum | sx126x_sleep_cfgs_e { SX126X_SLEEP_CFG_COLD_START = (0 << 2) , SX126X_SLEEP_CFG_WARM_START = (1 << 2) } |
SX126X sleep mode configurations definition. More... | |
enum | sx126x_standby_cfgs_e { SX126X_STANDBY_CFG_RC = 0x00 , SX126X_STANDBY_CFG_XOSC = 0x01 } |
SX126X standby modes enumeration definition. More... | |
enum | sx126x_status_e { SX126X_STATUS_OK = 0 , SX126X_STATUS_UNSUPPORTED_FEATURE , SX126X_STATUS_UNKNOWN_VALUE , SX126X_STATUS_ERROR } |
SX126X APIs return status enumeration definition. More... | |
enum | sx126x_tcxo_ctrl_voltages_e { SX126X_TCXO_CTRL_1_6V = 0x00 , SX126X_TCXO_CTRL_1_7V = 0x01 , SX126X_TCXO_CTRL_1_8V = 0x02 , SX126X_TCXO_CTRL_2_2V = 0x03 , SX126X_TCXO_CTRL_2_4V = 0x04 , SX126X_TCXO_CTRL_2_7V = 0x05 , SX126X_TCXO_CTRL_3_0V = 0x06 , SX126X_TCXO_CTRL_3_3V = 0x07 } |
SX126X TCXO control voltages enumeration definition. More... | |
enum | sx16x_gfsk_crc_types_e { SX126X_GFSK_CRC_OFF = 0x01 , SX126X_GFSK_CRC_1_BYTE = 0x00 , SX126X_GFSK_CRC_2_BYTES = 0x02 , SX126X_GFSK_CRC_1_BYTE_INV = 0x04 , SX126X_GFSK_CRC_2_BYTES_INV = 0x06 } |
SX126X GFSK CRC type enumeration definition. More... | |
Functions | |
sx126x_status_t | sx126x_cal (struct network_context *nctx, const sx126x_cal_mask_t param) |
Perform the calibration of the requested blocks. More... | |
sx126x_status_t | sx126x_cal_img (struct network_context *nctx, const uint32_t freq_in_hz) |
Perform device operating frequency band image rejection calibration. More... | |
sx126x_status_t | sx126x_cfg_rx_boosted (struct network_context *nctx, const bool state) |
Configure the boost mode in reception. More... | |
sx126x_status_t | sx126x_cfg_tx_clamp (struct network_context *nctx) |
Configure the Tx PA clamp. More... | |
sx126x_status_t | sx126x_clear_device_errors (struct network_context *nctx) |
Clear all active errors. More... | |
sx126x_status_t | sx126x_clear_irq_status (struct network_context *nctx, const sx126x_irq_mask_t irq_mask) |
Clear selected system interrupts. More... | |
uint32_t | sx126x_convert_freq_in_hz_to_pll_step (uint32_t freq_in_hz) |
Get the number of PLL steps for a given frequency in Hertz. More... | |
uint32_t | sx126x_convert_timeout_in_ms_to_rtc_step (uint32_t timeout_in_ms) |
Get the number of RTC steps for a given timeout in millisecond. More... | |
sx126x_status_t | sx126x_get_and_clear_irq_status (struct network_context *nctx, sx126x_irq_mask_t *irq) |
Clears any radio irq status flags that are set and returns the flags that were cleared. More... | |
sx126x_status_t | sx126x_get_device_errors (struct network_context *nctx, sx126x_errors_mask_t *errors) |
Get the list of all active errors. More... | |
sx126x_status_t | sx126x_get_gfsk_bw_param (const uint32_t bw, uint8_t *param) |
Get the parameter corresponding to a GFSK Rx bandwith immediately above the minimum requested one. More... | |
sx126x_status_t | sx126x_get_gfsk_pkt_status (struct network_context *nctx, sx126x_pkt_status_gfsk_t *pkt_status) |
Get the status of the last GFSK packet received. More... | |
sx126x_status_t | sx126x_get_gfsk_stats (struct network_context *nctx, sx126x_stats_gfsk_t *stats) |
Get the statistics about GFSK communication. More... | |
uint32_t | sx126x_get_gfsk_time_on_air_in_ms (const sx126x_pkt_params_gfsk_t *pkt_p, const sx126x_mod_params_gfsk_t *mod_p) |
Get the time on air in ms for GFSK transmission. More... | |
uint32_t | sx126x_get_gfsk_time_on_air_numerator (const sx126x_pkt_params_gfsk_t *pkt_p) |
Compute the numerator for GFSK time-on-air computation. More... | |
sx126x_status_t | sx126x_get_irq_status (struct network_context *nctx, sx126x_irq_mask_t *irq) |
Get system interrupt status. More... | |
uint32_t | sx126x_get_lora_bw_in_hz (sx126x_lora_bw_t bw) |
Get the actual value in Hertz of a given LoRa bandwidth. More... | |
sx126x_status_t | sx126x_get_lora_pkt_status (struct network_context *nctx, sx126x_pkt_status_lora_t *pkt_status) |
Get the status of the last LoRa packet received. More... | |
sx126x_status_t | sx126x_get_lora_stats (struct network_context *nctx, sx126x_stats_lora_t *stats) |
Get the statistics about LoRa communication. More... | |
uint32_t | sx126x_get_lora_time_on_air_in_ms (const sx126x_pkt_params_lora_t *pkt_p, const sx126x_mod_params_lora_t *mod_p) |
Get the time on air in ms for LoRa transmission. More... | |
uint32_t | sx126x_get_lora_time_on_air_numerator (const sx126x_pkt_params_lora_t *pkt_p, const sx126x_mod_params_lora_t *mod_p) |
Compute the numerator for LoRa time-on-air computation. More... | |
sx126x_status_t | sx126x_get_pkt_type (struct network_context *nctx, sx126x_pkt_type_t *pkt_type) |
Get the current packet type. More... | |
sx126x_status_t | sx126x_get_random_numbers (struct network_context *nctx, uint32_t *numbers, unsigned int n) |
Generate one or more 32-bit random numbers. More... | |
sx126x_status_t | sx126x_get_rssi_inst (struct network_context *nctx, int16_t *rssi_in_dbm) |
Get the instantaneous RSSI value. More... | |
sx126x_status_t | sx126x_get_rx_buffer_status (struct network_context *nctx, sx126x_rx_buffer_status_t *rx_buffer_status) |
Get the current Rx buffer status for both LoRa and GFSK Rx operations. More... | |
sx126x_status_t | sx126x_get_status (struct network_context *nctx, sx126x_chip_status_t *radio_status) |
Get the chip status. More... | |
sx126x_status_t | sx126x_read_buffer (struct network_context *nctx, const uint8_t offset, uint8_t *buffer, const uint8_t size) |
Read data from radio Rx buffer memory space. More... | |
sx126x_status_t | sx126x_read_register (struct network_context *nctx, const uint16_t address, uint8_t *buffer, const uint8_t size) |
Read data from register memory space. More... | |
sx126x_status_t | sx126x_reset (struct network_context *nctx) |
Perform a hard reset of the chip. More... | |
sx126x_status_t | sx126x_reset_stats (struct network_context *nctx) |
Reset all the statistics for both Lora and GFSK communications. More... | |
sx126x_status_t | sx126x_set_buffer_base_address (struct network_context *nctx, const uint8_t tx_base_address, const uint8_t rx_base_address) |
Set buffer start addresses for both Tx and Rx operations. More... | |
sx126x_status_t | sx126x_set_cad (struct network_context *nctx) |
Set the chip in CAD (Channel Activity Detection) mode. More... | |
sx126x_status_t | sx126x_set_cad_params (struct network_context *nctx, const sx126x_cad_params_t *params) |
Set the parameters for CAD operation. More... | |
sx126x_status_t | sx126x_set_dio2_as_rf_sw_ctrl (struct network_context *nctx, const bool enable) |
Configure the embedded RF switch control. More... | |
sx126x_status_t | sx126x_set_dio3_as_tcxo_ctrl (struct network_context *nctx, const sx126x_tcxo_ctrl_voltages_t tcxo_voltage, const uint32_t timeout) |
Configure the embedded TCXO switch control. More... | |
sx126x_status_t | sx126x_set_dio_irq_params (struct network_context *nctx, const uint16_t irq_mask, const uint16_t dio1_mask, const uint16_t dio2_mask, const uint16_t dio3_mask) |
Set which interrupt signals are redirected to the dedicated DIO pin. More... | |
sx126x_status_t | sx126x_set_fs (struct network_context *nctx) |
Set the chip in frequency synthesis mode. More... | |
sx126x_status_t | sx126x_set_gfsk_crc_polynomial (struct network_context *nctx, const uint16_t polynomial) |
Configure the polynomial used to compute CRC in GFSK packet. More... | |
sx126x_status_t | sx126x_set_gfsk_crc_seed (struct network_context *nctx, uint16_t seed) |
Configure the seed used to compute CRC in GFSK packet. More... | |
sx126x_status_t | sx126x_set_gfsk_mod_params (struct network_context *nctx, const sx126x_mod_params_gfsk_t *params) |
Set the modulation parameters for GFSK packets. More... | |
sx126x_status_t | sx126x_set_gfsk_pkt_params (struct network_context *nctx, const sx126x_pkt_params_gfsk_t *params) |
Set the packet parameters for GFSK packets. More... | |
sx126x_status_t | sx126x_set_gfsk_sync_word (struct network_context *nctx, const uint8_t *sync_word, const uint8_t sync_word_len) |
Configure the sync word used in GFSK packet. More... | |
sx126x_status_t | sx126x_set_gfsk_whitening_seed (struct network_context *nctx, const uint16_t seed) |
Configure the whitening seed used in GFSK packet. More... | |
sx126x_status_t | sx126x_set_lora_mod_params (struct network_context *nctx, const sx126x_mod_params_lora_t *params) |
Set the modulation parameters for LoRa packets. More... | |
sx126x_status_t | sx126x_set_lora_pkt_params (struct network_context *nctx, const sx126x_pkt_params_lora_t *params) |
Set the packet parameters for LoRa packets. More... | |
sx126x_status_t | sx126x_set_lora_symb_nb_timeout (struct network_context *nctx, const uint8_t nb_of_symbs) |
sx126x_status_t | sx126x_set_lora_sync_word (struct network_context *nctx, const uint8_t sync_word) |
Configure the sync word used in LoRa packet. More... | |
sx126x_status_t | sx126x_set_ocp_value (struct network_context *nctx, const uint8_t ocp_in_step_of_2_5_ma) |
Configure the Over Current Protection (OCP) value. More... | |
sx126x_status_t | sx126x_set_pa_cfg (struct network_context *nctx, const sx126x_pa_cfg_params_t *params) |
Configure the PA (Power Amplifier) More... | |
sx126x_status_t | sx126x_set_pkt_type (struct network_context *nctx, const sx126x_pkt_type_t pkt_type) |
Set the packet type. More... | |
sx126x_status_t | sx126x_set_reg_mode (struct network_context *nctx, const sx126x_reg_mod_t mode) |
Configure the regulator mode to be used. More... | |
sx126x_status_t | sx126x_set_rf_freq (struct network_context *nctx, const uint32_t freq_in_hz) |
Set the RF frequency for future radio operations. More... | |
sx126x_status_t | sx126x_set_rf_freq_in_pll_steps (struct network_context *nctx, const uint32_t freq) |
Set the RF frequency for future radio operations - parameter in PLL steps. More... | |
sx126x_status_t | sx126x_set_rx (struct network_context *nctx, const uint32_t timeout_in_ms) |
Set the chip in reception mode. More... | |
sx126x_status_t | sx126x_set_rx_duty_cycle (struct network_context *nctx, const uint32_t rx_time_in_ms, const uint32_t sleep_time_in_ms) |
Set the chip in reception mode with duty cycling. More... | |
sx126x_status_t | sx126x_set_rx_duty_cycle_with_timings_in_rtc_step (struct network_context *nctx, const uint32_t rx_time_in_rtc_step, const uint32_t sleep_time_in_rtc_step) |
Set the chip in reception mode with duty cycling. More... | |
sx126x_status_t | sx126x_set_rx_tx_fallback_mode (struct network_context *nctx, const sx126x_fallback_modes_t fallback_mode) |
Set chip mode to be used after successful transmission or reception. More... | |
sx126x_status_t | sx126x_set_rx_with_timeout_in_rtc_step (struct network_context *nctx, const uint32_t timeout_in_rtc_step) |
Set the chip in reception mode. More... | |
sx126x_status_t | sx126x_set_sleep (struct network_context *nctx, const sx126x_sleep_cfgs_t cfg) |
Set the chip in sleep mode. More... | |
sx126x_status_t | sx126x_set_standby (struct network_context *nctx, const sx126x_standby_cfg_t cfg) |
Set the chip in stand-by mode. More... | |
sx126x_status_t | sx126x_set_trimming_capacitor_values (struct network_context *nctx, const uint8_t trimming_cap_xta, const uint8_t trimming_cap_xtb) |
Configure the internal trimming capacitor values. More... | |
sx126x_status_t | sx126x_set_tx (struct network_context *nctx, const uint32_t timeout_in_ms) |
Set the chip in transmission mode. More... | |
sx126x_status_t | sx126x_set_tx_cw (struct network_context *nctx) |
Set the chip in Tx continuous wave (RF tone). More... | |
sx126x_status_t | sx126x_set_tx_infinite_preamble (struct network_context *nctx) |
Set the chip in Tx infinite preamble (modulated signal). More... | |
sx126x_status_t | sx126x_set_tx_params (struct network_context *nctx, const int8_t pwr_in_dbm, const sx126x_ramp_time_t ramp_time) |
Set the parameters for TX power and power amplifier ramp time. More... | |
sx126x_status_t | sx126x_set_tx_with_timeout_in_rtc_step (struct network_context *nctx, const uint32_t timeout_in_rtc_step) |
Set the chip in transmission mode. More... | |
sx126x_status_t | sx126x_stop_rtc (struct network_context *nctx) |
Stop the RTC and clear the related event. More... | |
sx126x_status_t | sx126x_stop_timer_on_preamble (struct network_context *nctx, const bool enable) |
Configure the event on which the Rx timeout is stopped. More... | |
sx126x_status_t | sx126x_wakeup (struct network_context *nctx) |
Wake the radio up from sleep mode. More... | |
sx126x_status_t | sx126x_write_buffer (struct network_context *nctx, const uint8_t offset, const uint8_t *buffer, const uint8_t size) |
Write data into radio Tx buffer memory space. More... | |
sx126x_status_t | sx126x_write_register (struct network_context *nctx, const uint16_t address, const uint8_t *buffer, const uint8_t size) |
Write data into register memory space. More... | |
SX126x radio driver definition.
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:
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.
Definition in file sx126x.h.
#define SX126X_CHIP_MODES_MASK (0x07UL << SX126X_CHIP_MODES_POS) |
#define SX126X_CMD_STATUS_MASK (0x07UL << SX126X_CMD_STATUS_POS) |
#define SX126X_GFSK_RX_STATUS_ABORT_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_ABORT_ERROR_POS) |
#define SX126X_GFSK_RX_STATUS_ADRS_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_ADRS_ERROR_POS) |
#define SX126X_GFSK_RX_STATUS_CRC_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_CRC_ERROR_POS) |
#define SX126X_GFSK_RX_STATUS_LENGTH_ERROR_MASK (0x01UL << SX126X_GFSK_RX_STATUS_LENGTH_ERROR_POS) |
#define SX126X_GFSK_RX_STATUS_PKT_RECEIVED_MASK (0x01UL << SX126X_GFSK_RX_STATUS_PKT_RECEIVED_POS) |
#define SX126X_GFSK_RX_STATUS_PKT_SENT_MASK (0x01UL << SX126X_GFSK_RX_STATUS_PKT_SENT_POS) |
#define SX126X_MAX_TIMEOUT_IN_MS (SX126X_MAX_TIMEOUT_IN_RTC_STEP / 64) |
Maximum value for parameter timeout_in_ms in both functions sx126x_set_rx and sx126x_set_tx.
#define SX126X_MAX_TIMEOUT_IN_RTC_STEP 0x00FFFFFE |
Maximum value for parameter timeout_in_rtc_step in both functions sx126x_set_rx_with_timeout_in_rtc_step and sx126x_set_tx_with_timeout_in_rtc_step.
#define SX126X_RX_CONTINUOUS 0x00FFFFFF |
Timeout parameter in sx126x_set_rx_with_timeout_in_rtc_step to launch a continuous reception.
#define SX126X_RX_SINGLE_MODE 0x00000000 |
Timeout parameter in sx126x_set_rx_with_timeout_in_rtc_step to set the chip in reception until a reception occurs.
typedef enum sx126x_cad_exit_modes_e sx126x_cad_exit_modes_t |
SX126X LoRa CAD exit modes enumeration definition.
typedef enum sx126x_cad_symbs_e sx126x_cad_symbs_t |
SX126X LoRa CAD number of symbols enumeration definition.
enum sx126x_cad_symbs_e |
enum sx126x_cal_mask_e |
enum sx126x_chip_modes_e |
enum sx126x_cmd_status_e |
enum sx126x_errors_e |
enum sx126x_gfsk_bw_e |
enum sx126x_irq_masks_e |
enum sx126x_lora_bw_e |
enum sx126x_lora_cr_e |
enum sx126x_lora_sf_e |
enum sx126x_pkt_types_e |
enum sx126x_ramp_time_e |
enum sx126x_reg_mods_e |
enum sx126x_sleep_cfgs_e |
enum sx126x_status_e |
sx126x_status_t sx126x_cal | ( | struct network_context * | nctx, |
const sx126x_cal_mask_t | param | ||
) |
Perform the calibration of the requested blocks.
[in] | context | Chip implementation context. |
[in] | param | Mask holding the blocks to be calibrated |
sx126x_status_t sx126x_cal_img | ( | struct network_context * | nctx, |
const uint32_t | freq_in_hz | ||
) |
sx126x_status_t sx126x_cfg_rx_boosted | ( | struct network_context * | nctx, |
const bool | state | ||
) |
Configure the boost mode in reception.
[in] | context | Chip implementation context. |
[in] | state | Boost mode activation |
sx126x_status_t sx126x_cfg_tx_clamp | ( | struct network_context * | nctx | ) |
Configure the Tx PA clamp.
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_clear_device_errors | ( | struct network_context * | nctx | ) |
sx126x_status_t sx126x_clear_irq_status | ( | struct network_context * | nctx, |
const sx126x_irq_mask_t | irq_mask | ||
) |
Clear selected system interrupts.
[in] | context | Chip implementation context. |
[in] | irq_mask | Variable that holds the system interrupt to be cleared |
uint32_t sx126x_convert_freq_in_hz_to_pll_step | ( | uint32_t | freq_in_hz | ) |
Get the number of PLL steps for a given frequency in Hertz.
[in] | freq_in_hz | Frequency in Hertz |
Definition at line 993 of file sx126x.c.
References SX126X_PLL_STEP_SCALED, and SX126X_PLL_STEP_SHIFT_AMOUNT.
uint32_t sx126x_convert_timeout_in_ms_to_rtc_step | ( | uint32_t | timeout_in_ms | ) |
Get the number of RTC steps for a given timeout in millisecond.
[in] | timeout_in_ms | Timeout in millisecond |
Definition at line 1007 of file sx126x.c.
References SX126X_RTC_FREQ_IN_HZ.
sx126x_status_t sx126x_get_and_clear_irq_status | ( | struct network_context * | nctx, |
sx126x_irq_mask_t * | irq | ||
) |
sx126x_status_t sx126x_get_device_errors | ( | struct network_context * | nctx, |
sx126x_errors_mask_t * | errors | ||
) |
sx126x_status_t sx126x_get_gfsk_bw_param | ( | const uint32_t | bw, |
uint8_t * | param | ||
) |
Get the parameter corresponding to a GFSK Rx bandwith immediately above the minimum requested one.
[in] | bw | Minimum required bandwith in Hz |
[out] | param | Pointer to a value to store the parameter |
sx126x_status_t sx126x_get_gfsk_pkt_status | ( | struct network_context * | nctx, |
sx126x_pkt_status_gfsk_t * | pkt_status | ||
) |
Get the status of the last GFSK packet received.
[in] | context | Chip implementation context. |
[out] | pkt_status | Pointer to a structure to store the packet status |
sx126x_status_t sx126x_get_gfsk_stats | ( | struct network_context * | nctx, |
sx126x_stats_gfsk_t * | stats | ||
) |
Get the statistics about GFSK communication.
[in] | context | Chip implementation context. |
[out] | stats | Pointer to a structure to store GFSK-related statistics |
uint32_t sx126x_get_gfsk_time_on_air_in_ms | ( | const sx126x_pkt_params_gfsk_t * | pkt_p, |
const sx126x_mod_params_gfsk_t * | mod_p | ||
) |
Get the time on air in ms for GFSK transmission.
[in] | pkt_p | Pointer to a structure holding the GFSK packet parameters |
[in] | mod_p | Pointer to a structure holding the GFSK modulation parameters |
uint32_t sx126x_get_gfsk_time_on_air_numerator | ( | const sx126x_pkt_params_gfsk_t * | pkt_p | ) |
Compute the numerator for GFSK time-on-air computation.
[in] | pkt_p | Pointer to the structure holding the GFSK packet parameters |
sx126x_status_t sx126x_get_irq_status | ( | struct network_context * | nctx, |
sx126x_irq_mask_t * | irq | ||
) |
Get system interrupt status.
[in] | context | Chip implementation context. |
[out] | irq | Pointer to a variable for holding the system interrupt status |
uint32_t sx126x_get_lora_bw_in_hz | ( | sx126x_lora_bw_t | bw | ) |
Get the actual value in Hertz of a given LoRa bandwidth.
[in] | bw | LoRa bandwidth parameter |
Definition at line 850 of file sx126x.c.
Referenced by sx126x_get_lora_time_on_air_in_ms().
sx126x_status_t sx126x_get_lora_pkt_status | ( | struct network_context * | nctx, |
sx126x_pkt_status_lora_t * | pkt_status | ||
) |
sx126x_status_t sx126x_get_lora_stats | ( | struct network_context * | nctx, |
sx126x_stats_lora_t * | stats | ||
) |
uint32_t sx126x_get_lora_time_on_air_in_ms | ( | const sx126x_pkt_params_lora_t * | pkt_p, |
const sx126x_mod_params_lora_t * | mod_p | ||
) |
Get the time on air in ms for LoRa transmission.
[in] | pkt_p | Pointer to a structure holding the LoRa packet parameters |
[in] | mod_p | Pointer to a structure holding the LoRa modulation parameters |
Definition at line 927 of file sx126x.c.
References sx126x_mod_params_lora_s::bw, sx126x_get_lora_bw_in_hz(), and sx126x_get_lora_time_on_air_numerator().
uint32_t sx126x_get_lora_time_on_air_numerator | ( | const sx126x_pkt_params_lora_t * | pkt_p, |
const sx126x_mod_params_lora_t * | mod_p | ||
) |
Compute the numerator for LoRa time-on-air computation.
[in] | pkt_p | Pointer to the structure holding the LoRa packet parameters |
[in] | mod_p | Pointer to the structure holding the LoRa modulation parameters |
Definition at line 889 of file sx126x.c.
References sx126x_mod_params_lora_s::cr, sx126x_pkt_params_lora_s::crc_is_on, sx126x_pkt_params_lora_s::header_type, sx126x_mod_params_lora_s::ldro, sx126x_pkt_params_lora_s::pld_len_in_bytes, sx126x_pkt_params_lora_s::preamble_len_in_symb, sx126x_mod_params_lora_s::sf, and SX126X_LORA_PKT_IMPLICIT.
Referenced by sx126x_get_lora_time_on_air_in_ms().
sx126x_status_t sx126x_get_pkt_type | ( | struct network_context * | nctx, |
sx126x_pkt_type_t * | pkt_type | ||
) |
sx126x_status_t sx126x_get_random_numbers | ( | struct network_context * | nctx, |
uint32_t * | numbers, | ||
unsigned int | n | ||
) |
Generate one or more 32-bit random numbers.
[in] | context | Chip implementation context. |
[out] | numbers | Array where numbers will be stored. |
[in] | n | Number of desired random numbers. |
This code can potentially result in interrupt generation. It is the responsibility of the calling code to disable radio interrupts before calling this function, and re-enable them afterwards if necessary, or be certain that any interrupts generated during this process will not cause undesired side-effects in the software.
Please note that the random numbers produced by the generator do not have a uniform or Gaussian distribution. If uniformity is needed, perform appropriate software post-processing.
sx126x_status_t sx126x_get_rssi_inst | ( | struct network_context * | nctx, |
int16_t * | rssi_in_dbm | ||
) |
Get the instantaneous RSSI value.
[in] | context | Chip implementation context. |
[out] | rssi_in_dbm | Pointer to a variable to store the RSSI value in dBm |
sx126x_status_t sx126x_get_rx_buffer_status | ( | struct network_context * | nctx, |
sx126x_rx_buffer_status_t * | rx_buffer_status | ||
) |
Get the current Rx buffer status for both LoRa and GFSK Rx operations.
This function is used to get the length of the received payload and the start address to be used when reading data from the Rx buffer.
[in] | context | Chip implementation context. |
[out] | rx_buffer_status | Pointer to a structure to store the current status |
sx126x_status_t sx126x_get_status | ( | struct network_context * | nctx, |
sx126x_chip_status_t * | radio_status | ||
) |
sx126x_status_t sx126x_read_buffer | ( | struct network_context * | nctx, |
const uint8_t | offset, | ||
uint8_t * | buffer, | ||
const uint8_t | size | ||
) |
Read data from radio Rx buffer memory space.
[in] | context | Chip implementation context. |
[in] | offset | Start address in the Rx buffer of the chip |
[in] | buffer | The buffer of bytes to be filled with content from Rx radio buffer |
[in] | size | The number of bytes to read from the Rx radio buffer |
sx126x_status_t sx126x_read_register | ( | struct network_context * | nctx, |
const uint16_t | address, | ||
uint8_t * | buffer, | ||
const uint8_t | size | ||
) |
Read data from register memory space.
[in] | context | Chip implementation context. |
[in] | address | The register memory address to start reading operation |
[in] | buffer | The buffer of bytes to be filled with data from registers |
[in] | size | Number of bytes to read from memory, starting from address |
sx126x_status_t sx126x_reset | ( | struct network_context * | nctx | ) |
sx126x_status_t sx126x_reset_stats | ( | struct network_context * | nctx | ) |
sx126x_status_t sx126x_set_buffer_base_address | ( | struct network_context * | nctx, |
const uint8_t | tx_base_address, | ||
const uint8_t | rx_base_address | ||
) |
sx126x_status_t sx126x_set_cad | ( | struct network_context * | nctx | ) |
Set the chip in CAD (Channel Activity Detection) mode.
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_set_cad_params | ( | struct network_context * | nctx, |
const sx126x_cad_params_t * | params | ||
) |
Set the parameters for CAD operation.
[in] | context | Chip implementation context. |
[in] | params | The structure of CAD configuration |
sx126x_status_t sx126x_set_dio2_as_rf_sw_ctrl | ( | struct network_context * | nctx, |
const bool | enable | ||
) |
sx126x_status_t sx126x_set_dio3_as_tcxo_ctrl | ( | struct network_context * | nctx, |
const sx126x_tcxo_ctrl_voltages_t | tcxo_voltage, | ||
const uint32_t | timeout | ||
) |
Configure the embedded TCXO switch control.
[in] | context | Chip implementation context. |
[in] | tcxo_voltage | Voltage used to power the TCXO. |
[in] | timeout | Time needed for the TCXO to be stable. |
sx126x_status_t sx126x_set_dio_irq_params | ( | struct network_context * | nctx, |
const uint16_t | irq_mask, | ||
const uint16_t | dio1_mask, | ||
const uint16_t | dio2_mask, | ||
const uint16_t | dio3_mask | ||
) |
Set which interrupt signals are redirected to the dedicated DIO pin.
[in] | context | Chip implementation context. |
[in] | irq_mask | Variable that holds the system interrupt mask |
[in] | dio1_mask | Variable that holds the interrupt mask for dio1 |
[in] | dio2_mask | Variable that holds the interrupt mask for dio2 |
[in] | dio3_mask | Variable that holds the interrupt mask for dio3 |
sx126x_status_t sx126x_set_fs | ( | struct network_context * | nctx | ) |
Set the chip in frequency synthesis mode.
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_set_gfsk_crc_polynomial | ( | struct network_context * | nctx, |
const uint16_t | polynomial | ||
) |
Configure the polynomial used to compute CRC in GFSK packet.
[in] | context | Chip implementation context. |
[in] | polynomial | Polynomial value used to compute the CRC value |
sx126x_status_t sx126x_set_gfsk_crc_seed | ( | struct network_context * | nctx, |
uint16_t | seed | ||
) |
Configure the seed used to compute CRC in GFSK packet.
[in] | context | Chip implementation context. |
[in] | seed | Seed value used to compute the CRC value |
sx126x_status_t sx126x_set_gfsk_mod_params | ( | struct network_context * | nctx, |
const sx126x_mod_params_gfsk_t * | params | ||
) |
Set the modulation parameters for GFSK packets.
[in] | context | Chip implementation context. |
[in] | params | The structure of GFSK modulation configuration |
sx126x_status_t sx126x_set_gfsk_pkt_params | ( | struct network_context * | nctx, |
const sx126x_pkt_params_gfsk_t * | params | ||
) |
Set the packet parameters for GFSK packets.
[in] | context | Chip implementation context. |
[in] | params | The structure of GFSK packet configuration |
sx126x_status_t sx126x_set_gfsk_sync_word | ( | struct network_context * | nctx, |
const uint8_t * | sync_word, | ||
const uint8_t | sync_word_len | ||
) |
Configure the sync word used in GFSK packet.
[in] | context | Chip implementation context. |
[in] | sync_word | Buffer holding the sync word to be configured |
[in] | sync_word_len | Sync word length in byte |
sx126x_status_t sx126x_set_gfsk_whitening_seed | ( | struct network_context * | nctx, |
const uint16_t | seed | ||
) |
Configure the whitening seed used in GFSK packet.
[in] | context | Chip implementation context. |
[in] | seed | Seed value used in data whitening |
sx126x_status_t sx126x_set_lora_mod_params | ( | struct network_context * | nctx, |
const sx126x_mod_params_lora_t * | params | ||
) |
Set the modulation parameters for LoRa packets.
[in] | context | Chip implementation context. |
[in] | params | The structure of LoRa modulation configuration |
sx126x_status_t sx126x_set_lora_pkt_params | ( | struct network_context * | nctx, |
const sx126x_pkt_params_lora_t * | params | ||
) |
Set the packet parameters for LoRa packets.
[in] | context | Chip implementation context. |
[in] | params | The structure of LoRa packet configuration |
sx126x_status_t sx126x_set_lora_symb_nb_timeout | ( | struct network_context * | nctx, |
const uint8_t | nb_of_symbs | ||
) |
sx126x_status_t sx126x_set_lora_sync_word | ( | struct network_context * | nctx, |
const uint8_t | sync_word | ||
) |
Configure the sync word used in LoRa packet.
[in] | context | Chip implementation context. |
[in] | sync_word | Sync word to be configured |
sx126x_status_t sx126x_set_ocp_value | ( | struct network_context * | nctx, |
const uint8_t | ocp_in_step_of_2_5_ma | ||
) |
Configure the Over Current Protection (OCP) value.
[in] | context | Chip implementation context. |
[in] | ocp_in_step_of_2_5_ma | OCP value given in steps of 2.5 mA |
sx126x_status_t sx126x_set_pa_cfg | ( | struct network_context * | nctx, |
const sx126x_pa_cfg_params_t * | params | ||
) |
Configure the PA (Power Amplifier)
This command is used to differentiate the SX1261 from the SX1262 / SX1268. When using this command, the user selects the PA to be used by the device as well as its configuration.
[in] | context | Chip implementation context. |
[in] | params | Power amplifier configuration parameters |
sx126x_status_t sx126x_set_pkt_type | ( | struct network_context * | nctx, |
const sx126x_pkt_type_t | pkt_type | ||
) |
sx126x_status_t sx126x_set_reg_mode | ( | struct network_context * | nctx, |
const sx126x_reg_mod_t | mode | ||
) |
Configure the regulator mode to be used.
[in] | context | Chip implementation context. |
[in] | mode | Regulator mode configuration. |
sx126x_status_t sx126x_set_rf_freq | ( | struct network_context * | nctx, |
const uint32_t | freq_in_hz | ||
) |
Set the RF frequency for future radio operations.
[in] | context | Chip implementation context. |
[in] | freq_in_hz | The frequency in Hz to set for radio operations |
sx126x_status_t sx126x_set_rf_freq_in_pll_steps | ( | struct network_context * | nctx, |
const uint32_t | freq | ||
) |
Set the RF frequency for future radio operations - parameter in PLL steps.
[in] | context | Chip implementation context. |
[in] | freq | The frequency in PLL steps to set for radio operations |
sx126x_status_t sx126x_set_rx | ( | struct network_context * | nctx, |
const uint32_t | timeout_in_ms | ||
) |
Set the chip in reception mode.
Special values | Meaning |
---|---|
SX126X_RX_SINGLE_MODE | Single: the chip stays in RX mode until a reception occurs, then switch to standby RC |
[in] | context | Chip implementation context. |
[in] | timeout_in_ms | The timeout configuration in millisecond for Rx operation |
sx126x_status_t sx126x_set_rx_duty_cycle | ( | struct network_context * | nctx, |
const uint32_t | rx_time_in_ms, | ||
const uint32_t | sleep_time_in_ms | ||
) |
Set the chip in reception mode with duty cycling.
[in] | context | Chip implementation context. |
[in] | rx_time_in_ms | The timeout of Rx period - in millisecond |
[in] | sleep_time_in_ms | The length of sleep period - in millisecond |
sx126x_status_t sx126x_set_rx_duty_cycle_with_timings_in_rtc_step | ( | struct network_context * | nctx, |
const uint32_t | rx_time_in_rtc_step, | ||
const uint32_t | sleep_time_in_rtc_step | ||
) |
Set the chip in reception mode with duty cycling.
[in] | context | Chip implementation context. |
[in] | rx_time | The timeout of Rx period |
[in] | sleep_time | The length of sleep period |
sx126x_status_t sx126x_set_rx_tx_fallback_mode | ( | struct network_context * | nctx, |
const sx126x_fallback_modes_t | fallback_mode | ||
) |
Set chip mode to be used after successful transmission or reception.
[in] | context | Chip implementation context. |
[in] | fallback_mode | Selected fallback mode |
sx126x_status_t sx126x_set_rx_with_timeout_in_rtc_step | ( | struct network_context * | nctx, |
const uint32_t | timeout_in_rtc_step | ||
) |
Set the chip in reception mode.
Special values | Meaning |
---|---|
SX126X_RX_SINGLE_MODE | Single: the chip stays in RX mode until a reception occurs, then switch to standby RC |
SX126X_RX_CONTINUOUS | Continuous: the chip stays in RX mode even after reception of a packet |
[in] | context | Chip implementation context. |
[in] | timeout_in_rtc_step | The timeout configuration for Rx operation |
sx126x_status_t sx126x_set_sleep | ( | struct network_context * | nctx, |
const sx126x_sleep_cfgs_t | cfg | ||
) |
Set the chip in sleep mode.
[in] | context | Chip implementation context. |
[in] | cfg | Sleep mode configuration |
sx126x_status_t sx126x_set_standby | ( | struct network_context * | nctx, |
const sx126x_standby_cfg_t | cfg | ||
) |
sx126x_status_t sx126x_set_trimming_capacitor_values | ( | struct network_context * | nctx, |
const uint8_t | trimming_cap_xta, | ||
const uint8_t | trimming_cap_xtb | ||
) |
Configure the internal trimming capacitor values.
[in] | context | Chip implementation context. |
[in] | trimming_cap_xta | Value for the trimming capacitor connected to XTA pin |
[in] | trimming_cap_xtb | Value for the trimming capacitor connected to XTB pin |
sx126x_status_t sx126x_set_tx | ( | struct network_context * | nctx, |
const uint32_t | timeout_in_ms | ||
) |
Set the chip in transmission mode.
[in] | context | Chip implementation context. |
[in] | timeout_in_ms | The timeout configuration in millisecond for Tx operation |
sx126x_status_t sx126x_set_tx_cw | ( | struct network_context * | nctx | ) |
Set the chip in Tx continuous wave (RF tone).
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_set_tx_infinite_preamble | ( | struct network_context * | nctx | ) |
Set the chip in Tx infinite preamble (modulated signal).
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_set_tx_params | ( | struct network_context * | nctx, |
const int8_t | pwr_in_dbm, | ||
const sx126x_ramp_time_t | ramp_time | ||
) |
sx126x_status_t sx126x_set_tx_with_timeout_in_rtc_step | ( | struct network_context * | nctx, |
const uint32_t | timeout_in_rtc_step | ||
) |
Set the chip in transmission mode.
[in] | context | Chip implementation context. |
[in] | timeout_in_rtc_step | The timeout configuration for Tx operation |
sx126x_status_t sx126x_stop_rtc | ( | struct network_context * | nctx | ) |
Stop the RTC and clear the related event.
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_stop_timer_on_preamble | ( | struct network_context * | nctx, |
const bool | enable | ||
) |
Configure the event on which the Rx timeout is stopped.
[in] | context | Chip implementation context. |
[in] | enable | If true, the timer stops on Syncword / Header detection. |
sx126x_status_t sx126x_wakeup | ( | struct network_context * | nctx | ) |
Wake the radio up from sleep mode.
[in] | context | Chip implementation context. |
sx126x_status_t sx126x_write_buffer | ( | struct network_context * | nctx, |
const uint8_t | offset, | ||
const uint8_t * | buffer, | ||
const uint8_t | size | ||
) |
Write data into radio Tx buffer memory space.
[in] | context | Chip implementation context. |
[in] | offset | Start address in the Tx buffer of the chip |
[in] | buffer | The buffer of bytes to write into radio buffer |
[in] | size | The number of bytes to write into Tx radio buffer |
sx126x_status_t sx126x_write_register | ( | struct network_context * | nctx, |
const uint16_t | address, | ||
const uint8_t * | buffer, | ||
const uint8_t | size | ||
) |
Write data into register memory space.
[in] | context | Chip implementation context. |
[in] | address | The register memory address to start writing operation |
[in] | buffer | The buffer of bytes to write into memory. |
[in] | size | Number of bytes to write into memory, starting from address |