40static uint8_t gs_rx_done;
41static uint8_t gs_send_buffer[256];
50static void a_callback(uint16_t type, uint8_t *buf, uint16_t len)
66 uint8_t signal_rssi_pkt_raw;
69 float signal_rssi_pkt;
75 (uint8_t *)&signal_rssi_pkt_raw, (
float *)&rssi_pkt,
76 (
float *)&snr_pkt, (
float *)&signal_rssi_pkt) != 0)
91 for (i = 0; i < len; i++)
451 for (i = 0; i < 192; i++)
453 gs_send_buffer[i] = i;
460 (uint8_t *)gs_send_buffer, 192, 0);
801 while ((s != 0) && (gs_rx_done == 0))
driver sx1262 send receive test header file
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
sx1262_bool_t
sx1262 bool enumeration definition
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_clear_irq_status(sx1262_handle_t *handle, uint16_t clear_irq_param)
clear the irq status
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_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_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
struct sx1262_handle_s sx1262_handle_t
sx1262 handle structure definition
uint8_t sx1262_set_standby(sx1262_handle_t *handle, sx1262_clock_source_t src)
enter to the standby mode
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_regulator_mode(sx1262_handle_t *handle, sx1262_regulator_mode_t mode)
set the regulator_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_lora_symb_num_timeout(sx1262_handle_t *handle, uint8_t symb_num)
set the lora symbol number timeout
uint8_t sx1262_irq_handler(sx1262_handle_t *handle)
irq handler
uint8_t sx1262_continuous_receive(sx1262_handle_t *handle)
enter to the continuous receive mode
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_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_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_set_stop_timer_on_preamble(sx1262_handle_t *handle, sx1262_bool_t enable)
stop timer on preamble
uint8_t sx1262_deinit(sx1262_handle_t *handle)
close the chip
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_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_check_packet_error(sx1262_handle_t *handle, sx1262_bool_t *enable)
check the packet error
uint8_t sx1262_clear_device_errors(sx1262_handle_t *handle)
clear the device errors
uint8_t sx1262_init(sx1262_handle_t *handle)
initialize the chip
@ SX1262_LORA_BANDWIDTH_125_KHZ
@ SX1262_RX_TX_FALLBACK_MODE_STDBY_XOSC
@ SX1262_PACKET_TYPE_LORA
@ SX1262_LORA_CRC_TYPE_ON
@ SX1262_LORA_HEADER_EXPLICIT
@ SX1262_IRQ_PREAMBLE_DETECTED
@ SX1262_IRQ_CAD_DETECTED
@ SX1262_IRQ_SYNC_WORD_VALID
@ SX1262_IRQ_HEADER_VALID
@ SX1262_CLOCK_SOURCE_XTAL_32MHZ
@ SX1262_REGULATOR_MODE_DC_DC_LDO
uint8_t sx1262_interface_busy_gpio_deinit(void)
interface busy gpio deinit
uint8_t sx1262_interface_reset_gpio_init(void)
interface reset gpio init
uint8_t sx1262_interface_spi_deinit(void)
interface spi bus deinit
uint8_t sx1262_interface_spi_init(void)
interface spi bus init
uint8_t sx1262_interface_reset_gpio_deinit(void)
interface reset gpio deinit
uint8_t sx1262_interface_busy_gpio_init(void)
interface busy gpio init
void sx1262_interface_receive_callback(uint16_t type, uint8_t *buf, uint16_t len)
interface receive callback
uint8_t sx1262_interface_reset_gpio_write(uint8_t data)
interface reset gpio write
void sx1262_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t sx1262_interface_busy_gpio_read(uint8_t *value)
interface busy gpio read
uint8_t sx1262_interface_spi_write_read(uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
interface spi bus write read
void sx1262_interface_delay_ms(uint32_t ms)
interface delay ms
#define DRIVER_SX1262_LINK_SPI_WRITE_READ(HANDLE, FUC)
link spi_write_read function
#define DRIVER_SX1262_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
#define DRIVER_SX1262_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_SX1262_LINK_BUSY_GPIO_DEINIT(HANDLE, FUC)
link busy_gpio_deinit function
#define DRIVER_SX1262_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_SX1262_LINK_BUSY_GPIO_INIT(HANDLE, FUC)
link busy_gpio_init function
#define DRIVER_SX1262_LINK_INIT(HANDLE, STRUCTURE)
initialize sx1262_handle_t structure
#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_READ(HANDLE, FUC)
link busy_gpio_read function
#define DRIVER_SX1262_LINK_RESET_GPIO_INIT(HANDLE, FUC)
link reset_gpio_init function
#define DRIVER_SX1262_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_SX1262_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
uint8_t sx1262_set_tx_clamp_config(sx1262_handle_t *handle, uint8_t config)
set the tx clamp config
uint8_t sx1262_set_lora_sync_word(sx1262_handle_t *handle, uint16_t sync_word)
set the lora sync word
uint8_t sx1262_get_iq_polarity(sx1262_handle_t *handle, uint8_t *setup)
get the iq polarity
uint8_t sx1262_set_iq_polarity(sx1262_handle_t *handle, uint8_t setup)
set the iq polarity
uint8_t sx1262_set_rx_gain(sx1262_handle_t *handle, uint8_t gain)
set the rx gain
uint8_t sx1262_set_ocp(sx1262_handle_t *handle, uint8_t ocp)
set the ocp
uint8_t sx1262_set_tx_modulation(sx1262_handle_t *handle, uint8_t modulation)
set the tx modulation
uint8_t sx1262_get_tx_clamp_config(sx1262_handle_t *handle, uint8_t *config)
get the tx clamp config
uint8_t sx1262_get_tx_modulation(sx1262_handle_t *handle, uint8_t *modulation)
get the tx modulation
uint8_t sx1262_send_test(void)
send test
uint8_t sx1262_interrupt_test_irq_handler(void)
sx1262 interrupt test irq
uint8_t sx1262_receive_test(uint32_t s)
receive test