53 uint8_t addr, addr_check;
55 uint16_t value, value_check;
57 uint8_t sync_word_check[8];
58 uint8_t setup, setup_check;
60 uint8_t modulation, modulation_check;
61 uint8_t gain, gain_check;
62 uint8_t config, config_check;
63 uint8_t ocp, ocp_check;
64 uint8_t control, control_check;
65 uint8_t trim, trim_check;
66 uint8_t mask, mask_check;
67 uint8_t enable, enable_check;
69 uint32_t freq, freq_check;
70 uint32_t br, br_check;
137 control = rand() % 256;
160 control = rand() % 256;
183 us = (rand() % 10000) / 10.0;
250 sx1262_interface_debug_print(
"sx1262: sx1262_gfsk_frequency_deviation_convert_to_register/sx1262_gfsk_frequency_deviation_convert_to_data test.\n");
341 value = rand() % 65536;
364 value = rand() % 65536;
387 for (i = 0; i < 8; i++)
389 sync_word[i] = rand() %256;
400 sync_word[0], sync_word[1], sync_word[2], sync_word[3],
401 sync_word[4], sync_word[5], sync_word[6], sync_word[7]);
410 sx1262_interface_debug_print(
"sx1262: check fsk sync word %s.\n", memcmp((uint8_t *)sync_word, (uint8_t *)sync_word_check, 8) == 0 ?
"ok" :
"error");
484 value = rand() % 65536;
575 config = rand() % 256;
737 enable = rand() % 0xF;
768 enable = rand() % 0xF;
791 control = rand() % 0x0F;
822 control = rand() % 0x0F;
934 value = rand() % 0xFFFFUL;
957 freq = rand() % 0xFFFFUL;
980 value = rand() % 0xFFFFUL;
1003 freq = rand() % 0xFFFFUL;
driver sx1262 register test header file
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_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_read_buffer(sx1262_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
read the buffer
struct sx1262_info_s sx1262_info_t
sx1262 information structure definition
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_timeout_convert_to_data(sx1262_handle_t *handle, uint32_t reg, double *us)
convert the register raw data to the timeout
uint8_t sx1262_write_buffer(sx1262_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
write the buffer
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_read_register(sx1262_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
read the register
sx1262_packet_type_t
sx1262 packet type enumeration definition
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_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_packet_type(sx1262_handle_t *handle, sx1262_packet_type_t type)
set the packet type
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_get_packet_type(sx1262_handle_t *handle, sx1262_packet_type_t *type)
get the packet type
uint8_t sx1262_write_register(sx1262_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
write the register
uint8_t sx1262_deinit(sx1262_handle_t *handle)
close the chip
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_init(sx1262_handle_t *handle)
initialize the chip
uint8_t sx1262_info(sx1262_info_t *info)
get chip's information
@ SX1262_PACKET_TYPE_GFSK
@ SX1262_PACKET_TYPE_LORA
@ SX1262_CLOCK_SOURCE_XTAL_32MHZ
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_get_fhss_freq0(sx1262_handle_t *handle, uint32_t *freq)
get fhss freq0
uint8_t sx1262_set_dio_input_enable(sx1262_handle_t *handle, uint8_t enable)
set the dio input enable
uint8_t sx1262_set_tx_clamp_config(sx1262_handle_t *handle, uint8_t config)
set the tx clamp config
uint8_t sx1262_set_dio3_output_control(sx1262_handle_t *handle, uint8_t control)
set the dio3 output
uint8_t sx1262_set_lora_sync_word(sx1262_handle_t *handle, uint16_t sync_word)
set the lora sync word
uint8_t sx1262_set_pull_up_control(sx1262_handle_t *handle, uint8_t control)
set the pull up control
uint8_t sx1262_get_fhss_symbols_freq0(sx1262_handle_t *handle, uint16_t *num)
get fhss freq0 symbols
uint8_t sx1262_set_pull_down_control(sx1262_handle_t *handle, uint8_t control)
set the pull down control
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_xta_trim(sx1262_handle_t *handle, uint8_t trim)
set the xta trim
uint8_t sx1262_get_fhss_nb_hopping_blocks(sx1262_handle_t *handle, uint8_t *n)
get fhss nb hopping blocks
uint8_t sx1262_set_rx_gain(sx1262_handle_t *handle, uint8_t gain)
set the rx gain
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_lora_sync_word(sx1262_handle_t *handle, uint16_t *sync_word)
get the lora sync word
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_get_fhss_packet_length(sx1262_handle_t *handle, uint8_t *len)
get fhss packet length
uint8_t sx1262_get_dio_output_enable(sx1262_handle_t *handle, uint8_t *enable)
get the dio output enable
uint8_t sx1262_set_rtc_control(sx1262_handle_t *handle, uint8_t control)
set the rtc control
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_fhss_symbols_freq15(sx1262_handle_t *handle, uint16_t *num)
get fhss freq15 symbols
uint8_t sx1262_get_random_number(sx1262_handle_t *handle, uint32_t *r)
get the random number
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_set_fsk_whitening_initial_value(sx1262_handle_t *handle, uint16_t value)
set the whitening initial value in FSK mode
uint8_t sx1262_get_rx_gain(sx1262_handle_t *handle, uint8_t *gain)
get the rx gain
uint8_t sx1262_set_fhss_nb_hopping_blocks(sx1262_handle_t *handle, uint8_t n)
set fhss nb hopping blocks
uint8_t sx1262_set_fhss_packet_length(sx1262_handle_t *handle, uint8_t len)
set fhss packet length
uint8_t sx1262_get_fsk_node_address(sx1262_handle_t *handle, uint8_t *addr)
get the node address in FSK mode
uint8_t sx1262_get_tx_clamp_config(sx1262_handle_t *handle, uint8_t *config)
get the tx clamp config
uint8_t sx1262_get_event_mask(sx1262_handle_t *handle, uint8_t *mask)
get the event mask
uint8_t sx1262_set_fhss_freq15(sx1262_handle_t *handle, uint32_t freq)
set fhss freq15
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_get_xta_trim(sx1262_handle_t *handle, uint8_t *trim)
get the xta trim
uint8_t sx1262_set_fhss_symbols_freq15(sx1262_handle_t *handle, uint16_t num)
set fhss freq15 symbols
uint8_t sx1262_get_dio_input_enable(sx1262_handle_t *handle, uint8_t *enable)
get the dio input enable
uint8_t sx1262_get_rtc_control(sx1262_handle_t *handle, uint8_t *control)
get the rtc control
uint8_t sx1262_get_tx_modulation(sx1262_handle_t *handle, uint8_t *modulation)
get the tx modulation
uint8_t sx1262_get_fhss_hopping_enable(sx1262_handle_t *handle, uint8_t *enable)
get fhss hopping enable
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_get_pull_down_control(sx1262_handle_t *handle, uint8_t *control)
get the pull down control
uint8_t sx1262_get_dio3_output_control(sx1262_handle_t *handle, uint8_t *control)
get the dio3 output
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_event_mask(sx1262_handle_t *handle, uint8_t mask)
set the event mask
uint8_t sx1262_get_pull_up_control(sx1262_handle_t *handle, uint8_t *control)
get the pull up control
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_fhss_symbols_freq0(sx1262_handle_t *handle, uint16_t num)
set fhss freq0 symbols
uint8_t sx1262_set_dio_output_enable(sx1262_handle_t *handle, uint8_t enable)
set the dio output enable
uint8_t sx1262_get_xtb_trim(sx1262_handle_t *handle, uint8_t *trim)
get the xtb trim
uint8_t sx1262_set_fsk_broadcast_address(sx1262_handle_t *handle, uint8_t addr)
set the broadcast address 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_set_fhss_freq0(sx1262_handle_t *handle, uint32_t freq)
set fhss freq0
uint8_t sx1262_get_ocp(sx1262_handle_t *handle, uint8_t *ocp)
get the ocp
uint8_t sx1262_set_xtb_trim(sx1262_handle_t *handle, uint8_t trim)
set the xtb trim
uint8_t sx1262_set_fhss_hopping_enable(sx1262_handle_t *handle, uint8_t enable)
set fhss hopping enable
uint8_t sx1262_get_fhss_freq15(sx1262_handle_t *handle, uint32_t *freq)
get fhss freq15
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_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v