RadioLib
Universal wireless communication library for Arduino
BuildOpt.h
1 #if !defined(_RADIOLIB_BUILD_OPTIONS_H)
2 #define _RADIOLIB_BUILD_OPTIONS_H
3 
4 #if ARDUINO >= 100
5  #include "Arduino.h"
6 #else
7  #error "Unsupported Arduino version (< 1.0.0)"
8 #endif
9 
10 /*
11  * Platform-specific configuration.
12  *
13  * RADIOLIB_PLATFORM - platform name, used in debugging to quickly check the correct platform is detected.
14  * RADIOLIB_PIN_TYPE - which type should be used for pin numbers in functions like digitalRead().
15  * RADIOLIB_PIN_MODE - which type should be used for pin modes in functions like pinMode().
16  * RADIOLIB_PIN_STATUS - which type should be used for pin values in functions like digitalWrite().
17  * RADIOLIB_INTERRUPT_STATUS - which type should be used for pin changes in functions like attachInterrupt().
18  * RADIOLIB_DIGITAL_PIN_TO_INTERRUPT - function/macro to be used to convert digital pin number to interrupt pin number.
19  * RADIOLIB_NC - alias for unused pin, usually the largest possible value of RADIOLIB_PIN_TYPE.
20  * RADIOLIB_DEFAULT_SPI - default SPIClass instance to use.
21  * RADIOLIB_PROGMEM - macro to place variable into program storage (usually Flash).
22  * RADIOLIB_PROGMEM_READ_BYTE - function/macro to read variables saved in program storage (usually Flash).
23  * RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED - defined if the specific platform does not support SoftwareSerial.
24  * RADIOLIB_HARDWARE_SERIAL_PORT - which hardware serial port should be used on platform that do not have SoftwareSerial support.
25  * RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK.
26  *
27  * In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266).
28  *
29  * Users may also specify their own configuration by uncommenting the RADIOLIB_CUSTOM_PLATFORM,
30  * and then specifying all platform parameters in the section below. This will override automatic
31  * platform detection.
32  */
33 
34 // uncomment to enable custom platform definition
35 //#define RADIOLIB_CUSTOM_PLATFORM
36 
37 #if defined(RADIOLIB_CUSTOM_PLATFORM)
38  // name for your platform
39  #define RADIOLIB_PLATFORM "Custom"
40 
41  // the following parameters must always be defined
42  #define RADIOLIB_PIN_TYPE uint8_t
43  #define RADIOLIB_PIN_MODE uint8_t
44  #define RADIOLIB_PIN_STATUS uint8_t
45  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
46  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
47  #define RADIOLIB_NC (0xFF)
48  #define RADIOLIB_DEFAULT_SPI SPI
49  #define RADIOLIB_PROGMEM PROGMEM
50  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
51 
52  // the following must be defined if the Arduino core does not support SoftwareSerial library
53  //#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
54  //#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
55 
56  // the following must be defined if the Arduino core does not support tone function
57  //#define RADIOLIB_TONE_UNSUPPORTED
58 
59  // some platforms seem to have issues with SPI modules that use a command interface
60  // this can be mitigated by adding delays into SPI communication
61  // (see https://github.com/jgromes/RadioLib/issues/158 for details)
62  //#define RADIOLIB_SPI_SLOWDOWN
63 
64  // some of RadioLib drivers may be excluded, to prevent collisions with platforms (or to speed up build process)
65  // the following is a complete list of all possible exclusion macros, uncomment any of them to disable that driver
66  // NOTE: Some of the exclusion macros are dependent on each other. For example, it is not possible to exclude RF69
67  // while keeping SX1231 (because RF69 is the base class for SX1231). The dependency is always uni-directional,
68  // so excluding SX1231 and keeping RF69 is valid.
69  //#define RADIOLIB_EXCLUDE_CC1101
70  //#define RADIOLIB_EXCLUDE_ESP8266
71  //#define RADIOLIB_EXCLUDE_HC05
72  //#define RADIOLIB_EXCLUDE_JDY08
73  //#define RADIOLIB_EXCLUDE_NRF24
74  //#define RADIOLIB_EXCLUDE_RF69
75  //#define RADIOLIB_EXCLUDE_SX1231 // dependent on RADIOLIB_EXCLUDE_RF69
76  //#define RADIOLIB_EXCLUDE_SI443X
77  //#define RADIOLIB_EXCLUDE_RFM2X // dependent on RADIOLIB_EXCLUDE_SI443X
78  //#define RADIOLIB_EXCLUDE_SX127X
79  //#define RADIOLIB_EXCLUDE_RFM9X // dependent on RADIOLIB_EXCLUDE_SX127X
80  //#define RADIOLIB_EXCLUDE_SX126X
81  //#define RADIOLIB_EXCLUDE_SX128X
82  //#define RADIOLIB_EXCLUDE_XBEE
83  //#define RADIOLIB_EXCLUDE_AFSK
84  //#define RADIOLIB_EXCLUDE_AX25
85  //#define RADIOLIB_EXCLUDE_HELLSCHREIBER
86  //#define RADIOLIB_EXCLUDE_HTTP
87  //#define RADIOLIB_EXCLUDE_MORSE
88  //#define RADIOLIB_EXCLUDE_MQTT
89  //#define RADIOLIB_EXCLUDE_RTTY
90  //#define RADIOLIB_EXCLUDE_SSTV
91 
92 #else
93  #if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
94  // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
95  #define RADIOLIB_PLATFORM "Arduino AVR"
96  #define RADIOLIB_PIN_TYPE uint8_t
97  #define RADIOLIB_PIN_MODE uint8_t
98  #define RADIOLIB_PIN_STATUS uint8_t
99  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
100  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
101  #define RADIOLIB_NC (0xFF)
102  #define RADIOLIB_DEFAULT_SPI SPI
103  #define RADIOLIB_PROGMEM PROGMEM
104  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
105 
106  #elif defined(ESP8266)
107  // ESP8266 boards
108  #define RADIOLIB_PLATFORM "ESP8266"
109  #define RADIOLIB_PIN_TYPE uint8_t
110  #define RADIOLIB_PIN_MODE uint8_t
111  #define RADIOLIB_PIN_STATUS uint8_t
112  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
113  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
114  #define RADIOLIB_NC (0xFF)
115  #define RADIOLIB_DEFAULT_SPI SPI
116  #define RADIOLIB_PROGMEM PROGMEM
117  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
118 
119  // RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform
120  #define RADIOLIB_EXCLUDE_ESP8266
121 
122  #elif defined(ESP32)
123  // ESP32 boards
124  #define RADIOLIB_PLATFORM "ESP32"
125  #define RADIOLIB_PIN_TYPE uint8_t
126  #define RADIOLIB_PIN_MODE uint8_t
127  #define RADIOLIB_PIN_STATUS uint8_t
128  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
129  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
130  #define RADIOLIB_NC (0xFF)
131  #define RADIOLIB_DEFAULT_SPI SPI
132  #define RADIOLIB_PROGMEM PROGMEM
133  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
134  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
135  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
136 
137  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
138  #define RADIOLIB_TONE_UNSUPPORTED
139  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
140 
141  #elif defined(ARDUINO_ARCH_STM32)
142  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
143  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
144  #define RADIOLIB_PIN_TYPE uint32_t
145  #define RADIOLIB_PIN_MODE uint32_t
146  #define RADIOLIB_PIN_STATUS uint32_t
147  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
148  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
149  #define RADIOLIB_NC (0xFFFFFFFF)
150  #define RADIOLIB_DEFAULT_SPI SPI
151  #define RADIOLIB_PROGMEM PROGMEM
152  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
153  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
154  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
155 
156  // slow down SX126x/8x SPI on this platform
157  #define RADIOLIB_SPI_SLOWDOWN
158 
159  #elif defined(SAMD_SERIES)
160  // Adafruit SAMD boards (M0 and M4)
161  #define RADIOLIB_PLATFORM "Adafruit SAMD"
162  #define RADIOLIB_PIN_TYPE uint32_t
163  #define RADIOLIB_PIN_MODE uint32_t
164  #define RADIOLIB_PIN_STATUS uint32_t
165  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
166  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
167  #define RADIOLIB_NC (0xFFFFFFFF)
168  #define RADIOLIB_DEFAULT_SPI SPI
169  #define RADIOLIB_PROGMEM PROGMEM
170  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
171  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
172  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
173 
174  // slow down SX126x/8x SPI on this platform
175  #define RADIOLIB_SPI_SLOWDOWN
176 
177  #elif defined(ARDUINO_ARCH_SAMD)
178  // Arduino SAMD (Zero, MKR, etc.)
179  #define RADIOLIB_PLATFORM "Arduino SAMD"
180  #define RADIOLIB_PIN_TYPE pin_size_t
181  #define RADIOLIB_PIN_MODE PinMode
182  #define RADIOLIB_PIN_STATUS PinStatus
183  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
184  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
185  #define RADIOLIB_NC (0xFF)
186  #define RADIOLIB_DEFAULT_SPI SPI
187  #define RADIOLIB_PROGMEM PROGMEM
188  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
189  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
190  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
191 
192  #elif defined(__SAM3X8E__)
193  // Arduino Due
194  #define RADIOLIB_PLATFORM "Arduino Due"
195  #define RADIOLIB_PIN_TYPE uint32_t
196  #define RADIOLIB_PIN_MODE uint32_t
197  #define RADIOLIB_PIN_STATUS uint32_t
198  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
199  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
200  #define RADIOLIB_NC (0xFFFFFFFF)
201  #define RADIOLIB_DEFAULT_SPI SPI
202  #define RADIOLIB_PROGMEM PROGMEM
203  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
204  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
205  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
206  #define RADIOLIB_TONE_UNSUPPORTED
207 
208  #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
209  // Adafruit nRF52 boards
210  #define RADIOLIB_PLATFORM "Adafruit nRF52"
211  #define RADIOLIB_PIN_TYPE uint32_t
212  #define RADIOLIB_PIN_MODE uint32_t
213  #define RADIOLIB_PIN_STATUS uint32_t
214  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
215  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
216  #define RADIOLIB_NC (0xFFFFFFFF)
217  #define RADIOLIB_DEFAULT_SPI SPI
218  #define RADIOLIB_PROGMEM PROGMEM
219  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
220 
221  #elif defined(ARDUINO_ARC32_TOOLS)
222  // Intel Curie
223  #define RADIOLIB_PLATFORM "Intel Curie"
224  #define RADIOLIB_PIN_TYPE uint8_t
225  #define RADIOLIB_PIN_MODE uint8_t
226  #define RADIOLIB_PIN_STATUS uint8_t
227  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
228  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
229  #define RADIOLIB_NC (0xFF)
230  #define RADIOLIB_DEFAULT_SPI SPI
231  #define RADIOLIB_PROGMEM PROGMEM
232  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
233 
234  #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)
235  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
236  #define RADIOLIB_PLATFORM "Arduino megaAVR"
237  #define RADIOLIB_PIN_TYPE uint8_t
238  #define RADIOLIB_PIN_MODE PinMode
239  #define RADIOLIB_PIN_STATUS PinStatus
240  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
241  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
242  #define RADIOLIB_NC (0xFF)
243  #define RADIOLIB_DEFAULT_SPI SPI
244  #define RADIOLIB_PROGMEM PROGMEM
245  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
246 
247  #elif defined(ARDUINO_ARCH_APOLLO3)
248  // Sparkfun Apollo3 boards
249  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
250  #define RADIOLIB_PIN_TYPE pin_size_t
251  #define RADIOLIB_PIN_MODE Arduino_PinMode
252  #define RADIOLIB_PIN_STATUS PinStatus
253  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
254  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
255  #define RADIOLIB_NC (0xFF)
256  #define RADIOLIB_DEFAULT_SPI SPI
257  #define RADIOLIB_PROGMEM PROGMEM
258  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
259  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
260  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
261 
262  // Apollo3 uses mbed libraries, which already contain ESP8266 driver
263  #define RADIOLIB_EXCLUDE_ESP8266
264 
265  // slow down SX126x/8x SPI on this platform
266  #define RADIOLIB_SPI_SLOWDOWN
267 
268  #elif defined(ARDUINO_ARDUINO_NANO33BLE)
269  // Arduino Nano 33 BLE
270  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
271  #define RADIOLIB_PIN_TYPE pin_size_t
272  #define RADIOLIB_PIN_MODE PinMode
273  #define RADIOLIB_PIN_STATUS PinStatus
274  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
275  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
276  #define RADIOLIB_NC (0xFF)
277  #define RADIOLIB_DEFAULT_SPI SPI
278  #define RADIOLIB_PROGMEM PROGMEM
279  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
280  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
281  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
282 
283  // Nano 33 BLE uses mbed libraries, which already contain ESP8266 driver
284  #define RADIOLIB_EXCLUDE_ESP8266
285 
286  #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
287  // Arduino Portenta H7
288  #define RADIOLIB_PLATFORM "Portenta H7"
289  #define RADIOLIB_PIN_TYPE pin_size_t
290  #define RADIOLIB_PIN_MODE PinMode
291  #define RADIOLIB_PIN_STATUS PinStatus
292  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
293  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
294  #define RADIOLIB_NC (0xFF)
295  #define RADIOLIB_DEFAULT_SPI SPI
296  #define RADIOLIB_PROGMEM PROGMEM
297  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
298  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
299  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
300 
301  // Arduino Portenta H7 uses mbed libraries, which already contain ESP8266 driver
302  #define RADIOLIB_EXCLUDE_ESP8266
303 
304  #elif defined(__STM32F4__) || defined(__STM32F1__)
305  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
306  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
307  #define RADIOLIB_PIN_TYPE uint8_t
308  #define RADIOLIB_PIN_MODE WiringPinMode
309  #define RADIOLIB_PIN_STATUS uint8_t
310  #define RADIOLIB_INTERRUPT_STATUS ExtIntTriggerMode
311  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
312  #define RADIOLIB_NC (0xFF)
313  #define RADIOLIB_DEFAULT_SPI SPI
314  #define RADIOLIB_PROGMEM PROGMEM
315  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
316  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
317  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
318 
319  #elif defined(ARDUINO_ARCH_MEGAAVR)
320  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
321  #define RADIOLIB_PLATFORM "MegaCoreX"
322  #define RADIOLIB_PIN_TYPE uint8_t
323  #define RADIOLIB_PIN_MODE uint8_t
324  #define RADIOLIB_PIN_STATUS uint8_t
325  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
326  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
327  #define RADIOLIB_NC (0xFF)
328  #define RADIOLIB_DEFAULT_SPI SPI
329  #define RADIOLIB_PROGMEM PROGMEM
330  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
331 
332  #else
333  // other platforms not covered by the above list - this may or may not work
334  #define RADIOLIB_PLATFORM "Unknown"
335  #define RADIOLIB_UNKNOWN_PLATFORM
336  #define RADIOLIB_PIN_TYPE uint8_t
337  #define RADIOLIB_PIN_MODE uint8_t
338  #define RADIOLIB_PIN_STATUS uint8_t
339  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
340  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
341  #define RADIOLIB_NC (0xFF)
342  #define RADIOLIB_DEFAULT_SPI SPI
343  #define RADIOLIB_PROGMEM PROGMEM
344  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
345 
346  #endif
347 #endif
348 
349 /*
350  * Uncomment to enable debug output.
351  * Warning: Debug output will slow down the whole system significantly.
352  * Also, it will result in larger compiled binary.
353  * Levels: debug - only main info
354  * verbose - full transcript of all SPI/UART communication
355  */
356 
357 //#define RADIOLIB_DEBUG
358 //#define RADIOLIB_VERBOSE
359 
360 // set which Serial port should be used for debug output
361 #define RADIOLIB_DEBUG_PORT Serial
362 
363 #if defined(RADIOLIB_DEBUG)
364  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
365  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
366 #else
367  #define RADIOLIB_DEBUG_PRINT(...) {}
368  #define RADIOLIB_DEBUG_PRINTLN(...) {}
369 #endif
370 
371 #if defined(RADIOLIB_VERBOSE)
372  #define RADIOLIB_VERBOSE_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
373  #define RADIOLIB_VERBOSE_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
374 #else
375  #define RADIOLIB_VERBOSE_PRINT(...) {}
376  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
377 #endif
378 
379 /*
380  * Uncomment to enable "paranoid" SPI mode
381  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
382  * This improves reliablility, but slightly slows down communication.
383  * Note: Enabled by default.
384  */
385 #define RADIOLIB_SPI_PARANOID
386 
387 /*
388  * Uncomment to enable parameter range checking
389  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
390  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
391  * possibly leading to bricked module and/or program crashing.
392  * Note: Enabled by default.
393  */
394 #define RADIOLIB_CHECK_PARAMS
395 
396 /*
397  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
398  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
399  * Failure to heed the above warning may result in bricked module.
400  */
401 //#define RADIOLIB_GODMODE
402 
403 /*
404  * Uncomment to enable low-level hardware access
405  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
406  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
407  */
408 //#define RADIOLIB_LOW_LEVEL
409 
410 /*
411  * Uncomment to enable pre-defined modules when using RadioShield.
412  */
413 //#define RADIOLIB_RADIOSHIELD
414 
415 /*
416  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
417  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
418  */
419 //#define RADIOLIB_STATIC_ONLY
420 
421 // set the size of static arrays to use
422 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
423 #define RADIOLIB_STATIC_ARRAY_SIZE 256
424 #endif
425 
429 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != ERR_NONE) { return(STATEVAR); } }
430 
434 #if defined(RADIOLIB_CHECK_PARAMS)
435 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
436 #else
437 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
438 #endif
439 
440 // version definitions
441 #define RADIOLIB_VERSION_MAJOR (0x04)
442 #define RADIOLIB_VERSION_MINOR (0x04)
443 #define RADIOLIB_VERSION_PATCH (0x01)
444 #define RADIOLIB_VERSION_EXTRA (0x00)
445 
446 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
447 
448 #endif