diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index 3a589a60..d6ccf3ba 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -84,7 +84,7 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html','');});
BuildOpt.h
-
1 #ifndef _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 of RadioLib drivers may be excluded, to prevent collisions with platforms (or to speed up build process)
60  // the following is a complete list of all possible exclusion macros, uncomment any of them to disable that driver
61  // NOTE: Some of the exclusion macros are dependent on each other. For example, it is not possible to exclude RF69
62  // while keeping SX1231 (because RF69 is the base class for SX1231). The dependency is always uni-directional,
63  // so excluding SX1231 and keeping RF69 is valid.
64  //#define RADIOLIB_EXCLUDE_CC1101
65  //#define RADIOLIB_EXCLUDE_ESP8266
66  //#define RADIOLIB_EXCLUDE_HC05
67  //#define RADIOLIB_EXCLUDE_JDY08
68  //#define RADIOLIB_EXCLUDE_NRF24
69  //#define RADIOLIB_EXCLUDE_RF69
70  //#define RADIOLIB_EXCLUDE_SX1231 // dependent on RADIOLIB_EXCLUDE_RF69
71  //#define RADIOLIB_EXCLUDE_SI443X
72  //#define RADIOLIB_EXCLUDE_RFM2X // dependent on RADIOLIB_EXCLUDE_SI443X
73  //#define RADIOLIB_EXCLUDE_SX127X
74  //#define RADIOLIB_EXCLUDE_RFM9X // dependent on RADIOLIB_EXCLUDE_SX127X
75  //#define RADIOLIB_EXCLUDE_SX126X
76  //#define RADIOLIB_EXCLUDE_SX128X
77  //#define RADIOLIB_EXCLUDE_XBEE
78  //#define RADIOLIB_EXCLUDE_AFSK
79  //#define RADIOLIB_EXCLUDE_AX25
80  //#define RADIOLIB_EXCLUDE_HELLSCHREIBER
81  //#define RADIOLIB_EXCLUDE_HTTP
82  //#define RADIOLIB_EXCLUDE_MORSE
83  //#define RADIOLIB_EXCLUDE_MQTT
84  //#define RADIOLIB_EXCLUDE_RTTY
85  //#define RADIOLIB_EXCLUDE_SSTV
86 
87 #else
88  #if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
89  // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
90  #define RADIOLIB_PLATFORM "Arduino AVR"
91  #define RADIOLIB_PIN_TYPE uint8_t
92  #define RADIOLIB_PIN_MODE uint8_t
93  #define RADIOLIB_PIN_STATUS uint8_t
94  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
95  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
96  #define RADIOLIB_NC (0xFF)
97  #define RADIOLIB_DEFAULT_SPI SPI
98  #define RADIOLIB_PROGMEM PROGMEM
99  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
100 
101  #elif defined(ESP8266)
102  // ESP8266 boards
103  #define RADIOLIB_PLATFORM "ESP8266"
104  #define RADIOLIB_PIN_TYPE uint8_t
105  #define RADIOLIB_PIN_MODE uint8_t
106  #define RADIOLIB_PIN_STATUS uint8_t
107  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
108  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
109  #define RADIOLIB_NC (0xFF)
110  #define RADIOLIB_DEFAULT_SPI SPI
111  #define RADIOLIB_PROGMEM PROGMEM
112  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
113 
114  // RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform
115  #define RADIOLIB_EXCLUDE_ESP8266
116 
117  #elif defined(ESP32)
118  // ESP32 boards
119  #define RADIOLIB_PLATFORM "ESP32"
120  #define RADIOLIB_PIN_TYPE uint8_t
121  #define RADIOLIB_PIN_MODE uint8_t
122  #define RADIOLIB_PIN_STATUS uint8_t
123  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
124  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
125  #define RADIOLIB_NC (0xFF)
126  #define RADIOLIB_DEFAULT_SPI SPI
127  #define RADIOLIB_PROGMEM PROGMEM
128  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
129  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
130  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
131 
132  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
133  #define RADIOLIB_TONE_UNSUPPORTED
134  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
135 
136  #elif defined(ARDUINO_ARCH_STM32)
137  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
138  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
139  #define RADIOLIB_PIN_TYPE uint32_t
140  #define RADIOLIB_PIN_MODE uint32_t
141  #define RADIOLIB_PIN_STATUS uint32_t
142  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
143  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(digitalPinToPinName(p))
144  #define RADIOLIB_NC (0xFFFFFFFF)
145  #define RADIOLIB_DEFAULT_SPI SPI
146  #define RADIOLIB_PROGMEM PROGMEM
147  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
148  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
149  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
150 
151  #elif defined(SAMD_SERIES)
152  // Adafruit SAMD boards (M0 and M4)
153  #define RADIOLIB_PLATFORM "Adafruit SAMD"
154  #define RADIOLIB_PIN_TYPE uint32_t
155  #define RADIOLIB_PIN_MODE uint32_t
156  #define RADIOLIB_PIN_STATUS uint32_t
157  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
158  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
159  #define RADIOLIB_NC (0xFFFFFFFF)
160  #define RADIOLIB_DEFAULT_SPI SPI
161  #define RADIOLIB_PROGMEM PROGMEM
162  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
163  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
164  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
165 
166  #elif defined(ARDUINO_ARCH_SAMD)
167  // Arduino SAMD (Zero, MKR, etc.)
168  #define RADIOLIB_PLATFORM "Arduino SAMD"
169  #define RADIOLIB_PIN_TYPE pin_size_t
170  #define RADIOLIB_PIN_MODE PinMode
171  #define RADIOLIB_PIN_STATUS PinStatus
172  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
173  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
174  #define RADIOLIB_NC (0xFF)
175  #define RADIOLIB_DEFAULT_SPI SPI
176  #define RADIOLIB_PROGMEM PROGMEM
177  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
178  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
179  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
180 
181  #elif defined(__SAM3X8E__)
182  // Arduino Due
183  #define RADIOLIB_PLATFORM "Arduino Due"
184  #define RADIOLIB_PIN_TYPE uint32_t
185  #define RADIOLIB_PIN_MODE uint32_t
186  #define RADIOLIB_PIN_STATUS uint32_t
187  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
188  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
189  #define RADIOLIB_NC (0xFFFFFFFF)
190  #define RADIOLIB_DEFAULT_SPI SPI
191  #define RADIOLIB_PROGMEM PROGMEM
192  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
193  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
194  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
195  #define RADIOLIB_TONE_UNSUPPORTED
196 
197  #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
198  // Adafruit nRF52 boards
199  #define RADIOLIB_PLATFORM "Adafruit nRF52"
200  #define RADIOLIB_PIN_TYPE uint32_t
201  #define RADIOLIB_PIN_MODE uint32_t
202  #define RADIOLIB_PIN_STATUS uint32_t
203  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
204  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
205  #define RADIOLIB_NC (0xFFFFFFFF)
206  #define RADIOLIB_DEFAULT_SPI SPI
207  #define RADIOLIB_PROGMEM PROGMEM
208  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
209 
210  #elif defined(ARDUINO_ARC32_TOOLS)
211  // Intel Curie
212  #define RADIOLIB_PLATFORM "Intel Curie"
213  #define RADIOLIB_PIN_TYPE uint8_t
214  #define RADIOLIB_PIN_MODE uint8_t
215  #define RADIOLIB_PIN_STATUS uint8_t
216  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
217  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
218  #define RADIOLIB_NC (0xFF)
219  #define RADIOLIB_DEFAULT_SPI SPI
220  #define RADIOLIB_PROGMEM PROGMEM
221  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
222 
223  #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)
224  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
225  #define RADIOLIB_PLATFORM "Arduino megaAVR"
226  #define RADIOLIB_PIN_TYPE uint8_t
227  #define RADIOLIB_PIN_MODE PinMode
228  #define RADIOLIB_PIN_STATUS PinStatus
229  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
230  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
231  #define RADIOLIB_NC (0xFF)
232  #define RADIOLIB_DEFAULT_SPI SPI
233  #define RADIOLIB_PROGMEM PROGMEM
234  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
235 
236  #elif defined(AM_PART_APOLLO3)
237  // Sparkfun Artemis boards
238  #define RADIOLIB_PLATFORM "Sparkfun Artemis"
239  #define RADIOLIB_PIN_TYPE uint8_t
240  #define RADIOLIB_PIN_MODE uint8_t
241  #define RADIOLIB_PIN_STATUS uint8_t
242  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
243  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
244  #define RADIOLIB_NC (0xFF)
245  #define RADIOLIB_DEFAULT_SPI SPI
246  #define RADIOLIB_PROGMEM PROGMEM
247  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
248  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
249  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
250 
251  #elif defined(ARDUINO_ARDUINO_NANO33BLE)
252  // Arduino Nano 33 BLE
253  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
254  #define RADIOLIB_PIN_TYPE pin_size_t
255  #define RADIOLIB_PIN_MODE PinMode
256  #define RADIOLIB_PIN_STATUS PinStatus
257  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
258  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
259  #define RADIOLIB_NC (0xFF)
260  #define RADIOLIB_DEFAULT_SPI SPI
261  #define RADIOLIB_PROGMEM PROGMEM
262  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
263  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
264  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
265 
266  // Nano 33 BLE uses mbed libraries, which already contain ESP8266 driver
267  #define RADIOLIB_EXCLUDE_ESP8266
268 
269  #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
270  // Arduino Portenta H7
271  #define RADIOLIB_PLATFORM "Portenta H7"
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  // Arduino Portenta H7 uses mbed libraries, which already contain ESP8266 driver
285  #define RADIOLIB_EXCLUDE_ESP8266
286 
287  #elif defined(__STM32F4__) || defined(__STM32F1__)
288  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
289  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
290  #define RADIOLIB_PIN_TYPE uint8_t
291  #define RADIOLIB_PIN_MODE WiringPinMode
292  #define RADIOLIB_PIN_STATUS uint8_t
293  #define RADIOLIB_INTERRUPT_STATUS ExtIntTriggerMode
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  #elif defined(ARDUINO_ARCH_MEGAAVR)
303  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
304  #define RADIOLIB_PLATFORM "MegaCoreX"
305  #define RADIOLIB_PIN_TYPE uint8_t
306  #define RADIOLIB_PIN_MODE uint8_t
307  #define RADIOLIB_PIN_STATUS uint8_t
308  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
309  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
310  #define RADIOLIB_NC (0xFF)
311  #define RADIOLIB_DEFAULT_SPI SPI
312  #define RADIOLIB_PROGMEM PROGMEM
313  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
314 
315  #else
316  // other platforms not covered by the above list - this may or may not work
317  #define RADIOLIB_PLATFORM "Unknown"
318  #define RADIOLIB_UNKNOWN_PLATFORM
319  #define RADIOLIB_PIN_TYPE uint8_t
320  #define RADIOLIB_PIN_MODE uint8_t
321  #define RADIOLIB_PIN_STATUS uint8_t
322  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
323  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
324  #define RADIOLIB_NC (0xFF)
325  #define RADIOLIB_DEFAULT_SPI SPI
326  #define RADIOLIB_PROGMEM PROGMEM
327  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
328 
329  #endif
330 #endif
331 
332 /*
333  * Uncomment to enable debug output.
334  * Warning: Debug output will slow down the whole system significantly.
335  * Also, it will result in larger compiled binary.
336  * Levels: debug - only main info
337  * verbose - full transcript of all SPI/UART communication
338  */
339 
340 //#define RADIOLIB_DEBUG
341 //#define RADIOLIB_VERBOSE
342 
343 // set which Serial port should be used for debug output
344 #define RADIOLIB_DEBUG_PORT Serial
345 
346 #if defined(RADIOLIB_DEBUG)
347  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
348  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
349 #else
350  #define RADIOLIB_DEBUG_PRINT(...) {}
351  #define RADIOLIB_DEBUG_PRINTLN(...) {}
352 #endif
353 
354 #if defined(RADIOLIB_VERBOSE)
355  #define RADIOLIB_VERBOSE_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
356  #define RADIOLIB_VERBOSE_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
357 #else
358  #define RADIOLIB_VERBOSE_PRINT(...) {}
359  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
360 #endif
361 
362 /*
363  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
364  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
365  * Failure to heed the above warning may result in bricked module.
366  */
367 //#define RADIOLIB_GODMODE
368 
369 /*
370  * Uncomment to enable pre-defined modules when using RadioShield.
371  */
372 //#define RADIOLIB_RADIOSHIELD
373 
374 /*
375  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
376  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
377  */
378 
379 //#define RADIOLIB_STATIC_ONLY
380 
381 // set the size of static arrays to use
382 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
383 #define RADIOLIB_STATIC_ARRAY_SIZE 256
384 #endif
385 
389 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != ERR_NONE) { return(STATEVAR); } }
390 
394 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
395 
396 // version definitions
397 #define RADIOLIB_VERSION_MAJOR (0x04)
398 #define RADIOLIB_VERSION_MINOR (0x01)
399 #define RADIOLIB_VERSION_PATCH (0x00)
400 #define RADIOLIB_VERSION_EXTRA (0x00)
401 
402 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
403 
404 #endif
+
1 #ifndef _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 of RadioLib drivers may be excluded, to prevent collisions with platforms (or to speed up build process)
60  // the following is a complete list of all possible exclusion macros, uncomment any of them to disable that driver
61  // NOTE: Some of the exclusion macros are dependent on each other. For example, it is not possible to exclude RF69
62  // while keeping SX1231 (because RF69 is the base class for SX1231). The dependency is always uni-directional,
63  // so excluding SX1231 and keeping RF69 is valid.
64  //#define RADIOLIB_EXCLUDE_CC1101
65  //#define RADIOLIB_EXCLUDE_ESP8266
66  //#define RADIOLIB_EXCLUDE_HC05
67  //#define RADIOLIB_EXCLUDE_JDY08
68  //#define RADIOLIB_EXCLUDE_NRF24
69  //#define RADIOLIB_EXCLUDE_RF69
70  //#define RADIOLIB_EXCLUDE_SX1231 // dependent on RADIOLIB_EXCLUDE_RF69
71  //#define RADIOLIB_EXCLUDE_SI443X
72  //#define RADIOLIB_EXCLUDE_RFM2X // dependent on RADIOLIB_EXCLUDE_SI443X
73  //#define RADIOLIB_EXCLUDE_SX127X
74  //#define RADIOLIB_EXCLUDE_RFM9X // dependent on RADIOLIB_EXCLUDE_SX127X
75  //#define RADIOLIB_EXCLUDE_SX126X
76  //#define RADIOLIB_EXCLUDE_SX128X
77  //#define RADIOLIB_EXCLUDE_XBEE
78  //#define RADIOLIB_EXCLUDE_AFSK
79  //#define RADIOLIB_EXCLUDE_AX25
80  //#define RADIOLIB_EXCLUDE_HELLSCHREIBER
81  //#define RADIOLIB_EXCLUDE_HTTP
82  //#define RADIOLIB_EXCLUDE_MORSE
83  //#define RADIOLIB_EXCLUDE_MQTT
84  //#define RADIOLIB_EXCLUDE_RTTY
85  //#define RADIOLIB_EXCLUDE_SSTV
86 
87 #else
88  #if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
89  // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
90  #define RADIOLIB_PLATFORM "Arduino AVR"
91  #define RADIOLIB_PIN_TYPE uint8_t
92  #define RADIOLIB_PIN_MODE uint8_t
93  #define RADIOLIB_PIN_STATUS uint8_t
94  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
95  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
96  #define RADIOLIB_NC (0xFF)
97  #define RADIOLIB_DEFAULT_SPI SPI
98  #define RADIOLIB_PROGMEM PROGMEM
99  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
100 
101  #elif defined(ESP8266)
102  // ESP8266 boards
103  #define RADIOLIB_PLATFORM "ESP8266"
104  #define RADIOLIB_PIN_TYPE uint8_t
105  #define RADIOLIB_PIN_MODE uint8_t
106  #define RADIOLIB_PIN_STATUS uint8_t
107  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
108  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
109  #define RADIOLIB_NC (0xFF)
110  #define RADIOLIB_DEFAULT_SPI SPI
111  #define RADIOLIB_PROGMEM PROGMEM
112  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
113 
114  // RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform
115  #define RADIOLIB_EXCLUDE_ESP8266
116 
117  #elif defined(ESP32)
118  // ESP32 boards
119  #define RADIOLIB_PLATFORM "ESP32"
120  #define RADIOLIB_PIN_TYPE uint8_t
121  #define RADIOLIB_PIN_MODE uint8_t
122  #define RADIOLIB_PIN_STATUS uint8_t
123  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
124  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
125  #define RADIOLIB_NC (0xFF)
126  #define RADIOLIB_DEFAULT_SPI SPI
127  #define RADIOLIB_PROGMEM PROGMEM
128  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
129  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
130  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
131 
132  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
133  #define RADIOLIB_TONE_UNSUPPORTED
134  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
135 
136  #elif defined(ARDUINO_ARCH_STM32)
137  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
138  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
139  #define RADIOLIB_PIN_TYPE uint32_t
140  #define RADIOLIB_PIN_MODE uint32_t
141  #define RADIOLIB_PIN_STATUS uint32_t
142  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
143  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(digitalPinToPinName(p))
144  #define RADIOLIB_NC (0xFFFFFFFF)
145  #define RADIOLIB_DEFAULT_SPI SPI
146  #define RADIOLIB_PROGMEM PROGMEM
147  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
148  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
149  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
150 
151  #elif defined(SAMD_SERIES)
152  // Adafruit SAMD boards (M0 and M4)
153  #define RADIOLIB_PLATFORM "Adafruit SAMD"
154  #define RADIOLIB_PIN_TYPE uint32_t
155  #define RADIOLIB_PIN_MODE uint32_t
156  #define RADIOLIB_PIN_STATUS uint32_t
157  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
158  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
159  #define RADIOLIB_NC (0xFFFFFFFF)
160  #define RADIOLIB_DEFAULT_SPI SPI
161  #define RADIOLIB_PROGMEM PROGMEM
162  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
163  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
164  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
165 
166  #elif defined(ARDUINO_ARCH_SAMD)
167  // Arduino SAMD (Zero, MKR, etc.)
168  #define RADIOLIB_PLATFORM "Arduino SAMD"
169  #define RADIOLIB_PIN_TYPE pin_size_t
170  #define RADIOLIB_PIN_MODE PinMode
171  #define RADIOLIB_PIN_STATUS PinStatus
172  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
173  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
174  #define RADIOLIB_NC (0xFF)
175  #define RADIOLIB_DEFAULT_SPI SPI
176  #define RADIOLIB_PROGMEM PROGMEM
177  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
178  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
179  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
180 
181  #elif defined(__SAM3X8E__)
182  // Arduino Due
183  #define RADIOLIB_PLATFORM "Arduino Due"
184  #define RADIOLIB_PIN_TYPE uint32_t
185  #define RADIOLIB_PIN_MODE uint32_t
186  #define RADIOLIB_PIN_STATUS uint32_t
187  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
188  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
189  #define RADIOLIB_NC (0xFFFFFFFF)
190  #define RADIOLIB_DEFAULT_SPI SPI
191  #define RADIOLIB_PROGMEM PROGMEM
192  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
193  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
194  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
195  #define RADIOLIB_TONE_UNSUPPORTED
196 
197  #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
198  // Adafruit nRF52 boards
199  #define RADIOLIB_PLATFORM "Adafruit nRF52"
200  #define RADIOLIB_PIN_TYPE uint32_t
201  #define RADIOLIB_PIN_MODE uint32_t
202  #define RADIOLIB_PIN_STATUS uint32_t
203  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
204  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
205  #define RADIOLIB_NC (0xFFFFFFFF)
206  #define RADIOLIB_DEFAULT_SPI SPI
207  #define RADIOLIB_PROGMEM PROGMEM
208  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
209 
210  #elif defined(ARDUINO_ARC32_TOOLS)
211  // Intel Curie
212  #define RADIOLIB_PLATFORM "Intel Curie"
213  #define RADIOLIB_PIN_TYPE uint8_t
214  #define RADIOLIB_PIN_MODE uint8_t
215  #define RADIOLIB_PIN_STATUS uint8_t
216  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
217  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
218  #define RADIOLIB_NC (0xFF)
219  #define RADIOLIB_DEFAULT_SPI SPI
220  #define RADIOLIB_PROGMEM PROGMEM
221  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
222 
223  #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)
224  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
225  #define RADIOLIB_PLATFORM "Arduino megaAVR"
226  #define RADIOLIB_PIN_TYPE uint8_t
227  #define RADIOLIB_PIN_MODE PinMode
228  #define RADIOLIB_PIN_STATUS PinStatus
229  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
230  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
231  #define RADIOLIB_NC (0xFF)
232  #define RADIOLIB_DEFAULT_SPI SPI
233  #define RADIOLIB_PROGMEM PROGMEM
234  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
235 
236  #elif defined(ARDUINO_ARCH_APOLLO3)
237  // Sparkfun Apollo3 boards
238  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
239  #define RADIOLIB_PIN_TYPE pin_size_t
240  #define RADIOLIB_PIN_MODE Arduino_PinMode
241  #define RADIOLIB_PIN_STATUS PinStatus
242  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
243  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
244  #define RADIOLIB_NC (0xFF)
245  #define RADIOLIB_DEFAULT_SPI SPI
246  #define RADIOLIB_PROGMEM PROGMEM
247  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
248  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
249  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
250 
251  // Apollo3 uses mbed libraries, which already contain ESP8266 driver
252  #define RADIOLIB_EXCLUDE_ESP8266
253 
254  #elif defined(ARDUINO_ARDUINO_NANO33BLE)
255  // Arduino Nano 33 BLE
256  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
257  #define RADIOLIB_PIN_TYPE pin_size_t
258  #define RADIOLIB_PIN_MODE PinMode
259  #define RADIOLIB_PIN_STATUS PinStatus
260  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
261  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
262  #define RADIOLIB_NC (0xFF)
263  #define RADIOLIB_DEFAULT_SPI SPI
264  #define RADIOLIB_PROGMEM PROGMEM
265  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
266  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
267  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
268 
269  // Nano 33 BLE uses mbed libraries, which already contain ESP8266 driver
270  #define RADIOLIB_EXCLUDE_ESP8266
271 
272  #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
273  // Arduino Portenta H7
274  #define RADIOLIB_PLATFORM "Portenta H7"
275  #define RADIOLIB_PIN_TYPE pin_size_t
276  #define RADIOLIB_PIN_MODE PinMode
277  #define RADIOLIB_PIN_STATUS PinStatus
278  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
279  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
280  #define RADIOLIB_NC (0xFF)
281  #define RADIOLIB_DEFAULT_SPI SPI
282  #define RADIOLIB_PROGMEM PROGMEM
283  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
284  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
285  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
286 
287  // Arduino Portenta H7 uses mbed libraries, which already contain ESP8266 driver
288  #define RADIOLIB_EXCLUDE_ESP8266
289 
290  #elif defined(__STM32F4__) || defined(__STM32F1__)
291  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
292  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
293  #define RADIOLIB_PIN_TYPE uint8_t
294  #define RADIOLIB_PIN_MODE WiringPinMode
295  #define RADIOLIB_PIN_STATUS uint8_t
296  #define RADIOLIB_INTERRUPT_STATUS ExtIntTriggerMode
297  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
298  #define RADIOLIB_NC (0xFF)
299  #define RADIOLIB_DEFAULT_SPI SPI
300  #define RADIOLIB_PROGMEM PROGMEM
301  #define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
302  #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
303  #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
304 
305  #elif defined(ARDUINO_ARCH_MEGAAVR)
306  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
307  #define RADIOLIB_PLATFORM "MegaCoreX"
308  #define RADIOLIB_PIN_TYPE uint8_t
309  #define RADIOLIB_PIN_MODE uint8_t
310  #define RADIOLIB_PIN_STATUS uint8_t
311  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
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 
318  #else
319  // other platforms not covered by the above list - this may or may not work
320  #define RADIOLIB_PLATFORM "Unknown"
321  #define RADIOLIB_UNKNOWN_PLATFORM
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  #endif
333 #endif
334 
335 /*
336  * Uncomment to enable debug output.
337  * Warning: Debug output will slow down the whole system significantly.
338  * Also, it will result in larger compiled binary.
339  * Levels: debug - only main info
340  * verbose - full transcript of all SPI/UART communication
341  */
342 
343 //#define RADIOLIB_DEBUG
344 //#define RADIOLIB_VERBOSE
345 
346 // set which Serial port should be used for debug output
347 #define RADIOLIB_DEBUG_PORT Serial
348 
349 #if defined(RADIOLIB_DEBUG)
350  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
351  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
352 #else
353  #define RADIOLIB_DEBUG_PRINT(...) {}
354  #define RADIOLIB_DEBUG_PRINTLN(...) {}
355 #endif
356 
357 #if defined(RADIOLIB_VERBOSE)
358  #define RADIOLIB_VERBOSE_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
359  #define RADIOLIB_VERBOSE_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
360 #else
361  #define RADIOLIB_VERBOSE_PRINT(...) {}
362  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
363 #endif
364 
365 /*
366  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
367  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
368  * Failure to heed the above warning may result in bricked module.
369  */
370 //#define RADIOLIB_GODMODE
371 
372 /*
373  * Uncomment to enable pre-defined modules when using RadioShield.
374  */
375 //#define RADIOLIB_RADIOSHIELD
376 
377 /*
378  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
379  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
380  */
381 
382 //#define RADIOLIB_STATIC_ONLY
383 
384 // set the size of static arrays to use
385 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
386 #define RADIOLIB_STATIC_ARRAY_SIZE 256
387 #endif
388 
392 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != ERR_NONE) { return(STATEVAR); } }
393 
397 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
398 
399 // version definitions
400 #define RADIOLIB_VERSION_MAJOR (0x04)
401 #define RADIOLIB_VERSION_MINOR (0x01)
402 #define RADIOLIB_VERSION_PATCH (0x00)
403 #define RADIOLIB_VERSION_EXTRA (0x00)
404 
405 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
406 
407 #endif