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  #define RADIOLIB_EXCLUDE_HTTP
122 
123  #elif defined(ESP32)
124  // ESP32 boards
125  #define RADIOLIB_PLATFORM "ESP32"
126  #define RADIOLIB_PIN_TYPE uint8_t
127  #define RADIOLIB_PIN_MODE uint8_t
128  #define RADIOLIB_PIN_STATUS uint8_t
129  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
130  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
131  #define RADIOLIB_NC (0xFF)
132  #define RADIOLIB_DEFAULT_SPI SPI
133  #define RADIOLIB_PROGMEM PROGMEM
134  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
135  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
136  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
137 
138  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
139  #define RADIOLIB_TONE_UNSUPPORTED
140  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
141 
142  #elif defined(ARDUINO_ARCH_STM32)
143  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
144  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
145  #define RADIOLIB_PIN_TYPE uint32_t
146  #define RADIOLIB_PIN_MODE uint32_t
147  #define RADIOLIB_PIN_STATUS uint32_t
148  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
149  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
150  #define RADIOLIB_NC (0xFFFFFFFF)
151  #define RADIOLIB_DEFAULT_SPI SPI
152  #define RADIOLIB_PROGMEM PROGMEM
153  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
154  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
155  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
156 
157  // slow down SX126x/8x SPI on this platform
158  #define RADIOLIB_SPI_SLOWDOWN
159 
160  #elif defined(SAMD_SERIES)
161  // Adafruit SAMD boards (M0 and M4)
162  #define RADIOLIB_PLATFORM "Adafruit SAMD"
163  #define RADIOLIB_PIN_TYPE uint32_t
164  #define RADIOLIB_PIN_MODE uint32_t
165  #define RADIOLIB_PIN_STATUS uint32_t
166  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
167  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
168  #define RADIOLIB_NC (0xFFFFFFFF)
169  #define RADIOLIB_DEFAULT_SPI SPI
170  #define RADIOLIB_PROGMEM PROGMEM
171  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
172  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
173  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
174 
175  // slow down SX126x/8x SPI on this platform
176  #define RADIOLIB_SPI_SLOWDOWN
177 
178  #elif defined(ARDUINO_ARCH_SAMD)
179  // Arduino SAMD (Zero, MKR, etc.)
180  #define RADIOLIB_PLATFORM "Arduino SAMD"
181  #define RADIOLIB_PIN_TYPE pin_size_t
182  #define RADIOLIB_PIN_MODE PinMode
183  #define RADIOLIB_PIN_STATUS PinStatus
184  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
185  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
186  #define RADIOLIB_NC (0xFF)
187  #define RADIOLIB_DEFAULT_SPI SPI
188  #define RADIOLIB_PROGMEM PROGMEM
189  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
190  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
191  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
192 
193  #elif defined(__SAM3X8E__)
194  // Arduino Due
195  #define RADIOLIB_PLATFORM "Arduino Due"
196  #define RADIOLIB_PIN_TYPE uint32_t
197  #define RADIOLIB_PIN_MODE uint32_t
198  #define RADIOLIB_PIN_STATUS uint32_t
199  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
200  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
201  #define RADIOLIB_NC (0xFFFFFFFF)
202  #define RADIOLIB_DEFAULT_SPI SPI
203  #define RADIOLIB_PROGMEM PROGMEM
204  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
205  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
206  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
207  #define RADIOLIB_TONE_UNSUPPORTED
208 
209  #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
210  // Adafruit nRF52 boards
211  #define RADIOLIB_PLATFORM "Adafruit nRF52"
212  #define RADIOLIB_PIN_TYPE uint32_t
213  #define RADIOLIB_PIN_MODE uint32_t
214  #define RADIOLIB_PIN_STATUS uint32_t
215  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
216  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
217  #define RADIOLIB_NC (0xFFFFFFFF)
218  #define RADIOLIB_DEFAULT_SPI SPI
219  #define RADIOLIB_PROGMEM PROGMEM
220  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
221 
222  #elif defined(ARDUINO_ARC32_TOOLS)
223  // Intel Curie
224  #define RADIOLIB_PLATFORM "Intel Curie"
225  #define RADIOLIB_PIN_TYPE uint8_t
226  #define RADIOLIB_PIN_MODE uint8_t
227  #define RADIOLIB_PIN_STATUS uint8_t
228  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
229  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
230  #define RADIOLIB_NC (0xFF)
231  #define RADIOLIB_DEFAULT_SPI SPI
232  #define RADIOLIB_PROGMEM PROGMEM
233  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
234 
235  #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)
236  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
237  #define RADIOLIB_PLATFORM "Arduino megaAVR"
238  #define RADIOLIB_PIN_TYPE uint8_t
239  #define RADIOLIB_PIN_MODE PinMode
240  #define RADIOLIB_PIN_STATUS PinStatus
241  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
242  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
243  #define RADIOLIB_NC (0xFF)
244  #define RADIOLIB_DEFAULT_SPI SPI
245  #define RADIOLIB_PROGMEM PROGMEM
246  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
247 
248  #elif defined(ARDUINO_ARCH_APOLLO3)
249  // Sparkfun Apollo3 boards
250  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
251  #define RADIOLIB_PIN_TYPE pin_size_t
252  #define RADIOLIB_PIN_MODE Arduino_PinMode
253  #define RADIOLIB_PIN_STATUS PinStatus
254  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
255  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
256  #define RADIOLIB_NC (0xFF)
257  #define RADIOLIB_DEFAULT_SPI SPI
258  #define RADIOLIB_PROGMEM PROGMEM
259  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
260  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
261  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
262 
263  // Apollo3 uses mbed libraries, which already contain ESP8266 driver
264  #define RADIOLIB_EXCLUDE_ESP8266
265 
266  // slow down SX126x/8x SPI on this platform
267  #define RADIOLIB_SPI_SLOWDOWN
268 
269  #elif defined(ARDUINO_ARDUINO_NANO33BLE)
270  // Arduino Nano 33 BLE
271  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
272  #define RADIOLIB_PIN_TYPE pin_size_t
273  #define RADIOLIB_PIN_MODE PinMode
274  #define RADIOLIB_PIN_STATUS PinStatus
275  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
276  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
277  #define RADIOLIB_NC (0xFF)
278  #define RADIOLIB_DEFAULT_SPI SPI
279  #define RADIOLIB_PROGMEM PROGMEM
280  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
281  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
282  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
283 
284  // Nano 33 BLE uses mbed libraries, which already contain ESP8266 driver
285  #define RADIOLIB_EXCLUDE_ESP8266
286 
287  #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
288  // Arduino Portenta H7
289  #define RADIOLIB_PLATFORM "Portenta H7"
290  #define RADIOLIB_PIN_TYPE pin_size_t
291  #define RADIOLIB_PIN_MODE PinMode
292  #define RADIOLIB_PIN_STATUS PinStatus
293  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
294  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
295  #define RADIOLIB_NC (0xFF)
296  #define RADIOLIB_DEFAULT_SPI SPI
297  #define RADIOLIB_PROGMEM PROGMEM
298  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
299  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
300  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
301 
302  // Arduino Portenta H7 uses mbed libraries, which already contain ESP8266 driver
303  #define RADIOLIB_EXCLUDE_ESP8266
304 
305  #elif defined(__STM32F4__) || defined(__STM32F1__)
306  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
307  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
308  #define RADIOLIB_PIN_TYPE uint8_t
309  #define RADIOLIB_PIN_MODE WiringPinMode
310  #define RADIOLIB_PIN_STATUS uint8_t
311  #define RADIOLIB_INTERRUPT_STATUS ExtIntTriggerMode
312  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
313  #define RADIOLIB_NC (0xFF)
314  #define RADIOLIB_DEFAULT_SPI SPI
315  #define RADIOLIB_PROGMEM PROGMEM
316  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
317  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
318  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
319 
320  #elif defined(ARDUINO_ARCH_MEGAAVR)
321  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
322  #define RADIOLIB_PLATFORM "MegaCoreX"
323  #define RADIOLIB_PIN_TYPE uint8_t
324  #define RADIOLIB_PIN_MODE uint8_t
325  #define RADIOLIB_PIN_STATUS uint8_t
326  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
327  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
328  #define RADIOLIB_NC (0xFF)
329  #define RADIOLIB_DEFAULT_SPI SPI
330  #define RADIOLIB_PROGMEM PROGMEM
331  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
332 
333  #else
334  // other platforms not covered by the above list - this may or may not work
335  #define RADIOLIB_PLATFORM "Unknown"
336  #define RADIOLIB_UNKNOWN_PLATFORM
337  #define RADIOLIB_PIN_TYPE uint8_t
338  #define RADIOLIB_PIN_MODE uint8_t
339  #define RADIOLIB_PIN_STATUS uint8_t
340  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
341  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
342  #define RADIOLIB_NC (0xFF)
343  #define RADIOLIB_DEFAULT_SPI SPI
344  #define RADIOLIB_PROGMEM PROGMEM
345  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
346 
347  #endif
348 #endif
349 
350 /*
351  * Uncomment to enable debug output.
352  * Warning: Debug output will slow down the whole system significantly.
353  * Also, it will result in larger compiled binary.
354  * Levels: debug - only main info
355  * verbose - full transcript of all SPI/UART communication
356  */
357 
358 //#define RADIOLIB_DEBUG
359 //#define RADIOLIB_VERBOSE
360 
361 // set which Serial port should be used for debug output
362 #define RADIOLIB_DEBUG_PORT Serial
363 
364 #if defined(RADIOLIB_DEBUG)
365  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
366  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
367 #else
368  #define RADIOLIB_DEBUG_PRINT(...) {}
369  #define RADIOLIB_DEBUG_PRINTLN(...) {}
370 #endif
371 
372 #if defined(RADIOLIB_VERBOSE)
373  #define RADIOLIB_VERBOSE_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
374  #define RADIOLIB_VERBOSE_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
375 #else
376  #define RADIOLIB_VERBOSE_PRINT(...) {}
377  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
378 #endif
379 
380 /*
381  * Uncomment to enable "paranoid" SPI mode
382  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
383  * This improves reliablility, but slightly slows down communication.
384  * Note: Enabled by default.
385  */
386 #define RADIOLIB_SPI_PARANOID
387 
388 /*
389  * Uncomment to enable parameter range checking
390  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
391  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
392  * possibly leading to bricked module and/or program crashing.
393  * Note: Enabled by default.
394  */
395 #define RADIOLIB_CHECK_PARAMS
396 
397 /*
398  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
399  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
400  * Failure to heed the above warning may result in bricked module.
401  */
402 //#define RADIOLIB_GODMODE
403 
404 /*
405  * Uncomment to enable low-level hardware access
406  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
407  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
408  */
409 //#define RADIOLIB_LOW_LEVEL
410 
411 /*
412  * Uncomment to enable pre-defined modules when using RadioShield.
413  */
414 //#define RADIOLIB_RADIOSHIELD
415 
416 /*
417  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
418  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
419  */
420 //#define RADIOLIB_STATIC_ONLY
421 
422 // set the size of static arrays to use
423 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
424 #define RADIOLIB_STATIC_ARRAY_SIZE 256
425 #endif
426 
430 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != ERR_NONE) { return(STATEVAR); } }
431 
435 #if defined(RADIOLIB_CHECK_PARAMS)
436 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
437 #else
438 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
439 #endif
440 
441 // version definitions
442 #define RADIOLIB_VERSION_MAJOR (0x04)
443 #define RADIOLIB_VERSION_MINOR (0x05)
444 #define RADIOLIB_VERSION_PATCH (0x00)
445 #define RADIOLIB_VERSION_EXTRA (0x00)
446 
447 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
448 
449 #endif