LibDriver SX1262
Loading...
Searching...
No Matches
sx1262 command driver function

sx1262 command driver modules More...

Collaboration diagram for sx1262 command driver function:

Data Structures

struct  sx1262_handle_s
 sx1262 handle structure definition More...
struct  sx1262_info_s
 sx1262 information structure definition More...

Typedefs

typedef struct sx1262_handle_s sx1262_handle_t
 sx1262 handle structure definition
typedef struct sx1262_info_s sx1262_info_t
 sx1262 information structure definition

Enumerations

enum  sx1262_bool_t { SX1262_BOOL_FALSE = 0x00 , SX1262_BOOL_TRUE = 0x01 }
 sx1262 bool enumeration definition More...
enum  sx1262_start_mode_t { SX1262_START_MODE_COLD = 0x00 , SX1262_START_MODE_WARM = 0x01 }
 sx1262 start mode enumeration definition More...
enum  sx1262_clock_source_t { SX1262_CLOCK_SOURCE_RC_13M = 0x00 , SX1262_CLOCK_SOURCE_XTAL_32MHZ = 0x01 }
 sx1262 clock source enumeration definition More...
enum  sx1262_regulator_mode_t { SX1262_REGULATOR_MODE_ONLY_LDO = 0x00 , SX1262_REGULATOR_MODE_DC_DC_LDO = 0x01 }
 sx1262 regulator mode enumeration definition More...
enum  sx1262_calibration_t {
  SX1262_CALIBRATION_RC64K = (1 << 0) , SX1262_CALIBRATION_RC13M = (1 << 1) , SX1262_CALIBRATION_PLL = (1 << 2) , SX1262_CALIBRATION_ADC_PULSE = (1 << 3) ,
  SX1262_CALIBRATION_ADC_BULK_N = (1 << 4) , SX1262_CALIBRATION_ADC_BULK_P = (1 << 5) , SX1262_CALIBRATION_IMAGE = (1 << 6)
}
 sx1262 calibration enumeration definition More...
enum  sx1262_irq_t {
  SX1262_IRQ_TX_DONE = (1 << 0) , SX1262_IRQ_RX_DONE = (1 << 1) , SX1262_IRQ_PREAMBLE_DETECTED = (1 << 2) , SX1262_IRQ_SYNC_WORD_VALID = (1 << 3) ,
  SX1262_IRQ_HEADER_VALID = (1 << 4) , SX1262_IRQ_HEADER_ERR = (1 << 5) , SX1262_IRQ_CRC_ERR = (1 << 6) , SX1262_IRQ_CAD_DONE = (1 << 7) ,
  SX1262_IRQ_CAD_DETECTED = (1 << 8) , SX1262_IRQ_TIMEOUT = (1 << 9)
}
 sx1262 irq enumeration definition More...
enum  sx1262_rx_tx_fallback_mode_t { SX1262_RX_TX_FALLBACK_MODE_FS = 0x40 , SX1262_RX_TX_FALLBACK_MODE_STDBY_XOSC = 0x30 , SX1262_RX_TX_FALLBACK_MODE_STDBY_RC = 0x20 }
 sx1262 rx tx fallback mode enumeration definition More...
enum  sx1262_tcxo_voltage_t {
  SX1262_TCXO_VOLTAGE_1P6V = 0x00 , SX1262_TCXO_VOLTAGE_1P7V = 0x01 , SX1262_TCXO_VOLTAGE_1P8V = 0x02 , SX1262_TCXO_VOLTAGE_2P2V = 0x03 ,
  SX1262_TCXO_VOLTAGE_2P4V = 0x04 , SX1262_TCXO_VOLTAGE_2P7V = 0x05 , SX1262_TCXO_VOLTAGE_3P0V = 0x06 , SX1262_TCXO_VOLTAGE_3P3V = 0x07
}
 sx1262 tcxo voltage enumeration definition More...
enum  sx1262_packet_type_t { SX1262_PACKET_TYPE_GFSK = 0x00 , SX1262_PACKET_TYPE_LORA = 0x01 , SX1262_PACKET_TYPE_FHSS = 0x03 }
 sx1262 packet type enumeration definition More...
enum  sx1262_ramp_time_t {
  SX1262_RAMP_TIME_10US = 0x00 , SX1262_RAMP_TIME_20US = 0x01 , SX1262_RAMP_TIME_40US = 0x02 , SX1262_RAMP_TIME_80US = 0x03 ,
  SX1262_RAMP_TIME_200US = 0x04 , SX1262_RAMP_TIME_800US = 0x05 , SX1262_RAMP_TIME_1700US = 0x06 , SX1262_RAMP_TIME_3400US = 0x07
}
 sx1262 ramp time enumeration definition More...
enum  sx1262_gfsk_pulse_shape_t {
  SX1262_GFSK_PULSE_SHAPE_NO_FILTER = 0x00 , SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P3 = 0x08 , SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P5 = 0x09 , SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P7 = 0x0A ,
  SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_1 = 0x0B
}
 sx1262 gfsk pulse shape enumeration definition More...
enum  sx1262_gfsk_bandwidth_t {
  SX1262_GFSK_BANDWIDTH_4P8_KHZ = 0x1F , SX1262_GFSK_BANDWIDTH_5P8_KHZ = 0x17 , SX1262_GFSK_BANDWIDTH_7P3_KHZ = 0x0F , SX1262_GFSK_BANDWIDTH_9P7_KHZ = 0x1E ,
  SX1262_GFSK_BANDWIDTH_11P7_KHZ = 0x16 , SX1262_GFSK_BANDWIDTH_14P6_KHZ = 0x0E , SX1262_GFSK_BANDWIDTH_19P5_KHZ = 0x1D , SX1262_GFSK_BANDWIDTH_23P4_KHZ = 0x15 ,
  SX1262_GFSK_BANDWIDTH_29P3_KHZ = 0x0D , SX1262_GFSK_BANDWIDTH_39_KHZ = 0x1C , SX1262_GFSK_BANDWIDTH_46P9_KHZ = 0x14 , SX1262_GFSK_BANDWIDTH_58P6_KHZ = 0x0C ,
  SX1262_GFSK_BANDWIDTH_78P2_KHZ = 0x1B , SX1262_GFSK_BANDWIDTH_93P8_KHZ = 0x13 , SX1262_GFSK_BANDWIDTH_117P3_KHZ = 0x0B , SX1262_GFSK_BANDWIDTH_156P2_KHZ = 0x1A ,
  SX1262_GFSK_BANDWIDTH_187P2_KHZ = 0x12 , SX1262_GFSK_BANDWIDTH_232P3_KHZ = 0x0A , SX1262_GFSK_BANDWIDTH_312_KHZ = 0x19 , SX1262_GFSK_BANDWIDTH_373P6_KHZ = 0x11 ,
  SX1262_GFSK_BANDWIDTH_467_KHZ = 0x09
}
 sx1262 gfsk bandwidth enumeration definition More...
enum  sx1262_lora_sf_t {
  SX1262_LORA_SF_5 = 0x05 , SX1262_LORA_SF_6 = 0x06 , SX1262_LORA_SF_7 = 0x07 , SX1262_LORA_SF_8 = 0x08 ,
  SX1262_LORA_SF_9 = 0x09 , SX1262_LORA_SF_10 = 0x0A , SX1262_LORA_SF_11 = 0x0B , SX1262_LORA_SF_12 = 0x0C
}
 sx1262 lora spreading factor enumeration definition More...
enum  sx1262_lora_bandwidth_t {
  SX1262_LORA_BANDWIDTH_7P81_KHZ = 0x00 , SX1262_LORA_BANDWIDTH_10P42_KHZ = 0x08 , SX1262_LORA_BANDWIDTH_15P63_KHZ = 0x01 , SX1262_LORA_BANDWIDTH_20P83_KHZ = 0x09 ,
  SX1262_LORA_BANDWIDTH_31P25_KHZ = 0x02 , SX1262_LORA_BANDWIDTH_41P67_KHZ = 0x0A , SX1262_LORA_BANDWIDTH_62P50_KHZ = 0x03 , SX1262_LORA_BANDWIDTH_125_KHZ = 0x04 ,
  SX1262_LORA_BANDWIDTH_250_KHZ = 0x05 , SX1262_LORA_BANDWIDTH_500_KHZ = 0x06
}
 sx1262 lora bandwidth enumeration definition More...
enum  sx1262_lora_cr_t { SX1262_LORA_CR_4_5 = 0x01 , SX1262_LORA_CR_4_6 = 0x02 , SX1262_LORA_CR_4_7 = 0x03 , SX1262_LORA_CR_4_8 = 0x04 }
 sx1262 lora coding rate enumeration definition More...
enum  sx1262_gfsk_preamble_detector_length_t {
  SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_OFF = 0x00 , SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_8_BITS = 0x04 , SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_16_BITS = 0x05 , SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_24_BITS = 0x06 ,
  SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_32_BITS = 0x07
}
 sx1262 gfsk preamble detector length enumeration definition More...
enum  sx1262_gfsk_addr_filter_t { SX1262_GFSK_ADDR_FILTER_DISABLE = 0x00 , SX1262_GFSK_ADDR_FILTER_ACTIVATED_NODE_ADDR = 0x01 , SX1262_GFSK_ADDR_FILTER_ACTIVATED_NODE_BROADCAST_ADDR = 0x02 }
 sx1262 gfsk addr filter enumeration definition More...
enum  sx1262_gfsk_packet_type_t { SX1262_GFSK_PACKET_TYPE_KNOWN_LENGTH = 0x00 , SX1262_GFSK_PACKET_TYPE_VARIABLE_SIZE = 0x01 }
 sx1262 gfsk packet type enumeration definition More...
enum  sx1262_gfsk_crc_type_t {
  SX1262_GFSK_CRC_TYPE_OFF = 0x01 , SX1262_GFSK_CRC_TYPE_1_BYTE = 0x00 , SX1262_GFSK_CRC_TYPE_2_BYTE = 0x02 , SX1262_GFSK_CRC_TYPE_1_BYTE_INV = 0x04 ,
  SX1262_GFSK_CRC_TYPE_2_BYTE_INV = 0x06
}
 sx1262 gfsk crc type enumeration definition More...
enum  sx1262_lora_header_t { SX1262_LORA_HEADER_EXPLICIT = 0x00 , SX1262_LORA_HEADER_IMPLICIT = 0x01 }
 sx1262 lora header enumeration definition More...
enum  sx1262_lora_crc_type_t { SX1262_LORA_CRC_TYPE_OFF = 0x00 , SX1262_LORA_CRC_TYPE_ON = 0x01 }
 sx1262 lora crc type enumeration definition More...
enum  sx1262_lora_cad_symbol_num_t {
  SX1262_LORA_CAD_SYMBOL_NUM_1 = 0x00 , SX1262_LORA_CAD_SYMBOL_NUM_2 = 0x01 , SX1262_LORA_CAD_SYMBOL_NUM_4 = 0x02 , SX1262_LORA_CAD_SYMBOL_NUM_8 = 0x03 ,
  SX1262_LORA_CAD_SYMBOL_NUM_16 = 0x04
}
 sx1262 lora cad symbol num enumeration definition More...
enum  sx1262_lora_cad_exit_mode_t { SX1262_LORA_CAD_EXIT_MODE_ONLY = 0x00 , SX1262_LORA_CAD_EXIT_MODE_RX = 0x01 }
 sx1262 lora cad exit mode enumeration definition More...
enum  sx1262_fsk_rx_status_t {
  SX1262_FSK_RX_STATUS_PREAMBLE_ERR = (1 << 7) , SX1262_FSK_RX_STATUS_SYNC_ERR = (1 << 6) , SX1262_FSK_RX_STATUS_ADDR_ERR = (1 << 5) , SX1262_FSK_RX_STATUS_CRC_ERR = (1 << 4) ,
  SX1262_FSK_RX_STATUS_LENGTH_ERR = (1 << 3) , SX1262_FSK_RX_STATUS_ABORT_ERR = (1 << 2) , SX1262_FSK_RX_STATUS_PKT_RECEIVED = (1 << 1) , SX1262_FSK_RX_STATUS_PKT_SEND = (1 << 0)
}
 sx1262 fsk rx status enumeration definition More...
enum  sx1262_op_error_t {
  SX1262_OP_ERROR_PA_RAMP_ERR = (1 << 8) , SX1262_OP_ERROR_PLL_LOCK_ERR = (1 << 6) , SX1262_OP_ERROR_XOSC_START_ERR = (1 << 5) , SX1262_OP_ERROR_IMG_CALIB_ERR = (1 << 4) ,
  SX1262_OP_ERROR_ADC_CALIB_ERR = (1 << 3) , SX1262_OP_ERROR_PLL_CALIB_ERR = (1 << 2) , SX1262_OP_ERROR_RC13M_CALIB_ERR = (1 << 1) , SX1262_OP_ERROR_RC64K_CALIB_ERR = (1 << 0)
}
 sx1262 op error enumeration definition More...

Functions

uint8_t sx1262_info (sx1262_info_t *info)
 get chip's information
uint8_t sx1262_irq_handler (sx1262_handle_t *handle)
 irq handler
uint8_t sx1262_init (sx1262_handle_t *handle)
 initialize the chip
uint8_t sx1262_deinit (sx1262_handle_t *handle)
 close the chip
uint8_t sx1262_lora_transmit (sx1262_handle_t *handle, sx1262_clock_source_t standby_src, uint16_t preamble_length, sx1262_lora_header_t header_type, sx1262_lora_crc_type_t crc_type, sx1262_bool_t invert_iq_enable, uint8_t *buf, uint16_t len, uint32_t us)
 send the lora data
uint8_t sx1262_lora_cad (sx1262_handle_t *handle, sx1262_bool_t *enable)
 run the cad
uint8_t sx1262_single_receive (sx1262_handle_t *handle, double us)
 enter to the single receive mode
uint8_t sx1262_continuous_receive (sx1262_handle_t *handle)
 enter to the continuous receive mode
uint8_t sx1262_write_register (sx1262_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 write the register
uint8_t sx1262_read_register (sx1262_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 read the register
uint8_t sx1262_write_buffer (sx1262_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
 write the buffer
uint8_t sx1262_read_buffer (sx1262_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
 read the buffer
uint8_t sx1262_check_packet_error (sx1262_handle_t *handle, sx1262_bool_t *enable)
 check the packet error
uint8_t sx1262_set_sleep (sx1262_handle_t *handle, sx1262_start_mode_t mode, sx1262_bool_t rtc_wake_up_enable)
 enter to the sleep mode
uint8_t sx1262_set_standby (sx1262_handle_t *handle, sx1262_clock_source_t src)
 enter to the standby mode
uint8_t sx1262_set_frequency_synthesis (sx1262_handle_t *handle)
 enter to the frequency synthesis mode
uint8_t sx1262_set_tx (sx1262_handle_t *handle, uint32_t timeout)
 enter to the tx mode
uint8_t sx1262_set_rx (sx1262_handle_t *handle, uint32_t timeout)
 enter to the rx mode
uint8_t sx1262_timeout_convert_to_register (sx1262_handle_t *handle, double us, uint32_t *reg)
 convert the timeout to the register raw data
uint8_t sx1262_timeout_convert_to_data (sx1262_handle_t *handle, uint32_t reg, double *us)
 convert the register raw data to the timeout
uint8_t sx1262_set_stop_timer_on_preamble (sx1262_handle_t *handle, sx1262_bool_t enable)
 stop timer on preamble
uint8_t sx1262_set_rx_duty_cycle (sx1262_handle_t *handle, uint32_t rx_period, uint32_t sleep_period)
 set the rx duty cycle
uint8_t sx1262_set_cad (sx1262_handle_t *handle)
 run the cad
uint8_t sx1262_set_tx_continuous_wave (sx1262_handle_t *handle)
 enter to the tx continuous wave mode
uint8_t sx1262_set_tx_infinite_preamble (sx1262_handle_t *handle)
 enter to the tx infinite preamble mode
uint8_t sx1262_set_regulator_mode (sx1262_handle_t *handle, sx1262_regulator_mode_t mode)
 set the regulator_mode
uint8_t sx1262_set_calibration (sx1262_handle_t *handle, uint8_t settings)
 set the calibration settings
uint8_t sx1262_set_calibration_image (sx1262_handle_t *handle, uint8_t freq1, uint8_t freq2)
 set the calibration image frequency
uint8_t sx1262_set_pa_config (sx1262_handle_t *handle, uint8_t pa_duty_cycle, uint8_t hp_max)
 set the pa config
uint8_t sx1262_set_rx_tx_fallback_mode (sx1262_handle_t *handle, sx1262_rx_tx_fallback_mode_t mode)
 set the rx tx fallback mode
uint8_t sx1262_set_dio_irq_params (sx1262_handle_t *handle, uint16_t irq_mask, uint16_t dio1_mask, uint16_t dio2_mask, uint16_t dio3_mask)
 set the dio irq params
uint8_t sx1262_get_irq_status (sx1262_handle_t *handle, uint16_t *status)
 get the irq status
uint8_t sx1262_clear_irq_status (sx1262_handle_t *handle, uint16_t clear_irq_param)
 clear the irq status
uint8_t sx1262_set_dio2_as_rf_switch_ctrl (sx1262_handle_t *handle, sx1262_bool_t enable)
 set dio2 as rf switch ctrl
uint8_t sx1262_set_dio3_as_tcxo_ctrl (sx1262_handle_t *handle, sx1262_tcxo_voltage_t voltage, uint32_t delay)
 set dio3 as tcxo ctrl
uint8_t sx1262_frequency_convert_to_register (sx1262_handle_t *handle, uint32_t freq, uint32_t *reg)
 convert the frequency to the register raw data
uint8_t sx1262_frequency_convert_to_data (sx1262_handle_t *handle, uint32_t reg, uint32_t *freq)
 convert the register raw data to the frequency
uint8_t sx1262_set_rf_frequency (sx1262_handle_t *handle, uint32_t reg)
 set the rf frequency
uint8_t sx1262_set_packet_type (sx1262_handle_t *handle, sx1262_packet_type_t type)
 set the packet type
uint8_t sx1262_get_packet_type (sx1262_handle_t *handle, sx1262_packet_type_t *type)
 get the packet type
uint8_t sx1262_set_tx_params (sx1262_handle_t *handle, int8_t dbm, sx1262_ramp_time_t t)
 set the tx params
uint8_t sx1262_set_gfsk_modulation_params (sx1262_handle_t *handle, uint32_t br, sx1262_gfsk_pulse_shape_t shape, sx1262_gfsk_bandwidth_t bw, uint32_t fdev)
 set the modulation params in GFSK mode
uint8_t sx1262_gfsk_bit_rate_convert_to_register (sx1262_handle_t *handle, uint32_t br, uint32_t *reg)
 convert the bit rate to the register raw data
uint8_t sx1262_gfsk_bit_rate_convert_to_data (sx1262_handle_t *handle, uint32_t reg, uint32_t *br)
 convert the register raw data to the bit rate
uint8_t sx1262_gfsk_frequency_deviation_convert_to_register (sx1262_handle_t *handle, uint32_t freq, uint32_t *reg)
 convert the frequency deviation to the register raw data
uint8_t sx1262_gfsk_frequency_deviation_convert_to_data (sx1262_handle_t *handle, uint32_t reg, uint32_t *freq)
 convert the register raw data to the frequency deviation
uint8_t sx1262_set_lora_modulation_params (sx1262_handle_t *handle, sx1262_lora_sf_t sf, sx1262_lora_bandwidth_t bw, sx1262_lora_cr_t cr, sx1262_bool_t low_data_rate_optimize_enable)
 set the modulation params in LoRa mode
uint8_t sx1262_set_gfsk_packet_params (sx1262_handle_t *handle, uint16_t preamble_length, sx1262_gfsk_preamble_detector_length_t detector_length, uint8_t sync_word_length, sx1262_gfsk_addr_filter_t filter, sx1262_gfsk_packet_type_t packet_type, uint8_t payload_length, sx1262_gfsk_crc_type_t crc_type, sx1262_bool_t whitening_enable)
 set the packet params in GFSK mode
uint8_t sx1262_set_lora_packet_params (sx1262_handle_t *handle, uint16_t preamble_length, sx1262_lora_header_t header_type, uint8_t payload_length, sx1262_lora_crc_type_t crc_type, sx1262_bool_t invert_iq_enable)
 set the packet params in LoRa mode
uint8_t sx1262_set_cad_params (sx1262_handle_t *handle, sx1262_lora_cad_symbol_num_t num, uint8_t cad_det_peak, uint8_t cad_det_min, sx1262_lora_cad_exit_mode_t mode, uint32_t timeout)
 set the cad params
uint8_t sx1262_set_buffer_base_address (sx1262_handle_t *handle, uint8_t tx_base_addr, uint8_t rx_base_addr)
 set the buffer base address
uint8_t sx1262_set_lora_symb_num_timeout (sx1262_handle_t *handle, uint8_t symb_num)
 set the lora symbol number timeout
uint8_t sx1262_get_status (sx1262_handle_t *handle, uint8_t *status)
 get the status
uint8_t sx1262_get_rx_buffer_status (sx1262_handle_t *handle, uint8_t *payload_length_rx, uint8_t *rx_start_buffer_pointer)
 get the rx buffer status
uint8_t sx1262_get_gfsk_packet_status (sx1262_handle_t *handle, uint8_t *rx_status, uint8_t *rssi_sync_raw, uint8_t *rssi_avg_raw, float *rssi_sync, float *rssi_avg)
 get the packet status in GFSK mode
uint8_t sx1262_get_lora_packet_status (sx1262_handle_t *handle, uint8_t *rssi_pkt_raw, int8_t *snr_pkt_raw, uint8_t *signal_rssi_pkt_raw, float *rssi_pkt, float *snr_pkt, float *signal_rssi_pkt)
 get the packet status in LoRa mode
uint8_t sx1262_get_instantaneous_rssi (sx1262_handle_t *handle, uint8_t *rssi_inst_raw, float *rssi_inst)
 get the instantaneous rssi
uint8_t sx1262_get_stats (sx1262_handle_t *handle, uint16_t *pkt_received, uint16_t *pkt_crc_error, uint16_t *pkt_length_header_error)
 get the stats
uint8_t sx1262_reset_stats (sx1262_handle_t *handle, uint16_t pkt_received, uint16_t pkt_crc_error, uint16_t pkt_length_header_error)
 reset the stats
uint8_t sx1262_get_device_errors (sx1262_handle_t *handle, uint16_t *op_error)
 get the device errors
uint8_t sx1262_clear_device_errors (sx1262_handle_t *handle)
 clear the device errors

Detailed Description

sx1262 command driver modules

Typedef Documentation

◆ sx1262_handle_t

sx1262 handle structure definition

◆ sx1262_info_t

typedef struct sx1262_info_s sx1262_info_t

sx1262 information structure definition

Enumeration Type Documentation

◆ sx1262_bool_t

sx1262 bool enumeration definition

Enumerator
SX1262_BOOL_FALSE 

disable function

SX1262_BOOL_TRUE 

enable function

Definition at line 62 of file driver_sx1262.h.

◆ sx1262_calibration_t

sx1262 calibration enumeration definition

Enumerator
SX1262_CALIBRATION_RC64K 

rc64k calibration

SX1262_CALIBRATION_RC13M 

rc13M calibration

SX1262_CALIBRATION_PLL 

pll calibration

SX1262_CALIBRATION_ADC_PULSE 

adc pulse calibration

SX1262_CALIBRATION_ADC_BULK_N 

adc bulk n calibration

SX1262_CALIBRATION_ADC_BULK_P 

adc bulk p calibration

SX1262_CALIBRATION_IMAGE 

image calibration

Definition at line 98 of file driver_sx1262.h.

◆ sx1262_clock_source_t

sx1262 clock source enumeration definition

Enumerator
SX1262_CLOCK_SOURCE_RC_13M 

rc 13MHz

SX1262_CLOCK_SOURCE_XTAL_32MHZ 

xtal 32MHz

Definition at line 80 of file driver_sx1262.h.

◆ sx1262_fsk_rx_status_t

sx1262 fsk rx status enumeration definition

Enumerator
SX1262_FSK_RX_STATUS_PREAMBLE_ERR 

preamble err

SX1262_FSK_RX_STATUS_SYNC_ERR 

sync err

SX1262_FSK_RX_STATUS_ADDR_ERR 

addr err

SX1262_FSK_RX_STATUS_CRC_ERR 

crc err

SX1262_FSK_RX_STATUS_LENGTH_ERR 

length err

SX1262_FSK_RX_STATUS_ABORT_ERR 

abort err

SX1262_FSK_RX_STATUS_PKT_RECEIVED 

pkt received

SX1262_FSK_RX_STATUS_PKT_SEND 

pkt send

Definition at line 349 of file driver_sx1262.h.

◆ sx1262_gfsk_addr_filter_t

sx1262 gfsk addr filter enumeration definition

Enumerator
SX1262_GFSK_ADDR_FILTER_DISABLE 

address filtering disable

SX1262_GFSK_ADDR_FILTER_ACTIVATED_NODE_ADDR 

address filtering activated on node address

SX1262_GFSK_ADDR_FILTER_ACTIVATED_NODE_BROADCAST_ADDR 

address filtering activated on node and broadcast addresses

Definition at line 274 of file driver_sx1262.h.

◆ sx1262_gfsk_bandwidth_t

sx1262 gfsk bandwidth enumeration definition

Enumerator
SX1262_GFSK_BANDWIDTH_4P8_KHZ 

4.8 kHz

SX1262_GFSK_BANDWIDTH_5P8_KHZ 

5.8 kHz

SX1262_GFSK_BANDWIDTH_7P3_KHZ 

7.3 kHz

SX1262_GFSK_BANDWIDTH_9P7_KHZ 

9.7 kHz

SX1262_GFSK_BANDWIDTH_11P7_KHZ 

11.7 kHz

SX1262_GFSK_BANDWIDTH_14P6_KHZ 

14.6 kHz

SX1262_GFSK_BANDWIDTH_19P5_KHZ 

19.5 kHz

SX1262_GFSK_BANDWIDTH_23P4_KHZ 

23.4 kHz

SX1262_GFSK_BANDWIDTH_29P3_KHZ 

29.3 kHz

SX1262_GFSK_BANDWIDTH_39_KHZ 

39 kHz

SX1262_GFSK_BANDWIDTH_46P9_KHZ 

46.9 kHz

SX1262_GFSK_BANDWIDTH_58P6_KHZ 

58.6 kHz

SX1262_GFSK_BANDWIDTH_78P2_KHZ 

78.2 kHz

SX1262_GFSK_BANDWIDTH_93P8_KHZ 

93.8 kHz

SX1262_GFSK_BANDWIDTH_117P3_KHZ 

117.3 kHz

SX1262_GFSK_BANDWIDTH_156P2_KHZ 

156.2 kHz

SX1262_GFSK_BANDWIDTH_187P2_KHZ 

187.2 kHz

SX1262_GFSK_BANDWIDTH_232P3_KHZ 

232.3 kHz

SX1262_GFSK_BANDWIDTH_312_KHZ 

312 kHz

SX1262_GFSK_BANDWIDTH_373P6_KHZ 

373.6 kHz

SX1262_GFSK_BANDWIDTH_467_KHZ 

467 kHz

Definition at line 191 of file driver_sx1262.h.

◆ sx1262_gfsk_crc_type_t

sx1262 gfsk crc type enumeration definition

Enumerator
SX1262_GFSK_CRC_TYPE_OFF 

no crc

SX1262_GFSK_CRC_TYPE_1_BYTE 

crc computed on 1 byte

SX1262_GFSK_CRC_TYPE_2_BYTE 

crc computed on 2 byte

SX1262_GFSK_CRC_TYPE_1_BYTE_INV 

crc computed on 1 byte and inverted

SX1262_GFSK_CRC_TYPE_2_BYTE_INV 

crc computed on 2 byte and inverted

Definition at line 295 of file driver_sx1262.h.

◆ sx1262_gfsk_packet_type_t

sx1262 gfsk packet type enumeration definition

Enumerator
SX1262_GFSK_PACKET_TYPE_KNOWN_LENGTH 

the packet length is known on both sides, the size of the payload is not added to the packet

SX1262_GFSK_PACKET_TYPE_VARIABLE_SIZE 

the packet is on variable size, the first byte of the payload will be the size of the packet

Definition at line 284 of file driver_sx1262.h.

◆ sx1262_gfsk_preamble_detector_length_t

sx1262 gfsk preamble detector length enumeration definition

Enumerator
SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_OFF 

preamble detector length off

SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_8_BITS 

preamble detector length 8 bits

SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_16_BITS 

preamble detector length 16 bits

SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_24_BITS 

preamble detector length 24 bits

SX1262_GFSK_PREAMBLE_DETECTOR_LENGTH_32_BITS 

preamble detector length 32 bits

Definition at line 262 of file driver_sx1262.h.

◆ sx1262_gfsk_pulse_shape_t

sx1262 gfsk pulse shape enumeration definition

Enumerator
SX1262_GFSK_PULSE_SHAPE_NO_FILTER 

no filter applied

SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P3 

gaussian bt 0.3

SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P5 

gaussian bt 0.5

SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_0P7 

gaussian bt 0.7

SX1262_GFSK_PULSE_SHAPE_GAUSSIAN_BT_1 

gaussian bt 1

Definition at line 179 of file driver_sx1262.h.

◆ sx1262_irq_t

sx1262 irq enumeration definition

Enumerator
SX1262_IRQ_TX_DONE 

packet transmission completed

SX1262_IRQ_RX_DONE 

packet received

SX1262_IRQ_PREAMBLE_DETECTED 

preamble detected

SX1262_IRQ_SYNC_WORD_VALID 

valid sync word detected

SX1262_IRQ_HEADER_VALID 

valid header

SX1262_IRQ_HEADER_ERR 

header error

SX1262_IRQ_CRC_ERR 

crc error

SX1262_IRQ_CAD_DONE 

cad done

SX1262_IRQ_CAD_DETECTED 

cad detected

SX1262_IRQ_TIMEOUT 

timeout

Definition at line 112 of file driver_sx1262.h.

◆ sx1262_lora_bandwidth_t

sx1262 lora bandwidth enumeration definition

Enumerator
SX1262_LORA_BANDWIDTH_7P81_KHZ 

7.81 kHz

SX1262_LORA_BANDWIDTH_10P42_KHZ 

10.42 kHz

SX1262_LORA_BANDWIDTH_15P63_KHZ 

15.63 kHz

SX1262_LORA_BANDWIDTH_20P83_KHZ 

20.83 kHz

SX1262_LORA_BANDWIDTH_31P25_KHZ 

31.25 kHz

SX1262_LORA_BANDWIDTH_41P67_KHZ 

41.67 kHz

SX1262_LORA_BANDWIDTH_62P50_KHZ 

62.50 kHz

SX1262_LORA_BANDWIDTH_125_KHZ 

125 kHz

SX1262_LORA_BANDWIDTH_250_KHZ 

250 kHz

SX1262_LORA_BANDWIDTH_500_KHZ 

500 kHz

Definition at line 234 of file driver_sx1262.h.

◆ sx1262_lora_cad_exit_mode_t

sx1262 lora cad exit mode enumeration definition

Enumerator
SX1262_LORA_CAD_EXIT_MODE_ONLY 

once done and whatever the activity on the channel, the chip goes back to STBY_RC mode

SX1262_LORA_CAD_EXIT_MODE_RX 

the chip performs a cad operation and if an activity is detected, it stays in rx until a packet is detected or the timer reaches the timeout defined by cad timeout * 15.625 us

Definition at line 337 of file driver_sx1262.h.

◆ sx1262_lora_cad_symbol_num_t

sx1262 lora cad symbol num enumeration definition

Enumerator
SX1262_LORA_CAD_SYMBOL_NUM_1 

1 symbol

SX1262_LORA_CAD_SYMBOL_NUM_2 

2 symbol

SX1262_LORA_CAD_SYMBOL_NUM_4 

4 symbol

SX1262_LORA_CAD_SYMBOL_NUM_8 

8 symbol

SX1262_LORA_CAD_SYMBOL_NUM_16 

16 symbol

Definition at line 325 of file driver_sx1262.h.

◆ sx1262_lora_cr_t

sx1262 lora coding rate enumeration definition

Enumerator
SX1262_LORA_CR_4_5 

cr 4/5

SX1262_LORA_CR_4_6 

cr 4/6

SX1262_LORA_CR_4_7 

cr 4/7

SX1262_LORA_CR_4_8 

cr 4/8

Definition at line 251 of file driver_sx1262.h.

◆ sx1262_lora_crc_type_t

sx1262 lora crc type enumeration definition

Enumerator
SX1262_LORA_CRC_TYPE_OFF 

crc off

SX1262_LORA_CRC_TYPE_ON 

crc on

Definition at line 316 of file driver_sx1262.h.

◆ sx1262_lora_header_t

sx1262 lora header enumeration definition

Enumerator
SX1262_LORA_HEADER_EXPLICIT 

explicit header

SX1262_LORA_HEADER_IMPLICIT 

implicit header

Definition at line 307 of file driver_sx1262.h.

◆ sx1262_lora_sf_t

sx1262 lora spreading factor enumeration definition

Enumerator
SX1262_LORA_SF_5 

spreading factor 5

SX1262_LORA_SF_6 

spreading factor 6

SX1262_LORA_SF_7 

spreading factor 7

SX1262_LORA_SF_8 

spreading factor 8

SX1262_LORA_SF_9 

spreading factor 9

SX1262_LORA_SF_10 

spreading factor 10

SX1262_LORA_SF_11 

spreading factor 11

SX1262_LORA_SF_12 

spreading factor 12

Definition at line 219 of file driver_sx1262.h.

◆ sx1262_op_error_t

sx1262 op error enumeration definition

Enumerator
SX1262_OP_ERROR_PA_RAMP_ERR 

pa ramping failed

SX1262_OP_ERROR_PLL_LOCK_ERR 

pll failed to lock

SX1262_OP_ERROR_XOSC_START_ERR 

xosc failed to start

SX1262_OP_ERROR_IMG_CALIB_ERR 

img calibration failed

SX1262_OP_ERROR_ADC_CALIB_ERR 

adc calibration failed

SX1262_OP_ERROR_PLL_CALIB_ERR 

pll calibration failed

SX1262_OP_ERROR_RC13M_CALIB_ERR 

rc13M calibration failed

SX1262_OP_ERROR_RC64K_CALIB_ERR 

rc64k calibration failed

Definition at line 364 of file driver_sx1262.h.

◆ sx1262_packet_type_t

sx1262 packet type enumeration definition

Enumerator
SX1262_PACKET_TYPE_GFSK 

gfsk mode

SX1262_PACKET_TYPE_LORA 

lora mode

SX1262_PACKET_TYPE_FHSS 

fhss mode

Definition at line 154 of file driver_sx1262.h.

◆ sx1262_ramp_time_t

sx1262 ramp time enumeration definition

Enumerator
SX1262_RAMP_TIME_10US 

10us

SX1262_RAMP_TIME_20US 

20us

SX1262_RAMP_TIME_40US 

40us

SX1262_RAMP_TIME_80US 

80us

SX1262_RAMP_TIME_200US 

200us

SX1262_RAMP_TIME_800US 

800us

SX1262_RAMP_TIME_1700US 

1700us

SX1262_RAMP_TIME_3400US 

3400us

Definition at line 164 of file driver_sx1262.h.

◆ sx1262_regulator_mode_t

sx1262 regulator mode enumeration definition

Enumerator
SX1262_REGULATOR_MODE_ONLY_LDO 

only ldo used for all modes

SX1262_REGULATOR_MODE_DC_DC_LDO 

dc_dc + ldo used for standby_xosc, fs, rx and rx modes

Definition at line 89 of file driver_sx1262.h.

◆ sx1262_rx_tx_fallback_mode_t

sx1262 rx tx fallback mode enumeration definition

Enumerator
SX1262_RX_TX_FALLBACK_MODE_FS 

the radio goes into fs mode after tx or rx

SX1262_RX_TX_FALLBACK_MODE_STDBY_XOSC 

the radio goes into standby_xosc mode after tx or rx

SX1262_RX_TX_FALLBACK_MODE_STDBY_RC 

the radio goes into standby_rc mode after tx or rx

Definition at line 129 of file driver_sx1262.h.

◆ sx1262_start_mode_t

sx1262 start mode enumeration definition

Enumerator
SX1262_START_MODE_COLD 

cold start mode

SX1262_START_MODE_WARM 

warm start mode

Definition at line 71 of file driver_sx1262.h.

◆ sx1262_tcxo_voltage_t

sx1262 tcxo voltage enumeration definition

Enumerator
SX1262_TCXO_VOLTAGE_1P6V 

dio3 outputs 1.6 V to supply the tcxo

SX1262_TCXO_VOLTAGE_1P7V 

dio3 outputs 1.7 V to supply the tcxo

SX1262_TCXO_VOLTAGE_1P8V 

dio3 outputs 1.8 V to supply the tcxo

SX1262_TCXO_VOLTAGE_2P2V 

dio3 outputs 2.2 V to supply the tcxo

SX1262_TCXO_VOLTAGE_2P4V 

dio3 outputs 2.4 V to supply the tcxo

SX1262_TCXO_VOLTAGE_2P7V 

dio3 outputs 2.7 V to supply the tcxo

SX1262_TCXO_VOLTAGE_3P0V 

dio3 outputs 3.0 V to supply the tcxo

SX1262_TCXO_VOLTAGE_3P3V 

dio3 outputs 3.3 V to supply the tcxo

Definition at line 139 of file driver_sx1262.h.

Function Documentation

◆ sx1262_check_packet_error()

uint8_t sx1262_check_packet_error ( sx1262_handle_t * handle,
sx1262_bool_t * enable )

check the packet error

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*enablepointer to a bool buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1053 of file driver_sx1262.c.

◆ sx1262_clear_device_errors()

uint8_t sx1262_clear_device_errors ( sx1262_handle_t * handle)

clear the device errors

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 clear device errors failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3629 of file driver_sx1262.c.

◆ sx1262_clear_irq_status()

uint8_t sx1262_clear_irq_status ( sx1262_handle_t * handle,
uint16_t clear_irq_param )

clear the irq status

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]clear_irq_paramirq mask
Returns
status code
  • 0 success
  • 1 clear irq status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2341 of file driver_sx1262.c.

◆ sx1262_continuous_receive()

uint8_t sx1262_continuous_receive ( sx1262_handle_t * handle)

enter to the continuous receive mode

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 lora continuous receive failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 897 of file driver_sx1262.c.

◆ sx1262_deinit()

uint8_t sx1262_deinit ( sx1262_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
  • 5 power down failed
  • 6 busy gpio deinit failed
  • 7 reset gpio deinit failed
Note
none

Definition at line 761 of file driver_sx1262.c.

◆ sx1262_frequency_convert_to_data()

uint8_t sx1262_frequency_convert_to_data ( sx1262_handle_t * handle,
uint32_t reg,
uint32_t * freq )

convert the register raw data to the frequency

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister raw data
[out]*freqpointer to a frequency buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2510 of file driver_sx1262.c.

◆ sx1262_frequency_convert_to_register()

uint8_t sx1262_frequency_convert_to_register ( sx1262_handle_t * handle,
uint32_t freq,
uint32_t * reg )

convert the frequency to the register raw data

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]freqfrequency
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2483 of file driver_sx1262.c.

◆ sx1262_get_device_errors()

uint8_t sx1262_get_device_errors ( sx1262_handle_t * handle,
uint16_t * op_error )

get the device errors

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*op_errorpointer to an op error buffer
Returns
status code
  • 0 success
  • 1 get device errors failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3584 of file driver_sx1262.c.

◆ sx1262_get_gfsk_packet_status()

uint8_t sx1262_get_gfsk_packet_status ( sx1262_handle_t * handle,
uint8_t * rx_status,
uint8_t * rssi_sync_raw,
uint8_t * rssi_avg_raw,
float * rssi_sync,
float * rssi_avg )

get the packet status in GFSK mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*rx_statuspointer to an rx status buffer
[out]*rssi_sync_rawpointer to an rssi sync raw buffer
[out]*rssi_avg_rawpointer to an rssi avg raw buffer
[out]*rssi_syncpointer to an rssi sync buffer
[out]*rssi_avgpointer to an rssi avg buffer
Returns
status code
  • 0 success
  • 1 get gfsk packet status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3325 of file driver_sx1262.c.

◆ sx1262_get_instantaneous_rssi()

uint8_t sx1262_get_instantaneous_rssi ( sx1262_handle_t * handle,
uint8_t * rssi_inst_raw,
float * rssi_inst )

get the instantaneous rssi

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*rssi_inst_rawpointer to an rssi instantaneous raw buffer
[out]*rssi_instpointer to an rssi instantaneous buffer
Returns
status code
  • 0 success
  • 1 get instantaneous rssi failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3434 of file driver_sx1262.c.

◆ sx1262_get_irq_status()

uint8_t sx1262_get_irq_status ( sx1262_handle_t * handle,
uint16_t * status )

get the irq status

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get irq status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2295 of file driver_sx1262.c.

◆ sx1262_get_lora_packet_status()

uint8_t sx1262_get_lora_packet_status ( sx1262_handle_t * handle,
uint8_t * rssi_pkt_raw,
int8_t * snr_pkt_raw,
uint8_t * signal_rssi_pkt_raw,
float * rssi_pkt,
float * snr_pkt,
float * signal_rssi_pkt )

get the packet status in LoRa mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*rssi_pkt_rawpointer to an rssi packet raw buffer
[out]*snr_pkt_rawpointer to an snr packet raw buffer
[out]*signal_rssi_pkt_rawpointer to a signal rssi packet raw buffer
[out]*rssi_pktpointer to an rssi packet buffer
[out]*snr_pktpointer to an snr packet buffer
[out]*signal_rssi_pktpointer to a signal rssi packet buffer
Returns
status code
  • 0 success
  • 1 get lora packet status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3381 of file driver_sx1262.c.

◆ sx1262_get_packet_type()

uint8_t sx1262_get_packet_type ( sx1262_handle_t * handle,
sx1262_packet_type_t * type )

get the packet type

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*typepointer to a packet type buffer
Returns
status code
  • 0 success
  • 1 get packet type failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2633 of file driver_sx1262.c.

◆ sx1262_get_rx_buffer_status()

uint8_t sx1262_get_rx_buffer_status ( sx1262_handle_t * handle,
uint8_t * payload_length_rx,
uint8_t * rx_start_buffer_pointer )

get the rx buffer status

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*payload_length_rxpointer to an rx payload length buffer
[out]*rx_start_buffer_pointerpointer to an rx start pointer buffer
Returns
status code
  • 0 success
  • 1 get rx buffer status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3274 of file driver_sx1262.c.

◆ sx1262_get_stats()

uint8_t sx1262_get_stats ( sx1262_handle_t * handle,
uint16_t * pkt_received,
uint16_t * pkt_crc_error,
uint16_t * pkt_length_header_error )

get the stats

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*pkt_receivedpointer to a packet received counter buffer
[out]*pkt_crc_errorpointer to a packet crc error buffer
[out]*pkt_length_header_errorpointer to a packet length header error buffer
Returns
status code
  • 0 success
  • 1 get stats failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3483 of file driver_sx1262.c.

◆ sx1262_get_status()

uint8_t sx1262_get_status ( sx1262_handle_t * handle,
uint8_t * status )

get the status

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3226 of file driver_sx1262.c.

◆ sx1262_gfsk_bit_rate_convert_to_data()

uint8_t sx1262_gfsk_bit_rate_convert_to_data ( sx1262_handle_t * handle,
uint32_t reg,
uint32_t * br )

convert the register raw data to the bit rate

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister raw data
[out]*brpointer to a bit rate buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2810 of file driver_sx1262.c.

◆ sx1262_gfsk_bit_rate_convert_to_register()

uint8_t sx1262_gfsk_bit_rate_convert_to_register ( sx1262_handle_t * handle,
uint32_t br,
uint32_t * reg )

convert the bit rate to the register raw data

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]brbit rate
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2783 of file driver_sx1262.c.

◆ sx1262_gfsk_frequency_deviation_convert_to_data()

uint8_t sx1262_gfsk_frequency_deviation_convert_to_data ( sx1262_handle_t * handle,
uint32_t reg,
uint32_t * freq )

convert the register raw data to the frequency deviation

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister raw data
[out]*freqpointer to a frequency deviation buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2864 of file driver_sx1262.c.

◆ sx1262_gfsk_frequency_deviation_convert_to_register()

uint8_t sx1262_gfsk_frequency_deviation_convert_to_register ( sx1262_handle_t * handle,
uint32_t freq,
uint32_t * reg )

convert the frequency deviation to the register raw data

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]freqfrequency deviation
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2837 of file driver_sx1262.c.

◆ sx1262_info()

uint8_t sx1262_info ( sx1262_info_t * info)

get chip's information

Parameters
[out]*infopointer to an sx1262 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 6266 of file driver_sx1262.c.

◆ sx1262_init()

uint8_t sx1262_init ( sx1262_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 spi initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 reset gpio initialization failed
  • 5 busy gpio initialization failed
  • 6 reset chip failed
Note
none

Definition at line 590 of file driver_sx1262.c.

◆ sx1262_irq_handler()

uint8_t sx1262_irq_handler ( sx1262_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 407 of file driver_sx1262.c.

◆ sx1262_lora_cad()

uint8_t sx1262_lora_cad ( sx1262_handle_t * handle,
sx1262_bool_t * enable )

run the cad

Parameters
[in]*handlepointer to an sx1262 handle structure
[out]*enablepointer to an enable buffer
Returns
status code
  • 0 success
  • 1 lora cad failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
  • 5 cad timeout
Note
none

Definition at line 966 of file driver_sx1262.c.

◆ sx1262_lora_transmit()

uint8_t sx1262_lora_transmit ( sx1262_handle_t * handle,
sx1262_clock_source_t standby_src,
uint16_t preamble_length,
sx1262_lora_header_t header_type,
sx1262_lora_crc_type_t crc_type,
sx1262_bool_t invert_iq_enable,
uint8_t * buf,
uint16_t len,
uint32_t us )

send the lora data

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]standby_srcclock source
[in]preamble_lengthpreamble length
[in]header_typeheader type
[in]crc_typecrc type
[in]invert_iq_enablebool value
[in]*bufpointer to a data buffer
[in]lendata length
[in]ustimeout
Returns
status code
  • 0 success
  • 1 send failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
  • 5 send timeout
  • 6 irq timeout
  • 7 unknown result
Note
none

Definition at line 1091 of file driver_sx1262.c.

◆ sx1262_read_buffer()

uint8_t sx1262_read_buffer ( sx1262_handle_t * handle,
uint8_t offset,
uint8_t * buf,
uint16_t len )

read the buffer

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]offsetbuffer offset
[out]*bufpointer to a data buffer
[in]lendata length
Returns
status code
  • 0 success
  • 1 read buffer failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1444 of file driver_sx1262.c.

◆ sx1262_read_register()

uint8_t sx1262_read_register ( sx1262_handle_t * handle,
uint16_t reg,
uint8_t * buf,
uint16_t len )

read the register

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister address
[out]*bufpointer to a data buffer
[in]lendata length
Returns
status code
  • 0 success
  • 1 read register failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1354 of file driver_sx1262.c.

◆ sx1262_reset_stats()

uint8_t sx1262_reset_stats ( sx1262_handle_t * handle,
uint16_t pkt_received,
uint16_t pkt_crc_error,
uint16_t pkt_length_header_error )

reset the stats

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]pkt_receivedreceived packet counter mask
[in]pkt_crc_errorpacket crc error mask
[in]pkt_length_header_errorpacket length header error mask
Returns
status code
  • 0 success
  • 1 reset stats failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3533 of file driver_sx1262.c.

◆ sx1262_set_buffer_base_address()

uint8_t sx1262_set_buffer_base_address ( sx1262_handle_t * handle,
uint8_t tx_base_addr,
uint8_t rx_base_addr )

set the buffer base address

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]tx_base_addrtx base address
[in]rx_base_addrrx base address
Returns
status code
  • 0 success
  • 1 set buffer base address failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3133 of file driver_sx1262.c.

◆ sx1262_set_cad()

uint8_t sx1262_set_cad ( sx1262_handle_t * handle)

run the cad

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 set cad failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1871 of file driver_sx1262.c.

◆ sx1262_set_cad_params()

uint8_t sx1262_set_cad_params ( sx1262_handle_t * handle,
sx1262_lora_cad_symbol_num_t num,
uint8_t cad_det_peak,
uint8_t cad_det_min,
sx1262_lora_cad_exit_mode_t mode,
uint32_t timeout )

set the cad params

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]numcad symbol number
[in]cad_det_peakcad detection peak
[in]cad_det_minmin cad detection peak
[in]modecad exit mode
[in]timeoutcad timeout
Returns
status code
  • 0 success
  • 1 set cad params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3078 of file driver_sx1262.c.

◆ sx1262_set_calibration()

uint8_t sx1262_set_calibration ( sx1262_handle_t * handle,
uint8_t settings )

set the calibration settings

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]settingscalibration param
Returns
status code
  • 0 success
  • 1 set calibration failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2047 of file driver_sx1262.c.

◆ sx1262_set_calibration_image()

uint8_t sx1262_set_calibration_image ( sx1262_handle_t * handle,
uint8_t freq1,
uint8_t freq2 )

set the calibration image frequency

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]freq1image frequency 1
[in]freq2image frequency 2
Returns
status code
  • 0 success
  • 1 set calibration image failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2094 of file driver_sx1262.c.

◆ sx1262_set_dio2_as_rf_switch_ctrl()

uint8_t sx1262_set_dio2_as_rf_switch_ctrl ( sx1262_handle_t * handle,
sx1262_bool_t enable )

set dio2 as rf switch ctrl

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set dio2 as rf switch ctrl failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2388 of file driver_sx1262.c.

◆ sx1262_set_dio3_as_tcxo_ctrl()

uint8_t sx1262_set_dio3_as_tcxo_ctrl ( sx1262_handle_t * handle,
sx1262_tcxo_voltage_t voltage,
uint32_t delay )

set dio3 as tcxo ctrl

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]voltagetcxo voltage
[in]delaytcxo ctrl delay
Returns
status code
  • 0 success
  • 1 set dio3 as tcxo ctrl failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2435 of file driver_sx1262.c.

◆ sx1262_set_dio_irq_params()

uint8_t sx1262_set_dio_irq_params ( sx1262_handle_t * handle,
uint16_t irq_mask,
uint16_t dio1_mask,
uint16_t dio2_mask,
uint16_t dio3_mask )

set the dio irq params

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]irq_maskirq mask
[in]dio1_maskdio1 mask
[in]dio2_maskdio2 mask
[in]dio3_maskdio3 mask
Returns
status code
  • 0 success
  • 1 set dio irq params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2240 of file driver_sx1262.c.

◆ sx1262_set_frequency_synthesis()

uint8_t sx1262_set_frequency_synthesis ( sx1262_handle_t * handle)

enter to the frequency synthesis mode

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 set frequency synthesis failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1579 of file driver_sx1262.c.

◆ sx1262_set_gfsk_modulation_params()

uint8_t sx1262_set_gfsk_modulation_params ( sx1262_handle_t * handle,
uint32_t br,
sx1262_gfsk_pulse_shape_t shape,
sx1262_gfsk_bandwidth_t bw,
uint32_t fdev )

set the modulation params in GFSK mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]brbit rate
[in]shapepulse shape
[in]bwbandwidth
[in]fdevfrequency deviation
Returns
status code
  • 0 success
  • 1 set gfsk modulation params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2730 of file driver_sx1262.c.

◆ sx1262_set_gfsk_packet_params()

uint8_t sx1262_set_gfsk_packet_params ( sx1262_handle_t * handle,
uint16_t preamble_length,
sx1262_gfsk_preamble_detector_length_t detector_length,
uint8_t sync_word_length,
sx1262_gfsk_addr_filter_t filter,
sx1262_gfsk_packet_type_t packet_type,
uint8_t payload_length,
sx1262_gfsk_crc_type_t crc_type,
sx1262_bool_t whitening_enable )

set the packet params in GFSK mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]preamble_lengthpreamble length
[in]detector_lengthpreamble detector length
[in]sync_word_lengthsync word length
[in]filteraddress filter
[in]packet_typepacket type
[in]payload_lengthlength of the payload
[in]crc_typecrc type
[in]whitening_enablebool value
Returns
status code
  • 0 success
  • 1 set gfsk packet params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
  • 5 sync word length is over 0x40
Note
none

Definition at line 2953 of file driver_sx1262.c.

◆ sx1262_set_lora_modulation_params()

uint8_t sx1262_set_lora_modulation_params ( sx1262_handle_t * handle,
sx1262_lora_sf_t sf,
sx1262_lora_bandwidth_t bw,
sx1262_lora_cr_t cr,
sx1262_bool_t low_data_rate_optimize_enable )

set the modulation params in LoRa mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]sfspreading factor
[in]bwbandwidth
[in]crcoding rate
[in]low_data_rate_optimize_enablebool value
Returns
status code
  • 0 success
  • 1 set lora modulation params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2895 of file driver_sx1262.c.

◆ sx1262_set_lora_packet_params()

uint8_t sx1262_set_lora_packet_params ( sx1262_handle_t * handle,
uint16_t preamble_length,
sx1262_lora_header_t header_type,
uint8_t payload_length,
sx1262_lora_crc_type_t crc_type,
sx1262_bool_t invert_iq_enable )

set the packet params in LoRa mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]preamble_lengthpreamble length
[in]header_typeheader type
[in]payload_lengthlength of payload
[in]crc_typecrc type
[in]invert_iq_enablebool value
Returns
status code
  • 0 success
  • 1 set lora packet params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3021 of file driver_sx1262.c.

◆ sx1262_set_lora_symb_num_timeout()

uint8_t sx1262_set_lora_symb_num_timeout ( sx1262_handle_t * handle,
uint8_t symb_num )

set the lora symbol number timeout

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]symb_numsymbol number
Returns
status code
  • 0 success
  • 1 set lora symb num timeout failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 3180 of file driver_sx1262.c.

◆ sx1262_set_pa_config()

uint8_t sx1262_set_pa_config ( sx1262_handle_t * handle,
uint8_t pa_duty_cycle,
uint8_t hp_max )

set the pa config

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]pa_duty_cyclepa duty cycle
[in]hp_maxmax power
Returns
status code
  • 0 success
  • 1 set the pa config failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2142 of file driver_sx1262.c.

◆ sx1262_set_packet_type()

uint8_t sx1262_set_packet_type ( sx1262_handle_t * handle,
sx1262_packet_type_t type )

set the packet type

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]typepacket type
Returns
status code
  • 0 success
  • 1 set packet type failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2587 of file driver_sx1262.c.

◆ sx1262_set_regulator_mode()

uint8_t sx1262_set_regulator_mode ( sx1262_handle_t * handle,
sx1262_regulator_mode_t mode )

set the regulator_mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]moderegulator mode
Returns
status code
  • 0 success
  • 1 set regulator mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2001 of file driver_sx1262.c.

◆ sx1262_set_rf_frequency()

uint8_t sx1262_set_rf_frequency ( sx1262_handle_t * handle,
uint32_t reg )

set the rf frequency

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regrf frequency register data
Returns
status code
  • 0 success
  • 1 set rf frequency failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2538 of file driver_sx1262.c.

◆ sx1262_set_rx()

uint8_t sx1262_set_rx ( sx1262_handle_t * handle,
uint32_t timeout )

enter to the rx mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]timeoutrx timeout
Returns
status code
  • 0 success
  • 1 set rx failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
0x000000 means timeout disable, rx single mode 0xFFFFFF means rx continuous mode

Definition at line 1672 of file driver_sx1262.c.

◆ sx1262_set_rx_duty_cycle()

uint8_t sx1262_set_rx_duty_cycle ( sx1262_handle_t * handle,
uint32_t rx_period,
uint32_t sleep_period )

set the rx duty cycle

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]rx_periodrx period
[in]sleep_periodsleep period
Returns
status code
  • 0 success
  • 1 set rx duty cycle failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
t_preamble + t_header <= 2 * rx_period + sleep_period

Definition at line 1821 of file driver_sx1262.c.

◆ sx1262_set_rx_tx_fallback_mode()

uint8_t sx1262_set_rx_tx_fallback_mode ( sx1262_handle_t * handle,
sx1262_rx_tx_fallback_mode_t mode )

set the rx tx fallback mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]moderx tx fallback mode
Returns
status code
  • 0 success
  • 1 set rx tx fallback mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2191 of file driver_sx1262.c.

◆ sx1262_set_sleep()

uint8_t sx1262_set_sleep ( sx1262_handle_t * handle,
sx1262_start_mode_t mode,
sx1262_bool_t rtc_wake_up_enable )

enter to the sleep mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]modestart mode
[in]rtc_wake_up_enablebool value
Returns
status code
  • 0 success
  • 1 set sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1488 of file driver_sx1262.c.

◆ sx1262_set_standby()

uint8_t sx1262_set_standby ( sx1262_handle_t * handle,
sx1262_clock_source_t src )

enter to the standby mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]srcclock source
Returns
status code
  • 0 success
  • 1 set standby failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1534 of file driver_sx1262.c.

◆ sx1262_set_stop_timer_on_preamble()

uint8_t sx1262_set_stop_timer_on_preamble ( sx1262_handle_t * handle,
sx1262_bool_t enable )

stop timer on preamble

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set stop timer on preamble failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1774 of file driver_sx1262.c.

◆ sx1262_set_tx()

uint8_t sx1262_set_tx ( sx1262_handle_t * handle,
uint32_t timeout )

enter to the tx mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]timeouttx timeout
Returns
status code
  • 0 success
  • 1 set tx failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
0x000000 means timeout disable, tx single mode

Definition at line 1623 of file driver_sx1262.c.

◆ sx1262_set_tx_continuous_wave()

uint8_t sx1262_set_tx_continuous_wave ( sx1262_handle_t * handle)

enter to the tx continuous wave mode

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 set tx continuous wave failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1914 of file driver_sx1262.c.

◆ sx1262_set_tx_infinite_preamble()

uint8_t sx1262_set_tx_infinite_preamble ( sx1262_handle_t * handle)

enter to the tx infinite preamble mode

Parameters
[in]*handlepointer to an sx1262 handle structure
Returns
status code
  • 0 success
  • 1 set tx infinite preamble failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1957 of file driver_sx1262.c.

◆ sx1262_set_tx_params()

uint8_t sx1262_set_tx_params ( sx1262_handle_t * handle,
int8_t dbm,
sx1262_ramp_time_t t )

set the tx params

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]dbmrf power
[in]tramp time
Returns
status code
  • 0 success
  • 1 set tx params failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 2680 of file driver_sx1262.c.

◆ sx1262_single_receive()

uint8_t sx1262_single_receive ( sx1262_handle_t * handle,
double us )

enter to the single receive mode

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]usrx timeout
Returns
status code
  • 0 success
  • 1 lora single receive failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 828 of file driver_sx1262.c.

◆ sx1262_timeout_convert_to_data()

uint8_t sx1262_timeout_convert_to_data ( sx1262_handle_t * handle,
uint32_t reg,
double * us )

convert the register raw data to the timeout

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister raw data
[out]*uspointer to a us buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1746 of file driver_sx1262.c.

◆ sx1262_timeout_convert_to_register()

uint8_t sx1262_timeout_convert_to_register ( sx1262_handle_t * handle,
double us,
uint32_t * reg )

convert the timeout to the register raw data

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]ustimeout
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1719 of file driver_sx1262.c.

◆ sx1262_write_buffer()

uint8_t sx1262_write_buffer ( sx1262_handle_t * handle,
uint8_t offset,
uint8_t * buf,
uint16_t len )

write the buffer

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]offsetbuffer offset
[in]*bufpointer to a data buffer
[in]lendata length
Returns
status code
  • 0 success
  • 1 write buffer failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1399 of file driver_sx1262.c.

◆ sx1262_write_register()

uint8_t sx1262_write_register ( sx1262_handle_t * handle,
uint16_t reg,
uint8_t * buf,
uint16_t len )

write the register

Parameters
[in]*handlepointer to an sx1262 handle structure
[in]regregister address
[in]*bufpointer to a data buffer
[in]lendata length
Returns
status code
  • 0 success
  • 1 write register failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 chip is busy
Note
none

Definition at line 1309 of file driver_sx1262.c.