43 #define CHIP_NAME "Semtech LLCC68"
44 #define MANUFACTURER_NAME "Semtech"
45 #define SUPPLY_VOLTAGE_MIN 1.8f
46 #define SUPPLY_VOLTAGE_MAX 3.7f
47 #define MAX_CURRENT 118.0f
48 #define TEMPERATURE_MIN -40.0f
49 #define TEMPERATURE_MAX 85.0f
50 #define DRIVER_VERSION 1000
55 #define LLCC68_COMMAND_SET_SLEEP 0x84
56 #define LLCC68_COMMAND_SET_STANDBY 0x80
57 #define LLCC68_COMMAND_SET_FS 0xC1
58 #define LLCC68_COMMAND_SET_TX 0x83
59 #define LLCC68_COMMAND_SET_RX 0x82
60 #define LLCC68_COMMAND_STOP_TIMER_ON_PREAMBLE 0x9F
61 #define LLCC68_COMMAND_SET_RX_DUTY_CYCLE 0x94
62 #define LLCC68_COMMAND_SET_CAD 0xC5
63 #define LLCC68_COMMAND_SET_TX_CONTINUOUS_WAVE 0xD1
64 #define LLCC68_COMMAND_SET_TX_INFINITE_PREAMBLE 0xD2
65 #define LLCC68_COMMAND_SET_REGULATOR_MODE 0x96
66 #define LLCC68_COMMAND_SET_CALIBRATE 0x89
67 #define LLCC68_COMMAND_SET_CALIBRATE_IMAGE 0x98
68 #define LLCC68_COMMAND_SET_PA_CONFIG 0x95
69 #define LLCC68_COMMAND_SET_RX_TX_FALLBACK_MODE 0x93
70 #define LLCC68_COMMAND_WRITE_REGISTER 0x0D
71 #define LLCC68_COMMAND_READ_REGISTER 0x1D
72 #define LLCC68_COMMAND_WRITE_BUFFER 0x0E
73 #define LLCC68_COMMAND_READ_BUFFER 0x1E
74 #define LLCC68_COMMAND_SET_DIO_IRQ_PARAMS 0x08
75 #define LLCC68_COMMAND_GET_IRQ_STATUS 0x12
76 #define LLCC68_COMMAND_CLEAR_IRQ_STATUS 0x02
77 #define LLCC68_COMMAND_SET_DIO2_AS_RF_SWITCH_CTRL 0x9D
78 #define LLCC68_COMMAND_SET_DIO3_AS_TCXO_CTRL 0x97
79 #define LLCC68_COMMAND_SET_RF_FREQUENCY 0x86
80 #define LLCC68_COMMAND_SET_PACKET_TYPE 0x8A
81 #define LLCC68_COMMAND_GET_PACKET_TYPE 0x11
82 #define LLCC68_COMMAND_SET_TX_PARAMS 0x8E
83 #define LLCC68_COMMAND_SET_MODULATION_PARAMS 0x8B
84 #define LLCC68_COMMAND_SET_PACKET_PARAMS 0x8C
85 #define LLCC68_COMMAND_SET_CAD_PARAMS 0x88
86 #define LLCC68_COMMAND_SET_BUFFER_BASE_ADDRESS 0x8F
87 #define LLCC68_COMMAND_SET_LORA_SYMB_NUM_TIMEOUT 0xA0
88 #define LLCC68_COMMAND_GET_STATUS 0xC0
89 #define LLCC68_COMMAND_GET_RSSI_LNST 0x15
90 #define LLCC68_COMMAND_GET_RX_BUFFER_STATUS 0x13
91 #define LLCC68_COMMAND_GET_PACKET_STATUS 0x14
92 #define LLCC68_COMMAND_GET_DEVICE_ERRORS 0x17
93 #define LLCC68_COMMAND_CLEAR_DEVICE_ERRORS 0x07
94 #define LLCC68_COMMAND_GET_STATS 0x10
95 #define LLCC68_COMMAND_RESET_STATS 0x00
100 #define LLCC68_REG_DIOX_OUTPUT_ENABLE 0x0580
101 #define LLCC68_REG_DIOX_INPUT_ENABLE 0x0583
102 #define LLCC68_REG_DIOX_PULL_UP_CONTROL 0x0584
103 #define LLCC68_REG_DIOX_PULL_DOWN_CONTROL 0x0585
104 #define LLCC68_REG_WHITENING_INIT_VALUE_MSB 0x06B8
105 #define LLCC68_REG_WHITENING_INIT_VALUE_LSB 0x06B9
106 #define LLCC68_REG_CRC_INIT_VALUE_MSB 0x06BC
107 #define LLCC68_REG_CRC_INIT_VALUE_LSB 0x06BD
108 #define LLCC68_REG_CRC_POLYNOMIAL_VALUE_MSB 0x06BE
109 #define LLCC68_REG_CRC_POLYNOMIAL_VALUE_LSB 0x06BF
110 #define LLCC68_REG_SYNC_WORD_0 0x06C0
111 #define LLCC68_REG_SYNC_WORD_1 0x06C1
112 #define LLCC68_REG_SYNC_WORD_2 0x06C2
113 #define LLCC68_REG_SYNC_WORD_3 0x06C3
114 #define LLCC68_REG_SYNC_WORD_4 0x06C4
115 #define LLCC68_REG_SYNC_WORD_5 0x06C5
116 #define LLCC68_REG_SYNC_WORD_6 0x06C6
117 #define LLCC68_REG_SYNC_WORD_7 0x06C7
118 #define LLCC68_REG_NODE_ADDRESS 0x06CD
119 #define LLCC68_REG_BROADCAST_ADDRESS 0x06CE
120 #define LLCC68_REG_IQ_POLARITY_SETUP 0x0736
121 #define LLCC68_REG_LORA_SYNC_WORD_MSB 0x0740
122 #define LLCC68_REG_LORA_SYNC_WORD_LSB 0x0741
123 #define LLCC68_REG_RANDOM_NUMBER_GEN_0 0x0819
124 #define LLCC68_REG_RANDOM_NUMBER_GEN_1 0x081A
125 #define LLCC68_REG_RANDOM_NUMBER_GEN_2 0x081B
126 #define LLCC68_REG_RANDOM_NUMBER_GEN_3 0x081C
127 #define LLCC68_REG_TX_MODULATION 0x0889
128 #define LLCC68_REG_RX_GAIN 0x08AC
129 #define LLCC68_REG_TX_CLAMP_CONFIG 0x08D8
130 #define LLCC68_REG_OCP_CONFIGURATION 0x08E7
131 #define LLCC68_REG_RTC_CONTROL 0x0902
132 #define LLCC68_REG_XTA_TRIM 0x0911
133 #define LLCC68_REG_XTB_TRIM 0x0912
134 #define LLCC68_REG_DIO3_OUTPUT_CONTROL 0x0920
135 #define LLCC68_REG_EVENT_MASK 0x0944
148 static uint8_t a_llcc68_spi_read(
llcc68_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
172 static uint8_t a_llcc68_spi_write(
llcc68_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
181 memset(handle->
buf, 0,
sizeof(uint8_t) * 384);
182 handle->
buf[0] = reg;
183 memcpy(&handle->
buf[1], buf, len);
206 static uint8_t a_llcc68_spi_read_register(
llcc68_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
217 memset(handle->
buf, 0,
sizeof(uint8_t) * 384);
219 reg_buf[1] = (reg >> 8) & 0xFF;
220 reg_buf[2] = (reg >> 0) & 0xFF;
227 memcpy(buf, handle->
buf + 1, len);
245 static uint8_t a_llcc68_spi_write_register(
llcc68_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
254 memset(handle->
buf, 0,
sizeof(uint8_t) * 384);
256 handle->
buf[1] = (reg >> 8) & 0xFF;
257 handle->
buf[2] = (reg >> 0) & 0xFF;
258 memcpy(&handle->
buf[3], buf, len);
281 static uint8_t a_llcc68_spi_write_buffer(
llcc68_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
290 memset(handle->
buf, 0,
sizeof(uint8_t) * 384);
292 handle->
buf[1] = offset;
293 memcpy(&handle->
buf[2], buf, len);
316 static uint8_t a_llcc68_spi_read_buffer(
llcc68_handle_t *handle, uint8_t offset, uint8_t *buf, uint16_t len)
327 memset(handle->
buf, 0,
sizeof(uint8_t) * 384);
336 memcpy(buf, handle->
buf + 1, len);
369 else if ((level == 1) && (timeout != 0))
415 memset(buf, 0,
sizeof(uint8_t) * 3);
419 handle->
debug_print(
"llcc68: get irq status failed.\n");
423 status = ((uint16_t)buf[1] << 8) | buf[2];
427 handle->
debug_print(
"llcc68: clear irq status failed.\n");
494 handle->
debug_print(
"llcc68: write register failed.\n");
503 handle->
debug_print(
"llcc68: read register failed.\n");
511 handle->
debug_print(
"llcc68: write register failed.\n");
532 uint8_t payload_length_rx;
533 uint8_t rx_start_buffer_pointer;
535 memset(buf, 0,
sizeof(uint8_t) * 3);
539 handle->
debug_print(
"llcc68: get rx buffer status failed.\n");
543 payload_length_rx = buf[1];
544 rx_start_buffer_pointer = buf[2];
546 res = a_llcc68_spi_read_buffer(handle, rx_start_buffer_pointer, handle->
receive_buf,
550 handle->
debug_print(
"llcc68: read buffer failed.\n");
598 handle->
debug_print(
"llcc68: spi_init is null.\n");
604 handle->
debug_print(
"llcc68: spi_deinit is null.\n");
610 handle->
debug_print(
"llcc68: spi_write_read is null.\n");
616 handle->
debug_print(
"llcc68: reset_gpio_init is null.\n");
622 handle->
debug_print(
"llcc68: reset_gpio_deinit is null.\n");
628 handle->
debug_print(
"llcc68: reset_gpio_write is null.\n");
634 handle->
debug_print(
"llcc68: busy_gpio_init is null.\n");
640 handle->
debug_print(
"llcc68: busy_gpio_deinit is null.\n");
646 handle->
debug_print(
"llcc68: busy_gpio_read is null.\n");
652 handle->
debug_print(
"llcc68: delay_ms is null.\n");
658 handle->
debug_print(
"llcc68: receive_callback is null.\n");
665 handle->
debug_print(
"llcc68: spi initialization failed.\n");
671 handle->
debug_print(
"llcc68: reset gpio initialization failed.\n");
678 handle->
debug_print(
"llcc68: busy gpio initialization failed.\n");
687 handle->
debug_print(
"llcc68: reset chip failed.\n");
697 handle->
debug_print(
"llcc68: reset chip failed.\n");
707 handle->
debug_print(
"llcc68: reset chip failed.\n");
718 handle->
debug_print(
"llcc68: get status failed.\n");
728 handle->
debug_print(
"llcc68: set standby failed.\n");
767 res = a_llcc68_check_busy(handle);
779 handle->
debug_print(
"llcc68: power down failed.\n");
787 handle->
debug_print(
"llcc68: busy gpio deinit failed.\n");
794 handle->
debug_print(
"llcc68: reset gpio deinit failed.\n");
801 handle->
debug_print(
"llcc68: spi deinit failed.\n");
825 uint16_t clear_irq_param;
837 res = a_llcc68_check_busy(handle);
845 clear_irq_param = 0x03FF;
846 buf[0] = (clear_irq_param >> 8) & 0xFF;
847 buf[1] = (clear_irq_param >> 0) & 0xFF;
851 handle->
debug_print(
"llcc68: clear irq status failed.\n");
856 res = a_llcc68_check_busy(handle);
864 timeout = (uint32_t)(us / 15.625);
865 buf[0] = (timeout >> 16) & 0xFF;
866 buf[1] = (timeout >> 8) & 0xFF;
867 buf[2] = (timeout >> 0) & 0xFF;
893 uint16_t clear_irq_param;
905 res = a_llcc68_check_busy(handle);
913 clear_irq_param = 0x03FF;
914 buf[0] = (clear_irq_param >> 8) & 0xFF;
915 buf[1] = (clear_irq_param >> 0) & 0xFF;
919 handle->
debug_print(
"llcc68: clear irq status failed.\n");
924 res = a_llcc68_check_busy(handle);
962 uint16_t clear_irq_param;
975 res = a_llcc68_check_busy(handle);
983 clear_irq_param = 0x03FF;
984 buf[0] = (clear_irq_param >> 8) & 0xFF;
985 buf[1] = (clear_irq_param >> 0) & 0xFF;
989 handle->
debug_print(
"llcc68: clear irq status failed.\n");
994 res = a_llcc68_check_busy(handle);
1013 while ((timeout != 0) && (handle->
cad_done == 0))
1087 uint8_t *buf, uint16_t len, uint32_t us)
1092 uint16_t clear_irq_param;
1105 res = a_llcc68_check_busy(handle);
1113 clear_irq_param = 0x03FF;
1114 buffer[0] = (clear_irq_param >> 8) & 0xFF;
1115 buffer[1] = (clear_irq_param >> 0) & 0xFF;
1119 handle->
debug_print(
"llcc68: clear irq status failed.\n");
1124 res = a_llcc68_check_busy(handle);
1136 handle->
debug_print(
"llcc68: set standby failed.\n");
1141 res = a_llcc68_check_busy(handle);
1149 buffer[0] = (preamble_length >> 8) & 0xFF;
1150 buffer[1] = (preamble_length >> 0) & 0xFF;
1151 buffer[2] = header_type;
1152 buffer[3] = (uint8_t)len;
1153 buffer[4] = crc_type;
1154 buffer[5] = invert_iq_enable;
1158 handle->
debug_print(
"llcc68: set lora modulation params failed.\n");
1167 res = a_llcc68_check_busy(handle);
1178 handle->
debug_print(
"llcc68: read register failed.\n");
1187 handle->
debug_print(
"llcc68: read register failed.\n");
1196 res = a_llcc68_check_busy(handle);
1207 handle->
debug_print(
"llcc68: read register failed.\n");
1216 handle->
debug_print(
"llcc68: read register failed.\n");
1222 res = a_llcc68_check_busy(handle);
1230 if (a_llcc68_spi_write_buffer(handle, 0x00, buf, len) != 0)
1232 handle->
debug_print(
"llcc68: write buffer failed.\n");
1237 res = a_llcc68_check_busy(handle);
1245 reg = (uint32_t)(us / 15.625);
1246 buffer[0] = (reg >> 16) & 0xFF;
1247 buffer[1] = (reg >> 8) & 0xFF;
1248 buffer[2] = (reg >> 0) & 0xFF;
1258 ms = us / 1000 + 10000;
1259 while ((ms != 0) && (handle->
tx_done == 0) && (handle->
timeout == 0))
1264 if ((ms != 0) && (handle->
tx_done == 1))
1268 else if ((ms == 0) && (handle->
tx_done == 0))
1274 else if (handle->
timeout == 1)
1315 res = a_llcc68_check_busy(handle);
1323 if (a_llcc68_spi_write_register(handle, reg, buf, len) != 0)
1325 handle->
debug_print(
"llcc68: write register failed.\n");
1360 res = a_llcc68_check_busy(handle);
1368 if (a_llcc68_spi_read_register(handle, reg, buf, len) != 0)
1370 handle->
debug_print(
"llcc68: read register failed.\n");
1405 res = a_llcc68_check_busy(handle);
1413 if (a_llcc68_spi_write_buffer(handle, offset, buf, len) != 0)
1415 handle->
debug_print(
"llcc68: write buffer failed.\n");
1450 res = a_llcc68_check_busy(handle);
1458 if (a_llcc68_spi_read_buffer(handle, offset, buf, len) != 0)
1460 handle->
debug_print(
"llcc68: read buffer failed.\n");
1495 res = a_llcc68_check_busy(handle);
1503 prev = (uint8_t)((mode << 2) | (rtc_wake_up_enable << 0));
1507 handle->
debug_print(
"llcc68: set sleep failed.\n");
1541 res = a_llcc68_check_busy(handle);
1553 handle->
debug_print(
"llcc68: set standby failed.\n");
1585 res = a_llcc68_check_busy(handle);
1630 res = a_llcc68_check_busy(handle);
1638 buf[0] = (timeout >> 16) & 0xFF;
1639 buf[1] = (timeout >> 8) & 0xFF;
1640 buf[2] = (timeout >> 0) & 0xFF;
1679 res = a_llcc68_check_busy(handle);
1687 buf[0] = (timeout >> 16) & 0xFF;
1688 buf[1] = (timeout >> 8) & 0xFF;
1689 buf[2] = (timeout >> 0) & 0xFF;
1723 *reg = (uint32_t)(us / 15.625);
1750 *us = (double)(reg) * 15.625;
1781 res = a_llcc68_check_busy(handle);
1793 handle->
debug_print(
"llcc68: set stop timer on preamble failed.\n");
1828 res = a_llcc68_check_busy(handle);
1836 buf[0] = (rx_period >> 16) & 0xFF;
1837 buf[1] = (rx_period >> 8) & 0xFF;
1838 buf[2] = (rx_period >> 0) & 0xFF;
1839 buf[3] = (sleep_period >> 16) & 0xFF;
1840 buf[4] = (sleep_period >> 8) & 0xFF;
1841 buf[5] = (sleep_period >> 0) & 0xFF;
1845 handle->
debug_print(
"llcc68: set rx duty cycle failed.\n");
1877 res = a_llcc68_check_busy(handle);
1920 res = a_llcc68_check_busy(handle);
1931 handle->
debug_print(
"llcc68: set tx continuous wave failed.\n");
1963 res = a_llcc68_check_busy(handle);
1974 handle->
debug_print(
"llcc68: set tx infinite preamble failed.\n");
2008 res = a_llcc68_check_busy(handle);
2020 handle->
debug_print(
"llcc68: set regulator mode failed.\n");
2054 res = a_llcc68_check_busy(handle);
2066 handle->
debug_print(
"llcc68: set calibration failed.\n");
2101 res = a_llcc68_check_busy(handle);
2114 handle->
debug_print(
"llcc68: set calibration image failed.\n");
2149 res = a_llcc68_check_busy(handle);
2157 buf[0] = pa_duty_cycle;
2164 handle->
debug_print(
"llcc68: set pa config failed.\n");
2198 res = a_llcc68_check_busy(handle);
2210 handle->
debug_print(
"llcc68: set rx tx fallback mode failed.\n");
2234 uint16_t dio2_mask, uint16_t dio3_mask)
2248 res = a_llcc68_check_busy(handle);
2256 buf[0] = (irq_mask >> 8) & 0xFF;
2257 buf[1] = (irq_mask >> 0) & 0xFF;
2258 buf[2] = (dio1_mask >> 8) & 0xFF;
2259 buf[3] = (dio1_mask >> 0) & 0xFF;
2260 buf[4] = (dio2_mask >> 8) & 0xFF;
2261 buf[5] = (dio2_mask >> 0) & 0xFF;
2262 buf[6] = (dio3_mask >> 8) & 0xFF;
2263 buf[7] = (dio3_mask >> 0) & 0xFF;
2268 handle->
debug_print(
"llcc68: set dio irq params failed.\n");
2302 res = a_llcc68_check_busy(handle);
2313 handle->
debug_print(
"llcc68: get irq status failed.\n");
2317 *status = ((uint16_t)buf[1] << 8) | buf[2];
2348 res = a_llcc68_check_busy(handle);
2356 buf[0] = (clear_irq_param >> 8) & 0xFF;
2357 buf[1] = (clear_irq_param >> 0) & 0xFF;
2361 handle->
debug_print(
"llcc68: clear irq status failed.\n");
2395 res = a_llcc68_check_busy(handle);
2407 handle->
debug_print(
"llcc68: set dio2 as rf switch ctrl failed.\n");
2442 res = a_llcc68_check_busy(handle);
2451 buf[1] = (delay >> 16) & 0xFF;
2452 buf[2] = (delay >> 8) & 0xFF;
2453 buf[3] = (delay >> 0) & 0xFF;
2457 handle->
debug_print(
"llcc68: set dio3 as tcxo ctrl status failed.\n");
2487 *reg = (uint32_t)(powf(2.0f, 25.0f) / (32 * powf(10.f, 6.0f)) * freq);
2514 *freq = (uint32_t)(32 * powf(10.f, 6.0f) / powf(2.0f, 25.0f) * reg);
2545 res = a_llcc68_check_busy(handle);
2553 buf[0] = (reg >> 24) & 0xFF;
2554 buf[1] = (reg >> 16) & 0xFF;
2555 buf[2] = (reg >> 8) & 0xFF;
2556 buf[3] = (reg >> 0) & 0xFF;
2560 handle->
debug_print(
"llcc68: set rf frequency failed.\n");
2594 res = a_llcc68_check_busy(handle);
2606 handle->
debug_print(
"llcc68: set packet type failed.\n");
2640 res = a_llcc68_check_busy(handle);
2651 handle->
debug_print(
"llcc68: get packet type failed.\n");
2687 res = a_llcc68_check_busy(handle);
2700 handle->
debug_print(
"llcc68: set tx params failed.\n");
2738 res = a_llcc68_check_busy(handle);
2746 buf[0] = (br >> 16) & 0xFF;
2747 buf[1] = (br >> 8) & 0xFF;
2748 buf[2] = (br >> 0) & 0xFF;
2751 buf[5] = (fdev >> 16) & 0xFF;
2752 buf[6] = (fdev >> 8) & 0xFF;
2753 buf[7] = (fdev >> 0) & 0xFF;
2757 handle->
debug_print(
"llcc68: set gfsk modulation params failed.\n");
2787 *reg = (uint32_t)(32 * (32 * powf(10.f, 6.0f))) / br;
2814 *br = (uint32_t)(32 * 32 * powf(10.f, 6.0f) / reg);
2841 *reg = (uint32_t)(powf(2.0f, 25.0f) * freq / (32 * powf(10.f, 6.0f)));
2868 *freq = (uint32_t)(32 * powf(10.f, 6.0f) / powf(2.0f, 25.0f) * reg);
2903 res = a_llcc68_check_busy(handle);
2914 buf[3] = low_data_rate_optimize_enable;
2918 handle->
debug_print(
"llcc68: set lora modulation params failed.\n");
2963 if (sync_word_length > 0x40)
2965 handle->
debug_print(
"llcc68: sync word length is over 0x40.\n");
2970 res = a_llcc68_check_busy(handle);
2978 buf[0] = (preamble_length >> 8) & 0xFF;
2979 buf[1] = (preamble_length >> 0) & 0xFF;
2980 buf[2] = detector_length;
2981 buf[3] = sync_word_length;
2983 buf[5] = packet_type;
2984 buf[6] = payload_length;
2986 buf[8] = whitening_enable;
2990 handle->
debug_print(
"llcc68: set gfsk modulation params failed.\n");
3030 res = a_llcc68_check_busy(handle);
3038 buf[0] = (preamble_length >> 8) & 0xFF;
3039 buf[1] = (preamble_length >> 0) & 0xFF;
3040 buf[2] = header_type;
3041 buf[3] = payload_length;
3043 buf[5] = invert_iq_enable;
3047 handle->
debug_print(
"llcc68: set lora modulation params failed.\n");
3087 res = a_llcc68_check_busy(handle);
3096 buf[1] = cad_det_peak;
3097 buf[2] = cad_det_min;
3099 buf[4] = (timeout >> 16) & 0xFF;
3100 buf[5] = (timeout >> 8) & 0xFF;
3101 buf[6] = (timeout >> 0) & 0xFF;
3105 handle->
debug_print(
"llcc68: set cad params failed.\n");
3140 res = a_llcc68_check_busy(handle);
3148 buf[0] = tx_base_addr;
3149 buf[1] = rx_base_addr;
3153 handle->
debug_print(
"llcc68: set buffer base address failed.\n");
3187 res = a_llcc68_check_busy(handle);
3199 handle->
debug_print(
"llcc68: set lora symb num timeout failed.\n");
3233 res = a_llcc68_check_busy(handle);
3241 memset(buf, 0,
sizeof(uint8_t) * 1);
3245 handle->
debug_print(
"llcc68: get status failed.\n");
3281 res = a_llcc68_check_busy(handle);
3292 handle->
debug_print(
"llcc68: get rx buffer status failed.\n");
3296 *payload_length_rx = buf[1];
3297 *rx_start_buffer_pointer = buf[2];
3319 uint8_t *rssi_avg_raw,
float *rssi_sync,
float *rssi_avg)
3333 res = a_llcc68_check_busy(handle);
3344 handle->
debug_print(
"llcc68: get packet status failed.\n");
3349 *rssi_sync_raw = buf[2];
3350 *rssi_avg_raw = buf[3];
3351 *rssi_sync = -(float)(*rssi_sync_raw) / 2.0f;
3352 *rssi_avg = -(float)(*rssi_avg_raw) / 2.0f;
3375 uint8_t *signal_rssi_pkt_raw,
float *rssi_pkt,
float *snr_pkt,
float *signal_rssi_pkt)
3389 res = a_llcc68_check_busy(handle);
3400 handle->
debug_print(
"llcc68: get packet status failed.\n");
3404 *rssi_pkt_raw= buf[1];
3405 *snr_pkt_raw = buf[2];
3406 *signal_rssi_pkt_raw = buf[3];
3407 *rssi_pkt = -(float)(*rssi_pkt_raw) / 2.0f;
3408 *snr_pkt = (float)(*snr_pkt_raw) / 4.0f;
3409 *signal_rssi_pkt = -(float)(*signal_rssi_pkt_raw) / 2.0f;
3441 res = a_llcc68_check_busy(handle);
3452 handle->
debug_print(
"llcc68: get instantaneous rssi failed.\n");
3456 *rssi_inst_raw = buf[1];
3457 *rssi_inst = -(float)(*rssi_inst_raw) / 2.0f;
3490 res = a_llcc68_check_busy(handle);
3501 handle->
debug_print(
"llcc68: get stats failed.\n");
3505 *pkt_received = (uint16_t)(((uint16_t)buf[1] << 8) | buf[2]);
3506 *pkt_crc_error = (uint16_t)(((uint16_t)buf[3] << 8) | buf[4]);
3507 *pkt_length_header_error = (uint16_t)(((uint16_t)buf[5] << 8) | buf[6]);
3540 res = a_llcc68_check_busy(handle);
3548 buf[0] = (pkt_received >> 8) & 0xFF;
3549 buf[1] = (pkt_received >> 0) & 0xFF;
3550 buf[2] = (pkt_crc_error >> 8) & 0xFF;
3551 buf[3] = (pkt_crc_error >> 0) & 0xFF;
3552 buf[4] = (pkt_length_header_error >> 8) & 0xFF;
3553 buf[5] = (pkt_length_header_error >> 0) & 0xFF;
3557 handle->
debug_print(
"llcc68: reset stats failed.\n");
3591 res = a_llcc68_check_busy(handle);
3602 handle->
debug_print(
"llcc68: get device errors failed.\n");
3606 *op_error = (uint16_t)(((uint16_t)buf[1] << 8) | buf[2]);
3636 res = a_llcc68_check_busy(handle);
3649 handle->
debug_print(
"llcc68: clear device errors failed.\n");
3683 res = a_llcc68_check_busy(handle);
3691 buf[0] = (value >> 8) & 0xFF;
3692 buf[1] = (value >> 0) & 0xFF;
3696 handle->
debug_print(
"llcc68: write register failed.\n");
3730 res = a_llcc68_check_busy(handle);
3741 handle->
debug_print(
"llcc68: read register failed.\n");
3745 *value = (uint16_t)((uint16_t)buf[0] << 8 | buf[1]);
3776 res = a_llcc68_check_busy(handle);
3784 buf[0] = (value >> 8) & 0xFF;
3785 buf[1] = (value >> 0) & 0xFF;
3789 handle->
debug_print(
"llcc68: write register failed.\n");
3823 res = a_llcc68_check_busy(handle);
3834 handle->
debug_print(
"llcc68: read register failed.\n");
3838 *value = (uint16_t)((uint16_t)buf[0] << 8 | buf[1]);
3869 res = a_llcc68_check_busy(handle);
3877 buf[0] = (value >> 8) & 0xFF;
3878 buf[1] = (value >> 0) & 0xFF;
3882 handle->
debug_print(
"llcc68: write register failed.\n");
3916 res = a_llcc68_check_busy(handle);
3927 handle->
debug_print(
"llcc68: read register failed.\n");
3931 *value = (uint16_t)((uint16_t)buf[0] << 8 | buf[1]);
3961 res = a_llcc68_check_busy(handle);
3972 handle->
debug_print(
"llcc68: write register failed.\n");
4005 res = a_llcc68_check_busy(handle);
4016 handle->
debug_print(
"llcc68: read register failed.\n");
4049 res = a_llcc68_check_busy(handle);
4060 handle->
debug_print(
"llcc68: write register failed.\n");
4093 res = a_llcc68_check_busy(handle);
4104 handle->
debug_print(
"llcc68: read register failed.\n");
4137 res = a_llcc68_check_busy(handle);
4148 handle->
debug_print(
"llcc68: write register failed.\n");
4181 res = a_llcc68_check_busy(handle);
4192 handle->
debug_print(
"llcc68: read register failed.\n");
4225 res = a_llcc68_check_busy(handle);
4236 handle->
debug_print(
"llcc68: write register failed.\n");
4269 res = a_llcc68_check_busy(handle);
4280 handle->
debug_print(
"llcc68: read register failed.\n");
4314 res = a_llcc68_check_busy(handle);
4322 buf[0] = (sync_word >> 8) & 0xFF;
4323 buf[1] = (sync_word >> 0) & 0xFF;
4327 handle->
debug_print(
"llcc68: write register failed.\n");
4361 res = a_llcc68_check_busy(handle);
4372 handle->
debug_print(
"llcc68: read register failed.\n");
4376 *sync_word = (uint16_t)((uint16_t)buf[0] << 8 | buf[1]);
4407 res = a_llcc68_check_busy(handle);
4418 handle->
debug_print(
"llcc68: read register failed.\n");
4422 *r = (uint32_t)((uint32_t)buf[0] << 24 | (uint32_t)buf[1] << 16 |
4423 (uint32_t)buf[2] << 8 | buf[3]);
4453 res = a_llcc68_check_busy(handle);
4464 handle->
debug_print(
"llcc68: write register failed.\n");
4497 res = a_llcc68_check_busy(handle);
4508 handle->
debug_print(
"llcc68: read register failed.\n");
4541 res = a_llcc68_check_busy(handle);
4552 handle->
debug_print(
"llcc68: write register failed.\n");
4585 res = a_llcc68_check_busy(handle);
4596 handle->
debug_print(
"llcc68: read register failed.\n");
4629 res = a_llcc68_check_busy(handle);
4640 handle->
debug_print(
"llcc68: write register failed.\n");
4673 res = a_llcc68_check_busy(handle);
4684 handle->
debug_print(
"llcc68: read register failed.\n");
4717 res = a_llcc68_check_busy(handle);
4728 handle->
debug_print(
"llcc68: write register failed.\n");
4761 res = a_llcc68_check_busy(handle);
4772 handle->
debug_print(
"llcc68: read register failed.\n");
4805 res = a_llcc68_check_busy(handle);
4816 handle->
debug_print(
"llcc68: write register failed.\n");
4849 res = a_llcc68_check_busy(handle);
4860 handle->
debug_print(
"llcc68: read register failed.\n");
4893 res = a_llcc68_check_busy(handle);
4904 handle->
debug_print(
"llcc68: write register failed.\n");
4937 res = a_llcc68_check_busy(handle);
4948 handle->
debug_print(
"llcc68: read register failed.\n");
4981 res = a_llcc68_check_busy(handle);
4992 handle->
debug_print(
"llcc68: write register failed.\n");
5025 res = a_llcc68_check_busy(handle);
5036 handle->
debug_print(
"llcc68: read register failed.\n");
5069 res = a_llcc68_check_busy(handle);
5080 handle->
debug_print(
"llcc68: write register failed.\n");
5113 res = a_llcc68_check_busy(handle);
5124 handle->
debug_print(
"llcc68: read register failed.\n");
5157 res = a_llcc68_check_busy(handle);
5168 handle->
debug_print(
"llcc68: write register failed.\n");
5201 res = a_llcc68_check_busy(handle);
5212 handle->
debug_print(
"llcc68: read register failed.\n");
5245 res = a_llcc68_check_busy(handle);
5256 handle->
debug_print(
"llcc68: write register failed.\n");
5289 res = a_llcc68_check_busy(handle);
5300 handle->
debug_print(
"llcc68: read register failed.\n");
5333 res = a_llcc68_check_busy(handle);
5344 handle->
debug_print(
"llcc68: write register failed.\n");
5377 res = a_llcc68_check_busy(handle);
5388 handle->
debug_print(
"llcc68: read register failed.\n");
5421 res = a_llcc68_check_busy(handle);
5432 handle->
debug_print(
"llcc68: write register failed.\n");
5465 res = a_llcc68_check_busy(handle);
5476 handle->
debug_print(
"llcc68: read register failed.\n");
5509 res = a_llcc68_check_busy(handle);
5520 handle->
debug_print(
"llcc68: write register failed.\n");
5553 res = a_llcc68_check_busy(handle);
5564 handle->
debug_print(
"llcc68: read register failed.\n");
5587 uint8_t *out_buf, uint32_t out_len)
5599 if (handle->
spi_write_read(in_buf, in_len, out_buf, out_len) != 0)
#define LLCC68_COMMAND_READ_BUFFER
#define LLCC68_COMMAND_WRITE_REGISTER
#define LLCC68_REG_TX_CLAMP_CONFIG
#define LLCC68_REG_LORA_SYNC_WORD_MSB
#define LLCC68_COMMAND_SET_DIO2_AS_RF_SWITCH_CTRL
#define LLCC68_COMMAND_CLEAR_IRQ_STATUS
#define LLCC68_REG_RANDOM_NUMBER_GEN_0
#define LLCC68_REG_WHITENING_INIT_VALUE_MSB
#define LLCC68_COMMAND_SET_PACKET_PARAMS
#define LLCC68_REG_BROADCAST_ADDRESS
#define LLCC68_COMMAND_SET_TX
#define LLCC68_REG_DIO3_OUTPUT_CONTROL
#define LLCC68_COMMAND_GET_PACKET_STATUS
#define LLCC68_REG_CRC_POLYNOMIAL_VALUE_MSB
#define LLCC68_COMMAND_SET_STANDBY
#define LLCC68_REG_DIOX_INPUT_ENABLE
#define LLCC68_REG_CRC_INIT_VALUE_MSB
#define LLCC68_COMMAND_GET_PACKET_TYPE
#define LLCC68_COMMAND_SET_TX_CONTINUOUS_WAVE
#define LLCC68_COMMAND_SET_DIO3_AS_TCXO_CTRL
#define LLCC68_COMMAND_WRITE_BUFFER
#define SUPPLY_VOLTAGE_MAX
#define LLCC68_COMMAND_SET_MODULATION_PARAMS
#define LLCC68_COMMAND_GET_IRQ_STATUS
#define LLCC68_COMMAND_SET_RX
#define LLCC68_REG_XTA_TRIM
#define LLCC68_COMMAND_GET_RX_BUFFER_STATUS
#define LLCC68_COMMAND_SET_REGULATOR_MODE
#define LLCC68_REG_DIOX_OUTPUT_ENABLE
chip register definition
#define LLCC68_REG_DIOX_PULL_DOWN_CONTROL
#define LLCC68_COMMAND_SET_CAD_PARAMS
#define LLCC68_COMMAND_GET_DEVICE_ERRORS
#define LLCC68_REG_XTB_TRIM
#define LLCC68_COMMAND_SET_RX_DUTY_CYCLE
#define LLCC68_REG_NODE_ADDRESS
#define LLCC68_REG_RX_GAIN
#define LLCC68_COMMAND_SET_TX_PARAMS
#define LLCC68_COMMAND_SET_BUFFER_BASE_ADDRESS
#define LLCC68_COMMAND_SET_CAD
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define LLCC68_REG_EVENT_MASK
#define LLCC68_COMMAND_SET_TX_INFINITE_PREAMBLE
#define LLCC68_COMMAND_GET_RSSI_LNST
#define LLCC68_COMMAND_GET_STATS
#define LLCC68_REG_TX_MODULATION
#define LLCC68_REG_DIOX_PULL_UP_CONTROL
#define LLCC68_COMMAND_RESET_STATS
#define LLCC68_REG_IQ_POLARITY_SETUP
#define LLCC68_COMMAND_SET_CALIBRATE
#define LLCC68_COMMAND_SET_CALIBRATE_IMAGE
#define LLCC68_REG_SYNC_WORD_0
#define LLCC68_COMMAND_SET_RX_TX_FALLBACK_MODE
#define LLCC68_COMMAND_SET_PA_CONFIG
#define LLCC68_COMMAND_SET_LORA_SYMB_NUM_TIMEOUT
#define CHIP_NAME
chip information definition
#define LLCC68_REG_RTC_CONTROL
#define LLCC68_COMMAND_SET_RF_FREQUENCY
#define LLCC68_COMMAND_CLEAR_DEVICE_ERRORS
#define LLCC68_REG_OCP_CONFIGURATION
#define LLCC68_COMMAND_STOP_TIMER_ON_PREAMBLE
#define LLCC68_COMMAND_SET_PACKET_TYPE
#define LLCC68_COMMAND_GET_STATUS
#define LLCC68_COMMAND_SET_FS
#define LLCC68_COMMAND_SET_SLEEP
chip command definition
#define LLCC68_COMMAND_READ_REGISTER
#define LLCC68_COMMAND_SET_DIO_IRQ_PARAMS
driver llcc68 header file
llcc68_lora_crc_type_t
llcc68 lora crc type enumeration definition
uint8_t llcc68_irq_handler(llcc68_handle_t *handle)
irq handler
llcc68_lora_bandwidth_t
llcc68 lora bandwidth enumeration definition
llcc68_bool_t
llcc68 bool enumeration definition
llcc68_gfsk_packet_type_t
llcc68 gfsk packet type enumeration definition
llcc68_clock_source_t
llcc68 clock source enumeration definition
uint8_t llcc68_set_rf_frequency(llcc68_handle_t *handle, uint32_t reg)
set the rf frequency
uint8_t llcc68_set_lora_modulation_params(llcc68_handle_t *handle, llcc68_lora_sf_t sf, llcc68_lora_bandwidth_t bw, llcc68_lora_cr_t cr, llcc68_bool_t low_data_rate_optimize_enable)
set the modulation params in LoRa mode
uint8_t llcc68_info(llcc68_info_t *info)
get chip's information
uint8_t llcc68_set_pa_config(llcc68_handle_t *handle, uint8_t pa_duty_cycle, uint8_t hp_max)
set the pa config
uint8_t llcc68_check_packet_error(llcc68_handle_t *handle, llcc68_bool_t *enable)
check the packet error
llcc68_lora_sf_t
llcc68 lora spreading factor enumeration definition
uint8_t llcc68_clear_device_errors(llcc68_handle_t *handle)
clear the device errors
llcc68_gfsk_crc_type_t
llcc68 gfsk crc type enumeration definition
uint8_t llcc68_lora_transmit(llcc68_handle_t *handle, llcc68_clock_source_t standby_src, uint16_t preamble_length, llcc68_lora_header_t header_type, llcc68_lora_crc_type_t crc_type, llcc68_bool_t invert_iq_enable, uint8_t *buf, uint16_t len, uint32_t us)
send the lora data
uint8_t llcc68_get_lora_packet_status(llcc68_handle_t *handle, uint8_t *rssi_pkt_raw, uint8_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 llcc68_get_gfsk_packet_status(llcc68_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 llcc68_get_status(llcc68_handle_t *handle, uint8_t *status)
get the status
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_clear_irq_status(llcc68_handle_t *handle, uint16_t clear_irq_param)
clear the irq status
uint8_t llcc68_get_packet_type(llcc68_handle_t *handle, llcc68_packet_type_t *type)
get the packet type
llcc68_tcxo_voltage_t
llcc68 tcxo voltage enumeration definition
uint8_t llcc68_get_instantaneous_rssi(llcc68_handle_t *handle, uint8_t *rssi_inst_raw, float *rssi_inst)
get the instantaneous rssi
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
llcc68_regulator_mode_t
llcc68 regulator mode enumeration definition
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
llcc68_start_mode_t
llcc68 start mode enumeration definition
uint8_t llcc68_set_gfsk_modulation_params(llcc68_handle_t *handle, uint32_t br, llcc68_gfsk_pulse_shape_t shape, llcc68_gfsk_bandwidth_t bw, uint32_t fdev)
set the modulation params in GFSK mode
uint8_t llcc68_set_rx(llcc68_handle_t *handle, uint32_t timeout)
enter to the rx mode
uint8_t llcc68_get_device_errors(llcc68_handle_t *handle, uint16_t *op_error)
get the device errors
uint8_t llcc68_single_receive(llcc68_handle_t *handle, double us)
enter to the single receive mode
uint8_t llcc68_reset_stats(llcc68_handle_t *handle, uint16_t pkt_received, uint16_t pkt_crc_error, uint16_t pkt_length_header_error)
reset the stats
llcc68_ramp_time_t
llcc68 ramp time enumeration definition
uint8_t llcc68_set_calibration_image(llcc68_handle_t *handle, uint8_t freq1, uint8_t freq2)
set the calibration image frequency
uint8_t llcc68_set_stop_timer_on_preamble(llcc68_handle_t *handle, llcc68_bool_t enable)
stop timer on preamble
uint8_t llcc68_set_regulator_mode(llcc68_handle_t *handle, llcc68_regulator_mode_t mode)
set the regulator_mode
llcc68_lora_cad_symbol_num_t
llcc68 lora cad symbol num enumeration definition
uint8_t llcc68_set_tx_continuous_wave(llcc68_handle_t *handle)
enter to the tx continuous wave mode
uint8_t llcc68_get_rx_buffer_status(llcc68_handle_t *handle, uint8_t *payload_length_rx, uint8_t *rx_start_buffer_pointer)
get the rx buffer status
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_set_lora_packet_params(llcc68_handle_t *handle, uint16_t preamble_length, llcc68_lora_header_t header_type, uint8_t payload_length, llcc68_lora_crc_type_t crc_type, llcc68_bool_t invert_iq_enable)
set the packet params in LoRa mode
llcc68_gfsk_preamble_detector_length_t
llcc68 gfsk preamble detector length enumeration definition
uint8_t llcc68_set_rx_tx_fallback_mode(llcc68_handle_t *handle, llcc68_rx_tx_fallback_mode_t mode)
set the rx tx fallback mode
uint8_t llcc68_set_lora_symb_num_timeout(llcc68_handle_t *handle, uint8_t symb_num)
set the lora symbol number timeout
uint8_t llcc68_set_sleep(llcc68_handle_t *handle, llcc68_start_mode_t mode, llcc68_bool_t rtc_wake_up_enable)
enter to the sleep mode
llcc68_lora_cr_t
llcc68 lora coding rate enumeration definition
uint8_t llcc68_set_dio3_as_tcxo_ctrl(llcc68_handle_t *handle, llcc68_tcxo_voltage_t voltage, uint32_t delay)
set dio3 as tcxo ctrl
uint8_t llcc68_set_tx_params(llcc68_handle_t *handle, int8_t dbm, llcc68_ramp_time_t t)
set the tx params
uint8_t llcc68_continuous_receive(llcc68_handle_t *handle)
enter to the continuous receive mode
uint8_t llcc68_set_frequency_synthesis(llcc68_handle_t *handle)
enter to the frequency synthesis mode
uint8_t llcc68_read_register(llcc68_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
read the register
uint8_t llcc68_set_cad_params(llcc68_handle_t *handle, llcc68_lora_cad_symbol_num_t num, uint8_t cad_det_peak, uint8_t cad_det_min, llcc68_lora_cad_exit_mode_t mode, uint32_t timeout)
set the cad params
uint8_t llcc68_set_calibration(llcc68_handle_t *handle, uint8_t settings)
set the calibration settings
uint8_t llcc68_set_gfsk_packet_params(llcc68_handle_t *handle, uint16_t preamble_length, llcc68_gfsk_preamble_detector_length_t detector_length, uint8_t sync_word_length, llcc68_gfsk_addr_filter_t filter, llcc68_gfsk_packet_type_t packet_type, uint8_t payload_length, llcc68_gfsk_crc_type_t crc_type, llcc68_bool_t whitening_enable)
set the packet params in GFSK mode
llcc68_gfsk_bandwidth_t
llcc68 gfsk bandwidth enumeration definition
uint8_t llcc68_set_dio_irq_params(llcc68_handle_t *handle, uint16_t irq_mask, uint16_t dio1_mask, uint16_t dio2_mask, uint16_t dio3_mask)
set the dio irq params
llcc68_packet_type_t
llcc68 packet type enumeration definition
uint8_t llcc68_set_cad(llcc68_handle_t *handle)
run the cad
uint8_t llcc68_set_standby(llcc68_handle_t *handle, llcc68_clock_source_t src)
enter to the standby mode
uint8_t llcc68_set_tx_infinite_preamble(llcc68_handle_t *handle)
enter to the tx infinite preamble 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_set_buffer_base_address(llcc68_handle_t *handle, uint8_t tx_base_addr, uint8_t rx_base_addr)
set the buffer base address
uint8_t llcc68_get_irq_status(llcc68_handle_t *handle, uint16_t *status)
get the irq status
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_get_stats(llcc68_handle_t *handle, uint16_t *pkt_received, uint16_t *pkt_crc_error, uint16_t *pkt_length_header_error)
get the stats
llcc68_gfsk_addr_filter_t
llcc68 gfsk addr filter enumeration definition
llcc68_lora_header_t
llcc68 lora header enumeration definition
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
llcc68_gfsk_pulse_shape_t
llcc68 gfsk pulse shape enumeration definition
llcc68_rx_tx_fallback_mode_t
llcc68 rx tx fallback mode enumeration definition
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_lora_cad(llcc68_handle_t *handle, llcc68_bool_t *enable)
run the cad
uint8_t llcc68_set_dio2_as_rf_switch_ctrl(llcc68_handle_t *handle, llcc68_bool_t enable)
set dio2 as rf switch ctrl
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_rx_duty_cycle(llcc68_handle_t *handle, uint32_t rx_period, uint32_t sleep_period)
set the rx duty cycle
uint8_t llcc68_set_tx(llcc68_handle_t *handle, uint32_t timeout)
enter to the tx mode
uint8_t llcc68_set_packet_type(llcc68_handle_t *handle, llcc68_packet_type_t type)
set the packet type
llcc68_lora_cad_exit_mode_t
llcc68 lora cad exit mode enumeration definition
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_IRQ_PREAMBLE_DETECTED
@ LLCC68_IRQ_CAD_DETECTED
@ LLCC68_IRQ_HEADER_VALID
@ LLCC68_IRQ_SYNC_WORD_VALID
uint8_t llcc68_write_read_reg(llcc68_handle_t *handle, uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
write and read register
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
llcc68 handle structure definition
uint8_t(* spi_write_read)(uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* busy_gpio_init)(void)
void(* receive_callback)(uint16_t type, uint8_t *buf, uint16_t len)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint8_t(* busy_gpio_deinit)(void)
uint8_t(* spi_deinit)(void)
uint8_t(* reset_gpio_init)(void)
uint8_t(* busy_gpio_read)(uint8_t *value)
uint8_t(* reset_gpio_write)(uint8_t value)
llcc68 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v