52 uint8_t addr, addr_check;
54 uint16_t value, value_check;
56 uint8_t sync_word_check[8];
57 uint8_t setup, setup_check;
59 uint8_t modulation, modulation_check;
60 uint8_t gain, gain_check;
61 uint8_t config, config_check;
62 uint8_t ocp, ocp_check;
63 uint8_t control, control_check;
64 uint8_t trim, trim_check;
65 uint8_t mask, mask_check;
66 uint8_t enable, enable_check;
68 uint32_t freq, freq_check;
69 uint32_t br, br_check;
136 control = rand() % 256;
159 control = rand() % 256;
182 us = (rand() % 10000) / 10.0;
249 llcc68_interface_debug_print(
"llcc68: llcc68_gfsk_frequency_deviation_convert_to_register/llcc68_gfsk_frequency_deviation_convert_to_data test.\n");
340 value = rand() % 65536;
363 value = rand() % 65536;
386 for (i = 0; i < 8; i++)
388 sync_word[i] = rand() %256;
399 sync_word[0], sync_word[1], sync_word[2], sync_word[3],
400 sync_word[4], sync_word[5], sync_word[6], sync_word[7]);
409 llcc68_interface_debug_print(
"llcc68: check fsk sync word %s.\n", memcmp((uint8_t *)sync_word, (uint8_t *)sync_word_check, 8) == 0 ?
"ok" :
"error");
483 value = rand() % 65536;
574 config = rand() % 256;
736 enable = rand() % 0xF;
767 enable = rand() % 0xF;
790 control = rand() % 0x0F;
821 control = rand() % 0x0F;
driver llcc68 register test header file
uint8_t llcc68_info(llcc68_info_t *info)
get chip's information
uint8_t llcc68_gfsk_bit_rate_convert_to_register(llcc68_handle_t *handle, uint32_t br, uint32_t *reg)
convert the bit rate to the register raw data
uint8_t llcc68_get_packet_type(llcc68_handle_t *handle, llcc68_packet_type_t *type)
get the packet type
uint8_t llcc68_deinit(llcc68_handle_t *handle)
close the chip
uint8_t llcc68_write_register(llcc68_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
write the register
uint8_t llcc68_gfsk_bit_rate_convert_to_data(llcc68_handle_t *handle, uint32_t reg, uint32_t *br)
convert the register raw data to the bit rate
uint8_t llcc68_timeout_convert_to_register(llcc68_handle_t *handle, double us, uint32_t *reg)
convert the timeout to the register raw data
uint8_t llcc68_read_register(llcc68_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
read the register
llcc68_packet_type_t
llcc68 packet type enumeration definition
uint8_t llcc68_set_standby(llcc68_handle_t *handle, llcc68_clock_source_t src)
enter to the standby mode
uint8_t llcc68_gfsk_frequency_deviation_convert_to_register(llcc68_handle_t *handle, uint32_t freq, uint32_t *reg)
convert the frequency deviation to the register raw data
uint8_t llcc68_timeout_convert_to_data(llcc68_handle_t *handle, uint32_t reg, double *us)
convert the register raw data to the timeout
uint8_t llcc68_frequency_convert_to_register(llcc68_handle_t *handle, uint32_t freq, uint32_t *reg)
convert the frequency to the register raw data
uint8_t llcc68_write_buffer(llcc68_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
write the buffer
uint8_t llcc68_frequency_convert_to_data(llcc68_handle_t *handle, uint32_t reg, uint32_t *freq)
convert the register raw data to the frequency
uint8_t llcc68_read_buffer(llcc68_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
read the buffer
uint8_t llcc68_set_packet_type(llcc68_handle_t *handle, llcc68_packet_type_t type)
set the packet type
uint8_t llcc68_init(llcc68_handle_t *handle)
initialize the chip
uint8_t llcc68_gfsk_frequency_deviation_convert_to_data(llcc68_handle_t *handle, uint32_t reg, uint32_t *freq)
convert the register raw data to the frequency deviation
@ LLCC68_CLOCK_SOURCE_XTAL_32MHZ
@ LLCC68_PACKET_TYPE_LORA
@ LLCC68_PACKET_TYPE_GFSK
uint8_t llcc68_interface_reset_gpio_init(void)
interface reset gpio init
uint8_t llcc68_interface_busy_gpio_read(uint8_t *value)
interface busy gpio read
uint8_t llcc68_interface_busy_gpio_deinit(void)
interface busy gpio deinit
uint8_t llcc68_interface_spi_deinit(void)
interface spi bus deinit
uint8_t llcc68_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
uint8_t llcc68_interface_reset_gpio_deinit(void)
interface reset gpio deinit
void llcc68_interface_receive_callback(uint16_t type, uint8_t *buf, uint16_t len)
interface receive callback
void llcc68_interface_debug_print(const char *const fmt,...)
interface print format data
void llcc68_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t llcc68_interface_spi_init(void)
interface spi bus init
uint8_t llcc68_interface_busy_gpio_init(void)
interface busy gpio init
uint8_t llcc68_interface_reset_gpio_write(uint8_t data)
interface reset gpio write
#define DRIVER_LLCC68_LINK_BUSY_GPIO_READ(HANDLE, FUC)
link busy_gpio_read function
#define DRIVER_LLCC68_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
#define DRIVER_LLCC68_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_LLCC68_LINK_RESET_GPIO_WRITE(HANDLE, FUC)
link reset_gpio_write function
#define DRIVER_LLCC68_LINK_BUSY_GPIO_DEINIT(HANDLE, FUC)
link busy_gpio_deinit function
#define DRIVER_LLCC68_LINK_SPI_WRITE_READ(HANDLE, FUC)
link spi_write_read function
#define DRIVER_LLCC68_LINK_INIT(HANDLE, STRUCTURE)
initialize llcc68_handle_t structure
#define DRIVER_LLCC68_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_LLCC68_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_LLCC68_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
#define DRIVER_LLCC68_LINK_RESET_GPIO_INIT(HANDLE, FUC)
link reset_gpio_init function
#define DRIVER_LLCC68_LINK_RESET_GPIO_DEINIT(HANDLE, FUC)
link reset_gpio_deinit function
#define DRIVER_LLCC68_LINK_BUSY_GPIO_INIT(HANDLE, FUC)
link busy_gpio_init function
uint8_t llcc68_set_dio_output_enable(llcc68_handle_t *handle, uint8_t enable)
set the dio output enable
uint8_t llcc68_get_dio_output_enable(llcc68_handle_t *handle, uint8_t *enable)
get the dio output enable
uint8_t llcc68_set_fsk_sync_word(llcc68_handle_t *handle, uint8_t sync_word[8])
set the sync word in FSK mode
uint8_t llcc68_get_fsk_broadcast_address(llcc68_handle_t *handle, uint8_t *addr)
get the broadcast address in FSK mode
uint8_t llcc68_set_xta_trim(llcc68_handle_t *handle, uint8_t trim)
set the xta trim
uint8_t llcc68_get_fsk_sync_word(llcc68_handle_t *handle, uint8_t sync_word[8])
get the sync word in FSK mode
uint8_t llcc68_set_iq_polarity(llcc68_handle_t *handle, uint8_t setup)
set the iq polarity
uint8_t llcc68_set_lora_sync_word(llcc68_handle_t *handle, uint16_t sync_word)
set the lora sync word
uint8_t llcc68_get_pull_down_control(llcc68_handle_t *handle, uint8_t *control)
get the pull down control
uint8_t llcc68_set_ocp(llcc68_handle_t *handle, uint8_t ocp)
set the ocp
uint8_t llcc68_set_tx_clamp_config(llcc68_handle_t *handle, uint8_t config)
set the tx clamp config
uint8_t llcc68_get_iq_polarity(llcc68_handle_t *handle, uint8_t *setup)
get the iq polarity
uint8_t llcc68_get_fsk_crc_initical_value(llcc68_handle_t *handle, uint16_t *value)
get the crc initical value in FSK mode
uint8_t llcc68_get_event_mask(llcc68_handle_t *handle, uint8_t *mask)
get the event mask
uint8_t llcc68_get_fsk_node_address(llcc68_handle_t *handle, uint8_t *addr)
get the node address in FSK mode
uint8_t llcc68_get_rtc_control(llcc68_handle_t *handle, uint8_t *control)
get the rtc control
uint8_t llcc68_set_rx_gain(llcc68_handle_t *handle, uint8_t gain)
set the rx gain
uint8_t llcc68_get_xtb_trim(llcc68_handle_t *handle, uint8_t *trim)
get the xtb trim
uint8_t llcc68_set_rtc_control(llcc68_handle_t *handle, uint8_t control)
set the rtc control
uint8_t llcc68_get_dio3_output_control(llcc68_handle_t *handle, uint8_t *control)
get the dio3 output
uint8_t llcc68_get_dio_input_enable(llcc68_handle_t *handle, uint8_t *enable)
get the dio input enable
uint8_t llcc68_get_xta_trim(llcc68_handle_t *handle, uint8_t *trim)
get the xta trim
uint8_t llcc68_set_pull_up_control(llcc68_handle_t *handle, uint8_t control)
set the pull up control
uint8_t llcc68_set_fsk_whitening_initial_value(llcc68_handle_t *handle, uint16_t value)
set the whitening initial value in FSK mode
uint8_t llcc68_set_event_mask(llcc68_handle_t *handle, uint8_t mask)
set the event mask
uint8_t llcc68_set_dio3_output_control(llcc68_handle_t *handle, uint8_t control)
set the dio3 output
uint8_t llcc68_get_lora_sync_word(llcc68_handle_t *handle, uint16_t *sync_word)
get the lora sync word
uint8_t llcc68_get_random_number(llcc68_handle_t *handle, uint32_t *r)
get the random number
uint8_t llcc68_get_pull_up_control(llcc68_handle_t *handle, uint8_t *control)
get the pull up control
uint8_t llcc68_set_fsk_broadcast_address(llcc68_handle_t *handle, uint8_t addr)
set the broadcast address in FSK mode
uint8_t llcc68_get_rx_gain(llcc68_handle_t *handle, uint8_t *gain)
get the rx gain
uint8_t llcc68_set_fsk_crc_polynomial_value(llcc68_handle_t *handle, uint16_t value)
set the crc polynomial value in FSK mode
uint8_t llcc68_set_tx_modulation(llcc68_handle_t *handle, uint8_t modulation)
set the tx modulation
uint8_t llcc68_set_fsk_node_address(llcc68_handle_t *handle, uint8_t addr)
set the node address in FSK mode
uint8_t llcc68_set_pull_down_control(llcc68_handle_t *handle, uint8_t control)
set the pull down control
uint8_t llcc68_set_dio_input_enable(llcc68_handle_t *handle, uint8_t enable)
set the dio input enable
uint8_t llcc68_get_tx_modulation(llcc68_handle_t *handle, uint8_t *modulation)
get the tx modulation
uint8_t llcc68_set_xtb_trim(llcc68_handle_t *handle, uint8_t trim)
set the xtb trim
uint8_t llcc68_get_tx_clamp_config(llcc68_handle_t *handle, uint8_t *config)
get the tx clamp config
uint8_t llcc68_get_ocp(llcc68_handle_t *handle, uint8_t *ocp)
get the ocp
uint8_t llcc68_get_fsk_whitening_initial_value(llcc68_handle_t *handle, uint16_t *value)
get the whitening initial value in FSK mode
uint8_t llcc68_get_fsk_crc_polynomial_value(llcc68_handle_t *handle, uint16_t *value)
get the crc polynomial value in FSK mode
uint8_t llcc68_set_fsk_crc_initical_value(llcc68_handle_t *handle, uint16_t value)
set the crc initial value in FSK mode
uint8_t llcc68_register_test(void)
register test
llcc68 handle structure definition
llcc68 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v