From f339e1224c1df64c9064f603c7198c5e3ca35174 Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 15 Sep 2023 18:20:41 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20bc7e8?= =?UTF-8?q?2999c5c80a47a2a2e336d3db24d8246e5dc=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _build_opt_8h_source.html | 794 +++++++++++++++++++------------------- 1 file changed, 398 insertions(+), 396 deletions(-) diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index 9ebe7264..fdc4abd7 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -193,406 +193,408 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
105 #elif defined(SAMD_SERIES)
106  // Adafruit SAMD boards (M0 and M4)
107  #define RADIOLIB_PLATFORM "Adafruit SAMD"
-
108 
-
109 #elif defined(ARDUINO_ARCH_SAMD)
-
110  // Arduino SAMD (Zero, MKR, etc.)
-
111  #define RADIOLIB_PLATFORM "Arduino SAMD"
-
112  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
113  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
114  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
115 
-
116 #elif defined(__SAM3X8E__)
-
117  // Arduino Due
-
118  #define RADIOLIB_PLATFORM "Arduino Due"
-
119  #define RADIOLIB_TONE_UNSUPPORTED
-
120  #define RADIOLIB_EEPROM_UNSUPPORTED
-
121 
-
122 #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
-
123  // Adafruit nRF52 boards
-
124  #define RADIOLIB_PLATFORM "Adafruit nRF52"
-
125  #define RADIOLIB_EEPROM_UNSUPPORTED
-
126 
-
127 #elif defined(ARDUINO_ARC32_TOOLS)
-
128  // Intel Curie
-
129  #define RADIOLIB_PLATFORM "Intel Curie"
-
130 
-
131 #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(PORTDUINO)
-
132  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
-
133  #define RADIOLIB_PLATFORM "Arduino megaAVR"
-
134 
-
135 #elif defined(ARDUINO_ARCH_APOLLO3)
-
136  // Sparkfun Apollo3 boards
-
137  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
-
138  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (Arduino_PinMode)
-
139  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
140  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
141 
-
142 #elif defined(ARDUINO_ARDUINO_NANO33BLE)
-
143  // Arduino Nano 33 BLE
-
144  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
-
145  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
146  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
147  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
148  #define RADIOLIB_EEPROM_UNSUPPORTED
-
149 
-
150  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
151  #define RADIOLIB_TONE_UNSUPPORTED
-
152  #define RADIOLIB_MBED_TONE_OVERRIDE
-
153 
-
154 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
-
155  // Arduino Portenta H7
-
156  #define RADIOLIB_PLATFORM "Portenta H7"
-
157  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
158  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
159  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
160  #define RADIOLIB_EEPROM_UNSUPPORTED
-
161 
-
162  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
163  #define RADIOLIB_TONE_UNSUPPORTED
-
164  #define RADIOLIB_MBED_TONE_OVERRIDE
-
165 
-
166 #elif defined(__STM32F4__) || defined(__STM32F1__)
-
167  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
-
168  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
-
169  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
-
170  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
-
171 
-
172 #elif defined(ARDUINO_ARCH_MEGAAVR)
-
173  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
-
174  #define RADIOLIB_PLATFORM "MegaCoreX"
-
175 
-
176 #elif defined(ARDUINO_ARCH_MBED_RP2040)
-
177  // Raspberry Pi Pico (official mbed core)
-
178  #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
-
179  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
180  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
181  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
182  #define RADIOLIB_EEPROM_UNSUPPORTED
-
183 
-
184  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
185  #define RADIOLIB_TONE_UNSUPPORTED
-
186  #define RADIOLIB_MBED_TONE_OVERRIDE
-
187 
-
188 #elif defined(ARDUINO_ARCH_RP2040)
-
189  // Raspberry Pi Pico (unofficial core)
-
190  #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
-
191  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
192  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
193  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
194 
-
195 #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
-
196  // CubeCell
-
197  #define RADIOLIB_PLATFORM "CubeCell"
-
198  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
-
199  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
-
200  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
-
201 
-
202  // provide an easy access to the on-board module
-
203  #include "board-config.h"
-
204  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
-
205 
-
206  // CubeCell doesn't seem to define nullptr, let's do something like that now
-
207  #define nullptr NULL
-
208 
-
209  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
-
210  #undef pinMode
-
211 
-
212  // ... and uses an outdated GCC which does not support type aliases
-
213  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
-
214 
-
215  // ... and it also has no tone(). This platform was designed by an idiot.
-
216  #define RADIOLIB_TONE_UNSUPPORTED
-
217 
-
218  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
-
219  #define RADIOLIB_YIELD_UNSUPPORTED
-
220  #if defined(yield)
-
221  #undef yield
-
222  #endif
-
223 
-
224 #elif defined(RASPI)
-
225  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
-
226  #define RADIOLIB_PLATFORM "RasPiArduino"
-
227 
-
228  // let's start off easy - no tone on this platform, that can happen
-
229  #define RADIOLIB_TONE_UNSUPPORTED
-
230 
-
231  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
-
232  #define RADIOLIB_YIELD_UNSUPPORTED
-
233 
-
234  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
-
235  #define PGM_P const char *
-
236 
-
237  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
-
238  #if defined(millis)
-
239  #undef millis
-
240  inline unsigned long millis() { return((unsigned long)(STCV / 1000)); };
-
241  #endif
-
242 
-
243  #if defined(micros)
-
244  #undef micros
-
245  inline unsigned long micros() { return((unsigned long)(STCV)); };
-
246  #endif
-
247 
-
248 #elif defined(TEENSYDUINO)
-
249  // Teensy
-
250  #define RADIOLIB_PLATFORM "Teensy"
-
251 
-
252 #elif defined(ARDUINO_ARCH_RENESAS)
-
253  // Arduino Renesas (UNO R4)
-
254  #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
-
255  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
256  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
257  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
258 
-
259 #else
-
260  // other Arduino platforms not covered by the above list - this may or may not work
-
261  #define RADIOLIB_PLATFORM "Unknown Arduino"
-
262  #define RADIOLIB_UNKNOWN_PLATFORM
-
263 
-
264 #endif
+
108  #define RADIOLIB_EEPROM_UNSUPPORTED
+
109 
+
110 #elif defined(ARDUINO_ARCH_SAMD)
+
111  // Arduino SAMD (Zero, MKR, etc.)
+
112  #define RADIOLIB_PLATFORM "Arduino SAMD"
+
113  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
114  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
115  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
116  #define RADIOLIB_EEPROM_UNSUPPORTED
+
117 
+
118 #elif defined(__SAM3X8E__)
+
119  // Arduino Due
+
120  #define RADIOLIB_PLATFORM "Arduino Due"
+
121  #define RADIOLIB_TONE_UNSUPPORTED
+
122  #define RADIOLIB_EEPROM_UNSUPPORTED
+
123 
+
124 #elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
+
125  // Adafruit nRF52 boards
+
126  #define RADIOLIB_PLATFORM "Adafruit nRF52"
+
127  #define RADIOLIB_EEPROM_UNSUPPORTED
+
128 
+
129 #elif defined(ARDUINO_ARC32_TOOLS)
+
130  // Intel Curie
+
131  #define RADIOLIB_PLATFORM "Intel Curie"
+
132 
+
133 #elif defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(PORTDUINO)
+
134  // Arduino megaAVR boards - Uno Wifi Rev.2, Nano Every
+
135  #define RADIOLIB_PLATFORM "Arduino megaAVR"
+
136 
+
137 #elif defined(ARDUINO_ARCH_APOLLO3)
+
138  // Sparkfun Apollo3 boards
+
139  #define RADIOLIB_PLATFORM "Sparkfun Apollo3"
+
140  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (Arduino_PinMode)
+
141  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
142  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
143 
+
144 #elif defined(ARDUINO_ARDUINO_NANO33BLE)
+
145  // Arduino Nano 33 BLE
+
146  #define RADIOLIB_PLATFORM "Arduino Nano 33 BLE"
+
147  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
148  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
149  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
150  #define RADIOLIB_EEPROM_UNSUPPORTED
+
151 
+
152  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
153  #define RADIOLIB_TONE_UNSUPPORTED
+
154  #define RADIOLIB_MBED_TONE_OVERRIDE
+
155 
+
156 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
+
157  // Arduino Portenta H7
+
158  #define RADIOLIB_PLATFORM "Portenta H7"
+
159  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
160  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
161  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
162  #define RADIOLIB_EEPROM_UNSUPPORTED
+
163 
+
164  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
165  #define RADIOLIB_TONE_UNSUPPORTED
+
166  #define RADIOLIB_MBED_TONE_OVERRIDE
+
167 
+
168 #elif defined(__STM32F4__) || defined(__STM32F1__)
+
169  // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
+
170  #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
+
171  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
+
172  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
+
173 
+
174 #elif defined(ARDUINO_ARCH_MEGAAVR)
+
175  // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
+
176  #define RADIOLIB_PLATFORM "MegaCoreX"
+
177 
+
178 #elif defined(ARDUINO_ARCH_MBED_RP2040)
+
179  // Raspberry Pi Pico (official mbed core)
+
180  #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
+
181  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
182  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
183  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
184  #define RADIOLIB_EEPROM_UNSUPPORTED
+
185 
+
186  // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
187  #define RADIOLIB_TONE_UNSUPPORTED
+
188  #define RADIOLIB_MBED_TONE_OVERRIDE
+
189 
+
190 #elif defined(ARDUINO_ARCH_RP2040)
+
191  // Raspberry Pi Pico (unofficial core)
+
192  #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
+
193  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
194  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
195  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
196 
+
197 #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
+
198  // CubeCell
+
199  #define RADIOLIB_PLATFORM "CubeCell"
+
200  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
+
201  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
+
202  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
+
203 
+
204  // provide an easy access to the on-board module
+
205  #include "board-config.h"
+
206  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
+
207 
+
208  // CubeCell doesn't seem to define nullptr, let's do something like that now
+
209  #define nullptr NULL
+
210 
+
211  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
+
212  #undef pinMode
+
213 
+
214  // ... and uses an outdated GCC which does not support type aliases
+
215  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
+
216 
+
217  // ... and it also has no tone(). This platform was designed by an idiot.
+
218  #define RADIOLIB_TONE_UNSUPPORTED
+
219 
+
220  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
+
221  #define RADIOLIB_YIELD_UNSUPPORTED
+
222  #if defined(yield)
+
223  #undef yield
+
224  #endif
+
225 
+
226 #elif defined(RASPI)
+
227  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
+
228  #define RADIOLIB_PLATFORM "RasPiArduino"
+
229 
+
230  // let's start off easy - no tone on this platform, that can happen
+
231  #define RADIOLIB_TONE_UNSUPPORTED
+
232 
+
233  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
+
234  #define RADIOLIB_YIELD_UNSUPPORTED
+
235 
+
236  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
+
237  #define PGM_P const char *
+
238 
+
239  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
+
240  #if defined(millis)
+
241  #undef millis
+
242  inline unsigned long millis() { return((unsigned long)(STCV / 1000)); };
+
243  #endif
+
244 
+
245  #if defined(micros)
+
246  #undef micros
+
247  inline unsigned long micros() { return((unsigned long)(STCV)); };
+
248  #endif
+
249 
+
250 #elif defined(TEENSYDUINO)
+
251  // Teensy
+
252  #define RADIOLIB_PLATFORM "Teensy"
+
253 
+
254 #elif defined(ARDUINO_ARCH_RENESAS)
+
255  // Arduino Renesas (UNO R4)
+
256  #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
+
257  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
258  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
259  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
260 
+
261 #else
+
262  // other Arduino platforms not covered by the above list - this may or may not work
+
263  #define RADIOLIB_PLATFORM "Unknown Arduino"
+
264  #define RADIOLIB_UNKNOWN_PLATFORM
265 
-
266  // set the default values for all macros
-
267  // these will be applied if they were not defined above
-
268  #if !defined(RADIOLIB_NC)
-
269  #define RADIOLIB_NC (0xFFFFFFFF)
-
270  #endif
-
271 
-
272  #if !defined(RADIOLIB_DEFAULT_SPI)
-
273  #define RADIOLIB_DEFAULT_SPI SPI
-
274  #endif
-
275 
-
276  #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
-
277  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
278  #endif
-
279 
-
280  #if !defined(RADIOLIB_NONVOLATILE)
-
281  #define RADIOLIB_NONVOLATILE PROGMEM
-
282  #endif
-
283 
-
284  #if !defined(RADIOLIB_NONVOLATILE_PTR)
-
285  #define RADIOLIB_NONVOLATILE_PTR PGM_P
-
286  #endif
-
287 
-
288  #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
-
289  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
290  #endif
-
291 
-
292  #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
-
293  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
-
294  #endif
-
295 
-
296  #if !defined(RADIOLIB_TYPE_ALIAS)
-
297  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
298  #endif
-
299 
-
300  #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
-
301  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
-
302  #endif
-
303 
-
304  #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
-
305  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
-
306  #endif
-
307 
-
308  #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
-
309  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
-
310  #endif
-
311 
-
312 #else
-
313  // generic non-Arduino platform
-
314  #define RADIOLIB_PLATFORM "Generic"
-
315 
-
316  #define RADIOLIB_NC (0xFF)
-
317  #define RADIOLIB_NONVOLATILE
-
318  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*((uint8_t *)(void *)(addr)))
-
319  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*((uint32_t *)(void *)(addr)))
-
320  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
321 
-
322  #if !defined(RADIOLIB_DEBUG_PORT)
-
323  #define RADIOLIB_DEBUG_PORT stdout
-
324  #endif
-
325 
-
326  #define DEC 10
-
327  #define HEX 16
-
328  #define OCT 8
-
329  #define BIN 2
-
330 
-
331  #include <stdint.h>
+
266 #endif
+
267 
+
268  // set the default values for all macros
+
269  // these will be applied if they were not defined above
+
270  #if !defined(RADIOLIB_NC)
+
271  #define RADIOLIB_NC (0xFFFFFFFF)
+
272  #endif
+
273 
+
274  #if !defined(RADIOLIB_DEFAULT_SPI)
+
275  #define RADIOLIB_DEFAULT_SPI SPI
+
276  #endif
+
277 
+
278  #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
+
279  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
280  #endif
+
281 
+
282  #if !defined(RADIOLIB_NONVOLATILE)
+
283  #define RADIOLIB_NONVOLATILE PROGMEM
+
284  #endif
+
285 
+
286  #if !defined(RADIOLIB_NONVOLATILE_PTR)
+
287  #define RADIOLIB_NONVOLATILE_PTR PGM_P
+
288  #endif
+
289 
+
290  #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
+
291  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
292  #endif
+
293 
+
294  #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
+
295  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
+
296  #endif
+
297 
+
298  #if !defined(RADIOLIB_TYPE_ALIAS)
+
299  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
300  #endif
+
301 
+
302  #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
+
303  #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
+
304  #endif
+
305 
+
306  #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
+
307  #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
+
308  #endif
+
309 
+
310  #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
+
311  #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
+
312  #endif
+
313 
+
314 #else
+
315  // generic non-Arduino platform
+
316  #define RADIOLIB_PLATFORM "Generic"
+
317 
+
318  #define RADIOLIB_NC (0xFF)
+
319  #define RADIOLIB_NONVOLATILE
+
320  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*((uint8_t *)(void *)(addr)))
+
321  #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*((uint32_t *)(void *)(addr)))
+
322  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
323 
+
324  #if !defined(RADIOLIB_DEBUG_PORT)
+
325  #define RADIOLIB_DEBUG_PORT stdout
+
326  #endif
+
327 
+
328  #define DEC 10
+
329  #define HEX 16
+
330  #define OCT 8
+
331  #define BIN 2
332 
-
333 #endif
+
333  #include <stdint.h>
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 communication
-
341  */
-
342 #if !defined(RADIOLIB_DEBUG)
-
343  //#define RADIOLIB_DEBUG
-
344 #endif
-
345 #if !defined(RADIOLIB_VERBOSE)
-
346  //#define RADIOLIB_VERBOSE
-
347 #endif
-
348 
-
349 // set which output port should be used for debug output
-
350 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
-
351 #if defined(RADIOLIB_BUILD_ARDUINO) && !defined(RADIOLIB_DEBUG_PORT)
-
352  #define RADIOLIB_DEBUG_PORT Serial
-
353 #endif
-
354 
-
355 /*
-
356  * Uncomment to enable "paranoid" SPI mode
-
357  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
-
358  * This improves reliability, but slightly slows down communication.
-
359  * Note: Enabled by default.
-
360  */
-
361 #if !defined(RADIOLIB_SPI_PARANOID)
-
362  #define RADIOLIB_SPI_PARANOID
-
363 #endif
-
364 
-
365 /*
-
366  * Uncomment to enable parameter range checking
-
367  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
-
368  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
-
369  * possibly leading to bricked module and/or program crashing.
-
370  * Note: Enabled by default.
-
371  */
-
372 #if !defined(RADIOLIB_CHECK_PARAMS)
-
373  #define RADIOLIB_CHECK_PARAMS
-
374 #endif
-
375 
-
376 /*
-
377  * Uncomment to enable SX127x errata fix
-
378  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
-
379  * It should only be enabled if you really are observing some errata-related issue.
-
380  * Note: Disabled by default.
-
381  */
-
382 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
-
383  //#define RADIOLIB_FIX_ERRATA_SX127X
-
384 #endif
-
385 
-
386 /*
-
387  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
-
388  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
-
389  * Failure to heed the above warning may result in bricked module.
-
390  */
-
391 #if !defined(RADIOLIB_GODMODE)
-
392  //#define RADIOLIB_GODMODE
-
393 #endif
-
394 
-
395 /*
-
396  * Uncomment to enable low-level hardware access
-
397  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
-
398  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
-
399  */
-
400 #if !defined(RADIOLIB_LOW_LEVEL)
-
401  //#define RADIOLIB_LOW_LEVEL
-
402 #endif
-
403 
-
404 /*
-
405  * Uncomment to enable pre-defined modules when using RadioShield.
-
406  */
-
407 #if !defined(RADIOLIB_RADIOSHIELD)
-
408  //#define RADIOLIB_RADIOSHIELD
-
409 #endif
-
410 
-
411 /*
-
412  * Uncomment to enable interrupt-based timing control
-
413  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
-
414  */
-
415 #if !defined(RADIOLIB_INTERRUPT_TIMING)
-
416  //#define RADIOLIB_INTERRUPT_TIMING
-
417 #endif
-
418 
-
419 /*
-
420  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
-
421  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
-
422  */
-
423 #if !defined(RADIOLIB_STATIC_ONLY)
-
424  //#define RADIOLIB_STATIC_ONLY
-
425 #endif
-
426 
-
427 // set the size of static arrays to use
-
428 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
-
429  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
-
430 #endif
-
431 
-
432 // the base address for persistent storage
-
433 // some protocols (e.g. LoRaWAN) require a method
-
434 // to store some data persistently
-
435 // on Arduino, this will use EEPROM, on non-Arduino platform,
-
436 // it will use anything provided by the hardware abstraction layer
-
437 // RadioLib will place these starting at this address
-
438 #if !defined(RADIOLIB_HAL_PERSISTENT_STORAGE_BASE)
-
439  #define RADIOLIB_HAL_PERSISTENT_STORAGE_BASE (0)
-
440 #endif
-
441 
-
442 // the amount of space allocated to the persistent storage
-
443 #if !defined(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE)
-
444  #define RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE (0x60)
-
445 #endif
-
446 
-
447 // This only compiles on STM32 boards with SUBGHZ module, but also
-
448 // include when generating docs
-
449 #if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
-
450  #define RADIOLIB_EXCLUDE_STM32WLX
-
451 #endif
-
452 
-
453 #if defined(RADIOLIB_DEBUG)
-
454  #if defined(RADIOLIB_BUILD_ARDUINO)
-
455  #define RADIOLIB_DEBUG_PRINT(...) Module::serialPrintf(__VA_ARGS__)
-
456  #define RADIOLIB_DEBUG_PRINTLN(M, ...) Module::serialPrintf(M "\n", ##__VA_ARGS__)
-
457  #else
-
458  #if !defined(RADIOLIB_DEBUG_PRINT)
-
459  #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
-
460  #endif
-
461  #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
462  #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
-
463  #endif
-
464  #endif
-
465  #define RADIOLIB_DEBUG_HEXDUMP(...) Module::hexdump(__VA_ARGS__)
-
466 #else
-
467  #define RADIOLIB_DEBUG_PRINT(...) {}
-
468  #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
469  #define RADIOLIB_DEBUG_HEXDUMP(...) {}
-
470 #endif
-
471 
-
472 #if defined(RADIOLIB_VERBOSE)
-
473  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
-
474  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
-
475 #else
-
476  #define RADIOLIB_VERBOSE_PRINT(...) {}
-
477  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
-
478 #endif
-
479 
-
483 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
-
484 
-
488 #if defined(RADIOLIB_CHECK_PARAMS)
-
489  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
490 #else
-
491  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
492 #endif
-
493 
-
494 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
-
495  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
496 #else
-
497  #define RADIOLIB_ERRATA_SX127X(...) {}
-
498 #endif
-
499 
-
500 // these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
-
501 #define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
-
502 #define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
-
503 #define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
-
504 
-
505 // version definitions
-
506 #define RADIOLIB_VERSION_MAJOR (0x06)
-
507 #define RADIOLIB_VERSION_MINOR (0x01)
-
508 #define RADIOLIB_VERSION_PATCH (0x00)
-
509 #define RADIOLIB_VERSION_EXTRA (0x00)
-
510 
-
511 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
335 #endif
+
336 
+
337 /*
+
338  * Uncomment to enable debug output.
+
339  * Warning: Debug output will slow down the whole system significantly.
+
340  * Also, it will result in larger compiled binary.
+
341  * Levels: debug - only main info
+
342  * verbose - full transcript of all SPI communication
+
343  */
+
344 #if !defined(RADIOLIB_DEBUG)
+
345  //#define RADIOLIB_DEBUG
+
346 #endif
+
347 #if !defined(RADIOLIB_VERBOSE)
+
348  //#define RADIOLIB_VERBOSE
+
349 #endif
+
350 
+
351 // set which output port should be used for debug output
+
352 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
+
353 #if defined(RADIOLIB_BUILD_ARDUINO) && !defined(RADIOLIB_DEBUG_PORT)
+
354  #define RADIOLIB_DEBUG_PORT Serial
+
355 #endif
+
356 
+
357 /*
+
358  * Uncomment to enable "paranoid" SPI mode
+
359  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
+
360  * This improves reliability, but slightly slows down communication.
+
361  * Note: Enabled by default.
+
362  */
+
363 #if !defined(RADIOLIB_SPI_PARANOID)
+
364  #define RADIOLIB_SPI_PARANOID
+
365 #endif
+
366 
+
367 /*
+
368  * Uncomment to enable parameter range checking
+
369  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
+
370  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
+
371  * possibly leading to bricked module and/or program crashing.
+
372  * Note: Enabled by default.
+
373  */
+
374 #if !defined(RADIOLIB_CHECK_PARAMS)
+
375  #define RADIOLIB_CHECK_PARAMS
+
376 #endif
+
377 
+
378 /*
+
379  * Uncomment to enable SX127x errata fix
+
380  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
+
381  * It should only be enabled if you really are observing some errata-related issue.
+
382  * Note: Disabled by default.
+
383  */
+
384 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
+
385  //#define RADIOLIB_FIX_ERRATA_SX127X
+
386 #endif
+
387 
+
388 /*
+
389  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
+
390  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
+
391  * Failure to heed the above warning may result in bricked module.
+
392  */
+
393 #if !defined(RADIOLIB_GODMODE)
+
394  //#define RADIOLIB_GODMODE
+
395 #endif
+
396 
+
397 /*
+
398  * Uncomment to enable low-level hardware access
+
399  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
+
400  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
+
401  */
+
402 #if !defined(RADIOLIB_LOW_LEVEL)
+
403  //#define RADIOLIB_LOW_LEVEL
+
404 #endif
+
405 
+
406 /*
+
407  * Uncomment to enable pre-defined modules when using RadioShield.
+
408  */
+
409 #if !defined(RADIOLIB_RADIOSHIELD)
+
410  //#define RADIOLIB_RADIOSHIELD
+
411 #endif
+
412 
+
413 /*
+
414  * Uncomment to enable interrupt-based timing control
+
415  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
+
416  */
+
417 #if !defined(RADIOLIB_INTERRUPT_TIMING)
+
418  //#define RADIOLIB_INTERRUPT_TIMING
+
419 #endif
+
420 
+
421 /*
+
422  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
+
423  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
424  */
+
425 #if !defined(RADIOLIB_STATIC_ONLY)
+
426  //#define RADIOLIB_STATIC_ONLY
+
427 #endif
+
428 
+
429 // set the size of static arrays to use
+
430 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
+
431  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
+
432 #endif
+
433 
+
434 // the base address for persistent storage
+
435 // some protocols (e.g. LoRaWAN) require a method
+
436 // to store some data persistently
+
437 // on Arduino, this will use EEPROM, on non-Arduino platform,
+
438 // it will use anything provided by the hardware abstraction layer
+
439 // RadioLib will place these starting at this address
+
440 #if !defined(RADIOLIB_HAL_PERSISTENT_STORAGE_BASE)
+
441  #define RADIOLIB_HAL_PERSISTENT_STORAGE_BASE (0)
+
442 #endif
+
443 
+
444 // the amount of space allocated to the persistent storage
+
445 #if !defined(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE)
+
446  #define RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE (0x60)
+
447 #endif
+
448 
+
449 // This only compiles on STM32 boards with SUBGHZ module, but also
+
450 // include when generating docs
+
451 #if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
+
452  #define RADIOLIB_EXCLUDE_STM32WLX
+
453 #endif
+
454 
+
455 #if defined(RADIOLIB_DEBUG)
+
456  #if defined(RADIOLIB_BUILD_ARDUINO)
+
457  #define RADIOLIB_DEBUG_PRINT(...) Module::serialPrintf(__VA_ARGS__)
+
458  #define RADIOLIB_DEBUG_PRINTLN(M, ...) Module::serialPrintf(M "\n", ##__VA_ARGS__)
+
459  #else
+
460  #if !defined(RADIOLIB_DEBUG_PRINT)
+
461  #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
+
462  #endif
+
463  #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
464  #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
+
465  #endif
+
466  #endif
+
467  #define RADIOLIB_DEBUG_HEXDUMP(...) Module::hexdump(__VA_ARGS__)
+
468 #else
+
469  #define RADIOLIB_DEBUG_PRINT(...) {}
+
470  #define RADIOLIB_DEBUG_PRINTLN(...) {}
+
471  #define RADIOLIB_DEBUG_HEXDUMP(...) {}
+
472 #endif
+
473 
+
474 #if defined(RADIOLIB_VERBOSE)
+
475  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
+
476  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
+
477 #else
+
478  #define RADIOLIB_VERBOSE_PRINT(...) {}
+
479  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
480 #endif
+
481 
+
485 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
486 
+
490 #if defined(RADIOLIB_CHECK_PARAMS)
+
491  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
492 #else
+
493  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
494 #endif
+
495 
+
496 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
+
497  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
498 #else
+
499  #define RADIOLIB_ERRATA_SX127X(...) {}
+
500 #endif
+
501 
+
502 // these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
+
503 #define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
+
504 #define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
+
505 #define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
+
506 
+
507 // version definitions
+
508 #define RADIOLIB_VERSION_MAJOR (0x06)
+
509 #define RADIOLIB_VERSION_MINOR (0x01)
+
510 #define RADIOLIB_VERSION_PATCH (0x00)
+
511 #define RADIOLIB_VERSION_EXTRA (0x00)
512 
-
513 #endif
+
513 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
514 
+
515 #endif