RadioLib
Universal wireless communication library for Arduino
Loading...
Searching...
No Matches
SX126x_commands.h
1
#if !defined(_RADIOLIB_SX126X_COMMANDS_H)
2
#define _RADIOLIB_SX126X_COMMANDS_H
3
4
#include "../../TypeDef.h"
5
6
#if !RADIOLIB_EXCLUDE_SX126X
7
8
// SX126X SPI commands
9
// operational modes commands
10
#define RADIOLIB_SX126X_CMD_NOP 0x00
11
#define RADIOLIB_SX126X_CMD_SET_SLEEP 0x84
12
#define RADIOLIB_SX126X_CMD_SET_STANDBY 0x80
13
#define RADIOLIB_SX126X_CMD_SET_FS 0xC1
14
#define RADIOLIB_SX126X_CMD_SET_TX 0x83
15
#define RADIOLIB_SX126X_CMD_SET_RX 0x82
16
#define RADIOLIB_SX126X_CMD_STOP_TIMER_ON_PREAMBLE 0x9F
17
#define RADIOLIB_SX126X_CMD_SET_RX_DUTY_CYCLE 0x94
18
#define RADIOLIB_SX126X_CMD_SET_CAD 0xC5
19
#define RADIOLIB_SX126X_CMD_SET_TX_CONTINUOUS_WAVE 0xD1
20
#define RADIOLIB_SX126X_CMD_SET_TX_INFINITE_PREAMBLE 0xD2
21
#define RADIOLIB_SX126X_CMD_SET_REGULATOR_MODE 0x96
22
#define RADIOLIB_SX126X_CMD_CALIBRATE 0x89
23
#define RADIOLIB_SX126X_CMD_CALIBRATE_IMAGE 0x98
24
#define RADIOLIB_SX126X_CMD_SET_PA_CONFIG 0x95
25
#define RADIOLIB_SX126X_CMD_SET_RX_TX_FALLBACK_MODE 0x93
26
27
// register and buffer access commands
28
#define RADIOLIB_SX126X_CMD_WRITE_REGISTER 0x0D
29
#define RADIOLIB_SX126X_CMD_READ_REGISTER 0x1D
30
#define RADIOLIB_SX126X_CMD_WRITE_BUFFER 0x0E
31
#define RADIOLIB_SX126X_CMD_READ_BUFFER 0x1E
32
33
// DIO and IRQ control
34
#define RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS 0x08
35
#define RADIOLIB_SX126X_CMD_GET_IRQ_STATUS 0x12
36
#define RADIOLIB_SX126X_CMD_CLEAR_IRQ_STATUS 0x02
37
#define RADIOLIB_SX126X_CMD_SET_DIO2_AS_RF_SWITCH_CTRL 0x9D
38
#define RADIOLIB_SX126X_CMD_SET_DIO3_AS_TCXO_CTRL 0x97
39
40
// RF, modulation and packet commands
41
#define RADIOLIB_SX126X_CMD_SET_RF_FREQUENCY 0x86
42
#define RADIOLIB_SX126X_CMD_SET_PACKET_TYPE 0x8A
43
#define RADIOLIB_SX126X_CMD_GET_PACKET_TYPE 0x11
44
#define RADIOLIB_SX126X_CMD_SET_TX_PARAMS 0x8E
45
#define RADIOLIB_SX126X_CMD_SET_MODULATION_PARAMS 0x8B
46
#define RADIOLIB_SX126X_CMD_SET_PACKET_PARAMS 0x8C
47
#define RADIOLIB_SX126X_CMD_SET_CAD_PARAMS 0x88
48
#define RADIOLIB_SX126X_CMD_SET_BUFFER_BASE_ADDRESS 0x8F
49
#define RADIOLIB_SX126X_CMD_SET_LORA_SYMB_NUM_TIMEOUT 0xA0
50
51
// status commands
52
#define RADIOLIB_SX126X_CMD_GET_STATUS 0xC0
53
#define RADIOLIB_SX126X_CMD_GET_RSSI_INST 0x15
54
#define RADIOLIB_SX126X_CMD_GET_RX_BUFFER_STATUS 0x13
55
#define RADIOLIB_SX126X_CMD_GET_PACKET_STATUS 0x14
56
#define RADIOLIB_SX126X_CMD_GET_DEVICE_ERRORS 0x17
57
#define RADIOLIB_SX126X_CMD_CLEAR_DEVICE_ERRORS 0x07
58
#define RADIOLIB_SX126X_CMD_GET_STATS 0x10
59
#define RADIOLIB_SX126X_CMD_RESET_STATS 0x00
60
61
#define RADIOLIB_SX126X_CMD_PRAM_UPDATE 0xD9
62
#define RADIOLIB_SX126X_CMD_SET_LBT_SCAN_PARAMS 0x9A
63
#define RADIOLIB_SX126X_CMD_SET_SPECTR_SCAN_PARAMS 0x9B
64
65
// SX126X SPI command variables
66
//RADIOLIB_SX126X_CMD_SET_SLEEP MSB LSB DESCRIPTION
67
#define RADIOLIB_SX126X_SLEEP_START_COLD 0b00000000
// 2 2 sleep mode: cold start, configuration is lost (default)
68
#define RADIOLIB_SX126X_SLEEP_START_WARM 0b00000100
// 2 2 warm start, configuration is retained
69
#define RADIOLIB_SX126X_SLEEP_RTC_OFF 0b00000000
// 0 0 wake on RTC timeout: disabled
70
#define RADIOLIB_SX126X_SLEEP_RTC_ON 0b00000001
// 0 0 enabled
71
72
//RADIOLIB_SX126X_CMD_SET_STANDBY
73
#define RADIOLIB_SX126X_STANDBY_RC 0x00
// 7 0 standby mode: 13 MHz RC oscillator
74
#define RADIOLIB_SX126X_STANDBY_XOSC 0x01
// 7 0 32 MHz crystal oscillator
75
76
//RADIOLIB_SX126X_CMD_SET_RX
77
#define RADIOLIB_SX126X_RX_TIMEOUT_NONE 0x000000
// 23 0 Rx timeout duration: no timeout (Rx single mode)
78
#define RADIOLIB_SX126X_RX_TIMEOUT_INF 0xFFFFFF
// 23 0 infinite (Rx continuous mode)
79
80
//RADIOLIB_SX126X_CMD_SET_TX
81
#define RADIOLIB_SX126X_TX_TIMEOUT_NONE 0x000000
// 23 0 Tx timeout duration: no timeout (Tx single mode)
82
83
//RADIOLIB_SX126X_CMD_STOP_TIMER_ON_PREAMBLE
84
#define RADIOLIB_SX126X_STOP_ON_PREAMBLE_OFF 0x00
// 7 0 stop timer on: sync word or header (default)
85
#define RADIOLIB_SX126X_STOP_ON_PREAMBLE_ON 0x01
// 7 0 preamble detection
86
87
//RADIOLIB_SX126X_CMD_SET_REGULATOR_MODE
88
#define RADIOLIB_SX126X_REGULATOR_LDO 0x00
// 7 0 set regulator mode: LDO (default)
89
#define RADIOLIB_SX126X_REGULATOR_DC_DC 0x01
// 7 0 DC-DC
90
91
//RADIOLIB_SX126X_CMD_CALIBRATE
92
#define RADIOLIB_SX126X_CALIBRATE_IMAGE_OFF 0b00000000
// 6 6 image calibration: disabled
93
#define RADIOLIB_SX126X_CALIBRATE_IMAGE_ON 0b01000000
// 6 6 enabled
94
#define RADIOLIB_SX126X_CALIBRATE_ADC_BULK_P_OFF 0b00000000
// 5 5 ADC bulk P calibration: disabled
95
#define RADIOLIB_SX126X_CALIBRATE_ADC_BULK_P_ON 0b00100000
// 5 5 enabled
96
#define RADIOLIB_SX126X_CALIBRATE_ADC_BULK_N_OFF 0b00000000
// 4 4 ADC bulk N calibration: disabled
97
#define RADIOLIB_SX126X_CALIBRATE_ADC_BULK_N_ON 0b00010000
// 4 4 enabled
98
#define RADIOLIB_SX126X_CALIBRATE_ADC_PULSE_OFF 0b00000000
// 3 3 ADC pulse calibration: disabled
99
#define RADIOLIB_SX126X_CALIBRATE_ADC_PULSE_ON 0b00001000
// 3 3 enabled
100
#define RADIOLIB_SX126X_CALIBRATE_PLL_OFF 0b00000000
// 2 2 PLL calibration: disabled
101
#define RADIOLIB_SX126X_CALIBRATE_PLL_ON 0b00000100
// 2 2 enabled
102
#define RADIOLIB_SX126X_CALIBRATE_RC13M_OFF 0b00000000
// 1 1 13 MHz RC osc. calibration: disabled
103
#define RADIOLIB_SX126X_CALIBRATE_RC13M_ON 0b00000010
// 1 1 enabled
104
#define RADIOLIB_SX126X_CALIBRATE_RC64K_OFF 0b00000000
// 0 0 64 kHz RC osc. calibration: disabled
105
#define RADIOLIB_SX126X_CALIBRATE_RC64K_ON 0b00000001
// 0 0 enabled
106
#define RADIOLIB_SX126X_CALIBRATE_ALL 0b01111111
// 6 0 calibrate all blocks
107
108
//RADIOLIB_SX126X_CMD_CALIBRATE_IMAGE
109
#define RADIOLIB_SX126X_CAL_IMG_430_MHZ_1 0x6B
110
#define RADIOLIB_SX126X_CAL_IMG_430_MHZ_2 0x6F
111
#define RADIOLIB_SX126X_CAL_IMG_470_MHZ_1 0x75
112
#define RADIOLIB_SX126X_CAL_IMG_470_MHZ_2 0x81
113
#define RADIOLIB_SX126X_CAL_IMG_779_MHZ_1 0xC1
114
#define RADIOLIB_SX126X_CAL_IMG_779_MHZ_2 0xC5
115
#define RADIOLIB_SX126X_CAL_IMG_863_MHZ_1 0xD7
116
#define RADIOLIB_SX126X_CAL_IMG_863_MHZ_2 0xDB
117
#define RADIOLIB_SX126X_CAL_IMG_902_MHZ_1 0xE1
118
#define RADIOLIB_SX126X_CAL_IMG_902_MHZ_2 0xE9
119
#define RADIOLIB_SX126X_CAL_IMG_FREQ_TRIG_MHZ (20.0f)
120
121
//RADIOLIB_SX126X_CMD_SET_PA_CONFIG
122
#define RADIOLIB_SX126X_PA_CONFIG_HP_MAX 0x07
123
#define RADIOLIB_SX126X_PA_CONFIG_PA_LUT 0x01
124
#define RADIOLIB_SX126X_PA_CONFIG_SX1262_8 0x00
125
126
//RADIOLIB_SX126X_CMD_SET_RX_TX_FALLBACK_MODE
127
#define RADIOLIB_SX126X_RX_TX_FALLBACK_MODE_FS 0x40
// 7 0 after Rx/Tx go to: FS mode
128
#define RADIOLIB_SX126X_RX_TX_FALLBACK_MODE_STDBY_XOSC 0x30
// 7 0 standby with crystal oscillator
129
#define RADIOLIB_SX126X_RX_TX_FALLBACK_MODE_STDBY_RC 0x20
// 7 0 standby with RC oscillator (default)
130
131
//RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS
132
#define RADIOLIB_SX126X_IRQ_LR_FHSS_HOP 0b0100000000000000
// 14 14 PA ramped up during LR-FHSS hop
133
#define RADIOLIB_SX126X_IRQ_TIMEOUT 0b0000001000000000
// 9 9 Rx or Tx timeout
134
#define RADIOLIB_SX126X_IRQ_CAD_DETECTED 0b0000000100000000
// 8 8 channel activity detected
135
#define RADIOLIB_SX126X_IRQ_CAD_DONE 0b0000000010000000
// 7 7 channel activity detection finished
136
#define RADIOLIB_SX126X_IRQ_CRC_ERR 0b0000000001000000
// 6 6 wrong CRC received
137
#define RADIOLIB_SX126X_IRQ_HEADER_ERR 0b0000000000100000
// 5 5 LoRa header CRC error
138
#define RADIOLIB_SX126X_IRQ_HEADER_VALID 0b0000000000010000
// 4 4 valid LoRa header received
139
#define RADIOLIB_SX126X_IRQ_SYNC_WORD_VALID 0b0000000000001000
// 3 3 valid sync word detected
140
#define RADIOLIB_SX126X_IRQ_PREAMBLE_DETECTED 0b0000000000000100
// 2 2 preamble detected
141
#define RADIOLIB_SX126X_IRQ_RX_DONE 0b0000000000000010
// 1 1 packet received
142
#define RADIOLIB_SX126X_IRQ_TX_DONE 0b0000000000000001
// 0 0 packet transmission completed
143
#define RADIOLIB_SX126X_IRQ_ALL 0b0100001111111111
// 14 0 all interrupts
144
#define RADIOLIB_SX126X_IRQ_NONE 0b0000000000000000
// 14 0 no interrupts
145
146
//RADIOLIB_SX126X_CMD_SET_DIO2_AS_RF_SWITCH_CTRL
147
#define RADIOLIB_SX126X_DIO2_AS_IRQ 0x00
// 7 0 DIO2 configuration: IRQ
148
#define RADIOLIB_SX126X_DIO2_AS_RF_SWITCH 0x01
// 7 0 RF switch control
149
150
//RADIOLIB_SX126X_CMD_SET_DIO3_AS_TCXO_CTRL
151
#define RADIOLIB_SX126X_DIO3_OUTPUT_1_6 0x00
// 7 0 DIO3 voltage output for TCXO: 1.6 V
152
#define RADIOLIB_SX126X_DIO3_OUTPUT_1_7 0x01
// 7 0 1.7 V
153
#define RADIOLIB_SX126X_DIO3_OUTPUT_1_8 0x02
// 7 0 1.8 V
154
#define RADIOLIB_SX126X_DIO3_OUTPUT_2_2 0x03
// 7 0 2.2 V
155
#define RADIOLIB_SX126X_DIO3_OUTPUT_2_4 0x04
// 7 0 2.4 V
156
#define RADIOLIB_SX126X_DIO3_OUTPUT_2_7 0x05
// 7 0 2.7 V
157
#define RADIOLIB_SX126X_DIO3_OUTPUT_3_0 0x06
// 7 0 3.0 V
158
#define RADIOLIB_SX126X_DIO3_OUTPUT_3_3 0x07
// 7 0 3.3 V
159
160
//RADIOLIB_SX126X_CMD_SET_PACKET_TYPE
161
#define RADIOLIB_SX126X_PACKET_TYPE_GFSK 0x00
// 7 0 packet type: GFSK
162
#define RADIOLIB_SX126X_PACKET_TYPE_LORA 0x01
// 7 0 LoRa
163
#define RADIOLIB_SX126X_PACKET_TYPE_BPSK 0x02
// 7 0 BPSK
164
#define RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS 0x03
// 7 0 LR-FHSS
165
166
//RADIOLIB_SX126X_CMD_SET_TX_PARAMS
167
#define RADIOLIB_SX126X_PA_RAMP_10U 0x00
// 7 0 ramp time: 10 us
168
#define RADIOLIB_SX126X_PA_RAMP_20U 0x01
// 7 0 20 us
169
#define RADIOLIB_SX126X_PA_RAMP_40U 0x02
// 7 0 40 us
170
#define RADIOLIB_SX126X_PA_RAMP_80U 0x03
// 7 0 80 us
171
#define RADIOLIB_SX126X_PA_RAMP_200U 0x04
// 7 0 200 us
172
#define RADIOLIB_SX126X_PA_RAMP_800U 0x05
// 7 0 800 us
173
#define RADIOLIB_SX126X_PA_RAMP_1700U 0x06
// 7 0 1700 us
174
#define RADIOLIB_SX126X_PA_RAMP_3400U 0x07
// 7 0 3400 us
175
176
//RADIOLIB_SX126X_CMD_SET_MODULATION_PARAMS
177
#define RADIOLIB_SX126X_GFSK_FILTER_NONE 0x00
// 7 0 GFSK filter: none
178
#define RADIOLIB_SX126X_GFSK_FILTER_GAUSS_0_3 0x08
// 7 0 Gaussian, BT = 0.3
179
#define RADIOLIB_SX126X_GFSK_FILTER_GAUSS_0_5 0x09
// 7 0 Gaussian, BT = 0.5
180
#define RADIOLIB_SX126X_GFSK_FILTER_GAUSS_0_7 0x0A
// 7 0 Gaussian, BT = 0.7
181
#define RADIOLIB_SX126X_GFSK_FILTER_GAUSS_1 0x0B
// 7 0 Gaussian, BT = 1
182
#define RADIOLIB_SX126X_GFSK_RX_BW_4_8 0x1F
// 7 0 GFSK Rx bandwidth: 4.8 kHz
183
#define RADIOLIB_SX126X_GFSK_RX_BW_5_8 0x17
// 7 0 5.8 kHz
184
#define RADIOLIB_SX126X_GFSK_RX_BW_7_3 0x0F
// 7 0 7.3 kHz
185
#define RADIOLIB_SX126X_GFSK_RX_BW_9_7 0x1E
// 7 0 9.7 kHz
186
#define RADIOLIB_SX126X_GFSK_RX_BW_11_7 0x16
// 7 0 11.7 kHz
187
#define RADIOLIB_SX126X_GFSK_RX_BW_14_6 0x0E
// 7 0 14.6 kHz
188
#define RADIOLIB_SX126X_GFSK_RX_BW_19_5 0x1D
// 7 0 19.5 kHz
189
#define RADIOLIB_SX126X_GFSK_RX_BW_23_4 0x15
// 7 0 23.4 kHz
190
#define RADIOLIB_SX126X_GFSK_RX_BW_29_3 0x0D
// 7 0 29.3 kHz
191
#define RADIOLIB_SX126X_GFSK_RX_BW_39_0 0x1C
// 7 0 39.0 kHz
192
#define RADIOLIB_SX126X_GFSK_RX_BW_46_9 0x14
// 7 0 46.9 kHz
193
#define RADIOLIB_SX126X_GFSK_RX_BW_58_6 0x0C
// 7 0 58.6 kHz
194
#define RADIOLIB_SX126X_GFSK_RX_BW_78_2 0x1B
// 7 0 78.2 kHz
195
#define RADIOLIB_SX126X_GFSK_RX_BW_93_8 0x13
// 7 0 93.8 kHz
196
#define RADIOLIB_SX126X_GFSK_RX_BW_117_3 0x0B
// 7 0 117.3 kHz
197
#define RADIOLIB_SX126X_GFSK_RX_BW_156_2 0x1A
// 7 0 156.2 kHz
198
#define RADIOLIB_SX126X_GFSK_RX_BW_187_2 0x12
// 7 0 187.2 kHz
199
#define RADIOLIB_SX126X_GFSK_RX_BW_234_3 0x0A
// 7 0 234.3 kHz
200
#define RADIOLIB_SX126X_GFSK_RX_BW_312_0 0x19
// 7 0 312.0 kHz
201
#define RADIOLIB_SX126X_GFSK_RX_BW_373_6 0x11
// 7 0 373.6 kHz
202
#define RADIOLIB_SX126X_GFSK_RX_BW_467_0 0x09
// 7 0 467.0 kHz
203
#define RADIOLIB_SX126X_LORA_BW_7_8 0x00
// 7 0 LoRa bandwidth: 7.8 kHz
204
#define RADIOLIB_SX126X_LORA_BW_10_4 0x08
// 7 0 10.4 kHz
205
#define RADIOLIB_SX126X_LORA_BW_15_6 0x01
// 7 0 15.6 kHz
206
#define RADIOLIB_SX126X_LORA_BW_20_8 0x09
// 7 0 20.8 kHz
207
#define RADIOLIB_SX126X_LORA_BW_31_25 0x02
// 7 0 31.25 kHz
208
#define RADIOLIB_SX126X_LORA_BW_41_7 0x0A
// 7 0 41.7 kHz
209
#define RADIOLIB_SX126X_LORA_BW_62_5 0x03
// 7 0 62.5 kHz
210
#define RADIOLIB_SX126X_LORA_BW_125_0 0x04
// 7 0 125.0 kHz
211
#define RADIOLIB_SX126X_LORA_BW_250_0 0x05
// 7 0 250.0 kHz
212
#define RADIOLIB_SX126X_LORA_BW_500_0 0x06
// 7 0 500.0 kHz
213
#define RADIOLIB_SX126X_LORA_CR_4_5 0x01
// 7 0 LoRa coding rate: 4/5
214
#define RADIOLIB_SX126X_LORA_CR_4_6 0x02
// 7 0 4/6
215
#define RADIOLIB_SX126X_LORA_CR_4_7 0x03
// 7 0 4/7
216
#define RADIOLIB_SX126X_LORA_CR_4_8 0x04
// 7 0 4/8
217
#define RADIOLIB_SX126X_LORA_CR_4_5_LI 0x05
// 7 0 4/5, long interleaver
218
#define RADIOLIB_SX126X_LORA_CR_4_6_LI 0x06
// 7 0 4/6, long interleaver
219
#define RADIOLIB_SX126X_LORA_CR_4_8_LI 0x07
// 7 0 4/8, long interleaver
220
#define RADIOLIB_SX126X_LORA_LOW_DATA_RATE_OPTIMIZE_OFF 0x00
// 7 0 LoRa low data rate optimization: disabled
221
#define RADIOLIB_SX126X_LORA_LOW_DATA_RATE_OPTIMIZE_ON 0x01
// 7 0 enabled
222
#define RADIOLIB_SX126X_BPSK_PULSE_SHAPE 0x16
// 7 0 BSPK pulse shape double OSR, RRC, BT=0.7
223
224
//RADIOLIB_SX126X_CMD_SET_PACKET_PARAMS
225
#define RADIOLIB_SX126X_GFSK_PREAMBLE_DETECT_OFF 0x00
// 7 0 GFSK minimum preamble length before reception starts: detector disabled
226
#define RADIOLIB_SX126X_GFSK_PREAMBLE_DETECT_8 0x04
// 7 0 8 bits
227
#define RADIOLIB_SX126X_GFSK_PREAMBLE_DETECT_16 0x05
// 7 0 16 bits
228
#define RADIOLIB_SX126X_GFSK_PREAMBLE_DETECT_24 0x06
// 7 0 24 bits
229
#define RADIOLIB_SX126X_GFSK_PREAMBLE_DETECT_32 0x07
// 7 0 32 bits
230
#define RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF 0x00
// 7 0 GFSK address filtering: disabled
231
#define RADIOLIB_SX126X_GFSK_ADDRESS_FILT_NODE 0x01
// 7 0 node only
232
#define RADIOLIB_SX126X_GFSK_ADDRESS_FILT_NODE_BROADCAST 0x02
// 7 0 node and broadcast
233
#define RADIOLIB_SX126X_GFSK_PACKET_FIXED 0x00
// 7 0 GFSK packet type: fixed (payload length known in advance to both sides)
234
#define RADIOLIB_SX126X_GFSK_PACKET_VARIABLE 0x01
// 7 0 variable (payload length added to packet)
235
#define RADIOLIB_SX126X_GFSK_CRC_OFF 0x01
// 7 0 GFSK packet CRC: disabled
236
#define RADIOLIB_SX126X_GFSK_CRC_1_BYTE 0x00
// 7 0 1 byte
237
#define RADIOLIB_SX126X_GFSK_CRC_2_BYTE 0x02
// 7 0 2 byte
238
#define RADIOLIB_SX126X_GFSK_CRC_1_BYTE_INV 0x04
// 7 0 1 byte, inverted
239
#define RADIOLIB_SX126X_GFSK_CRC_2_BYTE_INV 0x06
// 7 0 2 byte, inverted
240
#define RADIOLIB_SX126X_GFSK_WHITENING_OFF 0x00
// 7 0 GFSK data whitening: disabled
241
#define RADIOLIB_SX126X_GFSK_WHITENING_ON 0x01
// 7 0 enabled
242
#define RADIOLIB_SX126X_LORA_HEADER_EXPLICIT 0x00
// 7 0 LoRa header mode: explicit
243
#define RADIOLIB_SX126X_LORA_HEADER_IMPLICIT 0x01
// 7 0 implicit
244
#define RADIOLIB_SX126X_LORA_CRC_OFF 0x00
// 7 0 LoRa CRC mode: disabled
245
#define RADIOLIB_SX126X_LORA_CRC_ON 0x01
// 7 0 enabled
246
#define RADIOLIB_SX126X_LORA_IQ_STANDARD 0x00
// 7 0 LoRa IQ setup: standard
247
#define RADIOLIB_SX126X_LORA_IQ_INVERTED 0x01
// 7 0 inverted
248
#define RADIOLIB_SX126X_BPSK_RAMP_UP_TIME_NONE 0x0000
// 15 0 BPSK ramp-up time optimization: none
249
#define RADIOLIB_SX126X_BPSK_RAMP_UP_TIME_100_BPS 0x370F
// 15 0 for 100 bps
250
#define RADIOLIB_SX126X_BPSK_RAMP_UP_TIME_600_BPS 0x092F
// 15 0 for 600 bps
251
#define RADIOLIB_SX126X_BPSK_RAMP_DOWN_TIME_NONE 0x0000
// 15 0 BPSK ramp-down time optimization: none
252
#define RADIOLIB_SX126X_BPSK_RAMP_DOWN_TIME_100_BPS 0x1D70
// 15 0 for 100 bps
253
#define RADIOLIB_SX126X_BPSK_RAMP_DOWN_TIME_600_BPS 0x04E1
// 15 0 for 600 bps
254
255
//RADIOLIB_SX126X_CMD_SET_CAD_PARAMS
256
#define RADIOLIB_SX126X_CAD_ON_1_SYMB 0x00
// 7 0 number of symbols used for CAD: 1
257
#define RADIOLIB_SX126X_CAD_ON_2_SYMB 0x01
// 7 0 2
258
#define RADIOLIB_SX126X_CAD_ON_4_SYMB 0x02
// 7 0 4
259
#define RADIOLIB_SX126X_CAD_ON_8_SYMB 0x03
// 7 0 8
260
#define RADIOLIB_SX126X_CAD_ON_16_SYMB 0x04
// 7 0 16
261
#define RADIOLIB_SX126X_CAD_GOTO_STDBY 0x00
// 7 0 after CAD is done, always go to STDBY_RC mode
262
#define RADIOLIB_SX126X_CAD_GOTO_RX 0x01
// 7 0 after CAD is done, go to Rx mode if activity is detected
263
#define RADIOLIB_SX126X_CAD_PARAM_DEFAULT 0xFF
// 7 0 used by the CAD methods to specify default parameter value
264
#define RADIOLIB_SX126X_CAD_PARAM_DET_MIN 10
// 7 0 default detMin CAD parameter
265
266
//RADIOLIB_SX126X_CMD_GET_STATUS
267
#define RADIOLIB_SX126X_STATUS_MODE_STDBY_RC 0b00100000
// 6 4 current chip mode: STDBY_RC
268
#define RADIOLIB_SX126X_STATUS_MODE_STDBY_XOSC 0b00110000
// 6 4 STDBY_XOSC
269
#define RADIOLIB_SX126X_STATUS_MODE_FS 0b01000000
// 6 4 FS
270
#define RADIOLIB_SX126X_STATUS_MODE_RX 0b01010000
// 6 4 RX
271
#define RADIOLIB_SX126X_STATUS_MODE_TX 0b01100000
// 6 4 TX
272
#define RADIOLIB_SX126X_STATUS_DATA_AVAILABLE 0b00000100
// 3 1 command status: packet received and data can be retrieved
273
#define RADIOLIB_SX126X_STATUS_CMD_TIMEOUT 0b00000110
// 3 1 SPI command timed out
274
#define RADIOLIB_SX126X_STATUS_CMD_INVALID 0b00001000
// 3 1 invalid SPI command
275
#define RADIOLIB_SX126X_STATUS_CMD_FAILED 0b00001010
// 3 1 SPI command failed to execute
276
#define RADIOLIB_SX126X_STATUS_TX_DONE 0b00001100
// 3 1 packet transmission done
277
#define RADIOLIB_SX126X_STATUS_SPI_FAILED 0b11111111
// 7 0 SPI transaction failed
278
279
//RADIOLIB_SX126X_CMD_GET_PACKET_STATUS
280
#define RADIOLIB_SX126X_GFSK_RX_STATUS_PREAMBLE_ERR 0b10000000
// 7 7 GFSK Rx status: preamble error
281
#define RADIOLIB_SX126X_GFSK_RX_STATUS_SYNC_ERR 0b01000000
// 6 6 sync word error
282
#define RADIOLIB_SX126X_GFSK_RX_STATUS_ADRS_ERR 0b00100000
// 5 5 address error
283
#define RADIOLIB_SX126X_GFSK_RX_STATUS_CRC_ERR 0b00010000
// 4 4 CRC error
284
#define RADIOLIB_SX126X_GFSK_RX_STATUS_LENGTH_ERR 0b00001000
// 3 3 length error
285
#define RADIOLIB_SX126X_GFSK_RX_STATUS_ABORT_ERR 0b00000100
// 2 2 abort error
286
#define RADIOLIB_SX126X_GFSK_RX_STATUS_PACKET_RECEIVED 0b00000010
// 2 2 packet received
287
#define RADIOLIB_SX126X_GFSK_RX_STATUS_PACKET_SENT 0b00000001
// 2 2 packet sent
288
289
//RADIOLIB_SX126X_CMD_GET_DEVICE_ERRORS
290
#define RADIOLIB_SX126X_PA_RAMP_ERR 0b100000000
// 8 8 device errors: PA ramping failed
291
#define RADIOLIB_SX126X_PLL_LOCK_ERR 0b001000000
// 6 6 PLL failed to lock
292
#define RADIOLIB_SX126X_XOSC_START_ERR 0b000100000
// 5 5 crystal oscillator failed to start
293
#define RADIOLIB_SX126X_IMG_CALIB_ERR 0b000010000
// 4 4 image calibration failed
294
#define RADIOLIB_SX126X_ADC_CALIB_ERR 0b000001000
// 3 3 ADC calibration failed
295
#define RADIOLIB_SX126X_PLL_CALIB_ERR 0b000000100
// 2 2 PLL calibration failed
296
#define RADIOLIB_SX126X_RC13M_CALIB_ERR 0b000000010
// 1 1 RC13M calibration failed
297
#define RADIOLIB_SX126X_RC64K_CALIB_ERR 0b000000001
// 0 0 RC64K calibration failed
298
299
//RADIOLIB_SX126X_CMD_SET_LBT_SCAN_PARAMS + RADIOLIB_SX126X_CMD_SET_SPECTR_SCAN_PARAMS
300
#define RADIOLIB_SX126X_SCAN_INTERVAL_7_68_US 10
// 7 0 RSSI reading interval: 7.68 us
301
#define RADIOLIB_SX126X_SCAN_INTERVAL_8_20_US 11
// 7 0 8.20 us
302
#define RADIOLIB_SX126X_SCAN_INTERVAL_8_68_US 12
// 7 0 8.68 us
303
304
#endif
305
306
#endif
src
modules
SX126x
SX126x_commands.h
Generated by
1.9.8