LibDriver SX1262
Loading...
Searching...
No Matches
driver_sx1262.h File Reference

driver sx1262 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_sx1262.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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

Macros

#define DRIVER_SX1262_LINK_INIT(HANDLE, STRUCTURE)
 initialize sx1262_handle_t structure
#define DRIVER_SX1262_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_SX1262_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_SX1262_LINK_SPI_WRITE_READ(HANDLE, FUC)
 link spi_write_read function
#define DRIVER_SX1262_LINK_RESET_GPIO_INIT(HANDLE, FUC)
 link reset_gpio_init function
#define DRIVER_SX1262_LINK_RESET_GPIO_DEINIT(HANDLE, FUC)
 link reset_gpio_deinit function
#define DRIVER_SX1262_LINK_RESET_GPIO_WRITE(HANDLE, FUC)
 link reset_gpio_write function
#define DRIVER_SX1262_LINK_BUSY_GPIO_INIT(HANDLE, FUC)
 link busy_gpio_init function
#define DRIVER_SX1262_LINK_BUSY_GPIO_DEINIT(HANDLE, FUC)
 link busy_gpio_deinit function
#define DRIVER_SX1262_LINK_BUSY_GPIO_READ(HANDLE, FUC)
 link busy_gpio_read function
#define DRIVER_SX1262_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SX1262_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_SX1262_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

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
uint8_t sx1262_set_fsk_whitening_initial_value (sx1262_handle_t *handle, uint16_t value)
 set the whitening initial value in FSK mode
uint8_t sx1262_get_fsk_whitening_initial_value (sx1262_handle_t *handle, uint16_t *value)
 get the whitening initial value in FSK mode
uint8_t sx1262_set_fsk_crc_initical_value (sx1262_handle_t *handle, uint16_t value)
 set the crc initial value in FSK mode
uint8_t sx1262_get_fsk_crc_initical_value (sx1262_handle_t *handle, uint16_t *value)
 get the crc initical value in FSK mode
uint8_t sx1262_set_fsk_crc_polynomial_value (sx1262_handle_t *handle, uint16_t value)
 set the crc polynomial value in FSK mode
uint8_t sx1262_get_fsk_crc_polynomial_value (sx1262_handle_t *handle, uint16_t *value)
 get the crc polynomial value in FSK mode
uint8_t sx1262_set_fsk_sync_word (sx1262_handle_t *handle, uint8_t sync_word[8])
 set the sync word in FSK mode
uint8_t sx1262_get_fsk_sync_word (sx1262_handle_t *handle, uint8_t sync_word[8])
 get the sync word in FSK mode
uint8_t sx1262_set_fsk_node_address (sx1262_handle_t *handle, uint8_t addr)
 set the node address in FSK mode
uint8_t sx1262_get_fsk_node_address (sx1262_handle_t *handle, uint8_t *addr)
 get the node address in FSK mode
uint8_t sx1262_set_fsk_broadcast_address (sx1262_handle_t *handle, uint8_t addr)
 set the broadcast address in FSK mode
uint8_t sx1262_get_fsk_broadcast_address (sx1262_handle_t *handle, uint8_t *addr)
 get the broadcast address in FSK mode
uint8_t sx1262_set_iq_polarity (sx1262_handle_t *handle, uint8_t setup)
 set the iq polarity
uint8_t sx1262_get_iq_polarity (sx1262_handle_t *handle, uint8_t *setup)
 get the iq polarity
uint8_t sx1262_set_lora_sync_word (sx1262_handle_t *handle, uint16_t sync_word)
 set the lora sync word
uint8_t sx1262_get_lora_sync_word (sx1262_handle_t *handle, uint16_t *sync_word)
 get the lora sync word
uint8_t sx1262_get_random_number (sx1262_handle_t *handle, uint32_t *r)
 get the random number
uint8_t sx1262_set_tx_modulation (sx1262_handle_t *handle, uint8_t modulation)
 set the tx modulation
uint8_t sx1262_get_tx_modulation (sx1262_handle_t *handle, uint8_t *modulation)
 get the tx modulation
uint8_t sx1262_set_rx_gain (sx1262_handle_t *handle, uint8_t gain)
 set the rx gain
uint8_t sx1262_get_rx_gain (sx1262_handle_t *handle, uint8_t *gain)
 get the rx gain
uint8_t sx1262_set_tx_clamp_config (sx1262_handle_t *handle, uint8_t config)
 set the tx clamp config
uint8_t sx1262_get_tx_clamp_config (sx1262_handle_t *handle, uint8_t *config)
 get the tx clamp config
uint8_t sx1262_set_ocp (sx1262_handle_t *handle, uint8_t ocp)
 set the ocp
uint8_t sx1262_get_ocp (sx1262_handle_t *handle, uint8_t *ocp)
 get the ocp
uint8_t sx1262_set_rtc_control (sx1262_handle_t *handle, uint8_t control)
 set the rtc control
uint8_t sx1262_get_rtc_control (sx1262_handle_t *handle, uint8_t *control)
 get the rtc control
uint8_t sx1262_set_xta_trim (sx1262_handle_t *handle, uint8_t trim)
 set the xta trim
uint8_t sx1262_get_xta_trim (sx1262_handle_t *handle, uint8_t *trim)
 get the xta trim
uint8_t sx1262_set_xtb_trim (sx1262_handle_t *handle, uint8_t trim)
 set the xtb trim
uint8_t sx1262_get_xtb_trim (sx1262_handle_t *handle, uint8_t *trim)
 get the xtb trim
uint8_t sx1262_set_dio3_output_control (sx1262_handle_t *handle, uint8_t control)
 set the dio3 output
uint8_t sx1262_get_dio3_output_control (sx1262_handle_t *handle, uint8_t *control)
 get the dio3 output
uint8_t sx1262_set_event_mask (sx1262_handle_t *handle, uint8_t mask)
 set the event mask
uint8_t sx1262_get_event_mask (sx1262_handle_t *handle, uint8_t *mask)
 get the event mask
uint8_t sx1262_set_dio_output_enable (sx1262_handle_t *handle, uint8_t enable)
 set the dio output enable
uint8_t sx1262_get_dio_output_enable (sx1262_handle_t *handle, uint8_t *enable)
 get the dio output enable
uint8_t sx1262_set_dio_input_enable (sx1262_handle_t *handle, uint8_t enable)
 set the dio input enable
uint8_t sx1262_get_dio_input_enable (sx1262_handle_t *handle, uint8_t *enable)
 get the dio input enable
uint8_t sx1262_set_pull_up_control (sx1262_handle_t *handle, uint8_t control)
 set the pull up control
uint8_t sx1262_get_pull_up_control (sx1262_handle_t *handle, uint8_t *control)
 get the pull up control
uint8_t sx1262_set_pull_down_control (sx1262_handle_t *handle, uint8_t control)
 set the pull down control
uint8_t sx1262_get_pull_down_control (sx1262_handle_t *handle, uint8_t *control)
 get the pull down control
uint8_t sx1262_set_fhss_hopping_enable (sx1262_handle_t *handle, uint8_t enable)
 set fhss hopping enable
uint8_t sx1262_get_fhss_hopping_enable (sx1262_handle_t *handle, uint8_t *enable)
 get fhss hopping enable
uint8_t sx1262_set_fhss_packet_length (sx1262_handle_t *handle, uint8_t len)
 set fhss packet length
uint8_t sx1262_get_fhss_packet_length (sx1262_handle_t *handle, uint8_t *len)
 get fhss packet length
uint8_t sx1262_set_fhss_nb_hopping_blocks (sx1262_handle_t *handle, uint8_t n)
 set fhss nb hopping blocks
uint8_t sx1262_get_fhss_nb_hopping_blocks (sx1262_handle_t *handle, uint8_t *n)
 get fhss nb hopping blocks
uint8_t sx1262_set_fhss_symbols_freq0 (sx1262_handle_t *handle, uint16_t num)
 set fhss freq0 symbols
uint8_t sx1262_get_fhss_symbols_freq0 (sx1262_handle_t *handle, uint16_t *num)
 get fhss freq0 symbols
uint8_t sx1262_set_fhss_freq0 (sx1262_handle_t *handle, uint32_t freq)
 set fhss freq0
uint8_t sx1262_get_fhss_freq0 (sx1262_handle_t *handle, uint32_t *freq)
 get fhss freq0
uint8_t sx1262_set_fhss_symbols_freq15 (sx1262_handle_t *handle, uint16_t num)
 set fhss freq15 symbols
uint8_t sx1262_get_fhss_symbols_freq15 (sx1262_handle_t *handle, uint16_t *num)
 get fhss freq15 symbols
uint8_t sx1262_set_fhss_freq15 (sx1262_handle_t *handle, uint32_t freq)
 set fhss freq15
uint8_t sx1262_get_fhss_freq15 (sx1262_handle_t *handle, uint32_t *freq)
 get fhss freq15
uint8_t sx1262_write_read_reg (sx1262_handle_t *handle, uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
 write and read register

Detailed Description

driver sx1262 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2024-10-30

history

Date Version Author Description
2024/10/30 1.0 Shifeng Li first upload

Definition in file driver_sx1262.h.