diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index 15a86185..1c61abf2 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -110,555 +110,567 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
22 #if !defined(RADIOLIB_DEBUG_SPI)
23  #define RADIOLIB_DEBUG_SPI (0)
24 #endif
-
25 
-
26 // set which output port should be used for debug output
-
27 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
-
28 #if !defined(RADIOLIB_DEBUG_PORT)
-
29  #define RADIOLIB_DEBUG_PORT Serial
-
30 #endif
-
31 
-
32 /*
-
33  * Comment to disable "paranoid" SPI mode, or set RADIOLIB_SPI_PARANOID to 0
-
34  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
-
35  * This improves reliability, but slightly slows down communication.
-
36  * Note: Enabled by default.
-
37  */
-
38 #if !defined(RADIOLIB_SPI_PARANOID)
-
39  #define RADIOLIB_SPI_PARANOID (1)
-
40 #endif
-
41 
-
42 /*
-
43  * Comment to disable parameter range checking
-
44  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
-
45  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
-
46  * possibly leading to bricked module and/or program crashing.
-
47  * Note: Enabled by default.
-
48  */
-
49 #if !defined(RADIOLIB_CHECK_PARAMS)
-
50  #define RADIOLIB_CHECK_PARAMS (1)
-
51 #endif
-
52 
-
53 /*
-
54  * SX127x errata fix enable
-
55  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
-
56  * It should only be enabled if you really are observing some errata-related issue.
-
57  * Note: Disabled by default.
-
58  */
-
59 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
-
60  #define RADIOLIB_FIX_ERRATA_SX127X (0)
-
61 #endif
-
62 
-
63 /*
-
64  * God mode enable - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
-
65  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
-
66  * Failure to heed the above warning may result in bricked module.
-
67  */
-
68 #if !defined(RADIOLIB_GODMODE)
-
69  #define RADIOLIB_GODMODE (0)
-
70 #endif
-
71 
-
72 /*
-
73  * Low-level hardware access enable
-
74  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
-
75  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
-
76  */
-
77 #if !defined(RADIOLIB_LOW_LEVEL)
-
78  #define RADIOLIB_LOW_LEVEL (0)
-
79 #endif
-
80 
-
81 /*
-
82  * Enable pre-defined modules when using RadioShield, disabled by default.
-
83  */
-
84 #if !defined(RADIOLIB_RADIOSHIELD)
-
85  #define RADIOLIB_RADIOSHIELD (0)
-
86 #endif
-
87 
-
88 /*
-
89  * Enable interrupt-based timing control
-
90  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
-
91  */
-
92 #if !defined(RADIOLIB_INTERRUPT_TIMING)
-
93  #define RADIOLIB_INTERRUPT_TIMING (0)
-
94 #endif
-
95 
-
96 /*
-
97  * Enable static-only memory management: no dynamic allocation will be performed.
-
98  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
-
99  */
-
100 #if !defined(RADIOLIB_STATIC_ONLY)
-
101  #define RADIOLIB_STATIC_ONLY (0)
-
102 #endif
-
103 
-
104 // set the size of static arrays to use
-
105 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
-
106  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
-
107 #endif
-
108 
-
109 /*
-
110  * Uncomment on boards whose clock runs too slow or too fast
-
111  * Set the value according to the following scheme:
-
112  * Enable timestamps on your terminal
-
113  * Print something to terminal, wait 1000 milliseconds, print something again
-
114  * If the difference is e.g. 1014 milliseconds between the prints, set this value to 14
-
115  * Or, for more accuracy, wait for 100,000 milliseconds and divide the total drift by 100
-
116  */
-
117 #if !defined(RADIOLIB_CLOCK_DRIFT_MS)
-
118  //#define RADIOLIB_CLOCK_DRIFT_MS (0)
-
119 #endif
-
120 
-
121 #if ARDUINO >= 100
-
122  // Arduino build
-
123  #include "Arduino.h"
-
124  #define RADIOLIB_BUILD_ARDUINO
-
125 #else
-
126  // generic build
-
127  #include <stdio.h>
-
128  #define RADIOLIB_BUILD_GENERIC
-
129 #endif
-
130 
-
131 #if defined(RADIOLIB_BUILD_ARDUINO)
-
132 /*
-
133  * Platform-specific configuration.
-
134  *
-
135  * RADIOLIB_PLATFORM - platform name, used in debugging to quickly check the correct platform is detected.
-
136  * RADIOLIB_NC - alias for unused pin, usually the largest possible value of uint8_t.
-
137  * RADIOLIB_DEFAULT_SPI - default SPIClass instance to use.
-
138  * RADIOLIB_NONVOLATILE - macro to place variable into program storage (usually Flash).
-
139  * RADIOLIB_NONVOLATILE_READ_BYTE - function/macro to read variables saved in program storage (usually Flash).
-
140  * RADIOLIB_TYPE_ALIAS - construct to create an alias for a type, usually vai the `using` keyword.
-
141  * RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK.
-
142  * RADIOLIB_BUILTIN_MODULE - some platforms have a builtin radio module on fixed pins, this macro is used to specify that pinout.
-
143  *
-
144  * In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266).
-
145  *
-
146  * Users may also specify their own configuration by uncommenting the RADIOLIB_CUSTOM_ARDUINO,
-
147  * and then specifying all platform parameters in the section below. This will override automatic
-
148  * platform detection.
-
149  */
-
150 
-
151  // uncomment to enable custom platform definition
-
152  //#define RADIOLIB_CUSTOM_ARDUINO
+
25 #if !defined(RADIOLIB_VERBOSE_ASSERT)
+
26  #define RADIOLIB_VERBOSE_ASSERT (0)
+
27 #endif
+
28 
+
29 // set which output port should be used for debug output
+
30 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
+
31 #if !defined(RADIOLIB_DEBUG_PORT)
+
32  #define RADIOLIB_DEBUG_PORT Serial
+
33 #endif
+
34 
+
35 /*
+
36  * Comment to disable "paranoid" SPI mode, or set RADIOLIB_SPI_PARANOID to 0
+
37  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
+
38  * This improves reliability, but slightly slows down communication.
+
39  * Note: Enabled by default.
+
40  */
+
41 #if !defined(RADIOLIB_SPI_PARANOID)
+
42  #define RADIOLIB_SPI_PARANOID (1)
+
43 #endif
+
44 
+
45 /*
+
46  * Comment to disable parameter range checking
+
47  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
+
48  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
+
49  * possibly leading to bricked module and/or program crashing.
+
50  * Note: Enabled by default.
+
51  */
+
52 #if !defined(RADIOLIB_CHECK_PARAMS)
+
53  #define RADIOLIB_CHECK_PARAMS (1)
+
54 #endif
+
55 
+
56 /*
+
57  * SX127x errata fix enable
+
58  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
+
59  * It should only be enabled if you really are observing some errata-related issue.
+
60  * Note: Disabled by default.
+
61  */
+
62 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
+
63  #define RADIOLIB_FIX_ERRATA_SX127X (0)
+
64 #endif
+
65 
+
66 /*
+
67  * God mode enable - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
+
68  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
+
69  * Failure to heed the above warning may result in bricked module.
+
70  */
+
71 #if !defined(RADIOLIB_GODMODE)
+
72  #define RADIOLIB_GODMODE (0)
+
73 #endif
+
74 
+
75 /*
+
76  * Low-level hardware access enable
+
77  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
+
78  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
+
79  */
+
80 #if !defined(RADIOLIB_LOW_LEVEL)
+
81  #define RADIOLIB_LOW_LEVEL (0)
+
82 #endif
+
83 
+
84 /*
+
85  * Enable pre-defined modules when using RadioShield, disabled by default.
+
86  */
+
87 #if !defined(RADIOLIB_RADIOSHIELD)
+
88  #define RADIOLIB_RADIOSHIELD (0)
+
89 #endif
+
90 
+
91 /*
+
92  * Enable interrupt-based timing control
+
93  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
+
94  */
+
95 #if !defined(RADIOLIB_INTERRUPT_TIMING)
+
96  #define RADIOLIB_INTERRUPT_TIMING (0)
+
97 #endif
+
98 
+
99 /*
+
100  * Enable static-only memory management: no dynamic allocation will be performed.
+
101  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
102  */
+
103 #if !defined(RADIOLIB_STATIC_ONLY)
+
104  #define RADIOLIB_STATIC_ONLY (0)
+
105 #endif
+
106 
+
107 // set the size of static arrays to use
+
108 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
+
109  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
+
110 #endif
+
111 
+
112 /*
+
113  * Uncomment on boards whose clock runs too slow or too fast
+
114  * Set the value according to the following scheme:
+
115  * Enable timestamps on your terminal
+
116  * Print something to terminal, wait 1000 milliseconds, print something again
+
117  * If the difference is e.g. 1014 milliseconds between the prints, set this value to 14
+
118  * Or, for more accuracy, wait for 100,000 milliseconds and divide the total drift by 100
+
119  */
+
120 #if !defined(RADIOLIB_CLOCK_DRIFT_MS)
+
121  //#define RADIOLIB_CLOCK_DRIFT_MS (0)
+
122 #endif
+
123 
+
124 #if ARDUINO >= 100
+
125  // Arduino build
+
126  #include "Arduino.h"
+
127  #define RADIOLIB_BUILD_ARDUINO
+
128 #else
+
129  // generic build
+
130  #include <stdio.h>
+
131  #define RADIOLIB_BUILD_GENERIC
+
132 #endif
+
133 
+
134 #if defined(RADIOLIB_BUILD_ARDUINO)
+
135 /*
+
136  * Platform-specific configuration.
+
137  *
+
138  * RADIOLIB_PLATFORM - platform name, used in debugging to quickly check the correct platform is detected.
+
139  * RADIOLIB_NC - alias for unused pin, usually the largest possible value of uint8_t.
+
140  * RADIOLIB_DEFAULT_SPI - default SPIClass instance to use.
+
141  * RADIOLIB_NONVOLATILE - macro to place variable into program storage (usually Flash).
+
142  * RADIOLIB_NONVOLATILE_READ_BYTE - function/macro to read variables saved in program storage (usually Flash).
+
143  * RADIOLIB_TYPE_ALIAS - construct to create an alias for a type, usually vai the `using` keyword.
+
144  * RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK.
+
145  * RADIOLIB_BUILTIN_MODULE - some platforms have a builtin radio module on fixed pins, this macro is used to specify that pinout.
+
146  *
+
147  * In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266).
+
148  *
+
149  * Users may also specify their own configuration by uncommenting the RADIOLIB_CUSTOM_ARDUINO,
+
150  * and then specifying all platform parameters in the section below. This will override automatic
+
151  * platform detection.
+
152  */
153 
-
154 #if defined(RADIOLIB_CUSTOM_ARDUINO)
-
155  // name for your platform
-
156  #define RADIOLIB_PLATFORM "Custom"
-
157 
-
158  // the following must be defined if the Arduino core does not support tone or yield function
-
159  //#define RADIOLIB_TONE_UNSUPPORTED
-
160  //#define RADIOLIB_YIELD_UNSUPPORTED
-
161 
-
162  // in addition, the following macros may be defined if the Arduino core differs from the defaults
-
163  #define RADIOLIB_NC (0xFFFFFFFF)
-
164  #define RADIOLIB_DEFAULT_SPI SPI
-
165  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
166  #define RADIOLIB_NONVOLATILE PROGMEM
-
167  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
168  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
-
169  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
170 
-
171  // you might also have to define these if the Arduino core has some uncommon pin mode/status types
-
172  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
-
173  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
-
174  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
-
175 
-
176  // some of RadioLib drivers may be excluded, to prevent collisions with platforms (or to speed up build process)
-
177  // the following is a complete list of all possible exclusion macros, uncomment any of them to disable that driver
-
178  // NOTE: Some of the exclusion macros are dependent on each other. For example, it is not possible to exclude RF69
-
179  // while keeping SX1231 (because RF69 is the base class for SX1231). The dependency is always uni-directional,
-
180  // so excluding SX1231 and keeping RF69 is valid.
-
181  //#define RADIOLIB_EXCLUDE_CC1101 (1)
-
182  //#define RADIOLIB_EXCLUDE_NRF24 (1)
-
183  //#define RADIOLIB_EXCLUDE_RF69 (1)
-
184  //#define RADIOLIB_EXCLUDE_SX1231 (1) // dependent on RADIOLIB_EXCLUDE_RF69
-
185  //#define RADIOLIB_EXCLUDE_SI443X (1)
-
186  //#define RADIOLIB_EXCLUDE_RFM2X (1) // dependent on RADIOLIB_EXCLUDE_SI443X
-
187  //#define RADIOLIB_EXCLUDE_SX127X (1)
-
188  //#define RADIOLIB_EXCLUDE_SX126X (1)
-
189  //#define RADIOLIB_EXCLUDE_STM32WLX (1) // dependent on RADIOLIB_EXCLUDE_SX126X
-
190  //#define RADIOLIB_EXCLUDE_SX128X (1)
-
191  //#define RADIOLIB_EXCLUDE_AFSK (1)
-
192  //#define RADIOLIB_EXCLUDE_AX25 (1)
-
193  //#define RADIOLIB_EXCLUDE_HELLSCHREIBER (1)
-
194  //#define RADIOLIB_EXCLUDE_MORSE (1)
-
195  //#define RADIOLIB_EXCLUDE_RTTY (1)
-
196  //#define RADIOLIB_EXCLUDE_SSTV (1)
-
197  //#define RADIOLIB_EXCLUDE_DIRECT_RECEIVE (1)
-
198 
-
199 #elif defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
-
200  // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
-
201  #define RADIOLIB_PLATFORM "Arduino AVR"
-
202 
-
203  #if !(defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
204  #define RADIOLIB_LOWEND_PLATFORM
-
205  #endif
-
206 
-
207 #elif defined(ESP8266)
-
208  // ESP8266 boards
-
209  #define RADIOLIB_PLATFORM "ESP8266"
-
210 
-
211 #elif defined(ESP32) || defined(ARDUINO_ARCH_ESP32)
-
212  #define RADIOLIB_ESP32
+
154  // uncomment to enable custom platform definition
+
155  //#define RADIOLIB_CUSTOM_ARDUINO
+
156 
+
157 #if defined(RADIOLIB_CUSTOM_ARDUINO)
+
158  // name for your platform
+
159  #define RADIOLIB_PLATFORM "Custom"
+
160 
+
161  // the following must be defined if the Arduino core does not support tone or yield function
+
162  //#define RADIOLIB_TONE_UNSUPPORTED
+
163  //#define RADIOLIB_YIELD_UNSUPPORTED
+
164 
+
165  // in addition, the following macros may be defined if the Arduino core differs from the defaults
+
166  #define RADIOLIB_NC (0xFFFFFFFF)
+
167  #define RADIOLIB_DEFAULT_SPI SPI
+
168  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
169  #define RADIOLIB_NONVOLATILE PROGMEM
+
170  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
171  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
+
172  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
173 
+
174  // you might also have to define these if the Arduino core has some uncommon pin mode/status types
+
175  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
+
176  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
+
177  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
+
178 
+
179  // some of RadioLib drivers may be excluded, to prevent collisions with platforms (or to speed up build process)
+
180  // the following is a complete list of all possible exclusion macros, uncomment any of them to disable that driver
+
181  // NOTE: Some of the exclusion macros are dependent on each other. For example, it is not possible to exclude RF69
+
182  // while keeping SX1231 (because RF69 is the base class for SX1231). The dependency is always uni-directional,
+
183  // so excluding SX1231 and keeping RF69 is valid.
+
184  //#define RADIOLIB_EXCLUDE_CC1101 (1)
+
185  //#define RADIOLIB_EXCLUDE_NRF24 (1)
+
186  //#define RADIOLIB_EXCLUDE_RF69 (1)
+
187  //#define RADIOLIB_EXCLUDE_SX1231 (1) // dependent on RADIOLIB_EXCLUDE_RF69
+
188  //#define RADIOLIB_EXCLUDE_SI443X (1)
+
189  //#define RADIOLIB_EXCLUDE_RFM2X (1) // dependent on RADIOLIB_EXCLUDE_SI443X
+
190  //#define RADIOLIB_EXCLUDE_SX127X (1)
+
191  //#define RADIOLIB_EXCLUDE_SX126X (1)
+
192  //#define RADIOLIB_EXCLUDE_STM32WLX (1) // dependent on RADIOLIB_EXCLUDE_SX126X
+
193  //#define RADIOLIB_EXCLUDE_SX128X (1)
+
194  //#define RADIOLIB_EXCLUDE_AFSK (1)
+
195  //#define RADIOLIB_EXCLUDE_AX25 (1)
+
196  //#define RADIOLIB_EXCLUDE_HELLSCHREIBER (1)
+
197  //#define RADIOLIB_EXCLUDE_MORSE (1)
+
198  //#define RADIOLIB_EXCLUDE_RTTY (1)
+
199  //#define RADIOLIB_EXCLUDE_SSTV (1)
+
200  //#define RADIOLIB_EXCLUDE_DIRECT_RECEIVE (1)
+
201 
+
202 #elif defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
+
203  // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
+
204  #define RADIOLIB_PLATFORM "Arduino AVR"
+
205 
+
206  #if !(defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
+
207  #define RADIOLIB_LOWEND_PLATFORM
+
208  #endif
+
209 
+
210 #elif defined(ESP8266)
+
211  // ESP8266 boards
+
212  #define RADIOLIB_PLATFORM "ESP8266"
213 
-
214  // ESP32 boards
-
215  #define RADIOLIB_PLATFORM "ESP32"
-
216 
-
217  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
-
218  #define RADIOLIB_TONE_UNSUPPORTED
-
219  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
-
220 
-
221 #elif defined(ARDUINO_ARCH_STM32)
-
222  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
-
223  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
-
224 
-
225 #elif defined(SAMD_SERIES)
-
226  // Adafruit SAMD boards (M0 and M4)
-
227  #define RADIOLIB_PLATFORM "Adafruit SAMD"
-
228 
-
229 #elif defined(ARDUINO_ARCH_SAMD)
-
230  // Arduino SAMD (Zero, MKR, etc.)
-
231  #define RADIOLIB_PLATFORM "Arduino SAMD"
-
232  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
233  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
234  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
235 
-
236 #elif defined(__SAM3X8E__)
-
237  // Arduino Due
-
238  #define RADIOLIB_PLATFORM "Arduino Due"
-
239  #define RADIOLIB_TONE_UNSUPPORTED
-
240 
-
241 #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
-
242  // Adafruit nRF52 boards
-
243  #define RADIOLIB_PLATFORM "Adafruit nRF52"
-
244 
-
245 #elif defined(ARDUINO_ARC32_TOOLS)
-
246  // Intel Curie
-
247  #define RADIOLIB_PLATFORM "Intel Curie"
-
248 
-
249 #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(PORTDUINO)
-
250  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
-
251  #define RADIOLIB_PLATFORM "Arduino megaAVR"
-
252 
-
253 #elif defined(ARDUINO_ARCH_APOLLO3)
-
254  // Sparkfun Apollo3 boards
-
255  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
-
256  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (Arduino_PinMode)
-
257  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
258  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
259 
-
260 #elif defined(ARDUINO_ARDUINO_NANO33BLE)
-
261  // Arduino Nano 33 BLE
-
262  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
-
263  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
264  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
265  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
266 
-
267  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
268  #define RADIOLIB_TONE_UNSUPPORTED
-
269  #define RADIOLIB_MBED_TONE_OVERRIDE
-
270 
-
271 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
-
272  // Arduino Portenta H7
-
273  #define RADIOLIB_PLATFORM "Portenta H7"
-
274  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
275  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
276  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
277 
-
278  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
279  #define RADIOLIB_TONE_UNSUPPORTED
-
280  #define RADIOLIB_MBED_TONE_OVERRIDE
-
281 
-
282 #elif defined(__STM32F4__) || defined(__STM32F1__)
-
283  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
-
284  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
-
285  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
-
286  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
-
287 
-
288 #elif defined(ARDUINO_ARCH_MEGAAVR)
-
289  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
-
290  #define RADIOLIB_PLATFORM "MegaCoreX"
-
291 
-
292 #elif defined(ARDUINO_ARCH_MBED_RP2040)
-
293  // Raspberry Pi Pico (official mbed core)
-
294  #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
-
295  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
296  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
297  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
298 
-
299  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
300  #define RADIOLIB_TONE_UNSUPPORTED
-
301  #define RADIOLIB_MBED_TONE_OVERRIDE
-
302 
-
303 #elif defined(ARDUINO_ARCH_RP2040)
-
304  // Raspberry Pi Pico (unofficial core)
-
305  #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
-
306  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
307  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
308  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
309 
-
310 #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
-
311  // CubeCell
-
312  #define RADIOLIB_PLATFORM "CubeCell"
-
313  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
-
314  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
-
315  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
-
316 
-
317  // provide an easy access to the on-board module
-
318  #include "board-config.h"
-
319  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
-
320 
-
321  // CubeCell doesn't seem to define nullptr, let's do something like that now
-
322  #define nullptr NULL
+
214 #elif defined(ESP32) || defined(ARDUINO_ARCH_ESP32)
+
215  #define RADIOLIB_ESP32
+
216 
+
217  // ESP32 boards
+
218  #define RADIOLIB_PLATFORM "ESP32"
+
219 
+
220  // ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
+
221  #define RADIOLIB_TONE_UNSUPPORTED
+
222  #define RADIOLIB_TONE_ESP32_CHANNEL (1)
+
223 
+
224 #elif defined(ARDUINO_ARCH_STM32)
+
225  // official STM32 Arduino core (https://github.com/stm32duino/Arduino_Core_STM32)
+
226  #define RADIOLIB_PLATFORM "Arduino STM32 (official)"
+
227 
+
228 #elif defined(SAMD_SERIES)
+
229  // Adafruit SAMD boards (M0 and M4)
+
230  #define RADIOLIB_PLATFORM "Adafruit SAMD"
+
231 
+
232 #elif defined(ARDUINO_ARCH_SAMD)
+
233  // Arduino SAMD (Zero, MKR, etc.)
+
234  #define RADIOLIB_PLATFORM "Arduino SAMD"
+
235  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
236  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
237  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
238 
+
239 #elif defined(__SAM3X8E__)
+
240  // Arduino Due
+
241  #define RADIOLIB_PLATFORM "Arduino Due"
+
242  #define RADIOLIB_TONE_UNSUPPORTED
+
243 
+
244 #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
+
245  // Adafruit nRF52 boards
+
246  #define RADIOLIB_PLATFORM "Adafruit nRF52"
+
247 
+
248 #elif defined(ARDUINO_ARC32_TOOLS)
+
249  // Intel Curie
+
250  #define RADIOLIB_PLATFORM "Intel Curie"
+
251 
+
252 #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(PORTDUINO)
+
253  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
+
254  #define RADIOLIB_PLATFORM "Arduino megaAVR"
+
255 
+
256 #elif defined(ARDUINO_ARCH_APOLLO3)
+
257  // Sparkfun Apollo3 boards
+
258  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
+
259  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (Arduino_PinMode)
+
260  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
261  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
262 
+
263 #elif defined(ARDUINO_ARDUINO_NANO33BLE)
+
264  // Arduino Nano 33 BLE
+
265  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
+
266  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
267  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
268  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
269 
+
270  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
271  #define RADIOLIB_TONE_UNSUPPORTED
+
272  #define RADIOLIB_MBED_TONE_OVERRIDE
+
273 
+
274 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
+
275  // Arduino Portenta H7
+
276  #define RADIOLIB_PLATFORM "Portenta H7"
+
277  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
278  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
279  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
280 
+
281  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
282  #define RADIOLIB_TONE_UNSUPPORTED
+
283  #define RADIOLIB_MBED_TONE_OVERRIDE
+
284 
+
285 #elif defined(__STM32F4__) || defined(__STM32F1__)
+
286  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
+
287  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
+
288  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
+
289  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
+
290 
+
291 #elif defined(ARDUINO_ARCH_MEGAAVR)
+
292  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
+
293  #define RADIOLIB_PLATFORM "MegaCoreX"
+
294 
+
295 #elif defined(ARDUINO_ARCH_MBED_RP2040)
+
296  // Raspberry Pi Pico (official mbed core)
+
297  #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
+
298  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
299  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
300  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
301 
+
302  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
303  #define RADIOLIB_TONE_UNSUPPORTED
+
304  #define RADIOLIB_MBED_TONE_OVERRIDE
+
305 
+
306 #elif defined(ARDUINO_ARCH_RP2040)
+
307  // Raspberry Pi Pico (unofficial core)
+
308  #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
+
309  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
310  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
311  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
312 
+
313 #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
+
314  // CubeCell
+
315  #define RADIOLIB_PLATFORM "CubeCell"
+
316  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
+
317  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
+
318  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
+
319 
+
320  // provide an easy access to the on-board module
+
321  #include "board-config.h"
+
322  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
323 
-
324  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
-
325  #undef pinMode
+
324  // CubeCell doesn't seem to define nullptr, let's do something like that now
+
325  #define nullptr NULL
326 
-
327  // ... and uses an outdated GCC which does not support type aliases
-
328  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
+
327  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
+
328  #undef pinMode
329 
-
330  // ... and it also has no tone(). This platform was designed by an idiot.
-
331  #define RADIOLIB_TONE_UNSUPPORTED
+
330  // ... and uses an outdated GCC which does not support type aliases
+
331  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
332 
-
333  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
-
334  #define RADIOLIB_YIELD_UNSUPPORTED
-
335  #if defined(yield)
-
336  #undef yield
-
337  #endif
-
338 
-
339 #elif defined(RASPI)
-
340  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
-
341  #define RADIOLIB_PLATFORM "RasPiArduino"
-
342 
-
343  // let's start off easy - no tone on this platform, that can happen
-
344  #define RADIOLIB_TONE_UNSUPPORTED
+
333  // ... and it also has no tone(). This platform was designed by an idiot.
+
334  #define RADIOLIB_TONE_UNSUPPORTED
+
335 
+
336  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
+
337  #define RADIOLIB_YIELD_UNSUPPORTED
+
338  #if defined(yield)
+
339  #undef yield
+
340  #endif
+
341 
+
342 #elif defined(RASPI)
+
343  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
+
344  #define RADIOLIB_PLATFORM "RasPiArduino"
345 
-
346  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
-
347  #define RADIOLIB_YIELD_UNSUPPORTED
+
346  // let's start off easy - no tone on this platform, that can happen
+
347  #define RADIOLIB_TONE_UNSUPPORTED
348 
-
349  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
-
350  #define PGM_P const char *
+
349  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
+
350  #define RADIOLIB_YIELD_UNSUPPORTED
351 
-
352  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
-
353  #if defined(millis)
-
354  #undef millis
-
355  inline RadioLibTime_t millis() { return((RadioLibTime_t)(STCV / 1000)); };
-
356  #endif
-
357 
-
358  #if defined(micros)
-
359  #undef micros
-
360  inline RadioLibTime_t micros() { return((RadioLibTime_t)(STCV)); };
-
361  #endif
-
362 
-
363 #elif defined(TEENSYDUINO)
-
364  // Teensy
-
365  #define RADIOLIB_PLATFORM "Teensy"
-
366 
-
367 #elif defined(ARDUINO_ARCH_RENESAS)
-
368  // Arduino Renesas (UNO R4)
-
369  #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
-
370  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
371  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
372  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
373 
-
374 #else
-
375  // other Arduino platforms not covered by the above list - this may or may not work
-
376  #define RADIOLIB_PLATFORM "Unknown Arduino"
-
377  #define RADIOLIB_UNKNOWN_PLATFORM
-
378 
-
379 #endif
-
380 
-
381  // set the default values for all macros
-
382  // these will be applied if they were not defined above
-
383  #if !defined(RADIOLIB_NC)
-
384  #define RADIOLIB_NC (0xFFFFFFFF)
-
385  #endif
-
386 
-
387  #if !defined(RADIOLIB_DEFAULT_SPI)
-
388  #define RADIOLIB_DEFAULT_SPI SPI
-
389  #endif
-
390 
-
391  #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
-
392  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
393  #endif
-
394 
-
395  #if !defined(RADIOLIB_NONVOLATILE)
-
396  #define RADIOLIB_NONVOLATILE PROGMEM
-
397  #endif
-
398 
-
399  #if !defined(RADIOLIB_NONVOLATILE_PTR)
-
400  #define RADIOLIB_NONVOLATILE_PTR PGM_P
-
401  #endif
-
402 
-
403  #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
-
404  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
405  #endif
-
406 
-
407  #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
-
408  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
-
409  #endif
-
410 
-
411  #if !defined(RADIOLIB_TYPE_ALIAS)
-
412  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
413  #endif
-
414 
-
415  #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
-
416  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
-
417  #endif
-
418 
-
419  #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
-
420  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
-
421  #endif
-
422 
-
423  #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
-
424  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
-
425  #endif
-
426 
-
427 #else
-
428  // generic non-Arduino platform
-
429  #define RADIOLIB_PLATFORM "Generic"
-
430 
-
431  #define RADIOLIB_NC (0xFF)
-
432  #define RADIOLIB_NONVOLATILE
-
433  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*((uint8_t *)(void *)(addr)))
-
434  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*((uint32_t *)(void *)(addr)))
-
435  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
436 
-
437  #if !defined(RADIOLIB_DEBUG_PORT)
-
438  #define RADIOLIB_DEBUG_PORT stdout
-
439  #endif
-
440 
-
441  #define DEC 10
-
442  #define HEX 16
-
443  #define OCT 8
-
444  #define BIN 2
-
445 
-
446  #include <stdint.h>
-
447 
-
448 #endif
-
449 
-
450 // This only compiles on STM32 boards with SUBGHZ module, but also
-
451 // include when generating docs
-
452 #if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
-
453  #define RADIOLIB_EXCLUDE_STM32WLX (1)
-
454 #endif
-
455 
-
456 // set the global debug mode flag
-
457 #if RADIOLIB_DEBUG_BASIC || RADIOLIB_DEBUG_PROTOCOL || RADIOLIB_DEBUG_SPI
-
458  #define RADIOLIB_DEBUG (1)
-
459 #else
-
460  #define RADIOLIB_DEBUG (0)
-
461 #endif
-
462 
-
463 #if RADIOLIB_DEBUG
-
464  #if defined(RADIOLIB_BUILD_ARDUINO)
-
465  #define RADIOLIB_DEBUG_PRINT(...) Module::serialPrintf(__VA_ARGS__)
-
466  #define RADIOLIB_DEBUG_PRINTLN(M, ...) Module::serialPrintf(M "\n", ##__VA_ARGS__)
-
467  #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) Module::serialPrintf(LEVEL "" M, ##__VA_ARGS__)
-
468  #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) Module::serialPrintf(LEVEL "" M "\n", ##__VA_ARGS__)
-
469 
-
470  // some platforms do not support printf("%f"), so it has to be done this way
-
471  #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL); RADIOLIB_DEBUG_PORT.print(VAL, DECIMALS)
-
472  #else
-
473  #if !defined(RADIOLIB_DEBUG_PRINT)
-
474  #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
-
475  #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M, ##__VA_ARGS__)
-
476  #endif
-
477  #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
478  #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
-
479  #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M "\n", ##__VA_ARGS__)
-
480  #endif
-
481  #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL "%.3f", VAL)
-
482  #endif
-
483 
-
484  #define RADIOLIB_DEBUG_HEXDUMP(LEVEL, ...) Module::hexdump(LEVEL, __VA_ARGS__)
-
485 #else
-
486  #define RADIOLIB_DEBUG_PRINT(...) {}
-
487  #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
488  #define RADIOLIB_DEBUG_PRINT_FLOAT(VAL, DECIMALS) {}
-
489  #define RADIOLIB_DEBUG_HEXDUMP(...) {}
-
490 #endif
+
352  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
+
353  #define PGM_P const char *
+
354 
+
355  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
+
356  #if defined(millis)
+
357  #undef millis
+
358  inline RadioLibTime_t millis() { return((RadioLibTime_t)(STCV / 1000)); };
+
359  #endif
+
360 
+
361  #if defined(micros)
+
362  #undef micros
+
363  inline RadioLibTime_t micros() { return((RadioLibTime_t)(STCV)); };
+
364  #endif
+
365 
+
366 #elif defined(TEENSYDUINO)
+
367  // Teensy
+
368  #define RADIOLIB_PLATFORM "Teensy"
+
369 
+
370 #elif defined(ARDUINO_ARCH_RENESAS)
+
371  // Arduino Renesas (UNO R4)
+
372  #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
+
373  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
374  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
375  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
376 
+
377 #else
+
378  // other Arduino platforms not covered by the above list - this may or may not work
+
379  #define RADIOLIB_PLATFORM "Unknown Arduino"
+
380  #define RADIOLIB_UNKNOWN_PLATFORM
+
381 
+
382 #endif
+
383 
+
384  // set the default values for all macros
+
385  // these will be applied if they were not defined above
+
386  #if !defined(RADIOLIB_NC)
+
387  #define RADIOLIB_NC (0xFFFFFFFF)
+
388  #endif
+
389 
+
390  #if !defined(RADIOLIB_DEFAULT_SPI)
+
391  #define RADIOLIB_DEFAULT_SPI SPI
+
392  #endif
+
393 
+
394  #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
+
395  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
396  #endif
+
397 
+
398  #if !defined(RADIOLIB_NONVOLATILE)
+
399  #define RADIOLIB_NONVOLATILE PROGMEM
+
400  #endif
+
401 
+
402  #if !defined(RADIOLIB_NONVOLATILE_PTR)
+
403  #define RADIOLIB_NONVOLATILE_PTR PGM_P
+
404  #endif
+
405 
+
406  #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
+
407  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
408  #endif
+
409 
+
410  #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
+
411  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
+
412  #endif
+
413 
+
414  #if !defined(RADIOLIB_TYPE_ALIAS)
+
415  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
416  #endif
+
417 
+
418  #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
+
419  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
+
420  #endif
+
421 
+
422  #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
+
423  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
+
424  #endif
+
425 
+
426  #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
+
427  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
+
428  #endif
+
429 
+
430 #else
+
431  // generic non-Arduino platform
+
432  #define RADIOLIB_PLATFORM "Generic"
+
433 
+
434  #define RADIOLIB_NC (0xFF)
+
435  #define RADIOLIB_NONVOLATILE
+
436  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*((uint8_t *)(void *)(addr)))
+
437  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*((uint32_t *)(void *)(addr)))
+
438  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
439 
+
440  #if !defined(RADIOLIB_DEBUG_PORT)
+
441  #define RADIOLIB_DEBUG_PORT stdout
+
442  #endif
+
443 
+
444  #define DEC 10
+
445  #define HEX 16
+
446  #define OCT 8
+
447  #define BIN 2
+
448 
+
449  #include <stdint.h>
+
450 
+
451 #endif
+
452 
+
453 // This only compiles on STM32 boards with SUBGHZ module, but also
+
454 // include when generating docs
+
455 #if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
+
456  #define RADIOLIB_EXCLUDE_STM32WLX (1)
+
457 #endif
+
458 
+
459 // if verbose assert is enabled, enable basic debug too
+
460 #if RADIOLIB_VERBOSE_ASSERT
+
461  #define RADIOLIB_DEBUG (1)
+
462 #endif
+
463 
+
464 // set the global debug mode flag
+
465 #if RADIOLIB_DEBUG_BASIC || RADIOLIB_DEBUG_PROTOCOL || RADIOLIB_DEBUG_SPI
+
466  #define RADIOLIB_DEBUG (1)
+
467 #else
+
468  #define RADIOLIB_DEBUG (0)
+
469 #endif
+
470 
+
471 #if RADIOLIB_DEBUG
+
472  #if defined(RADIOLIB_BUILD_ARDUINO)
+
473  #define RADIOLIB_DEBUG_PRINT(...) Module::serialPrintf(__VA_ARGS__)
+
474  #define RADIOLIB_DEBUG_PRINTLN(M, ...) Module::serialPrintf(M "\n", ##__VA_ARGS__)
+
475  #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) Module::serialPrintf(LEVEL "" M, ##__VA_ARGS__)
+
476  #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) Module::serialPrintf(LEVEL "" M "\n", ##__VA_ARGS__)
+
477 
+
478  // some platforms do not support printf("%f"), so it has to be done this way
+
479  #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL); RADIOLIB_DEBUG_PORT.print(VAL, DECIMALS)
+
480  #else
+
481  #if !defined(RADIOLIB_DEBUG_PRINT)
+
482  #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
+
483  #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M, ##__VA_ARGS__)
+
484  #endif
+
485  #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
486  #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
+
487  #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M "\n", ##__VA_ARGS__)
+
488  #endif
+
489  #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL "%.3f", VAL)
+
490  #endif
491 
-
492 #if RADIOLIB_DEBUG_BASIC
-
493  #define RADIOLIB_DEBUG_BASIC_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_DBG: ", __VA_ARGS__)
-
494  #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
-
495  #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_DBG: ", __VA_ARGS__)
-
496  #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_DBG: ", __VA_ARGS__);
-
497  #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_DBG: ", __VA_ARGS__);
-
498 #else
-
499  #define RADIOLIB_DEBUG_BASIC_PRINT(...) {}
-
500  #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) {}
-
501  #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) {}
-
502  #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) {}
-
503  #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) {}
-
504 #endif
-
505 
-
506 #if RADIOLIB_DEBUG_PROTOCOL
-
507  #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_PRO: ", __VA_ARGS__)
-
508  #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_PRO: ", __VA_ARGS__)
-
509  #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_PRO: ", __VA_ARGS__);
-
510  #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_PRO: ", __VA_ARGS__);
-
511 #else
-
512  #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) {}
-
513  #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) {}
-
514  #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) {}
-
515  #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) {}
-
516 #endif
-
517 
-
518 #if RADIOLIB_DEBUG_SPI
-
519  #define RADIOLIB_DEBUG_SPI_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_SPI: ", __VA_ARGS__)
-
520  #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
-
521  #define RADIOLIB_DEBUG_SPI_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_SPI: ", __VA_ARGS__)
-
522  #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) RADIOLIB_DEBUG_PRINTLN_LVL("", __VA_ARGS__)
-
523  #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_SPI: ", __VA_ARGS__);
-
524  #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_SPI: ", __VA_ARGS__);
-
525 #else
-
526  #define RADIOLIB_DEBUG_SPI_PRINT(...) {}
-
527  #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) {}
-
528  #define RADIOLIB_DEBUG_SPI_PRINTLN(...) {}
-
529  #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) {}
-
530  #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) {}
-
531  #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) {}
-
532 #endif
-
533 
-
534 // debug info strings
-
535 #define RADIOLIB_VALUE_TO_STRING(x) #x
-
536 #define RADIOLIB_VALUE(x) RADIOLIB_VALUE_TO_STRING(x)
-
537 
-
538 #define RADIOLIB_INFO "\nRadioLib Info\nVersion: \"" \
-
539  RADIOLIB_VALUE(RADIOLIB_VERSION_MAJOR) "." \
-
540  RADIOLIB_VALUE(RADIOLIB_VERSION_MINOR) "." \
-
541  RADIOLIB_VALUE(RADIOLIB_VERSION_PATCH) "." \
-
542  RADIOLIB_VALUE(RADIOLIB_VERSION_EXTRA) "\"\n" \
-
543  "Platform: " RADIOLIB_VALUE(RADIOLIB_PLATFORM) "\n" \
-
544  "Compiled: " RADIOLIB_VALUE(__DATE__) " " RADIOLIB_VALUE(__TIME__)
+
492  #define RADIOLIB_DEBUG_HEXDUMP(LEVEL, ...) Module::hexdump(LEVEL, __VA_ARGS__)
+
493 #else
+
494  #define RADIOLIB_DEBUG_PRINT(...) {}
+
495  #define RADIOLIB_DEBUG_PRINTLN(...) {}
+
496  #define RADIOLIB_DEBUG_PRINT_FLOAT(VAL, DECIMALS) {}
+
497  #define RADIOLIB_DEBUG_HEXDUMP(...) {}
+
498 #endif
+
499 
+
500 #if RADIOLIB_DEBUG_BASIC
+
501  #define RADIOLIB_DEBUG_BASIC_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_DBG: ", __VA_ARGS__)
+
502  #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
+
503  #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_DBG: ", __VA_ARGS__)
+
504  #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_DBG: ", __VA_ARGS__);
+
505  #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_DBG: ", __VA_ARGS__);
+
506 #else
+
507  #define RADIOLIB_DEBUG_BASIC_PRINT(...) {}
+
508  #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) {}
+
509  #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) {}
+
510  #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) {}
+
511  #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) {}
+
512 #endif
+
513 
+
514 #if RADIOLIB_DEBUG_PROTOCOL
+
515  #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_PRO: ", __VA_ARGS__)
+
516  #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_PRO: ", __VA_ARGS__)
+
517  #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_PRO: ", __VA_ARGS__);
+
518  #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_PRO: ", __VA_ARGS__);
+
519 #else
+
520  #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) {}
+
521  #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) {}
+
522  #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) {}
+
523  #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) {}
+
524 #endif
+
525 
+
526 #if RADIOLIB_DEBUG_SPI
+
527  #define RADIOLIB_DEBUG_SPI_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_SPI: ", __VA_ARGS__)
+
528  #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
+
529  #define RADIOLIB_DEBUG_SPI_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_SPI: ", __VA_ARGS__)
+
530  #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) RADIOLIB_DEBUG_PRINTLN_LVL("", __VA_ARGS__)
+
531  #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_SPI: ", __VA_ARGS__);
+
532  #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_SPI: ", __VA_ARGS__);
+
533 #else
+
534  #define RADIOLIB_DEBUG_SPI_PRINT(...) {}
+
535  #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) {}
+
536  #define RADIOLIB_DEBUG_SPI_PRINTLN(...) {}
+
537  #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) {}
+
538  #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) {}
+
539  #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) {}
+
540 #endif
+
541 
+
542 // debug info strings
+
543 #define RADIOLIB_VALUE_TO_STRING(x) #x
+
544 #define RADIOLIB_VALUE(x) RADIOLIB_VALUE_TO_STRING(x)
545 
-
549 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
-
550 
-
554 #if RADIOLIB_CHECK_PARAMS
-
555  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
556 #else
-
557  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
558 #endif
-
559 
-
560 #if RADIOLIB_FIX_ERRATA_SX127X
-
561  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
562 #else
-
563  #define RADIOLIB_ERRATA_SX127X(...) {}
-
564 #endif
-
565 
-
566 // these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
-
567 #define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
-
568 #define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
-
569 #define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
-
570 
-
571 // version definitions
-
572 #define RADIOLIB_VERSION_MAJOR 6
-
573 #define RADIOLIB_VERSION_MINOR 6
-
574 #define RADIOLIB_VERSION_PATCH 0
-
575 #define RADIOLIB_VERSION_EXTRA 0
-
576 
-
577 #define RADIOLIB_VERSION (((RADIOLIB_VERSION_MAJOR) << 24) | ((RADIOLIB_VERSION_MINOR) << 16) | ((RADIOLIB_VERSION_PATCH) << 8) | (RADIOLIB_VERSION_EXTRA))
-
578 
-
579 #endif
+
546 #define RADIOLIB_INFO "\nRadioLib Info\nVersion: \"" \
+
547  RADIOLIB_VALUE(RADIOLIB_VERSION_MAJOR) "." \
+
548  RADIOLIB_VALUE(RADIOLIB_VERSION_MINOR) "." \
+
549  RADIOLIB_VALUE(RADIOLIB_VERSION_PATCH) "." \
+
550  RADIOLIB_VALUE(RADIOLIB_VERSION_EXTRA) "\"\n" \
+
551  "Platform: " RADIOLIB_VALUE(RADIOLIB_PLATFORM) "\n" \
+
552  "Compiled: " RADIOLIB_VALUE(__DATE__) " " RADIOLIB_VALUE(__TIME__)
+
553 
+
559 #if RADIOLIB_VERBOSE_ASSERT
+
560 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { RADIOLIB_DEBUG_BASIC_PRINTLN("%d at %s:%d", STATEVAR, __FILE__, __LINE__); return(STATEVAR); } }
+
561 #else
+
562 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
563 #endif
+
564 
+
568 #if RADIOLIB_CHECK_PARAMS
+
569  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
570 #else
+
571  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
572 #endif
+
573 
+
574 #if RADIOLIB_FIX_ERRATA_SX127X
+
575  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
576 #else
+
577  #define RADIOLIB_ERRATA_SX127X(...) {}
+
578 #endif
+
579 
+
580 // these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
+
581 #define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
+
582 #define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
+
583 #define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
+
584 
+
585 // version definitions
+
586 #define RADIOLIB_VERSION_MAJOR 6
+
587 #define RADIOLIB_VERSION_MINOR 6
+
588 #define RADIOLIB_VERSION_PATCH 0
+
589 #define RADIOLIB_VERSION_EXTRA 0
+
590 
+
591 #define RADIOLIB_VERSION (((RADIOLIB_VERSION_MAJOR) << 24) | ((RADIOLIB_VERSION_MINOR) << 16) | ((RADIOLIB_VERSION_PATCH) << 8) | (RADIOLIB_VERSION_EXTRA))
+
592 
+
593 #endif
RadioLibTime_t
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition: TypeDef.h:616
diff --git a/_build_opt_user_8h_source.html b/_build_opt_user_8h_source.html index 5766cf18..172044b2 100644 --- a/_build_opt_user_8h_source.html +++ b/_build_opt_user_8h_source.html @@ -96,8 +96,9 @@ $(document).ready(function(){initNavTree('_build_opt_user_8h_source.html',''); i
8 //#define RADIOLIB_DEBUG_BASIC (1) // basic debugging (e.g. reporting GPIO timeouts or module not being found)
9 //#define RADIOLIB_DEBUG_PROTOCOL (1) // protocol information (e.g. LoRaWAN internal information)
10 //#define RADIOLIB_DEBUG_SPI (1) // verbose transcription of all SPI communication - produces large debug logs!
-
11 
-
12 #endif
+
11 //#define RADIOLIB_VERBOSE_ASSERT (1) // verbose assertions - will print out print out file and line number on failure
+
12 
+
13 #endif