RadioLib
Universal wireless communication library for Arduino
Loading...
Searching...
No Matches
LR11x0.h
1#if !defined(_RADIOLIB_LR11X0_H)
2#define _RADIOLIB_LR11X0_H
3
4#include "../../TypeDef.h"
5
6#if !RADIOLIB_EXCLUDE_LR11X0
7
8#include "../../Module.h"
9
10#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
11
12// LR11X0 physical layer properties
13#define RADIOLIB_LR11X0_FREQUENCY_STEP_SIZE 1.0
14#define RADIOLIB_LR11X0_MAX_PACKET_LENGTH 255
15#define RADIOLIB_LR11X0_CRYSTAL_FREQ 32.0
16#define RADIOLIB_LR11X0_DIV_EXPONENT 25
17
18// LR11X0 SPI commands
19#define RADIOLIB_LR11X0_CMD_NOP (0x0000)
20#define RADIOLIB_LR11X0_CMD_WRITE_REG_MEM (0x0105)
21#define RADIOLIB_LR11X0_CMD_READ_REG_MEM (0x0106)
22#define RADIOLIB_LR11X0_CMD_WRITE_BUFFER (0x0109)
23#define RADIOLIB_LR11X0_CMD_READ_BUFFER (0x010A)
24#define RADIOLIB_LR11X0_CMD_CLEAR_RX_BUFFER (0x010B)
25#define RADIOLIB_LR11X0_CMD_WRITE_REG_MEM_MASK (0x010C)
26#define RADIOLIB_LR11X0_CMD_GET_STATUS (0x0100)
27#define RADIOLIB_LR11X0_CMD_GET_VERSION (0x0101)
28#define RADIOLIB_LR11X0_CMD_GET_ERRORS (0x010D)
29#define RADIOLIB_LR11X0_CMD_CLEAR_ERRORS (0x010E)
30#define RADIOLIB_LR11X0_CMD_CALIBRATE (0x010F)
31#define RADIOLIB_LR11X0_CMD_SET_REG_MODE (0x0110)
32#define RADIOLIB_LR11X0_CMD_CALIB_IMAGE (0x0111)
33#define RADIOLIB_LR11X0_CMD_SET_DIO_AS_RF_SWITCH (0x0112)
34#define RADIOLIB_LR11X0_CMD_SET_DIO_IRQ_PARAMS (0x0113)
35#define RADIOLIB_LR11X0_CMD_CLEAR_IRQ (0x0114)
36#define RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK (0x0116)
37#define RADIOLIB_LR11X0_CMD_SET_TCXO_MODE (0x0117)
38#define RADIOLIB_LR11X0_CMD_REBOOT (0x0118)
39#define RADIOLIB_LR11X0_CMD_GET_VBAT (0x0119)
40#define RADIOLIB_LR11X0_CMD_GET_TEMP (0x011A)
41#define RADIOLIB_LR11X0_CMD_SET_SLEEP (0x011B)
42#define RADIOLIB_LR11X0_CMD_SET_STANDBY (0x011C)
43#define RADIOLIB_LR11X0_CMD_SET_FS (0x011D)
44#define RADIOLIB_LR11X0_CMD_GET_RANDOM_NUMBER (0x0120)
45#define RADIOLIB_LR11X0_CMD_ERASE_INFO_PAGE (0x0121)
46#define RADIOLIB_LR11X0_CMD_WRITE_INFO_PAGE (0x0122)
47#define RADIOLIB_LR11X0_CMD_READ_INFO_PAGE (0x0123)
48#define RADIOLIB_LR11X0_CMD_GET_CHIP_EUI (0x0125)
49#define RADIOLIB_LR11X0_CMD_GET_SEMTECH_JOIN_EUI (0x0126)
50#define RADIOLIB_LR11X0_CMD_DERIVE_ROOT_KEYS_AND_GET_PIN (0x0127)
51#define RADIOLIB_LR11X0_CMD_ENABLE_SPI_CRC (0x0128)
52#define RADIOLIB_LR11X0_CMD_DRIVE_DIOS_IN_SLEEP_MODE (0x012A)
53#define RADIOLIB_LR11X0_CMD_RESET_STATS (0x0200)
54#define RADIOLIB_LR11X0_CMD_GET_STATS (0x0201)
55#define RADIOLIB_LR11X0_CMD_GET_PACKET_TYPE (0x0202)
56#define RADIOLIB_LR11X0_CMD_GET_RX_BUFFER_STATUS (0x0203)
57#define RADIOLIB_LR11X0_CMD_GET_PACKET_STATUS (0x0204)
58#define RADIOLIB_LR11X0_CMD_GET_RSSI_INST (0x0205)
59#define RADIOLIB_LR11X0_CMD_SET_GFSK_SYNC_WORD (0x0206)
60#define RADIOLIB_LR11X0_CMD_SET_LORA_PUBLIC_NETWORK (0x0208)
61#define RADIOLIB_LR11X0_CMD_SET_RX (0x0209)
62#define RADIOLIB_LR11X0_CMD_SET_TX (0x020A)
63#define RADIOLIB_LR11X0_CMD_SET_RF_FREQUENCY (0x020B)
64#define RADIOLIB_LR11X0_CMD_AUTO_TX_RX (0x020C)
65#define RADIOLIB_LR11X0_CMD_SET_CAD_PARAMS (0x020D)
66#define RADIOLIB_LR11X0_CMD_SET_PACKET_TYPE (0x020E)
67#define RADIOLIB_LR11X0_CMD_SET_MODULATION_PARAMS (0x020F)
68#define RADIOLIB_LR11X0_CMD_SET_PACKET_PARAMS (0x0210)
69#define RADIOLIB_LR11X0_CMD_SET_TX_PARAMS (0x0211)
70#define RADIOLIB_LR11X0_CMD_SET_PACKET_ADRS (0x0212)
71#define RADIOLIB_LR11X0_CMD_SET_RX_TX_FALLBACK_MODE (0x0213)
72#define RADIOLIB_LR11X0_CMD_SET_RX_DUTY_CYCLE (0x0214)
73#define RADIOLIB_LR11X0_CMD_SET_PA_CONFIG (0x0215)
74#define RADIOLIB_LR11X0_CMD_STOP_TIMEOUT_ON_PREAMBLE (0x0217)
75#define RADIOLIB_LR11X0_CMD_SET_CAD (0x0218)
76#define RADIOLIB_LR11X0_CMD_SET_TX_CW (0x0219)
77#define RADIOLIB_LR11X0_CMD_SET_TX_INFINITE_PREAMBLE (0x021A)
78#define RADIOLIB_LR11X0_CMD_SET_LORA_SYNCH_TIMEOUT (0x021B)
79#define RADIOLIB_LR11X0_CMD_SET_RANGING_ADDR (0x021C)
80#define RADIOLIB_LR11X0_CMD_SET_RANGING_REQ_ADDR (0x021D)
81#define RADIOLIB_LR11X0_CMD_GET_RANGING_RESULT (0x021E)
82#define RADIOLIB_LR11X0_CMD_SET_RANGING_TX_RX_DELAY (0x021F)
83#define RADIOLIB_LR11X0_CMD_SET_GFSK_CRC_PARAMS (0x0224)
84#define RADIOLIB_LR11X0_CMD_SET_GFSK_WHIT_PARAMS (0x0225)
85#define RADIOLIB_LR11X0_CMD_SET_RX_BOOSTED (0x0227)
86#define RADIOLIB_LR11X0_CMD_SET_RANGING_PARAMETER (0x0228)
87#define RADIOLIB_LR11X0_CMD_SET_RSSI_CALIBRATION (0x0229)
88#define RADIOLIB_LR11X0_CMD_SET_LORA_SYNC_WORD (0x022B)
89#define RADIOLIB_LR11X0_CMD_LR_FHSS_BUILD_FRAME (0x022C)
90#define RADIOLIB_LR11X0_CMD_LR_FHSS_SET_SYNC_WORD (0x022D)
91#define RADIOLIB_LR11X0_CMD_CONFIG_BLE_BEACON (0x022E)
92#define RADIOLIB_LR11X0_CMD_GET_LORA_RX_HEADER_INFOS (0x0230)
93#define RADIOLIB_LR11X0_CMD_BLE_BEACON_SEND (0x0231)
94#define RADIOLIB_LR11X0_CMD_WIFI_SCAN (0x0300)
95#define RADIOLIB_LR11X0_CMD_WIFI_SCAN_TIME_LIMIT (0x0301)
96#define RADIOLIB_LR11X0_CMD_WIFI_COUNTRY_CODE (0x0302)
97#define RADIOLIB_LR11X0_CMD_WIFI_COUNTRY_CODE_TIME_LIMIT (0x0303)
98#define RADIOLIB_LR11X0_CMD_WIFI_GET_NB_RESULTS (0x0305)
99#define RADIOLIB_LR11X0_CMD_WIFI_READ_RESULTS (0x0306)
100#define RADIOLIB_LR11X0_CMD_WIFI_RESET_CUMUL_TIMINGS (0x0307)
101#define RADIOLIB_LR11X0_CMD_WIFI_READ_CUMUL_TIMINGS (0x0308)
102#define RADIOLIB_LR11X0_CMD_WIFI_GET_NB_COUNTRY_CODE_RESULTS (0x0309)
103#define RADIOLIB_LR11X0_CMD_WIFI_READ_COUNTRY_CODE_RESULTS (0x030A)
104#define RADIOLIB_LR11X0_CMD_WIFI_CFG_TIMESTAMP_AP_PHONE (0x030B)
105#define RADIOLIB_LR11X0_CMD_WIFI_READ_VERSION (0x0320)
106#define RADIOLIB_LR11X0_CMD_GNSS_READ_RSSI (0x0222)
107#define RADIOLIB_LR11X0_CMD_GNSS_SET_CONSTELLATION_TO_USE (0x0400)
108#define RADIOLIB_LR11X0_CMD_GNSS_READ_CONSTELLATION_TO_USE (0x0401)
109#define RADIOLIB_LR11X0_CMD_GNSS_SET_ALMANAC_UPDATE (0x0402)
110#define RADIOLIB_LR11X0_CMD_GNSS_READ_ALMANAC_UPDATE (0x0403)
111#define RADIOLIB_LR11X0_CMD_GNSS_SET_FREQ_SEARCH_SPACE (0x0404)
112#define RADIOLIB_LR11X0_CMD_GNSS_READ_FREQ_SEARCH_SPACE (0x0405)
113#define RADIOLIB_LR11X0_CMD_GNSS_READ_VERSION (0x0406)
114#define RADIOLIB_LR11X0_CMD_GNSS_READ_SUPPORTED_CONSTELLATIONS (0x0407)
115#define RADIOLIB_LR11X0_CMD_GNSS_SET_MODE (0x0408)
116#define RADIOLIB_LR11X0_CMD_GNSS_AUTONOMOUS (0x0409)
117#define RADIOLIB_LR11X0_CMD_GNSS_ASSISTED (0x040A)
118#define RADIOLIB_LR11X0_CMD_GNSS_SCAN (0x040B)
119#define RADIOLIB_LR11X0_CMD_GNSS_GET_RESULT_SIZE (0x040C)
120#define RADIOLIB_LR11X0_CMD_GNSS_READ_RESULTS (0x040D)
121#define RADIOLIB_LR11X0_CMD_GNSS_ALMANAC_FULL_UPDATE (0x040E)
122#define RADIOLIB_LR11X0_CMD_GNSS_ALMANAC_READ_ADDR_SIZE (0x040F)
123#define RADIOLIB_LR11X0_CMD_GNSS_SET_ASSISTANCE_POSITION (0x0410)
124#define RADIOLIB_LR11X0_CMD_GNSS_READ_ASSISTANCE_POSITION (0x0411)
125#define RADIOLIB_LR11X0_CMD_GNSS_PUSH_SOLVER_MSG (0x0414)
126#define RADIOLIB_LR11X0_CMD_GNSS_PUSH_DM_MSG (0x0415)
127#define RADIOLIB_LR11X0_CMD_GNSS_GET_CONTEXT_STATUS (0x0416)
128#define RADIOLIB_LR11X0_CMD_GNSS_GET_NB_SV_DETECTED (0x0417)
129#define RADIOLIB_LR11X0_CMD_GNSS_GET_SV_DETECTED (0x0418)
130#define RADIOLIB_LR11X0_CMD_GNSS_GET_CONSUMPTION (0x0419)
131#define RADIOLIB_LR11X0_CMD_GNSS_READ_ALMANAC_PER_SATELLITE (0x041A)
132#define RADIOLIB_LR11X0_CMD_GNSS_GET_SV_VISIBLE (0x041F)
133#define RADIOLIB_LR11X0_CMD_GNSS_GET_SV_VISIBLE_DOPPLER (0x0420)
134#define RADIOLIB_LR11X0_CMD_GNSS_READ_LAST_SCAN_MODE_LAUNCHED (0x0426)
135#define RADIOLIB_LR11X0_CMD_GNSS_FETCH_TIME (0x0432)
136#define RADIOLIB_LR11X0_CMD_GNSS_READ_TIME (0x0434)
137#define RADIOLIB_LR11X0_CMD_GNSS_RESET_TIME (0x0435)
138#define RADIOLIB_LR11X0_CMD_GNSS_RESET_POSITION (0x0437)
139#define RADIOLIB_LR11X0_CMD_GNSS_READ_WEEK_NUMBER_ROLLOWER (0x0438)
140#define RADIOLIB_LR11X0_CMD_GNSS_READ_DEMOD_STATUS (0x0439)
141#define RADIOLIB_LR11X0_CMD_GNSS_READ_CUMUL_TIMING (0x044A)
142#define RADIOLIB_LR11X0_CMD_GNSS_SET_TIME (0x044B)
143#define RADIOLIB_LR11X0_CMD_GNSS_CONFIG_DELAY_RESET_AP (0x044D)
144#define RADIOLIB_LR11X0_CMD_GNSS_READ_DOPPLER_SOLVER_RES (0x044F)
145#define RADIOLIB_LR11X0_CMD_GNSS_READ_DELAY_RESET_AP (0x0453)
146#define RADIOLIB_LR11X0_CMD_GNSS_ALMANAC_UPDATE_FROM_SAT (0x0454)
147#define RADIOLIB_LR11X0_CMD_GNSS_READ_KEEP_SYNC_STATUS (0x0456)
148#define RADIOLIB_LR11X0_CMD_GNSS_READ_ALMANAC_STATUS (0x0457)
149#define RADIOLIB_LR11X0_CMD_GNSS_CONFIG_ALMANAC_UPDATE_PERIOD (0x0463)
150#define RADIOLIB_LR11X0_CMD_GNSS_READ_ALMANAC_UPDATE_PERIOD (0x0464)
151#define RADIOLIB_LR11X0_CMD_GNSS_GET_SV_WARM_START (0x0466)
152#define RADIOLIB_LR11X0_CMD_GNSS_GET_SV_SYNC (0x0466)
153#define RADIOLIB_LR11X0_CMD_GNSS_READ_WARM_START_STATUS (0x0469)
154#define RADIOLIB_LR11X0_CMD_GNSS_WRITE_BIT_MASK_SAT_ACTIVATED (0x0472)
155#define RADIOLIB_LR11X0_CMD_CRYPTO_SET_KEY (0x0502)
156#define RADIOLIB_LR11X0_CMD_CRYPTO_DERIVE_KEY (0x0503)
157#define RADIOLIB_LR11X0_CMD_CRYPTO_PROCESS_JOIN_ACCEPT (0x0504)
158#define RADIOLIB_LR11X0_CMD_CRYPTO_COMPUTE_AES_CMAC (0x0505)
159#define RADIOLIB_LR11X0_CMD_CRYPTO_VERIFY_AES_CMAC (0x0506)
160#define RADIOLIB_LR11X0_CMD_CRYPTO_AES_ENCRYPT_01 (0x0507)
161#define RADIOLIB_LR11X0_CMD_CRYPTO_AES_ENCRYPT (0x0508)
162#define RADIOLIB_LR11X0_CMD_CRYPTO_AES_DECRYPT (0x0509)
163#define RADIOLIB_LR11X0_CMD_CRYPTO_STORE_TO_FLASH (0x050A)
164#define RADIOLIB_LR11X0_CMD_CRYPTO_RESTORE_FROM_FLASH (0x050B)
165#define RADIOLIB_LR11X0_CMD_CRYPTO_SET_PARAM (0x050D)
166#define RADIOLIB_LR11X0_CMD_CRYPTO_GET_PARAM (0x050E)
167#define RADIOLIB_LR11X0_CMD_CRYPTO_CHECK_ENCRYPTED_FIRMWARE_IMAGE (0x050F)
168#define RADIOLIB_LR11X0_CMD_CRYPTO_CHECK_ENCRYPTED_FIRMWARE_IMAGE_RESULT (0x0510)
169#define RADIOLIB_LR11X0_CMD_BOOT_ERASE_FLASH (0x8000)
170#define RADIOLIB_LR11X0_CMD_BOOT_WRITE_FLASH_ENCRYPTED (0x8003)
171#define RADIOLIB_LR11X0_CMD_BOOT_REBOOT (0x8005)
172#define RADIOLIB_LR11X0_CMD_BOOT_GET_PIN (0x800B)
173#define RADIOLIB_LR11X0_CMD_BOOT_GET_CHIP_EUI (0x800C)
174#define RADIOLIB_LR11X0_CMD_BOOT_GET_JOIN_EUI (0x800D)
175
176// LR11X0 register map
177#define RADIOLIB_LR11X0_REG_SF6_SX127X_COMPAT (0x00F20414)
178#define RADIOLIB_LR11X0_REG_LORA_HIGH_POWER_FIX (0x00F30054)
179#define RADIOLIB_LR11X0_REG_LNA_MODE (0x00F3008C)
180// TODO add fix for br 600/1200 bps
181
182// LR11X0 SPI command variables
183
184// RADIOLIB_LR11X0_CMD_GET_STATUS MSB LSB DESCRIPTION
185#define RADIOLIB_LR11X0_STAT_1_CMD_FAIL (0x00UL << 1) // 3 1 command status: last command could not be executed
186#define RADIOLIB_LR11X0_STAT_1_CMD_PERR (0x01UL << 1) // 3 1 processing error
187#define RADIOLIB_LR11X0_STAT_1_CMD_OK (0x02UL << 1) // 3 1 successfully processed
188#define RADIOLIB_LR11X0_STAT_1_CMD_DAT (0x03UL << 1) // 3 1 successfully processed, data is being transmitted
189#define RADIOLIB_LR11X0_STAT_1_IRQ_INACTIVE (0x00UL << 0) // 0 0 interrupt status: inactive
190#define RADIOLIB_LR11X0_STAT_1_IRQ_ACTIVE (0x01UL << 0) // 0 0 at least 1 interrupt active
191#define RADIOLIB_LR11X0_STAT_2_CMD_RST_CLEARED (0x00UL << 4) // 7 4 reset status: cleared
192#define RADIOLIB_LR11X0_STAT_2_CMD_RST_ANALOG (0x01UL << 4) // 7 4 analog (power on, brown-out)
193#define RADIOLIB_LR11X0_STAT_2_CMD_RST_EXTERNAL (0x02UL << 4) // 7 4 NRESET pin
194#define RADIOLIB_LR11X0_STAT_2_CMD_RST_SYSTEM (0x03UL << 4) // 7 4 system
195#define RADIOLIB_LR11X0_STAT_2_CMD_RST_WATCHDOG (0x04UL << 4) // 7 4 watchdog
196#define RADIOLIB_LR11X0_STAT_2_CMD_RST_WAKEUP (0x05UL << 4) // 7 4 NSS toggling wake-up
197#define RADIOLIB_LR11X0_STAT_2_CMD_RST_RTC (0x06UL << 4) // 7 4 realtime clock
198#define RADIOLIB_LR11X0_STAT_2_MODE_SLEEP (0x00UL << 1) // 3 1 chip mode: sleep
199#define RADIOLIB_LR11X0_STAT_2_MODE_STBY_RC (0x01UL << 1) // 3 1 standby with RC oscillator
200#define RADIOLIB_LR11X0_STAT_2_MODE_STBY_OSC (0x02UL << 1) // 3 1 standby with external oscillator
201#define RADIOLIB_LR11X0_STAT_2_MODE_FS (0x03UL << 1) // 3 1 frequency synthesis
202#define RADIOLIB_LR11X0_STAT_2_MODE_RX (0x04UL << 1) // 3 1 receive
203#define RADIOLIB_LR11X0_STAT_2_MODE_TX (0x05UL << 1) // 3 1 transmit
204#define RADIOLIB_LR11X0_STAT_2_MODE_WIFI_GNSS (0x06UL << 1) // 3 1 WiFi or GNSS geolocation
205#define RADIOLIB_LR11X0_STAT_2_BOOT (0x00UL << 0) // 0 0 code executed from: bootloader
206#define RADIOLIB_LR11X0_STAT_2_FLASH (0x01UL << 0) // 0 0 flash
207
208// RADIOLIB_LR11X0_CMD_WRITE_REG_MEM
209#define RADIOLIB_LR11X0_SPI_MAX_READ_WRITE_LEN (256) // 7 0 maximum length of read/write SPI payload in bytes
210
211// RADIOLIB_LR11X0_CMD_GET_VERSION
212#define RADIOLIB_LR11X0_DEVICE_LR1110 (0x01UL << 0) // 7 0 HW device: LR1110
213#define RADIOLIB_LR11X0_DEVICE_LR1120 (0x02UL << 0) // 7 0 LR1120
214#define RADIOLIB_LR11X0_DEVICE_LR1121 (0x03UL << 0) // 7 0 LR1121
215#define RADIOLIB_LR11X0_DEVICE_BOOT (0xDFUL << 0) // 7 0 bootloader mode
216
217// RADIOLIB_LR11X0_CMD_GET_ERRORS
218#define RADIOLIB_LR11X0_ERROR_STAT_LF_RC_CALIB_ERR (0x01UL << 0) // 15 0 error: low frequency RC not calibrated
219#define RADIOLIB_LR11X0_ERROR_STAT_HF_RC_CALIB_ERR (0x01UL << 1) // 15 0 high frequency RC not calibrated
220#define RADIOLIB_LR11X0_ERROR_STAT_ADC_CALIB_ERR (0x01UL << 2) // 15 0 ADC not calibrated
221#define RADIOLIB_LR11X0_ERROR_STAT_PLL_CALIB_ERR (0x01UL << 3) // 15 0 PLL not calibrated
222#define RADIOLIB_LR11X0_ERROR_STAT_IMG_CALIB_ERR (0x01UL << 4) // 15 0 image rejection not calibrated
223#define RADIOLIB_LR11X0_ERROR_STAT_HF_XOSC_START_ERR (0x01UL << 5) // 15 0 high frequency oscillator failed to start
224#define RADIOLIB_LR11X0_ERROR_STAT_LF_XOSC_START_ERR (0x01UL << 6) // 15 0 low frequency oscillator failed to start
225#define RADIOLIB_LR11X0_ERROR_STAT_PLL_LOCK_ERR (0x01UL << 7) // 15 0 PLL failed to lock
226#define RADIOLIB_LR11X0_ERROR_STAT_RX_ADC_OFFSET_ERR (0x01UL << 8) // 15 0 ADC offset not calibrated
227
228// RADIOLIB_LR11X0_CMD_CALIBRATE
229#define RADIOLIB_LR11X0_CALIBRATE_PLL_TX (0x01UL << 5) // 5 5 calibrate: Tx PLL
230#define RADIOLIB_LR11X0_CALIBRATE_IMG (0x01UL << 4) // 4 4 image rejection
231#define RADIOLIB_LR11X0_CALIBRATE_ADC (0x01UL << 3) // 3 3 A/D converter
232#define RADIOLIB_LR11X0_CALIBRATE_PLL (0x01UL << 2) // 2 2 PLL
233#define RADIOLIB_LR11X0_CALIBRATE_HF_RC (0x01UL << 1) // 1 1 high frequency RC
234#define RADIOLIB_LR11X0_CALIBRATE_LF_RC (0x01UL << 0) // 0 0 low frequency RC
235#define RADIOLIB_LR11X0_CALIBRATE_ALL (0x3FUL << 0) // 5 0 everything
236#define RADIOLIB_LR11X0_CAL_IMG_FREQ_TRIG_MHZ (20.0f)
237
238// RADIOLIB_LR11X0_CMD_SET_REG_MODE
239#define RADIOLIB_LR11X0_REG_MODE_LDO (0x00UL << 0) // 0 0 regulator mode: LDO in all modes
240#define RADIOLIB_LR11X0_REG_MODE_DC_DC (0x01UL << 0) // 0 0 DC-DC and LDO
241
242// RADIOLIB_LR11X0_CMD_SET_DIO_AS_RF_SWITCH
243#define RADIOLIB_LR11X0_RFSW_DIO5_ENABLED (0x01UL << 0) // 4 0 RF switch: DIO5 enabled
244#define RADIOLIB_LR11X0_RFSW_DIO5_DISABLED (0x00UL << 0) // 4 0 DIO5 disabled (default)
245#define RADIOLIB_LR11X0_RFSW_DIO6_ENABLED (0x01UL << 1) // 4 0 RF switch: DIO6 enabled
246#define RADIOLIB_LR11X0_RFSW_DIO6_DISABLED (0x00UL << 1) // 4 0 DIO6 disabled (default)
247#define RADIOLIB_LR11X0_RFSW_DIO7_ENABLED (0x01UL << 2) // 4 0 RF switch: DIO7 enabled
248#define RADIOLIB_LR11X0_RFSW_DIO7_DISABLED (0x00UL << 2) // 4 0 DIO7 disabled (default)
249#define RADIOLIB_LR11X0_RFSW_DIO8_ENABLED (0x01UL << 3) // 4 0 RF switch: DIO8 enabled
250#define RADIOLIB_LR11X0_RFSW_DIO8_DISABLED (0x00UL << 3) // 4 0 DIO8 disabled (default)
251#define RADIOLIB_LR11X0_RFSW_DIO10_ENABLED (0x01UL << 4) // 4 0 RF switch: DIO10 enabled
252#define RADIOLIB_LR11X0_RFSW_DIO10_DISABLED (0x00UL << 4) // 4 0 DIO10 disabled (default)
253#define RADIOLIB_LR11X0_DIOx(X) ((X) | RFSWITCH_PIN_FLAG)
254#define RADIOLIB_LR11X0_DIOx_VAL(X) ((X) & ~RFSWITCH_PIN_FLAG)
255#define RADIOLIB_LR11X0_DIO5 (RADIOLIB_LR11X0_DIOx(0))
256#define RADIOLIB_LR11X0_DIO6 (RADIOLIB_LR11X0_DIOx(1))
257#define RADIOLIB_LR11X0_DIO7 (RADIOLIB_LR11X0_DIOx(2))
258#define RADIOLIB_LR11X0_DIO8 (RADIOLIB_LR11X0_DIOx(3))
259#define RADIOLIB_LR11X0_DIO10 (RADIOLIB_LR11X0_DIOx(4))
260
261// RADIOLIB_LR11X0_CMD_SET_DIO_IRQ_PARAMS
262#define RADIOLIB_LR11X0_IRQ_TX_DONE (0x01UL << 2) // 31 0 interrupt: packet transmitted
263#define RADIOLIB_LR11X0_IRQ_RX_DONE (0x01UL << 3) // 31 0 packet received
264#define RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED (0x01UL << 4) // 31 0 preamble detected
265#define RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID (0x01UL << 5) // 31 0 sync word or LoRa header valid
266#define RADIOLIB_LR11X0_IRQ_HEADER_ERR (0x01UL << 6) // 31 0 LoRa header CRC error
267#define RADIOLIB_LR11X0_IRQ_CRC_ERR (0x01UL << 7) // 31 0 packet CRC error
268#define RADIOLIB_LR11X0_IRQ_CAD_DONE (0x01UL << 8) // 31 0 CAD completed
269#define RADIOLIB_LR11X0_IRQ_CAD_DETECTED (0x01UL << 9) // 31 0 CAD detected
270#define RADIOLIB_LR11X0_IRQ_TIMEOUT (0x01UL << 10) // 31 0 Rx or Tx timeout
271#define RADIOLIB_LR11X0_IRQ_LR_FHSS_HOP (0x01UL << 11) // 31 0 FHSS hop
272#define RADIOLIB_LR11X0_IRQ_GNSS_DONE (0x01UL << 19) // 31 0 GNSS scan finished
273#define RADIOLIB_LR11X0_IRQ_WIFI_DONE (0x01UL << 20) // 31 0 WiFi scan finished
274#define RADIOLIB_LR11X0_IRQ_LBD (0x01UL << 21) // 31 0 low battery detected
275#define RADIOLIB_LR11X0_IRQ_CMD_ERROR (0x01UL << 22) // 31 0 command error
276#define RADIOLIB_LR11X0_IRQ_ERROR (0x01UL << 23) // 31 0 some other error than CMD_ERR
277#define RADIOLIB_LR11X0_IRQ_FSK_LEN_ERROR (0x01UL << 24) // 31 0 FSK packet received with length error
278#define RADIOLIB_LR11X0_IRQ_FSK_ADDR_ERROR (0x01UL << 25) // 31 0 FSK packet received with address error
279#define RADIOLIB_LR11X0_IRQ_LORA_RX_TIMESTAMP (0x01UL << 27) // 31 0 last LoRa symbol was received (timestamp source)
280#define RADIOLIB_LR11X0_IRQ_GNSS_ABORT (0x01UL << 28) // 31 0 GNSS scan aborted
281#define RADIOLIB_LR11X0_IRQ_ALL (0x1BF80FFCUL) // 31 0 all interrupts
282#define RADIOLIB_LR11X0_IRQ_NONE (0x00UL << 0) // 31 0 no interrupts
283
284// RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK
285#define RADIOLIB_LR11X0_LF_CLK_RC (0x00UL << 0) // 1 0 32.768 kHz source: RC oscillator
286#define RADIOLIB_LR11X0_LF_CLK_XOSC (0x01UL << 0) // 1 0 crystal oscillator
287#define RADIOLIB_LR11X0_LF_CLK_EXT (0x02UL << 0) // 1 0 external signal on DIO11
288#define RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED (0x00UL << 2) // 2 2
289#define RADIOLIB_LR11X0_LF_BUSY_RELEASE_ENABLED (0x01UL << 2) // 2 2
290
291// RADIOLIB_LR11X0_CMD_SET_TCXO_MODE
292#define RADIOLIB_LR11X0_TCXO_VOLTAGE_1_6 (0x00UL << 0) // 2 0 TCXO supply voltage: 1.6V
293#define RADIOLIB_LR11X0_TCXO_VOLTAGE_1_7 (0x01UL << 0) // 2 0 1.7V
294#define RADIOLIB_LR11X0_TCXO_VOLTAGE_1_8 (0x02UL << 0) // 2 0 1.8V
295#define RADIOLIB_LR11X0_TCXO_VOLTAGE_2_2 (0x03UL << 0) // 2 0 2.2V
296#define RADIOLIB_LR11X0_TCXO_VOLTAGE_2_4 (0x04UL << 0) // 2 0 2.4V
297#define RADIOLIB_LR11X0_TCXO_VOLTAGE_2_7 (0x05UL << 0) // 2 0 2.7V
298#define RADIOLIB_LR11X0_TCXO_VOLTAGE_3_0 (0x06UL << 0) // 2 0 3.0V
299#define RADIOLIB_LR11X0_TCXO_VOLTAGE_3_3 (0x07UL << 0) // 2 0 3.3V
300
301// RADIOLIB_LR11X0_CMD_SET_SLEEP
302#define RADIOLIB_LR11X0_SLEEP_RETENTION_DISABLED (0x00UL << 0) // 0 0 configuration retention in sleep mode: disabled
303#define RADIOLIB_LR11X0_SLEEP_RETENTION_ENABLED (0x01UL << 0) // 0 0 enabled
304#define RADIOLIB_LR11X0_SLEEP_WAKEUP_DISABLED (0x00UL << 0) // 1 1 automated wakeup: disabled
305#define RADIOLIB_LR11X0_SLEEP_WAKEUP_ENABLED (0x01UL << 0) // 1 1 enabled
306
307// RADIOLIB_LR11X0_CMD_SET_STANDBY
308#define RADIOLIB_LR11X0_STANDBY_RC (0x00UL << 0) // 7 0 standby mode: RC oscillator
309#define RADIOLIB_LR11X0_STANDBY_XOSC (0x00UL << 0) // 7 0 XTAL/TCXO oscillator
310
311// RADIOLIB_LR11X0_CMD_ERASE_INFO_PAGE
312#define RADIOLIB_LR11X0_INFO_PAGE (1)
313
314// RADIOLIB_LR11X0_CMD_GET_CHIP_EUI
315#define RADIOLIB_LR11X0_EUI_LEN (8)
316
317// RADIOLIB_LR11X0_CMD_DERIVE_ROOT_KEYS_AND_GET_PIN
318#define RADIOLIB_LR11X0_PIN_LEN (4)
319
320// RADIOLIB_LR11X0_CMD_GET_PACKET_STATUS
321#define RADIOLIB_LR11X0_RX_STATUS_ADDR_ERR (0x01UL << 5) // 7 0 Rx status: address filtering error
322#define RADIOLIB_LR11X0_RX_STATUS_CRC_ERR (0x01UL << 4) // 7 0 CRC error
323#define RADIOLIB_LR11X0_RX_STATUS_LEN_ERR (0x01UL << 3) // 7 0 length filtering error
324#define RADIOLIB_LR11X0_RX_STATUS_ABORTED (0x01UL << 2) // 7 0 packet reception aborted
325#define RADIOLIB_LR11X0_RX_STATUS_PACKET_RECEIVED (0x01UL << 1) // 7 0 packet received
326#define RADIOLIB_LR11X0_RX_STATUS_PACKET_SENT (0x01UL << 0) // 7 0 packet sent
327
328// RADIOLIB_LR11X0_CMD_SET_GFSK_SYNC_WORD
329#define RADIOLIB_LR11X0_GFSK_SYNC_WORD_LEN (8)
330
331// RADIOLIB_LR11X0_CMD_SET_LORA_PUBLIC_NETWORK
332#define RADIOLIB_LR11X0_LORA_PRIVATE_NETWORK (0x00UL << 0) // 7 0 LoRa sync word: private network
333#define RADIOLIB_LR11X0_LORA_PUBLIC_NETWORK (0x01UL << 0) // 7 0 public network
334
335// RADIOLIB_LR11X0_CMD_SET_RX
336#define RADIOLIB_LR11X0_RX_TIMEOUT_NONE (0x000000UL) // 23 0 Rx timeout duration: no timeout (Rx single mode)
337#define RADIOLIB_LR11X0_RX_TIMEOUT_INF (0xFFFFFFUL) // 23 0 infinite (Rx continuous mode)
338
339// RADIOLIB_LR11X0_CMD_SET_TX
340#define RADIOLIB_LR11X0_TX_TIMEOUT_NONE (0x000000UL) // 23 0 disable Tx timeout
341
342// RADIOLIB_LR11X0_CMD_AUTO_TX_RX
343#define RADIOLIB_LR11X0_AUTO_TX_RX_DISABLED (0xFFFFFFUL) // 23 0 disable auto Tx/Rx mode
344#define RADIOLIB_LR11X0_AUTO_TX_RX_SKIP_INT (0x000000UL) // 23 0 skip intermediary mode
345#define RADIOLIB_LR11X0_AUTO_INTERMEDIARY_MODE_SLEEP (0x00UL << 0) // 1 0 intermediary mode: sleep
346#define RADIOLIB_LR11X0_AUTO_INTERMEDIARY_MODE_STBY_RC (0x01UL << 0) // 1 0 standby with RC
347#define RADIOLIB_LR11X0_AUTO_INTERMEDIARY_MODE_STBY_XOSC (0x02UL << 0) // 1 0 standby with XOSC
348#define RADIOLIB_LR11X0_AUTO_INTERMEDIARY_MODE_FS (0x03UL << 0) // 1 0 frequency synthesis
349#define RADIOLIB_LR11X0_AUTO_TX_RX_TIMEOUT_DISABLED (0x000000UL) // 23 0 disable timeout of the second mode
350
351// RADIOLIB_LR11X0_CMD_SET_CAD_PARAMS
352#define RADIOLIB_LR11X0_CAD_EXIT_MODE_STBY_RC (0x00UL << 0) // 7 0 mode to set after CAD: standby with RC
353#define RADIOLIB_LR11X0_CAD_EXIT_MODE_RX (0x01UL << 0) // 7 0 receive if activity detected
354#define RADIOLIB_LR11X0_CAD_EXIT_MODE_LBT (0x10UL << 0) // 7 0 transmit if no activity detected
355#define RADIOLIB_LR11X0_CAD_PARAM_DEFAULT (0xFFUL << 0) // 7 0 used by the CAD methods to specify default parameter value
356
357// RADIOLIB_LR11X0_CMD_SET_PACKET_TYPE
358#define RADIOLIB_LR11X0_PACKET_TYPE_NONE (0x00UL << 0) // 2 0 packet type: none
359#define RADIOLIB_LR11X0_PACKET_TYPE_GFSK (0x01UL << 0) // 2 0 (G)FSK
360#define RADIOLIB_LR11X0_PACKET_TYPE_LORA (0x02UL << 0) // 2 0 LoRa
361#define RADIOLIB_LR11X0_PACKET_TYPE_SIGFOX (0x03UL << 0) // 2 0 Sigfox
362#define RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS (0x04UL << 0) // 2 0 GMSK/LR-FHSS
363#define RADIOLIB_LR11X0_PACKET_TYPE_RANGING (0x05UL << 0) // 2 0 ranging
364#define RADIOLIB_LR11X0_PACKET_TYPE_BLE (0x06UL << 0) // 2 0 BLE beacon
365
366// RADIOLIB_LR11X0_CMD_SET_MODULATION_PARAMS
367#define RADIOLIB_LR11X0_LORA_BW_62_5 (0x03UL << 0) // 7 0 LoRa bandwidth: 62.5 kHz
368#define RADIOLIB_LR11X0_LORA_BW_125_0 (0x04UL << 0) // 7 0 125.0 kHz
369#define RADIOLIB_LR11X0_LORA_BW_250_0 (0x05UL << 0) // 7 0 250.0 kHz
370#define RADIOLIB_LR11X0_LORA_BW_500_0 (0x06UL << 0) // 7 0 500.0 kHz
371#define RADIOLIB_LR11X0_LORA_BW_203_125 (0x0DUL << 0) // 7 0 203.0 kHz (2.4GHz only)
372#define RADIOLIB_LR11X0_LORA_BW_406_25 (0x0EUL << 0) // 7 0 406.0 kHz (2.4GHz only)
373#define RADIOLIB_LR11X0_LORA_BW_812_50 (0x0FUL << 0) // 7 0 812.0 kHz (2.4GHz only)
374#define RADIOLIB_LR11X0_LORA_CR_4_5_SHORT (0x01UL << 0) // 7 0 coding rate: 4/5 with short interleaver
375#define RADIOLIB_LR11X0_LORA_CR_4_6_SHORT (0x02UL << 0) // 7 0 4/6 with short interleaver
376#define RADIOLIB_LR11X0_LORA_CR_4_7_SHORT (0x03UL << 0) // 7 0 4/7 with short interleaver
377#define RADIOLIB_LR11X0_LORA_CR_4_8_SHORT (0x04UL << 0) // 7 0 4/8 with short interleaver
378#define RADIOLIB_LR11X0_LORA_CR_4_5_LONG (0x05UL << 0) // 7 0 4/5 with long interleaver
379#define RADIOLIB_LR11X0_LORA_CR_4_6_LONG (0x06UL << 0) // 7 0 4/6 with long interleaver
380#define RADIOLIB_LR11X0_LORA_CR_4_8_LONG (0x07UL << 0) // 7 0 4/8 with long interleaver
381#define RADIOLIB_LR11X0_LORA_LDRO_DISABLED (0x00UL << 0) // 7 0 low data rate optimize: disabled
382#define RADIOLIB_LR11X0_LORA_LDRO_ENABLED (0x01UL << 0) // 7 0 enabled
383#define RADIOLIB_LR11X0_GFSK_BIT_RATE_DIV_DISABLED (0x00UL << 31) // 31 0 divide bit rate value by 256: disabled
384#define RADIOLIB_LR11X0_GFSK_BIT_RATE_DIV_ENABLED (0x01UL << 31) // 31 0 enabled
385#define RADIOLIB_LR11X0_GFSK_SHAPING_NONE (0x00UL << 0) // 7 0 shaping filter: none
386#define RADIOLIB_LR11X0_GFSK_SHAPING_GAUSSIAN_BT_0_3 (0x08UL << 0) // 7 0 Gaussian, BT = 0.3
387#define RADIOLIB_LR11X0_GFSK_SHAPING_GAUSSIAN_BT_0_5 (0x09UL << 0) // 7 0 Gaussian, BT = 0.5
388#define RADIOLIB_LR11X0_GFSK_SHAPING_GAUSSIAN_BT_0_7 (0x0AUL << 0) // 7 0 Gaussian, BT = 0.7
389#define RADIOLIB_LR11X0_GFSK_SHAPING_GAUSSIAN_BT_1_0 (0x0BUL << 0) // 7 0 Gaussian, BT = 1.0
390#define RADIOLIB_LR11X0_GFSK_SHAPING_RAISED_COSINE_BT_0_7 (0x16UL << 0) // 7 0 raised cosine, BT = 0.7
391#define RADIOLIB_LR11X0_GFSK_RX_BW_4_8 (0x1FUL << 0) // 7 0 GFSK Rx bandwidth: 4.8 kHz
392#define RADIOLIB_LR11X0_GFSK_RX_BW_5_8 (0x17UL << 0) // 7 0 5.8 kHz
393#define RADIOLIB_LR11X0_GFSK_RX_BW_7_3 (0x0FUL << 0) // 7 0 7.3 kHz
394#define RADIOLIB_LR11X0_GFSK_RX_BW_9_7 (0x1EUL << 0) // 7 0 9.7 kHz
395#define RADIOLIB_LR11X0_GFSK_RX_BW_11_7 (0x16UL << 0) // 7 0 11.7 kHz
396#define RADIOLIB_LR11X0_GFSK_RX_BW_14_6 (0x0EUL << 0) // 7 0 14.6 kHz
397#define RADIOLIB_LR11X0_GFSK_RX_BW_19_5 (0x1DUL << 0) // 7 0 19.5 kHz
398#define RADIOLIB_LR11X0_GFSK_RX_BW_23_4 (0x15UL << 0) // 7 0 23.4 kHz
399#define RADIOLIB_LR11X0_GFSK_RX_BW_29_3 (0x0DUL << 0) // 7 0 29.3 kHz
400#define RADIOLIB_LR11X0_GFSK_RX_BW_39_0 (0x1CUL << 0) // 7 0 39.0 kHz
401#define RADIOLIB_LR11X0_GFSK_RX_BW_46_9 (0x14UL << 0) // 7 0 46.9 kHz
402#define RADIOLIB_LR11X0_GFSK_RX_BW_58_6 (0x0CUL << 0) // 7 0 58.6 kHz
403#define RADIOLIB_LR11X0_GFSK_RX_BW_78_2 (0x1BUL << 0) // 7 0 78.2 kHz
404#define RADIOLIB_LR11X0_GFSK_RX_BW_93_8 (0x13UL << 0) // 7 0 93.8 kHz
405#define RADIOLIB_LR11X0_GFSK_RX_BW_117_3 (0x0BUL << 0) // 7 0 117.3 kHz
406#define RADIOLIB_LR11X0_GFSK_RX_BW_156_2 (0x1AUL << 0) // 7 0 156.2 kHz
407#define RADIOLIB_LR11X0_GFSK_RX_BW_187_2 (0x12UL << 0) // 7 0 187.2 kHz
408#define RADIOLIB_LR11X0_GFSK_RX_BW_234_3 (0x0AUL << 0) // 7 0 234.3 kHz
409#define RADIOLIB_LR11X0_GFSK_RX_BW_312_0 (0x19UL << 0) // 7 0 312.0 kHz
410#define RADIOLIB_LR11X0_GFSK_RX_BW_373_6 (0x11UL << 0) // 7 0 373.6 kHz
411#define RADIOLIB_LR11X0_GFSK_RX_BW_467_0 (0x09UL << 0) // 7 0 467.0 kHz
412#define RADIOLIB_LR11X0_LR_FHSS_BIT_RATE (488.28215f) // 31 0 LR FHSS bit rate: 488.28215 bps
413#define RADIOLIB_LR11X0_LR_FHSS_BIT_RATE_RAW (0x8001E848UL) // 31 0 488.28215 bps in raw
414#define RADIOLIB_LR11X0_LR_FHSS_SHAPING_GAUSSIAN_BT_1_0 (0x0BUL << 0) // 7 0 shaping filter: Gaussian, BT = 1.0
415#define RADIOLIB_LR11X0_SIGFOX_SHAPING_GAUSSIAN_BT_0_7 (0x16UL << 0) // 7 0 shaping filter: Gaussian, BT = 0.7
416
417// RADIOLIB_LR11X0_CMD_SET_PACKET_PARAMS
418#define RADIOLIB_LR11X0_LORA_HEADER_EXPLICIT (0x00UL << 0) // 7 0 LoRa header mode: explicit
419#define RADIOLIB_LR11X0_LORA_HEADER_IMPLICIT (0x01UL << 0) // 7 0 implicit
420#define RADIOLIB_LR11X0_LORA_PAYLOAD_LEN_ANY (0x00UL << 0) // 7 0 accept any payload length
421#define RADIOLIB_LR11X0_LORA_CRC_ENABLED (0x01UL << 0) // 7 0 CRC: enabled
422#define RADIOLIB_LR11X0_LORA_CRC_DISABLED (0x00UL << 0) // 7 0 disabled
423#define RADIOLIB_LR11X0_LORA_IQ_STANDARD (0x00UL << 0) // 7 0 IQ setup: standard
424#define RADIOLIB_LR11X0_LORA_IQ_INVERTED (0x01UL << 0) // 7 0 inverted
425#define RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_DISABLED (0x00UL << 0) // 7 0 preamble detector: disabled
426#define RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_8_BITS (0x04UL << 0) // 7 0 8 bits
427#define RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_16_BITS (0x05UL << 0) // 7 0 16 bits
428#define RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_24_BITS (0x06UL << 0) // 7 0 24 bits
429#define RADIOLIB_LR11X0_GFSK_PREAMBLE_DETECT_32_BITS (0x07UL << 0) // 7 0 32 bits
430#define RADIOLIB_LR11X0_GFSK_ADDR_FILTER_DISABLED (0x00UL << 0) // 7 0 address filtering: disabled
431#define RADIOLIB_LR11X0_GFSK_ADDR_FILTER_NODE (0x01UL << 0) // 7 0 node address
432#define RADIOLIB_LR11X0_GFSK_ADDR_FILTER_NODE_BROADCAST (0x02UL << 0) // 7 0 node and broadcast address
433#define RADIOLIB_LR11X0_GFSK_PACKET_LENGTH_FIXED (0x00UL << 0) // 7 0 packet length: fixed
434#define RADIOLIB_LR11X0_GFSK_PACKET_LENGTH_VARIABLE (0x01UL << 0) // 7 0 variable
435#define RADIOLIB_LR11X0_GFSK_PACKET_LENGTH_VARIABLE_SX128X (0x02UL << 0) // 7 0 variable, SX128x 9-bit length encoding
436#define RADIOLIB_LR11X0_GFSK_PAYLOAD_LEN_ANY (0x00UL << 0) // 7 0 accept any payload length
437#define RADIOLIB_LR11X0_GFSK_CRC_DISABLED (0x01UL << 0) // 7 0 CRC: disabled
438#define RADIOLIB_LR11X0_GFSK_CRC_1_BYTE (0x00UL << 0) // 7 0 1-byte
439#define RADIOLIB_LR11X0_GFSK_CRC_2_BYTE (0x02UL << 0) // 7 0 2-byte
440#define RADIOLIB_LR11X0_GFSK_CRC_1_BYTE_INV (0x04UL << 0) // 7 0 1-byte, inverted
441#define RADIOLIB_LR11X0_GFSK_CRC_2_BYTE_INV (0x06UL << 0) // 7 0 2-byte, inverted
442#define RADIOLIB_LR11X0_GFSK_WHITENING_DISABLED (0x00UL << 0) // 7 0 whitening: disabled
443#define RADIOLIB_LR11X0_GFSK_WHITENING_ENABLED (0x01UL << 0) // 7 0 enabled
444
445// RADIOLIB_LR11X0_CMD_SET_TX_PARAMS
446#define RADIOLIB_LR11X0_PA_RAMP_48U (0x02UL << 0) // 7 0 PA ramp time: 48 us
447
448// RADIOLIB_LR11X0_CMD_SET_RX_TX_FALLBACK_MODE
449#define RADIOLIB_LR11X0_FALLBACK_MODE_STBY_RC (0x01UL << 0) // 1 0 fallback mode after Rx/Tx: standby with RC
450#define RADIOLIB_LR11X0_FALLBACK_MODE_STBY_XOSC (0x02UL << 0) // 1 0 standby with XOSC
451#define RADIOLIB_LR11X0_FALLBACK_MODE_FS (0x03UL << 0) // 1 0 frequency synthesis
452
453// RADIOLIB_LR11X0_CMD_SET_RX_DUTY_CYCLE
454#define RADIOLIB_LR11X0_RX_DUTY_CYCLE_MODE_RX (0x00UL << 0) // 0 0 mode in Rx windows: Rx (default)
455#define RADIOLIB_LR11X0_RX_DUTY_CYCLE_MODE_CAD (0x01UL << 0) // 0 0 CAD
456#define RADIOLIB_LR11X0_TIMING_STEP (1.0f/32768.0f) // 23 0 timing step fo delays
457
458// RADIOLIB_LR11X0_CMD_SET_PA_CONFIG
459#define RADIOLIB_LR11X0_PA_SEL_LP (0x00UL << 0) // 7 0 PA select: low power PA
460#define RADIOLIB_LR11X0_PA_SEL_HP (0x01UL << 0) // 7 0 high power PA
461#define RADIOLIB_LR11X0_PA_SEL_HF (0x02UL << 0) // 7 0 high frequency PA
462#define RADIOLIB_LR11X0_PA_SUPPLY_INTERNAL (0x00UL << 0) // 7 0 PA power source: internal
463#define RADIOLIB_LR11X0_PA_SUPPLY_VBAT (0x01UL << 0) // 7 0 VBAT (required for >= 14 dBm)
464
465// RADIOLIB_LR11X0_CMD_STOP_TIMEOUT_ON_PREAMBLE
466#define RADIOLIB_LR11X0_STOP_ON_SYNC_HEADER (0x00UL << 0) // 0 0 stop timeout on: sync word or header (default)
467#define RADIOLIB_LR11X0_STOP_ON_PREAMBLE (0x01UL << 0) // 0 0 preamble
468
469// RADIOLIB_LR11X0_CMD_GET_RANGING_RESULT
470#define RADIOLIB_LR11X0_RANGING_RESULT_DISTANCE (0) // 7 0 ranging result type: distance
471#define RADIOLIB_LR11X0_RANGING_RESULT_RSSI (1) // 7 0 RSSI
472
473// RADIOLIB_LR11X0_CMD_SET_RX_BOOSTED
474#define RADIOLIB_LR11X0_RX_BOOSTED_ENABLED (0x01UL << 0) // 0 0 Rx boosted mode: enabled
475#define RADIOLIB_LR11X0_RX_BOOSTED_DISABLED (0x00UL << 0) // 0 0 disabled
476
477// RADIOLIB_LR11X0_CMD_SET_LORA_SYNC_WORD
478#define RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE (0x12)
479#define RADIOLIB_LR11X0_LORA_SYNC_WORD_PUBLIC (0x34)
480
481// RADIOLIB_LR11X0_CMD_LR_FHSS_BUILD_FRAME
482#define RADIOLIB_LR11X0_LR_FHSS_CR_5_6 (0x00UL << 0) // 7 0 LR FHSS coding rate: 5/6
483#define RADIOLIB_LR11X0_LR_FHSS_CR_2_3 (0x01UL << 0) // 7 0 2/3
484#define RADIOLIB_LR11X0_LR_FHSS_CR_1_2 (0x02UL << 0) // 7 0 1/2
485#define RADIOLIB_LR11X0_LR_FHSS_CR_1_3 (0x03UL << 0) // 7 0 1/3
486#define RADIOLIB_LR11X0_LR_FHSS_MOD_TYPE_GMSK (0x00UL << 0) // 7 0 LR FHSS modulation: GMSK
487#define RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_FCC (0x00UL << 0) // 7 0 LR FHSS step size: 25.390625 kHz (FCC)
488#define RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_NON_FCC (0x01UL << 0) // 7 0 3.90625 kHz (non-FCC)
489#define RADIOLIB_LR11X0_LR_FHSS_HOPPING_DISABLED (0x00UL << 0) // 7 0 LR FHSS hopping: disabled
490#define RADIOLIB_LR11X0_LR_FHSS_HOPPING_ENABLED (0x01UL << 0) // 7 0 enabled
491#define RADIOLIB_LR11X0_LR_FHSS_BW_39_06 (0x00UL << 0) // 7 0 LR FHSS bandwidth: 39.06 kHz
492#define RADIOLIB_LR11X0_LR_FHSS_BW_85_94 (0x01UL << 0) // 7 0 85.94 kHz
493#define RADIOLIB_LR11X0_LR_FHSS_BW_136_72 (0x02UL << 0) // 7 0 136.72 kHz
494#define RADIOLIB_LR11X0_LR_FHSS_BW_183_59 (0x03UL << 0) // 7 0 183.59 kHz
495#define RADIOLIB_LR11X0_LR_FHSS_BW_335_94 (0x04UL << 0) // 7 0 335.94 kHz
496#define RADIOLIB_LR11X0_LR_FHSS_BW_386_72 (0x05UL << 0) // 7 0 386.72 kHz
497#define RADIOLIB_LR11X0_LR_FHSS_BW_722_66 (0x06UL << 0) // 7 0 722.66 kHz
498#define RADIOLIB_LR11X0_LR_FHSS_BW_773_44 (0x07UL << 0) // 7 0 773.44 kHz
499#define RADIOLIB_LR11X0_LR_FHSS_BW_1523_4 (0x08UL << 0) // 7 0 1523.4 kHz
500#define RADIOLIB_LR11X0_LR_FHSS_BW_1574_2 (0x09UL << 0) // 7 0 1574.2 kHz
501#define RADIOLIB_LR11X0_LR_FHSS_HEADER_BITS (114) // 7 0 LR FHSS packet bit widths: header
502#define RADIOLIB_LR11X0_LR_FHSS_FRAG_BITS (48) // 7 0 payload fragment
503#define RADIOLIB_LR11X0_LR_FHSS_BLOCK_PREAMBLE_BITS (2) // 7 0 block preamble
504#define RADIOLIB_LR11X0_LR_FHSS_BLOCK_BITS (RADIOLIB_LR11X0_LR_FHSS_FRAG_BITS + RADIOLIB_LR11X0_LR_FHSS_BLOCK_PREAMBLE_BITS)
505
506// RADIOLIB_LR11X0_CMD_GET_LORA_RX_HEADER_INFOS
507#define RADIOLIB_LR11X0_LAST_HEADER_CRC_ENABLED (0x01UL << 4) // 4 4 last header CRC: enabled
508#define RADIOLIB_LR11X0_LAST_HEADER_CRC_DISABLED (0x00UL << 4) // 4 4 disabled
509
510// RADIOLIB_LR11X0_CMD_WIFI_SCAN
511#define RADIOLIB_LR11X0_WIFI_SCAN_802_11_B (0x01UL << 0) // 7 0 Wi-Fi type to scan: 802.11b
512#define RADIOLIB_LR11X0_WIFI_SCAN_802_11_G (0x02UL << 0) // 7 0 802.11g
513#define RADIOLIB_LR11X0_WIFI_SCAN_802_11_N (0x03UL << 0) // 7 0 802.11n
514#define RADIOLIB_LR11X0_WIFI_SCAN_ALL (0x04UL << 0) // 7 0 all (802.11b first)
515#define RADIOLIB_LR11X0_WIFI_ACQ_MODE_BEACON_ONLY (0x01UL << 0) // 7 0 Wi-Fi acquisition mode: beacon only
516#define RADIOLIB_LR11X0_WIFI_ACQ_MODE_BEACON_PACKET (0x02UL << 0) // 7 0 beacon and packet
517#define RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_TRAFFIC (0x03UL << 0) // 7 0 full traffic
518#define RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON (0x04UL << 0) // 7 0 full beacon
519#define RADIOLIB_LR11X0_WIFI_ACQ_MODE_SSID_BEACON (0x05UL << 0) // 7 0 SSID beacon
520#define RADIOLIB_LR11X0_WIFI_ABORT_ON_TIMEOUT_ENABLED (0x01UL << 0) // 7 0 abort scanning on preamble timeout: enabled
521#define RADIOLIB_LR11X0_WIFI_ABORT_ON_TIMEOUT_DISABLED (0x00UL << 0) // 7 0 disabled
522#define RADIOLIB_LR11X0_WIFI_MAX_NUM_RESULTS (32) // 7 0 maximum possible number of Wi-Fi scan results
523#define RADIOLIB_LR11X0_WIFI_ALL_CHANNELS (0x3FFFUL) // 16 0 scan all channels
524
525// RADIOLIB_LR11X0_CMD_WIFI_READ_RESULTS
526#define RADIOLIB_LR11X0_WIFI_RESULT_TYPE_COMPLETE (0x01UL << 0) // 7 0 Wi-Fi scan result type: complete
527#define RADIOLIB_LR11X0_WIFI_RESULT_TYPE_BASIC (0x04UL << 0) // 7 0 basic
528#define RADIOLIB_LR11X0_WIFI_RESULT_MAX_LEN (79) // 7 0 maximum possible Wi-Fi scan size
529#define RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN (6) // 7 0 MAC address length in bytes
530#define RADIOLIB_LR11X0_WIFI_RESULT_SSID_LEN (32) // 7 0 SSID length in bytes
531
532// RADIOLIB_LR11X0_CMD_GNSS_SET_CONSTELLATION_TO_USE
533#define RADIOLIB_LR11X0_GNSS_CONSTELLATION_GPS (0x01UL << 0) // 7 0 GNSS constellation to use: GPS
534#define RADIOLIB_LR11X0_GNSS_CONSTELLATION_BEIDOU (0x01UL << 1) // 7 0 BeiDou
535
536// RADIOLIB_LR11X0_CMD_GNSS_SET_MODE
537#define RADIOLIB_LR11X0_GNSS_MODE_SINGLE_SCAN (0x00UL << 0) // 7 0 GNSS scanning mode: single/legacy
538#define RADIOLIB_LR11X0_GNSS_MODE_SINGLE_MULTIPLE (0x03UL << 1) // 7 0 multiple/advanced
539
540// RADIOLIB_LR11X0_CMD_GNSS_AUTONOMOUS
541#define RADIOLIB_LR11X0_GNSS_RES_PSEUDO_DOPPLER_ENABLED (0x01UL << 0) // 0 0 GNSS results in NAV message: pseudo-range (in single scan mode) or Doppler information (in multiple scan mode)
542#define RADIOLIB_LR11X0_GNSS_RES_PSEUDO_DOPPLER_DISABLED (0x00UL << 0) // 0 0 not included
543#define RADIOLIB_LR11X0_GNSS_RES_DOPPLER_ENABLED (0x01UL << 1) // 1 1 Doppler information
544#define RADIOLIB_LR11X0_GNSS_RES_DOPPLER_DISABLED (0x00UL << 1) // 1 1 not included
545#define RADIOLIB_LR11X0_GNSS_NB_SV_ALL (0x00UL << 0) // 7 0 include all detected satellites
546#define RADIOLIB_LR11X0_GNSS_AUTO_EFFORT_MODE (0x00UL << 0) // 7 0 reserved, always 0
547
548// RADIOLIB_LR11X0_CMD_GNSS_ASSISTED
549#define RADIOLIB_LR11X0_GNSS_ASSIST_LOW_POWER (0x00UL << 0) // 7 0 effort mode: low power
550#define RADIOLIB_LR11X0_GNSS_ASSIST_BEST_EFFORT (0x01UL << 0) // 7 0 best effort
551
552// RADIOLIB_LR11X0_CMD_GNSS_GET_CONTEXT_STATUS
553#define RADIOLIB_LR11X0_GNSS_CONTEXT_ERR_NONE (0x00UL << 0) // 7 4 error code: none
554#define RADIOLIB_LR11X0_GNSS_CONTEXT_ERR_ALMANAC_OLD (0x01UL << 0) // 7 4 almanac too old
555#define RADIOLIB_LR11X0_GNSS_CONTEXT_ERR_ALMANAC_CRC (0x02UL << 0) // 7 4 almanac CRC mismatch
556#define RADIOLIB_LR11X0_GNSS_CONTEXT_ERR_FLASH (0x03UL << 0) // 7 4 flash integrity error
557#define RADIOLIB_LR11X0_GNSS_CONTEXT_ERR_ALMANAC_UPD (0x04UL << 0) // 7 4 almanac update not allowed
558#define RADIOLIB_LR11X0_GNSS_CONTEXT_FREQ_SPACE_250_HZ (0x00UL << 0) // 8 7 frequency search space: 250 Hz
559#define RADIOLIB_LR11X0_GNSS_CONTEXT_FREQ_SPACE_500_HZ (0x01UL << 0) // 8 7 500 Hz
560#define RADIOLIB_LR11X0_GNSS_CONTEXT_FREQ_SPACE_1000_HZ (0x02UL << 0) // 8 7 1000 Hz
561#define RADIOLIB_LR11X0_GNSS_CONTEXT_FREQ_SPACE_2000_HZ (0x03UL << 0) // 8 7 2000 Hz
562
563// RADIOLIB_LR11X0_CMD_GNSS_GET_SV_VISIBLE
564#define RADIOLIB_LR11X0_SV_CONSTELLATION_GPS (0x00UL << 0) // 7 0 GNSS constellation: GPS
565#define RADIOLIB_LR11X0_SV_CONSTELLATION_BEIDOU (0x01UL << 0) // 7 0 BeiDou
566
567// RADIOLIB_LR11X0_CMD_GNSS_ALMANAC_FULL_UPDATE
568#define RADIOLIB_LR11X0_GNSS_ALMANAC_HEADER_ID (0x80UL << 0) // 7 0 starting byte of GNSS almanac header
569#define RADIOLIB_LR11X0_GNSS_ALMANAC_BLOCK_SIZE (20)
570
571// RADIOLIB_LR11X0_CMD_GNSS_FETCH_TIME
572#define RADIOLIB_LR11X0_GNSS_EFFORT_LOW (0x00UL << 0) // 7 0 GNSS effort mode: low sensitivity
573#define RADIOLIB_LR11X0_GNSS_EFFORT_MID (0x01UL << 0) // 7 0 medium sensitivity
574#define RADIOLIB_LR11X0_GNSS_FETCH_TIME_OPT_TOW (0x00UL << 0) // 7 0 time fetch options: ToW only, requires WN to demodulated beforehand
575#define RADIOLIB_LR11X0_GNSS_FETCH_TIME_OPT_TOW_WN (0x01UL << 0) // 7 0 ToW and WN
576#define RADIOLIB_LR11X0_GNSS_FETCH_TIME_OPT_TOW_WN_ROLL (0x02UL << 0) // 7 0 ToW, WN and rollover
577
578// RADIOLIB_LR11X0_CMD_GNSS_READ_DEMOD_STATUS
579#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NOT_POSSIBLE (-21) // 7 0 GNSS demodulation status: not possible to demodulate
580#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_SAT_LOST (-20) // 7 0 satellite lost
581#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_ALMANAC_DEMOD_ERROR (-19) // 7 0 almanac demodulation error
582#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_TOO_LATE (-18) // 7 0 woke up after preamble (demodulation started too late)
583#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_20_MS_FAIL (-17) // 7 0 20ms real-time clock failed
584#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WAKE_UP_FAIL (-16) // 7 0 wake up sync failed
585#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WN_INVALID (-15) // 7 0 week number not validated
586#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NO_ACTIVE_SAT (-14) // 7 0 no active satellite selected in satellite list
587#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_SLEEP_TOO_LONG (-13) // 7 0 sleep time too long
588#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_TOW_INVALID (-12) // 7 0 wrong time-of-week demodulated
589#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_PREAMBLE_INVALID (-11) // 7 0 preamble not validated
590#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_DISABLED (-10) // 7 0 demodulator disabled
591#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_EXTR_FAILED (-9) // 7 0 demodulator extraction failed
592#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NO_BIT_CHANGE (-8) // 7 0 no bit change found during demodulation start
593#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NO_BIT_CHANGE_ADV (-7) // 7 0 no bit change found during advanced scan
594#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NO_SAT_FOUND (-6) // 7 0 no satellites found
595#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_SYNC_LOST (-5) // 7 0 word sync lost
596#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_PARITY_NOT_ENOUGH (-3) // 7 0 parity check fail (not enough)
597#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_PARITY_TOO_MANY (-2) // 7 0 parity check fail (too many)
598#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_NO_PARITY (-1) // 7 0 parity check fail (no parity found)
599#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WORD_SYNC_NONE (0) // 7 0 word sync search not started
600#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WORD_SYNC_POT (1) // 7 0 potential word sync found
601#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WORD_SYNC_OK (2) // 7 0 word sync found
602#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_TOW_FOUND (3) // 7 0 time-of-week found
603#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_WN_FOUND (4) // 7 0 week number and time-of-week found
604#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_ALM_FOUND_UNSAVED (5) // 7 0 almanac found but not saved
605#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_HALF_ALM_SAVED (6) // 7 0 half of almanac found and saved
606#define RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_FULL_ALM_SAVED (7) // 7 0 full almanac found and saved
607#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_WORD_SYNC_FOUND (0x01UL << 0) // 7 0 GNSS demodulation info: word synchronization found
608#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_TOW_FOUND (0x01UL << 1) // 7 0 time-of-week found
609#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_WN_DEMODED (0x01UL << 2) // 7 0 week number demodulated
610#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_WN_FOUND (0x01UL << 3) // 7 0 week number found
611#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_SUBFRAME_1_FOUND (0x01UL << 4) // 7 0 subframe 1 found
612#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_SUBFRAME_4_FOUND (0x01UL << 5) // 7 0 subframe 4 found
613#define RADIOLIB_LR11X0_GNSS_DEMOD_INFO_SUBFRAME_5_FOUND (0x01UL << 6) // 7 0 subframe 5 found
614
615// RADIOLIB_LR11X0_CMD_GNSS_READ_ALMANAC_STATUS
616#define RADIOLIB_LR11X0_GNSS_ALMANAC_STATUS_UP_TO_DATE (0) // 7 0 GPS/BeiDou almanac status: all satellites up-to-date
617#define RADIOLIB_LR11X0_GNSS_ALMANAC_STATUS_OUTDATED (1) // 7 0 at least one satellite needs update
618
619// RADIOLIB_LR11X0_CMD_GNSS_READ_DOPPLER_SOLVER_RES
620#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_NONE (0) // 7 0 internal 2D solver error: no error
621#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_RES_HIGH (1) // 7 0 residue too high
622#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_NOT_CONVERGED (2) // 7 0 not converged on solution
623#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_NOT_ENOUGH_SV (3) // 7 0 not enough satellites
624#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_ILL_MATRIX (4) // 7 0 matrix error (?)
625#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_TIME (5) // 7 0 time error
626#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_ALM_PART_OLD (6) // 7 0 part of almanac too old or not available
627#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_INCONSISTENT (7) // 7 0 not consistent with history (?)
628#define RADIOLIB_LR11X0_GNSS_SOLVER_ERR_ALM_OLD (8) // 7 0 all of almanac too old
629
630// RADIOLIB_LR11X0_CMD_CRYPTO_SET_KEY
631#define RADIOLIB_LR11X0_CRYPTO_STATUS_SUCCESS (0x00UL << 0) // 7 0 crypto engine status: success
632#define RADIOLIB_LR11X0_CRYPTO_STATUS_FAIL_CMAC (0x01UL << 0) // 7 0 MIC check failed
633#define RADIOLIB_LR11X0_CRYPTO_STATUS_INV_KEY_ID (0x03UL << 0) // 7 0 key/parameter source or destination ID error
634#define RADIOLIB_LR11X0_CRYPTO_STATUS_BUF_SIZE (0x05UL << 0) // 7 0 data buffer size invalid
635#define RADIOLIB_LR11X0_CRYPTO_STATUS_ERROR (0x06UL << 0) // 7 0 generic error
636
637// RADIOLIB_LR11X0_CMD_CRYPTO_PROCESS_JOIN_ACCEPT
638#define RADIOLIB_LR11X0_CRYPTO_LORAWAN_VERSION_1_0 (0x00UL << 0) // 7 0 LoRaWAN version: 1.0.x
639#define RADIOLIB_LR11X0_CRYPTO_LORAWAN_VERSION_1_1 (0x01UL << 0) // 7 0 1.1
640
641// LR11X0 SPI register variables
642
643// RADIOLIB_LR11X0_REG_SF6_SX127X_COMPAT
644#define RADIOLIB_LR11X0_SF6_SX126X (0x00UL << 18) // 18 18 SF6 mode: SX126x series
645#define RADIOLIB_LR11X0_SF6_SX127X (0x01UL << 18) // 18 18 SX127x series
646
647// RADIOLIB_LR11X0_REG_LORA_HIGH_POWER_FIX
648#define RADIOLIB_LR11X0_LORA_HIGH_POWER_FIX (0x00UL << 30) // 30 30 fix for errata
649
650// RADIOLIB_LR11X0_REG_LNA_MODE
651#define RADIOLIB_LR11X0_LNA_MODE_SINGLE_RFI_N (0x01UL << 4) // 7 4 LNA mode: single-ended RFI_N
652#define RADIOLIB_LR11X0_LNA_MODE_SINGLE_RFI_P (0x02UL << 4) // 7 4 single-ended RFI_P
653#define RADIOLIB_LR11X0_LNA_MODE_DIFFERENTIAL (0x03UL << 4) // 7 4 differential (default)
654
662 char type;
663
665 uint8_t dataRateId;
666
668 uint16_t channelFreq;
669
671 uint8_t origin;
672
674 bool ap;
675
677 float rssi;
678
680 uint8_t mac[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN];
681};
682
690 uint8_t frameType;
691
694
697
700
702 uint16_t phiOffset;
703
705 uint64_t timestamp;
706
708 uint32_t periodBeacon;
709};
710
720 uint8_t rate;
721
723 uint16_t service;
724
726 uint16_t length;
727
729 uint8_t mac0[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN];
730
732 uint8_t mac2[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN];
733
735 uint16_t seqCtrl;
736
738 uint8_t ssid[RADIOLIB_LR11X0_WIFI_RESULT_SSID_LEN];
739
742
744 char countryCode[3];
745
747 uint8_t ioReg;
748
751};
752
759 uint8_t hardware;
760
762 uint8_t device;
763
765 uint8_t fwMajor;
766
768 uint8_t fwMinor;
769
771 uint8_t fwMajorWiFi;
772
774 uint8_t fwMinorWiFi;
775
777 uint8_t fwGNSS;
778
780 uint8_t almanacGNSS;
781};
782
789 int8_t demodStat;
790
792 uint8_t numSatsDet;
793
795 uint16_t resSize;
796};
797
804 float latitude;
805
808
810 uint16_t accuracy;
811
813 uint8_t numSatsUsed;
814};
815
822 uint8_t svId;
823
825 uint8_t c_n0;
826
828 int16_t doppler;
829};
830
836 int8_t status;
837 uint32_t timeUntilSubframe;
838 uint8_t numSubframes;
839 uint8_t nextSubframe4SvId;
840 uint8_t nextSubframe5SvId;
841 uint8_t nextSubframeStart;
842 uint8_t numUpdateNeeded;
843 uint32_t flagsUpdateNeeded[2];
844 uint32_t flagsActive[2];
845};
846
868
874class LR11x0: public PhysicalLayer {
875 public:
876 // introduce PhysicalLayer overloads
882
887 explicit LR11x0(Module* mod);
888
911
915 bool XTAL;
916
928 int16_t begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool high = false);
929
939 int16_t beginGFSK(float br, float freqDev, float rxBw, uint16_t preambleLength, float tcxoVoltage);
940
949 int16_t beginLRFHSS(uint8_t bw, uint8_t cr, bool narrowGrid, float tcxoVoltage);
950
957 int16_t beginGNSS(uint8_t constellations = RADIOLIB_LR11X0_GNSS_CONSTELLATION_GPS | RADIOLIB_LR11X0_GNSS_CONSTELLATION_BEIDOU, float tcxoVoltage = 1.6);
958
963 int16_t reset();
964
973 int16_t transmit(const uint8_t* data, size_t len, uint8_t addr = 0) override;
974
982 int16_t receive(uint8_t* data, size_t len) override;
983
989 int16_t transmitDirect(uint32_t frf = 0) override;
990
996 int16_t receiveDirect() override;
997
1002 int16_t scanChannel() override;
1003
1009 int16_t scanChannel(const ChannelScanConfig_t &config) override;
1010
1015 int16_t standby() override;
1016
1024 int16_t standby(uint8_t mode, bool wakeup = true);
1025
1031 int16_t sleep() override;
1032
1040 int16_t sleep(bool retainConfig, uint32_t sleepTime);
1041
1042 // interrupt methods
1043
1048 void setIrqAction(void (*func)(void));
1049
1053 void clearIrqAction();
1054
1059 void setPacketReceivedAction(void (*func)(void)) override;
1060
1064 void clearPacketReceivedAction() override;
1065
1070 void setPacketSentAction(void (*func)(void)) override;
1071
1075 void clearPacketSentAction() override;
1076
1081 int16_t finishTransmit() override;
1082
1089 int16_t startReceive() override;
1090
1095 uint32_t getIrqStatus();
1096
1105 int16_t readData(uint8_t* data, size_t len) override;
1106
1112 int16_t startChannelScan() override;
1113
1120 int16_t startChannelScan(const ChannelScanConfig_t &config) override;
1121
1126 int16_t getChannelScanResult() override;
1127
1128 // configuration methods
1129
1136 int16_t setBandwidth(float bw, bool high = false);
1137
1144 int16_t setSpreadingFactor(uint8_t sf, bool legacy = false);
1145
1153 int16_t setCodingRate(uint8_t cr, bool longInterleave = false);
1154
1160 int16_t setSyncWord(uint8_t syncWord);
1161
1167 int16_t setBitRate(float br) override;
1168
1174 int16_t setFrequencyDeviation(float freqDev) override;
1175
1182 int16_t setRxBandwidth(float rxBw);
1183
1190 int16_t setSyncWord(uint8_t* syncWord, size_t len) override;
1191
1199 int16_t setSyncBits(uint8_t *syncWord, uint8_t bitsLen);
1200
1206 int16_t setNodeAddress(uint8_t nodeAddr);
1207
1214 int16_t setBroadcastAddress(uint8_t broadAddr);
1215
1220 int16_t disableAddressFiltering();
1221
1229 int16_t setDataShaping(uint8_t sh) override;
1230
1236 int16_t setEncoding(uint8_t encoding) override;
1237
1243 int16_t fixedPacketLengthMode(uint8_t len = RADIOLIB_LR11X0_MAX_PACKET_LENGTH);
1244
1250 int16_t variablePacketLengthMode(uint8_t maxLen = RADIOLIB_LR11X0_MAX_PACKET_LENGTH);
1251
1259 int16_t setWhitening(bool enabled, uint16_t initial = 0x01FF);
1260
1266 int16_t setDataRate(DataRate_t dr) override;
1267
1273 int16_t checkDataRate(DataRate_t dr) override;
1274
1280 int16_t setPreambleLength(size_t preambleLength) override;
1281
1290 int16_t setTCXO(float voltage, uint32_t delay = 5000);
1291
1300 int16_t setCRC(uint8_t len, uint32_t initial = 0x00001D0FUL, uint32_t polynomial = 0x00001021UL, bool inverted = true);
1301
1307 int16_t invertIQ(bool enable) override;
1308
1313 float getRSSI() override;
1314
1319 float getSNR() override;
1320
1325 float getFrequencyError();
1326
1332 size_t getPacketLength(bool update = true) override;
1333
1339 size_t getPacketLength(bool update, uint8_t* offset);
1340
1346 RadioLibTime_t getTimeOnAir(size_t len) override;
1347
1354
1359 uint32_t getIrqFlags() override;
1360
1366 int16_t setIrqFlags(uint32_t irq) override;
1367
1373 int16_t clearIrqFlags(uint32_t irq) override;
1374
1379 uint8_t randomByte() override;
1380
1386 int16_t implicitHeader(size_t len);
1387
1392 int16_t explicitHeader();
1393
1398 float getDataRate() const;
1399
1404 int16_t setRegulatorLDO();
1405
1410 int16_t setRegulatorDCDC();
1411
1417 int16_t setRxBoostedGainMode(bool en);
1418
1420 void setRfSwitchTable(const uint32_t (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
1421
1428 int16_t forceLDRO(bool enable);
1429
1435 int16_t autoLDRO();
1436
1445 int16_t setLrFhssConfig(uint8_t bw, uint8_t cr, uint8_t hdrCount = 3, uint16_t hopSeed = 0x13A);
1446
1461 int16_t startWifiScan(char wifiType, uint8_t mode = RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON, uint16_t chanMask = RADIOLIB_LR11X0_WIFI_ALL_CHANNELS, uint8_t numScans = 16, uint16_t timeout = 100);
1462
1467 void setWiFiScanAction(void (*func)(void));
1468
1472 void clearWiFiScanAction();
1473
1479 int16_t getWifiScanResultsCount(uint8_t* count);
1480
1490 int16_t getWifiScanResult(LR11x0WifiResult_t* result, uint8_t index, bool brief = false);
1491
1508 int16_t wifiScan(uint8_t wifiType, uint8_t* count, uint8_t mode = RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON, uint16_t chanMask = RADIOLIB_LR11X0_WIFI_ALL_CHANNELS, uint8_t numScans = 16, uint16_t timeout = 100);
1509
1515 int16_t getVersionInfo(LR11x0VersionInfo_t* info);
1516
1527 int16_t updateFirmware(const uint32_t* image, size_t size, bool nonvolatile = true);
1528
1533 int16_t isGnssScanCapable();
1534
1541 int16_t gnssScan(LR11x0GnssResult_t* res = NULL);
1542
1550
1560 int16_t gnssDelayUntilSubframe(LR11x0GnssAlmanacStatus_t *stat, uint8_t constellation);
1561
1568 int16_t updateGnssAlmanac(uint8_t constellation);
1569
1576 int16_t getGnssPosition(LR11x0GnssPosition_t* pos, bool filtered = true);
1577
1584 int16_t getGnssSatellites(LR11x0GnssSatellite_t* sats, uint8_t numSats);
1585
1591 int16_t getModem(ModemType_t* modem) override;
1592
1600 int16_t calibrateImageRejection(float freqMin, float freqMax);
1601
1603 int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) override;
1604
1606 int16_t launchMode() override;
1607
1608#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
1609 protected:
1610#endif
1611 Module* getMod() override;
1612
1613 // LR11x0 SPI command implementations
1614 int16_t writeRegMem32(uint32_t addr, const uint32_t* data, size_t len);
1615 int16_t readRegMem32(uint32_t addr, uint32_t* data, size_t len);
1616 int16_t writeBuffer8(const uint8_t* data, size_t len);
1617 int16_t readBuffer8(uint8_t* data, size_t len, size_t offset);
1618 int16_t clearRxBuffer(void);
1619 int16_t writeRegMemMask32(uint32_t addr, uint32_t mask, uint32_t data);
1620
1621 int16_t getStatus(uint8_t* stat1, uint8_t* stat2, uint32_t* irq);
1622 int16_t getVersion(uint8_t* hw, uint8_t* device, uint8_t* major, uint8_t* minor);
1623 int16_t getErrors(uint16_t* err);
1624 int16_t clearErrors(void);
1625 int16_t calibrate(uint8_t params);
1626 int16_t setRegMode(uint8_t mode);
1627 int16_t setDioAsRfSwitch(uint8_t en, uint8_t stbyCfg, uint8_t rxCfg, uint8_t txCfg, uint8_t txHpCfg, uint8_t txHfCfg, uint8_t gnssCfg, uint8_t wifiCfg);
1628 int16_t setDioIrqParams(uint32_t irq1, uint32_t irq2);
1629 int16_t setDioIrqParams(uint32_t irq);
1630 int16_t clearIrqState(uint32_t irq);
1631 int16_t configLfClock(uint8_t setup);
1632 int16_t setTcxoMode(uint8_t tune, uint32_t delay);
1633 int16_t reboot(bool stay);
1634 int16_t getVbat(float* vbat);
1635 int16_t getTemp(float* temp);
1636 int16_t setFs(void);
1637 int16_t getRandomNumber(uint32_t* rnd);
1638 int16_t eraseInfoPage(void);
1639 int16_t writeInfoPage(uint16_t addr, const uint32_t* data, size_t len);
1640 int16_t readInfoPage(uint16_t addr, uint32_t* data, size_t len);
1641 int16_t getChipEui(uint8_t* eui);
1642 int16_t getSemtechJoinEui(uint8_t* eui);
1643 int16_t deriveRootKeysAndGetPin(uint8_t* pin);
1644 int16_t enableSpiCrc(bool en);
1645 int16_t driveDiosInSleepMode(bool en);
1646
1647 int16_t resetStats(void);
1648 int16_t getStats(uint16_t* nbPktReceived, uint16_t* nbPktCrcError, uint16_t* data1, uint16_t* data2);
1649 int16_t getPacketType(uint8_t* type);
1650 int16_t getRxBufferStatus(uint8_t* len, uint8_t* startOffset);
1651 int16_t getPacketStatusLoRa(float* rssiPkt, float* snrPkt, float* signalRssiPkt);
1652 int16_t getPacketStatusGFSK(float* rssiSync, float* rssiAvg, uint8_t* rxLen, uint8_t* stat);
1653 int16_t getRssiInst(float* rssi);
1654 int16_t setGfskSyncWord(uint8_t* sync);
1655 int16_t setLoRaPublicNetwork(bool pub);
1656 int16_t setRx(uint32_t timeout);
1657 int16_t setTx(uint32_t timeout);
1658 int16_t setRfFrequency(uint32_t rfFreq);
1659 int16_t autoTxRx(uint32_t delay, uint8_t intMode, uint32_t timeout);
1660 int16_t setCadParams(uint8_t symNum, uint8_t detPeak, uint8_t detMin, uint8_t cadExitMode, uint32_t timeout);
1661 int16_t setPacketType(uint8_t type);
1662 int16_t setModulationParamsLoRa(uint8_t sf, uint8_t bw, uint8_t cr, uint8_t ldro);
1663 int16_t setModulationParamsGFSK(uint32_t br, uint8_t sh, uint8_t rxBw, uint32_t freqDev);
1664 int16_t setModulationParamsLrFhss(uint32_t br, uint8_t sh);
1665 int16_t setModulationParamsSigfox(uint32_t br, uint8_t sh);
1666 int16_t setPacketParamsLoRa(uint16_t preambleLen, uint8_t hdrType, uint8_t payloadLen, uint8_t crcType, uint8_t invertIQ);
1667 int16_t setPacketParamsGFSK(uint16_t preambleLen, uint8_t preambleDetectorLen, uint8_t syncWordLen, uint8_t addrCmp, uint8_t packType, uint8_t payloadLen, uint8_t crcType, uint8_t whiten);
1668 int16_t setPacketParamsSigfox(uint8_t payloadLen, uint16_t rampUpDelay, uint16_t rampDownDelay, uint16_t bitNum);
1669 int16_t setTxParams(int8_t pwr, uint8_t ramp);
1670 int16_t setPacketAdrs(uint8_t node, uint8_t broadcast);
1671 int16_t setRxTxFallbackMode(uint8_t mode);
1672 int16_t setRxDutyCycle(uint32_t rxPeriod, uint32_t sleepPeriod, uint8_t mode);
1673 int16_t setPaConfig(uint8_t paSel, uint8_t regPaSupply, uint8_t paDutyCycle, uint8_t paHpSel);
1674 int16_t stopTimeoutOnPreamble(bool stop);
1675 int16_t setCad(void);
1676 int16_t setTxCw(void);
1677 int16_t setTxInfinitePreamble(void);
1678 int16_t setLoRaSynchTimeout(uint8_t symbolNum);
1679 int16_t setRangingAddr(uint32_t addr, uint8_t checkLen);
1680 int16_t setRangingReqAddr(uint32_t addr);
1681 int16_t getRangingResult(uint8_t type, float* res);
1682 int16_t setRangingTxRxDelay(uint32_t delay);
1683 int16_t setGfskCrcParams(uint32_t init, uint32_t poly);
1684 int16_t setGfskWhitParams(uint16_t seed);
1685 int16_t setRangingParameter(uint8_t symbolNum);
1686 int16_t setRssiCalibration(const int8_t* tune, int16_t gainOffset);
1687 int16_t setLoRaSyncWord(uint8_t sync);
1688 int16_t lrFhssBuildFrame(uint8_t hdrCount, uint8_t cr, uint8_t grid, bool hop, uint8_t bw, uint16_t hopSeq, int8_t devOffset, const uint8_t* payload, size_t len);
1689 int16_t lrFhssSetSyncWord(uint32_t sync);
1690 int16_t configBleBeacon(uint8_t chan, const uint8_t* payload, size_t len);
1691 int16_t getLoRaRxHeaderInfos(uint8_t* info);
1692 int16_t bleBeaconSend(uint8_t chan, const uint8_t* payload, size_t len);
1693
1694 int16_t wifiScan(uint8_t type, uint16_t mask, uint8_t acqMode, uint8_t nbMaxRes, uint8_t nbScanPerChan, uint16_t timeout, uint8_t abortOnTimeout);
1695 int16_t wifiScanTimeLimit(uint8_t type, uint16_t mask, uint8_t acqMode, uint8_t nbMaxRes, uint16_t timePerChan, uint16_t timeout);
1696 int16_t wifiCountryCode(uint16_t mask, uint8_t nbMaxRes, uint8_t nbScanPerChan, uint16_t timeout, uint8_t abortOnTimeout);
1697 int16_t wifiCountryCodeTimeLimit(uint16_t mask, uint8_t nbMaxRes, uint16_t timePerChan, uint16_t timeout);
1698 int16_t wifiGetNbResults(uint8_t* nbResults);
1699 int16_t wifiReadResults(uint8_t index, uint8_t nbResults, uint8_t format, uint8_t* results);
1700 int16_t wifiResetCumulTimings(void);
1701 int16_t wifiReadCumulTimings(uint32_t* detection, uint32_t* capture, uint32_t* demodulation);
1702 int16_t wifiGetNbCountryCodeResults(uint8_t* nbResults);
1703 int16_t wifiReadCountryCodeResults(uint8_t index, uint8_t nbResults, uint8_t* results);
1704 int16_t wifiCfgTimestampAPphone(uint32_t timestamp);
1705 int16_t wifiReadVersion(uint8_t* major, uint8_t* minor);
1706
1707 int16_t gnssReadRssi(int8_t* rssi);
1708 int16_t gnssSetConstellationToUse(uint8_t mask);
1709 int16_t gnssReadConstellationToUse(uint8_t* mask);
1710 int16_t gnssSetAlmanacUpdate(uint8_t mask);
1711 int16_t gnssReadAlmanacUpdate(uint8_t* mask);
1712 int16_t gnssSetFreqSearchSpace(uint8_t freq);
1713 int16_t gnssReadFreqSearchSpace(uint8_t* freq);
1714 int16_t gnssReadVersion(uint8_t* fw, uint8_t* almanac);
1715 int16_t gnssReadSupportedConstellations(uint8_t* mask);
1716 int16_t gnssSetMode(uint8_t mode);
1717 int16_t gnssAutonomous(uint32_t gpsTime, uint8_t resMask, uint8_t nbSvMask);
1718 int16_t gnssAssisted(uint32_t gpsTime, uint8_t effort, uint8_t resMask, uint8_t nbSvMask);
1719 int16_t gnssSetAssistancePosition(float lat, float lon);
1720 int16_t gnssReadAssistancePosition(float* lat, float* lon);
1721 int16_t gnssPushSolverMsg(uint8_t* payload, size_t len);
1722 int16_t gnssPushDmMsg(uint8_t* payload, size_t len);
1723 int16_t gnssGetContextStatus(uint8_t* fwVersion, uint32_t* almanacCrc, uint8_t* errCode, uint8_t* almUpdMask, uint8_t* freqSpace);
1724 int16_t gnssGetNbSvDetected(uint8_t* nbSv);
1725 int16_t gnssGetSvDetected(uint8_t* svId, uint8_t* snr, int16_t* doppler, size_t nbSv);
1726 int16_t gnssGetConsumption(uint32_t* cpu, uint32_t* radio);
1727 int16_t gnssGetResultSize(uint16_t* size);
1728 int16_t gnssReadResults(uint8_t* result, uint16_t size);
1729 int16_t gnssAlmanacFullUpdateHeader(uint16_t date, uint32_t globalCrc);
1730 int16_t gnssAlmanacFullUpdateSV(uint8_t svn, const uint8_t* svnAlmanac);
1731 int16_t gnssAlmanacReadAddrSize(uint32_t* addr, uint16_t* size);
1732 int16_t gnssAlmanacReadSV(uint8_t svId, uint8_t* almanac);
1733 int16_t gnssGetNbSvVisible(uint32_t time, float lat, float lon, uint8_t constellation, uint8_t* nbSv);
1734 int16_t gnssGetSvVisible(uint8_t nbSv, uint8_t** svId, int16_t** doppler, int16_t** dopplerErr);
1735 int16_t gnssPerformScan(uint8_t effort, uint8_t resMask, uint8_t nbSvMax);
1736 int16_t gnssReadLastScanModeLaunched(uint8_t* lastScanMode);
1737 int16_t gnssFetchTime(uint8_t effort, uint8_t opt);
1738 int16_t gnssReadTime(uint8_t* err, uint32_t* time, uint32_t* nbUs, uint32_t* timeAccuracy);
1739 int16_t gnssResetTime(void);
1740 int16_t gnssResetPosition(void);
1741 int16_t gnssReadWeekNumberRollover(uint8_t* status, uint8_t* rollover);
1742 int16_t gnssReadDemodStatus(int8_t* status, uint8_t* info);
1743 int16_t gnssReadCumulTiming(uint32_t* timing, uint8_t* constDemod);
1744 int16_t gnssSetTime(uint32_t time, uint16_t accuracy);
1745 int16_t gnssReadDopplerSolverRes(uint8_t* error, uint8_t* nbSvUsed, float* lat, float* lon, uint16_t* accuracy, uint16_t* xtal, float* latFilt, float* lonFilt, uint16_t* accuracyFilt, uint16_t* xtalFilt);
1746 int16_t gnssReadDelayResetAP(uint32_t* delay);
1747 int16_t gnssAlmanacUpdateFromSat(uint8_t effort, uint8_t bitMask);
1748 int16_t gnssReadAlmanacStatus(uint8_t* status);
1749 int16_t gnssReadKeepSyncStatus(uint8_t mask, uint8_t* nbSvVisible, uint32_t* elapsed);
1750 int16_t gnssConfigAlmanacUpdatePeriod(uint8_t bitMask, uint8_t svType, uint16_t period);
1751 int16_t gnssReadAlmanacUpdatePeriod(uint8_t bitMask, uint8_t svType, uint16_t* period);
1752 int16_t gnssConfigDelayResetAP(uint32_t delay);
1753 int16_t gnssGetSvWarmStart(uint8_t bitMask, uint8_t* sv, uint8_t nbVisSat);
1754 int16_t gnssReadWarmStartStatus(uint8_t bitMask, uint8_t* nbVisSat, uint32_t* timeElapsed);
1755 int16_t gnssGetSvSync(uint8_t mask, uint8_t nbSv, uint8_t* syncList);
1756 int16_t gnssWriteBitMaskSatActivated(uint8_t bitMask, uint32_t* bitMaskActivated0, uint32_t* bitMaskActivated1);
1757 void gnssAbort();
1758
1759 int16_t cryptoSetKey(uint8_t keyId, const uint8_t* key);
1760 int16_t cryptoDeriveKey(uint8_t srcKeyId, uint8_t dstKeyId, const uint8_t* key);
1761 int16_t cryptoProcessJoinAccept(uint8_t decKeyId, uint8_t verKeyId, uint8_t lwVer, const uint8_t* header, const uint8_t* dataIn, size_t len, uint8_t* dataOut);
1762 int16_t cryptoComputeAesCmac(uint8_t keyId, const uint8_t* data, size_t len, uint32_t* mic);
1763 int16_t cryptoVerifyAesCmac(uint8_t keyId, uint32_t micExp, const uint8_t* data, size_t len, bool* result);
1764 int16_t cryptoAesEncrypt01(uint8_t keyId, const uint8_t* dataIn, size_t len, uint8_t* dataOut);
1765 int16_t cryptoAesEncrypt(uint8_t keyId, const uint8_t* dataIn, size_t len, uint8_t* dataOut);
1766 int16_t cryptoAesDecrypt(uint8_t keyId, const uint8_t* dataIn, size_t len, uint8_t* dataOut);
1767 int16_t cryptoStoreToFlash(void);
1768 int16_t cryptoRestoreFromFlash(void);
1769 int16_t cryptoSetParam(uint8_t id, uint32_t value);
1770 int16_t cryptoGetParam(uint8_t id, uint32_t* value);
1771 int16_t cryptoCheckEncryptedFirmwareImage(uint32_t offset, const uint32_t* data, size_t len, bool nonvolatile);
1772 int16_t cryptoCheckEncryptedFirmwareImageResult(bool* result);
1773
1774 int16_t bootEraseFlash(void);
1775 int16_t bootWriteFlashEncrypted(uint32_t offset, const uint32_t* data, size_t len, bool nonvolatile);
1776 int16_t bootReboot(bool stay);
1777 int16_t bootGetPin(uint8_t* pin);
1778 int16_t bootGetChipEui(uint8_t* eui);
1779 int16_t bootGetJoinEui(uint8_t* eui);
1780
1781 int16_t SPIcommand(uint16_t cmd, bool write, uint8_t* data, size_t len, const uint8_t* out = NULL, size_t outLen = 0);
1782
1783#if !RADIOLIB_GODMODE
1784 protected:
1785#endif
1786 uint8_t chipType = 0;
1787 float freqMHz = 0;
1788
1789#if !RADIOLIB_GODMODE
1790 private:
1791#endif
1792 Module* mod;
1793
1794 // cached LoRa parameters
1795 uint8_t bandwidth = 0, spreadingFactor = 0, codingRate = 0, ldrOptimize = 0, crcTypeLoRa = 0, headerType = 0;
1796 uint16_t preambleLengthLoRa = 0;
1797 float bandwidthKhz = 0;
1798 bool ldroAuto = true;
1799 size_t implicitLen = 0;
1800 bool invertIQEnabled = false;
1801
1802 // cached GFSK parameters
1803 uint32_t bitRate = 0, frequencyDev = 0;
1804 uint8_t preambleDetLength = 0, rxBandwidth = 0, pulseShape = 0, crcTypeGFSK = 0, syncWordLength = 0, addrComp = 0, whitening = 0, packetType = 0, node = 0;
1805 uint16_t preambleLengthGFSK = 0;
1806
1807 // cached LR-FHSS parameters
1808 uint8_t lrFhssCr = 0, lrFhssBw = 0, lrFhssHdrCount = 0, lrFhssGrid = 0;
1809 uint16_t lrFhssHopSeq = 0;
1810
1811 float dataRateMeasured = 0;
1812
1813 uint8_t wifiScanMode = 0;
1814 bool gnss = false;
1815 uint32_t rxTimeout = 0;
1816
1817 int16_t modSetup(float tcxoVoltage, uint8_t modem);
1818 static int16_t SPIparseStatus(uint8_t in);
1819 static int16_t SPIcheckStatus(Module* mod);
1820 bool findChip(uint8_t ver);
1821 int16_t config(uint8_t modem);
1822 int16_t setPacketMode(uint8_t mode, uint8_t len);
1823 int16_t startCad(uint8_t symbolNum, uint8_t detPeak, uint8_t detMin, uint8_t exitMode, RadioLibTime_t timeout);
1824 int16_t setHeaderType(uint8_t hdrType, size_t len = 0xFF);
1825
1826 // common methods to avoid some copy-paste
1827 int16_t bleBeaconCommon(uint16_t cmd, uint8_t chan, const uint8_t* payload, size_t len);
1828 int16_t writeCommon(uint16_t cmd, uint32_t addrOffset, const uint32_t* data, size_t len, bool nonvolatile);
1829 int16_t cryptoCommon(uint16_t cmd, uint8_t keyId, const uint8_t* dataIn, size_t len, uint8_t* dataOut);
1830};
1831
1832#endif
1833
1834#endif
Base class for LR11x0 series. All derived classes for LR11x0 (e.g. LR1110 or LR1120) inherit from thi...
Definition LR11x0.h:874
float getSNR() override
Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa modem.
Definition LR11x0.cpp:1167
uint32_t getIrqStatus()
Reads the current IRQ status.
Definition LR11x0.cpp:431
int16_t setDataRate(DataRate_t dr) override
Set data.
Definition LR11x0.cpp:956
void setRfSwitchTable(const uint32_t(&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[])
Some modules contain external RF switch controlled by pins. This function gives RadioLib control over...
Definition LR11x0.cpp:1351
int16_t getGnssPosition(LR11x0GnssPosition_t *pos, bool filtered=true)
Get GNSS position. Called after gnssScan to retrieve the position calculated by the internal solver.
Definition LR11x0.cpp:1888
int16_t setRegulatorDCDC()
Set regulator mode to DC-DC.
Definition LR11x0.cpp:1342
int16_t getChannelScanResult() override
Read the channel scan result.
Definition LR11x0.cpp:531
float getDataRate() const
Gets effective data rate for the last transmitted packet. The value is calculated only for payload by...
Definition LR11x0.cpp:1334
int16_t readData(uint8_t *data, size_t len) override
Reads data received after calling startReceive method. When the packet length is not known in advance...
Definition LR11x0.cpp:441
uint32_t getIrqFlags() override
Read currently active IRQ flags.
Definition LR11x0.cpp:1308
int16_t transmit(const uint8_t *data, size_t len, uint8_t addr=0) override
Blocking binary transmit method. Overloads for string-based transmissions are implemented in Physical...
Definition LR11x0.cpp:179
int16_t beginLRFHSS(uint8_t bw, uint8_t cr, bool narrowGrid, float tcxoVoltage)
Initialization method for LR-FHSS modem.
Definition LR11x0.cpp:103
int16_t setRxBandwidth(float rxBw)
Sets GFSK receiver bandwidth. Allowed values are 4.8, 5.8, 7.3, 9.7, 11.7, 14.6, 19....
Definition LR11x0.cpp:707
RadioLibTime_t calculateRxTimeout(RadioLibTime_t timeoutUs) override
Calculate the timeout value for this specific module / series (in number of symbols or units of time)
Definition LR11x0.cpp:1301
int16_t reset()
Reset method. Will reset the chip to the default state using RST pin.
Definition LR11x0.cpp:156
OpMode_t
Custom operation modes for LR11x0. Needed because LR11x0 has several modems (sub-GHz,...
Definition LR11x0.h:893
@ MODE_TX_HP
Definition LR11x0.h:903
@ MODE_END_OF_TABLE
Definition LR11x0.h:895
@ MODE_WIFI
Definition LR11x0.h:909
@ MODE_GNSS
Definition LR11x0.h:907
@ MODE_TX
Definition LR11x0.h:901
@ MODE_RX
Definition LR11x0.h:899
@ MODE_STBY
Definition LR11x0.h:897
@ MODE_TX_HF
Definition LR11x0.h:905
int16_t startWifiScan(char wifiType, uint8_t mode=RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON, uint16_t chanMask=RADIOLIB_LR11X0_WIFI_ALL_CHANNELS, uint8_t numScans=16, uint16_t timeout=100)
Start passive WiFi scan. BUSY pin will be de-activated when the scan is finished.
Definition LR11x0.cpp:1440
int16_t explicitHeader()
Set explicit header mode for future reception/transmission.
Definition LR11x0.cpp:1330
int16_t receive(uint8_t *data, size_t len) override
Blocking binary receive method. Overloads for string-based transmissions are implemented in PhysicalL...
Definition LR11x0.cpp:229
bool XTAL
Whether the module has an XTAL (true) or TCXO (false). Defaults to false.
Definition LR11x0.h:915
int16_t getWifiScanResult(LR11x0WifiResult_t *result, uint8_t index, bool brief=false)
Retrieve passive WiFi scan result.
Definition LR11x0.cpp:1504
void setIrqAction(void(*func)(void))
Sets interrupt service routine to call when IRQ1 activates.
Definition LR11x0.cpp:395
int16_t checkDataRate(DataRate_t dr) override
Check the data rate can be configured by this module.
Definition LR11x0.cpp:995
int16_t startChannelScan() override
Interrupt-driven channel activity detection method. IRQ1 will be activated when LoRa preamble is dete...
Definition LR11x0.cpp:486
int16_t setCRC(uint8_t len, uint32_t initial=0x00001D0FUL, uint32_t polynomial=0x00001021UL, bool inverted=true)
Sets CRC configuration.
Definition LR11x0.cpp:1093
int16_t setCodingRate(uint8_t cr, bool longInterleave=false)
Sets LoRa coding rate denominator. Allowed values range from 5 to 8.
Definition LR11x0.cpp:625
int16_t setDataShaping(uint8_t sh) override
Sets time-bandwidth product of Gaussian filter applied for shaping. Allowed values are RADIOLIB_SHAPI...
Definition LR11x0.cpp:885
int16_t fixedPacketLengthMode(uint8_t len=RADIOLIB_LR11X0_MAX_PACKET_LENGTH)
Set modem in fixed packet length mode. Available in GFSK mode only.
Definition LR11x0.cpp:923
int16_t getWifiScanResultsCount(uint8_t *count)
Get number of WiFi scan results after the scan is finished.
Definition LR11x0.cpp:1490
int16_t setNodeAddress(uint8_t nodeAddr)
Sets node address. Calling this method will also enable address filtering for node address only.
Definition LR11x0.cpp:834
int16_t setIrqFlags(uint32_t irq) override
Set interrupt on IRQ pin to be sent on a specific IRQ bit (e.g. RxTimeout, CadDone).
Definition LR11x0.cpp:1312
int16_t setSyncBits(uint8_t *syncWord, uint8_t bitsLen)
Sets GFSK sync word in the form of array of up to 8 bytes.
Definition LR11x0.cpp:813
int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t *cfg) override
Stage mode of the radio to be launched later using launchMode.
Definition LR11x0.cpp:1950
int16_t scanChannel() override
Performs scan for LoRa transmission in the current channel. Detects both preamble and payload.
Definition LR11x0.cpp:323
float getRSSI() override
Gets RSSI (Recorded Signal Strength Indicator) of the last received packet. Only available for LoRa o...
Definition LR11x0.cpp:1150
int16_t setBandwidth(float bw, bool high=false)
Sets LoRa bandwidth. Allowed values are 62.5, 125.0, 250.0 and 500.0 kHz. (default,...
Definition LR11x0.cpp:554
int16_t getGnssAlmanacStatus(LR11x0GnssAlmanacStatus_t *stat)
Read information about the almanac.
Definition LR11x0.cpp:1795
int16_t standby() override
Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator)...
Definition LR11x0.cpp:352
int16_t isGnssScanCapable()
Method to check whether the device is capable of performing a GNSS scan.
Definition LR11x0.cpp:1681
uint8_t randomByte() override
Get one truly random byte from RSSI noise.
Definition LR11x0.cpp:1320
int16_t setEncoding(uint8_t encoding) override
Sets transmission encoding. Available in GFSK mode only. Serves only as alias for PhysicalLayer compa...
Definition LR11x0.cpp:919
int16_t setLrFhssConfig(uint8_t bw, uint8_t cr, uint8_t hdrCount=3, uint16_t hopSeed=0x13A)
Sets LR-FHSS configuration.
Definition LR11x0.cpp:1419
void setPacketSentAction(void(*func)(void)) override
Sets interrupt service routine to call when a packet is sent.
Definition LR11x0.cpp:411
int16_t setRegulatorLDO()
Set regulator mode to LDO.
Definition LR11x0.cpp:1338
void clearPacketSentAction() override
Clears interrupt service routine to call when a packet is sent.
Definition LR11x0.cpp:415
int16_t updateGnssAlmanac(uint8_t constellation)
Perform almanac update. Must be called immediately after gnssDelayUntilSubframe.
Definition LR11x0.cpp:1858
void clearPacketReceivedAction() override
Clears interrupt service routine to call when a packet is received.
Definition LR11x0.cpp:407
int16_t setTCXO(float voltage, uint32_t delay=5000)
Sets TCXO (Temperature Compensated Crystal Oscillator) configuration.
Definition LR11x0.cpp:1038
int16_t getGnssSatellites(LR11x0GnssSatellite_t *sats, uint8_t numSats)
Get GNSS satellites found during the last scan.
Definition LR11x0.cpp:1908
int16_t begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool high=false)
Initialization method for LoRa modem.
Definition LR11x0.cpp:28
int16_t clearIrqFlags(uint32_t irq) override
Clear interrupt on a specific IRQ bit (e.g. RxTimeout, CadDone).
Definition LR11x0.cpp:1316
int16_t setPreambleLength(size_t preambleLength) override
Sets preamble length for LoRa or GFSK modem. Allowed values range from 1 to 65535.
Definition LR11x0.cpp:1017
int16_t startReceive() override
Interrupt-driven receive method with default parameters. Implemented for compatibility with PhysicalL...
Definition LR11x0.cpp:427
int16_t autoLDRO()
Re-enables automatic LDRO configuration. Only available in LoRa mode. After calling this method,...
Definition LR11x0.cpp:1407
int16_t launchMode() override
Launch previously staged mode.
Definition LR11x0.cpp:2041
int16_t finishTransmit() override
Clean up after transmission is done.
Definition LR11x0.cpp:419
int16_t setRxBoostedGainMode(bool en)
Enables or disables Rx Boosted Gain mode (additional Rx gain for increased power consumption).
Definition LR11x0.cpp:1346
void clearIrqAction()
Clears interrupt service routine to call when IRQ1 activates.
Definition LR11x0.cpp:399
int16_t setBitRate(float br) override
Sets GFSK bit rate. Allowed values range from 0.6 to 300.0 kbps.
Definition LR11x0.cpp:670
int16_t updateFirmware(const uint32_t *image, size_t size, bool nonvolatile=true)
Method to upload new firmware image to the device. The device will be automatically erased,...
Definition LR11x0.cpp:1623
int16_t gnssDelayUntilSubframe(LR11x0GnssAlmanacStatus_t *stat, uint8_t constellation)
Blocking wait until the next subframe with almanac data is available. Used to control timing during a...
Definition LR11x0.cpp:1834
int16_t implicitHeader(size_t len)
Set implicit header mode for future reception/transmission.
Definition LR11x0.cpp:1326
int16_t beginGFSK(float br, float freqDev, float rxBw, uint16_t preambleLength, float tcxoVoltage)
Initialization method for FSK modem.
Definition LR11x0.cpp:62
RadioLibTime_t getTimeOnAir(size_t len) override
Get expected time-on-air for a given size of payload.
Definition LR11x0.cpp:1204
int16_t setFrequencyDeviation(float freqDev) override
Sets GFSK frequency deviation. Allowed values range from 0.0 to 200.0 kHz.
Definition LR11x0.cpp:687
size_t getPacketLength(bool update=true) override
Query modem for the packet length of received payload.
Definition LR11x0.cpp:1185
void setPacketReceivedAction(void(*func)(void)) override
Sets interrupt service routine to call when a packet is received.
Definition LR11x0.cpp:403
int16_t getVersionInfo(LR11x0VersionInfo_t *info)
Retrieve LR11x0 hardware, device and firmware version information.
Definition LR11x0.cpp:1603
void clearWiFiScanAction()
Clears interrupt service routine to call when a WiFi scan is completed.
Definition LR11x0.cpp:1486
int16_t sleep() override
Sets the module to sleep mode. To wake the device up, call standby(). Overload with warm start enable...
Definition LR11x0.cpp:370
int16_t beginGNSS(uint8_t constellations=RADIOLIB_LR11X0_GNSS_CONSTELLATION_GPS|RADIOLIB_LR11X0_GNSS_CONSTELLATION_BEIDOU, float tcxoVoltage=1.6)
Initialization method for GNSS scanning.
Definition LR11x0.cpp:126
float getFrequencyError()
Gets frequency error of the latest received packet.
Definition LR11x0.cpp:1180
int16_t gnssScan(LR11x0GnssResult_t *res=NULL)
Performs GNSS scan.
Definition LR11x0.cpp:1727
int16_t calibrateImageRejection(float freqMin, float freqMax)
Perform image rejection calibration for the specified frequency band. WARNING: Use at your own risk!...
Definition LR11x0.cpp:2448
int16_t variablePacketLengthMode(uint8_t maxLen=RADIOLIB_LR11X0_MAX_PACKET_LENGTH)
Set modem in variable packet length mode. Available in GFSK mode only.
Definition LR11x0.cpp:927
int16_t setWhitening(bool enabled, uint16_t initial=0x01FF)
Sets GFSK whitening parameters.
Definition LR11x0.cpp:931
int16_t wifiScan(uint8_t wifiType, uint8_t *count, uint8_t mode=RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON, uint16_t chanMask=RADIOLIB_LR11X0_WIFI_ALL_CHANNELS, uint8_t numScans=16, uint16_t timeout=100)
Blocking WiFi scan method. Performs a full passive WiFi scan. This method may block for several secon...
Definition LR11x0.cpp:1578
int16_t setSpreadingFactor(uint8_t sf, bool legacy=false)
Sets LoRa spreading factor. Allowed values range from 5 to 12.
Definition LR11x0.cpp:604
int16_t transmitDirect(uint32_t frf=0) override
Starts direct mode transmission.
Definition LR11x0.cpp:300
int16_t forceLDRO(bool enable)
Forces LoRa low data rate optimization. Only available in LoRa mode. After calling this method,...
Definition LR11x0.cpp:1392
int16_t receiveDirect() override
Starts direct mode reception. Only implemented for PhysicalLayer compatibility, as SX126x series does...
Definition LR11x0.cpp:315
int16_t disableAddressFiltering()
Disables address filtering. Calling this method will also erase previously set addresses.
Definition LR11x0.cpp:871
int16_t setSyncWord(uint8_t syncWord)
Sets LoRa sync word.
Definition LR11x0.cpp:658
int16_t setBroadcastAddress(uint8_t broadAddr)
Sets broadcast address. Calling this method will also enable address filtering for node and broadcast...
Definition LR11x0.cpp:853
int16_t invertIQ(bool enable) override
Enable/disable inversion of the I and Q signals.
Definition LR11x0.cpp:1137
int16_t getModem(ModemType_t *modem) override
Get modem currently in use by the radio.
Definition LR11x0.cpp:1928
void setWiFiScanAction(void(*func)(void))
Sets interrupt service routine to call when a WiFi scan is completed.
Definition LR11x0.cpp:1482
Implements all common low-level methods to control the wireless module. Every module class contains o...
Definition Module.h:73
static const size_t RFSWITCH_MAX_PINS
The maximum number of pins supported by the RF switch code. Note: It is not recommended to use this c...
Definition Module.h:82
@ MODE_TX
Transmission mode.
Definition Module.h:119
@ MODE_IDLE
Idle mode.
Definition Module.h:113
@ MODE_RX
Receive mode.
Definition Module.h:116
@ MODE_END_OF_TABLE
End of table marker, use END_OF_MODE_TABLE constant instead. Value is zero to ensure zero-initialized...
Definition Module.h:110
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition PhysicalLayer.h:216
virtual int16_t startReceive()
Sets module to received mode using its default configuration.
Definition PhysicalLayer.cpp:130
virtual int16_t readData(uint8_t *data, size_t len)
Reads data that was received after calling startReceive method.
Definition PhysicalLayer.cpp:220
int16_t transmit(const char *str, uint8_t addr=0)
C-string transmit method.
Definition PhysicalLayer.cpp:53
int16_t startTransmit(const char *str, uint8_t addr=0)
Interrupt-driven Arduino String transmit method. Unlike the standard transmit method,...
Definition PhysicalLayer.cpp:155
virtual int16_t receive(uint8_t *data, size_t len)
Binary receive method. Must be implemented in module class.
Definition PhysicalLayer.cpp:111
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition TypeDef.h:642
Structure to save information about the GNSS almanac. This is not the actual almanac,...
Definition LR11x0.h:852
RadioLibTime_t start
Timestamp of when almanac status was retrieved - timeUntilSubframe is relative to this value.
Definition LR11x0.h:866
LR11x0GnssAlmanacStatusPart_t beidou
BeiDou part of the almanac.
Definition LR11x0.h:857
uint8_t nextAlmanacId
Next almanac ID.
Definition LR11x0.h:863
uint32_t beidouSvNoAlmanacFlags[2]
Extra flags present for BeiDou only.
Definition LR11x0.h:860
LR11x0GnssAlmanacStatusPart_t gps
GPS part of the almanac.
Definition LR11x0.h:854
Structure to save information about one constellation of the GNSS almanac.
Definition LR11x0.h:835
Structure to report position from LR11x0 internal solver.
Definition LR11x0.h:802
float latitude
Latitude in degrees.
Definition LR11x0.h:804
uint16_t accuracy
Accuracy of this result.
Definition LR11x0.h:810
float longitude
Longitude in degrees.
Definition LR11x0.h:807
uint8_t numSatsUsed
Number of satellites used to solve this position.
Definition LR11x0.h:813
Structure to report information results of a GNSS scan.
Definition LR11x0.h:787
uint16_t resSize
Result size, used when passing data to LoRa cloud.
Definition LR11x0.h:795
int8_t demodStat
Demodulator status. One of RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_*.
Definition LR11x0.h:789
uint8_t numSatsDet
Number of satellites detected during the scan.
Definition LR11x0.h:792
Structure to save information about a satellite found during GNSS scan.
Definition LR11x0.h:820
uint8_t svId
Satellite vehicle (SV) identifier.
Definition LR11x0.h:822
uint8_t c_n0
C/N0 in dB.
Definition LR11x0.h:825
int16_t doppler
Doppler shift of the signal in Hz.
Definition LR11x0.h:828
Structure to report information about versions of the LR11x0 hardware and firmware.
Definition LR11x0.h:757
uint8_t fwMajor
Major revision of the base firmware.
Definition LR11x0.h:765
uint8_t fwMinorWiFi
Minor revision of the WiFi firmware.
Definition LR11x0.h:774
uint8_t device
Which device this is - one of RADIOLIB_LR11X0_DEVICE_* macros.
Definition LR11x0.h:762
uint8_t hardware
Hardware revision.
Definition LR11x0.h:759
uint8_t fwMinor
Minor revision of the base firmware.
Definition LR11x0.h:768
uint8_t fwGNSS
Revision of the GNSS firmware.
Definition LR11x0.h:777
uint8_t almanacGNSS
Almanac revision of the GNSS firmware.
Definition LR11x0.h:780
uint8_t fwMajorWiFi
Major revision of the WiFi firmware.
Definition LR11x0.h:771
Structure to save result of passive WiFi scan. This result only saves the basic information.
Definition LR11x0.h:660
bool ap
Whether this signal was sent by an access point (true) or end device (false)
Definition LR11x0.h:674
uint16_t channelFreq
Channel frequency in MHz.
Definition LR11x0.h:668
char type
WiFi (802.11) signal type, 'b', 'n' or 'g'.
Definition LR11x0.h:662
uint8_t mac[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN]
MAC address.
Definition LR11x0.h:680
uint8_t dataRateId
Data rate ID holding information about modulation and coding rate. See LR11x0 user manual for details...
Definition LR11x0.h:665
float rssi
RSSI in dBm.
Definition LR11x0.h:677
uint8_t origin
MAC address origin: from gateway (1), phone (2) or undetermined (3)
Definition LR11x0.h:671
Structure to save result of passive WiFi scan. This result saves additional information alongside tha...
Definition LR11x0.h:718
uint8_t rate
Data rate. See LR11x0 user manual for details.
Definition LR11x0.h:720
uint16_t length
Refer to IEEE Std 802.11, 2016, Part 11: Wireless LAN MAC and PHY Spec.
Definition LR11x0.h:726
bool fcsCheckOk
True if frame check sequences is valid, false otherwise.
Definition LR11x0.h:750
uint16_t service
Refer to IEEE Std 802.11, 2016, Part 11: Wireless LAN MAC and PHY Spec.
Definition LR11x0.h:723
uint8_t mac2[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN]
MAC address 2.
Definition LR11x0.h:732
uint8_t ssid[RADIOLIB_LR11X0_WIFI_RESULT_SSID_LEN]
SSID.
Definition LR11x0.h:738
uint8_t currentChannel
WiFi channel number.
Definition LR11x0.h:741
uint16_t seqCtrl
Refer to IEEE Std 802.11, 2016, Part 11: Wireless LAN MAC and PHY Spec.
Definition LR11x0.h:735
uint8_t mac0[RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN]
MAC address 0.
Definition LR11x0.h:729
char countryCode[3]
Two-letter country code (null-terminated string).
Definition LR11x0.h:744
uint8_t ioReg
Refer to IEEE Std 802.11, 2016, Part 11: Wireless LAN MAC and PHY Spec.
Definition LR11x0.h:747
Structure to save result of passive WiFi scan. This result saves additional information alongside tha...
Definition LR11x0.h:688
uint32_t periodBeacon
Beacon period in microseconds.
Definition LR11x0.h:708
uint16_t phiOffset
See LR11x0 user manual for details.
Definition LR11x0.h:702
bool fromDistributionSystem
Frame sent from distribution system to client station.
Definition LR11x0.h:699
uint64_t timestamp
Number of microseconds the AP has been active.
Definition LR11x0.h:705
uint8_t frameType
Frame type. See LR11x0 user manual for details.
Definition LR11x0.h:690
uint8_t frameSubType
Frame sub type. See LR11x0 user manual for details.
Definition LR11x0.h:693
bool toDistributionSystem
Frame sent from client station to distribution system.
Definition LR11x0.h:696
Description of RF switch pin states for a single mode. See setRfSwitchTable for details.
Definition Module.h:89
Common channel scan configuration structure.
Definition PhysicalLayer.h:125
Common data rate structure.
Definition PhysicalLayer.h:74
Definition PhysicalLayer.h:168