diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index 932cdc67..80d7c87a 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -1042,85 +1042,93 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
954 #endif
955 
956 /*
-
957  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
-
958  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
957  * Uncomment to enable interrupt-based timing control
+
958  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
959  */
-
960 #if !defined(RADIOLIB_STATIC_ONLY)
-
961  //#define RADIOLIB_STATIC_ONLY
+
960 #if !defined(RADIOLIB_INTERRUPT_TIMING)
+
961  //#define RADIOLIB_INTERRUPT_TIMING
962 #endif
963 
-
964 // set the size of static arrays to use
-
965 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
-
966  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
-
967 #endif
-
968 
-
969 #if defined(RADIOLIB_DEBUG)
-
970  #if defined(RADIOLIB_BUILD_ARDUINO)
-
971  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
-
972  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
-
973  #else
-
974  #if !defined(RADIOLIB_DEBUG_PRINT)
-
975  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
-
976  #endif
-
977  #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
978  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
-
979  #endif
-
980  #endif
-
981 #else
-
982  #define RADIOLIB_DEBUG_PRINT(...) {}
-
983  #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
984 #endif
-
985 
-
986 #if defined(RADIOLIB_VERBOSE)
-
987  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
-
988  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
+
964 /*
+
965  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
+
966  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
967  */
+
968 #if !defined(RADIOLIB_STATIC_ONLY)
+
969  //#define RADIOLIB_STATIC_ONLY
+
970 #endif
+
971 
+
972 // set the size of static arrays to use
+
973 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
+
974  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
+
975 #endif
+
976 
+
977 #if defined(RADIOLIB_DEBUG)
+
978  #if defined(RADIOLIB_BUILD_ARDUINO)
+
979  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
+
980  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
+
981  #else
+
982  #if !defined(RADIOLIB_DEBUG_PRINT)
+
983  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
+
984  #endif
+
985  #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
986  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
+
987  #endif
+
988  #endif
989 #else
-
990  #define RADIOLIB_VERBOSE_PRINT(...) {}
-
991  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
990  #define RADIOLIB_DEBUG_PRINT(...) {}
+
991  #define RADIOLIB_DEBUG_PRINTLN(...) {}
992 #endif
993 
-
997 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
-
998 
-
999 /*
-
1000  * Macros that create callback for the hardware abstraction layer.
-
1001  *
-
1002  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
-
1003  * Come one, come all and witness the horror:
-
1004  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
-
1005  */
-
1006 #define RADIOLIB_FIRST(arg, ...) arg
-
1007 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
-
1008 #define RADIOLIB_EXP(...) __VA_ARGS__
-
1009 
-
1010 #define RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, FUNC, ...) public: typedef RET (*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
-
1011 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
-
1012 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
-
1013 
-
1014 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, FUNC, ...) public: typedef RET (Module::*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
-
1015 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
-
1016 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
994 #if defined(RADIOLIB_VERBOSE)
+
995  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
+
996  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
+
997 #else
+
998  #define RADIOLIB_VERBOSE_PRINT(...) {}
+
999  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
1000 #endif
+
1001 
+
1005 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
1006 
+
1007 /*
+
1008  * Macros that create callback for the hardware abstraction layer.
+
1009  *
+
1010  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
+
1011  * Come one, come all and witness the horror:
+
1012  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
+
1013  */
+
1014 #define RADIOLIB_FIRST(arg, ...) arg
+
1015 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
+
1016 #define RADIOLIB_EXP(...) __VA_ARGS__
1017 
-
1021 #if defined(RADIOLIB_CHECK_PARAMS)
-
1022  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
1023 #else
-
1024  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
1025 #endif
-
1026 
-
1027 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
-
1028  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
1029 #else
-
1030  #define RADIOLIB_ERRATA_SX127X(...) {}
-
1031 #endif
-
1032 
-
1033 // version definitions
-
1034 #define RADIOLIB_VERSION_MAJOR (0x05)
-
1035 #define RADIOLIB_VERSION_MINOR (0x04)
-
1036 #define RADIOLIB_VERSION_PATCH (0x01)
-
1037 #define RADIOLIB_VERSION_EXTRA (0x00)
-
1038 
-
1039 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
1018 #define RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, FUNC, ...) public: typedef RET (*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
+
1019 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
+
1020 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
1021 
+
1022 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, FUNC, ...) public: typedef RET (Module::*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
+
1023 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
+
1024 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
1025 
+
1029 #if defined(RADIOLIB_CHECK_PARAMS)
+
1030  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
1031 #else
+
1032  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
1033 #endif
+
1034 
+
1035 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
+
1036  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
1037 #else
+
1038  #define RADIOLIB_ERRATA_SX127X(...) {}
+
1039 #endif
1040 
-
1041 #endif
+
1041 // version definitions
+
1042 #define RADIOLIB_VERSION_MAJOR (0x05)
+
1043 #define RADIOLIB_VERSION_MINOR (0x04)
+
1044 #define RADIOLIB_VERSION_PATCH (0x01)
+
1045 #define RADIOLIB_VERSION_EXTRA (0x00)
+
1046 
+
1047 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
1048 
+
1049 #endif
diff --git a/_f_s_k4_8h_source.html b/_f_s_k4_8h_source.html index 415834e5..a6113389 100644 --- a/_f_s_k4_8h_source.html +++ b/_f_s_k4_8h_source.html @@ -149,7 +149,7 @@ $(document).ready(function(){initNavTree('_f_s_k4_8h_source.html',''); initResiz
FSK4Client::setCorrection
int16_t setCorrection(int16_t offsets[4], float length=1.0f)
Set correction coefficients for frequencies and tone length.
Definition: FSK4.cpp:47
FSK4Client::write
size_t write(uint8_t *buff, size_t len)
Transmit binary data.
Definition: FSK4.cpp:56
FSK4Client::idle
void idle()
Send out idle condition (RF tone at mark frequency).
Definition: FSK4.cpp:42
-
FSK4Client::standby
int16_t standby()
Stop transmitting.
Definition: FSK4.cpp:99
+
FSK4Client::standby
int16_t standby()
Stop transmitting.
Definition: FSK4.cpp:97
PhysicalLayer
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:14
FSK4Client
Client for FSK-4 communication. The public interface is the same as Arduino Serial.
Definition: FSK4.h:16
FSK4Client::FSK4Client
FSK4Client(PhysicalLayer *phy)
Constructor for FSK-4 mode.
Definition: FSK4.cpp:4
diff --git a/_module_8h_source.html b/_module_8h_source.html index 4a551524..184f63ea 100644 --- a/_module_8h_source.html +++ b/_module_8h_source.html @@ -120,195 +120,212 @@ $(document).ready(function(){initNavTree('_module_8h_source.html',''); initResiz
88 
92  uint8_t SPIwriteCommand = 0b10000000;
93 
-
94  // basic methods
+
94  #if defined(RADIOLIB_INTERRUPT_TIMING)
95 
-
99  void init();
+
99  typedef void (*TimerSetupCb_t)(uint32_t len);
100 
-
104  void term();
+
104  TimerSetupCb_t TimerSetupCb = nullptr;
105 
-
106  // SPI methods
-
107 
-
119  int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
-
120 
-
138  int16_t SPIsetRegValue(uint8_t reg, uint8_t value, uint8_t msb = 7, uint8_t lsb = 0, uint8_t checkInterval = 2, uint8_t checkMask = 0xFF);
+
109  volatile bool TimerFlag = false;
+
110 
+
111  #endif
+
112 
+
113  // basic methods
+
114 
+
118  void init();
+
119 
+
123  void term();
+
124 
+
125  // SPI methods
+
126 
+
138  int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
139 
-
149  void SPIreadRegisterBurst(uint8_t reg, uint8_t numBytes, uint8_t* inBytes);
-
150 
-
158  uint8_t SPIreadRegister(uint8_t reg);
-
159 
-
169  void SPIwriteRegisterBurst(uint8_t reg, uint8_t* data, uint8_t numBytes);
-
170 
-
178  void SPIwriteRegister(uint8_t reg, uint8_t data);
-
179 
-
193  void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes);
-
194 
-
195  // pin number access methods
-
196 
-
202  RADIOLIB_PIN_TYPE getCs() const { return(_cs); }
-
203 
-
209  RADIOLIB_PIN_TYPE getIrq() const { return(_irq); }
-
210 
-
216  RADIOLIB_PIN_TYPE getRst() const { return(_rst); }
-
217 
-
223  RADIOLIB_PIN_TYPE getGpio() const { return(_gpio); }
-
224 
-
233  void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
-
234 
-
242  void setRfSwitchState(RADIOLIB_PIN_STATUS rxPinState, RADIOLIB_PIN_STATUS txPinState);
+
157  int16_t SPIsetRegValue(uint8_t reg, uint8_t value, uint8_t msb = 7, uint8_t lsb = 0, uint8_t checkInterval = 2, uint8_t checkMask = 0xFF);
+
158 
+
168  void SPIreadRegisterBurst(uint8_t reg, uint8_t numBytes, uint8_t* inBytes);
+
169 
+
177  uint8_t SPIreadRegister(uint8_t reg);
+
178 
+
188  void SPIwriteRegisterBurst(uint8_t reg, uint8_t* data, uint8_t numBytes);
+
189 
+
197  void SPIwriteRegister(uint8_t reg, uint8_t data);
+
198 
+
212  void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes);
+
213 
+
214  // pin number access methods
+
215 
+
221  RADIOLIB_PIN_TYPE getCs() const { return(_cs); }
+
222 
+
228  RADIOLIB_PIN_TYPE getIrq() const { return(_irq); }
+
229 
+
235  RADIOLIB_PIN_TYPE getRst() const { return(_rst); }
+
236 
+
242  RADIOLIB_PIN_TYPE getGpio() const { return(_gpio); }
243 
-
244  // Arduino core overrides
-
245 
-
253  void pinMode(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode);
-
254 
-
262  void digitalWrite(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS value);
-
263 
-
271  RADIOLIB_PIN_STATUS digitalRead(RADIOLIB_PIN_TYPE pin);
+
252  void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
+
253 
+
261  void setRfSwitchState(RADIOLIB_PIN_STATUS rxPinState, RADIOLIB_PIN_STATUS txPinState);
+
262 
+
271  void waitForMicroseconds(uint32_t start, uint32_t len);
272 
-
280  void tone(RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration = 0);
-
281 
-
287  void noTone(RADIOLIB_PIN_TYPE pin);
-
288 
-
298  void attachInterrupt(RADIOLIB_PIN_TYPE interruptNum, void (*userFunc)(void), RADIOLIB_INTERRUPT_STATUS mode);
-
299 
-
305  void detachInterrupt(RADIOLIB_PIN_TYPE interruptNum);
-
306 
-
310  void yield();
-
311 
-
317  void delay(uint32_t ms);
-
318 
-
324  void delayMicroseconds(uint32_t us);
-
325 
-
329  uint32_t millis();
-
330 
-
334  uint32_t micros();
+
273  // Arduino core overrides
+
274 
+
282  void pinMode(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode);
+
283 
+
291  void digitalWrite(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS value);
+
292 
+
300  RADIOLIB_PIN_STATUS digitalRead(RADIOLIB_PIN_TYPE pin);
+
301 
+
309  void tone(RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration = 0);
+
310 
+
316  void noTone(RADIOLIB_PIN_TYPE pin);
+
317 
+
327  void attachInterrupt(RADIOLIB_PIN_TYPE interruptNum, void (*userFunc)(void), RADIOLIB_INTERRUPT_STATUS mode);
+
328 
+
334  void detachInterrupt(RADIOLIB_PIN_TYPE interruptNum);
335 
-
339  uint32_t pulseIn(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS state, uint32_t timeout);
+
339  void yield();
340 
-
344  void begin();
-
345 
-
349  void beginTransaction();
-
350 
-
354  uint8_t transfer(uint8_t b);
-
355 
-
359  void endTransaction();
-
360 
-
364  void end();
-
365 
-
366  // helper functions to set up SPI overrides on Arduino
-
367  #if defined(RADIOLIB_BUILD_ARDUINO)
-
368  void SPIbegin();
-
369  void SPIend();
-
370  #endif
-
371  virtual void SPIbeginTransaction();
-
372  virtual uint8_t SPItransfer(uint8_t b);
-
373  virtual void SPIendTransaction();
+
346  void delay(uint32_t ms);
+
347 
+
353  void delayMicroseconds(uint32_t us);
+
354 
+
358  uint32_t millis();
+
359 
+
363  uint32_t micros();
+
364 
+
368  uint32_t pulseIn(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS state, uint32_t timeout);
+
369 
+
373  void begin();
374 
-
378  static uint8_t flipBits(uint8_t b);
+
378  void beginTransaction();
379 
-
383  static uint16_t flipBits16(uint16_t i);
+
383  uint8_t transfer(uint8_t b);
384 
-
392  static void hexdump(uint8_t* data, size_t len);
-
393 
-
401  void regdump(uint8_t start, uint8_t len);
-
402 
-
403 #if !defined(RADIOLIB_GODMODE)
-
404  private:
-
405 #endif
-
406 
-
407  // pins
-
408  RADIOLIB_PIN_TYPE _cs = RADIOLIB_NC;
-
409  RADIOLIB_PIN_TYPE _irq = RADIOLIB_NC;
-
410  RADIOLIB_PIN_TYPE _rst = RADIOLIB_NC;
-
411  RADIOLIB_PIN_TYPE _gpio = RADIOLIB_NC;
-
412 
-
413  // SPI interface (Arduino only)
-
414  #if defined(RADIOLIB_BUILD_ARDUINO)
-
415  SPIClass* _spi = NULL;
-
416  SPISettings _spiSettings = RADIOLIB_DEFAULT_SPI_SETTINGS;
-
417  bool _initInterface = false;
-
418  #endif
-
419 
-
420  // RF switch presence and pins
-
421  bool _useRfSwitch = false;
-
422  RADIOLIB_PIN_TYPE _rxEn = RADIOLIB_NC;
-
423  RADIOLIB_PIN_TYPE _txEn = RADIOLIB_NC;
-
424 
-
425  // hardware abstraction layer callbacks
-
426  // this is placed at the end of Module class because the callback generator macros
-
427  // screw with the private/public access specifiers
-
428  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_PIN_MODE);
-
429  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DIGITAL_WRITE);
-
430  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DIGITAL_READ);
-
431  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_TONE);
-
432  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_NO_TONE);
-
433  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_ATTACH_INTERRUPT);
-
434  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DETACH_INTERRUPT);
-
435  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_YIELD);
-
436  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DELAY);
-
437  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DELAY_MICROSECONDS);
-
438  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_MILLIS);
-
439  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_MICROS);
-
440  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_PULSE_IN);
+
388  void endTransaction();
+
389 
+
393  void end();
+
394 
+
395  // helper functions to set up SPI overrides on Arduino
+
396  #if defined(RADIOLIB_BUILD_ARDUINO)
+
397  void SPIbegin();
+
398  void SPIend();
+
399  #endif
+
400  virtual void SPIbeginTransaction();
+
401  virtual uint8_t SPItransfer(uint8_t b);
+
402  virtual void SPIendTransaction();
+
403 
+
407  static uint8_t flipBits(uint8_t b);
+
408 
+
412  static uint16_t flipBits16(uint16_t i);
+
413 
+
421  static void hexdump(uint8_t* data, size_t len);
+
422 
+
430  void regdump(uint8_t start, uint8_t len);
+
431 
+
432 #if !defined(RADIOLIB_GODMODE)
+
433  private:
+
434 #endif
+
435 
+
436  // pins
+
437  RADIOLIB_PIN_TYPE _cs = RADIOLIB_NC;
+
438  RADIOLIB_PIN_TYPE _irq = RADIOLIB_NC;
+
439  RADIOLIB_PIN_TYPE _rst = RADIOLIB_NC;
+
440  RADIOLIB_PIN_TYPE _gpio = RADIOLIB_NC;
441 
-
442  #if defined(RADIOLIB_BUILD_ARDUINO)
-
443  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_BEGIN);
-
444  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION);
-
445  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_TRANSFER);
-
446  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_END_TRANSACTION);
-
447  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_END);
-
448  #else
-
449  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_BEGIN);
-
450  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION);
-
451  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_TRANSFER);
-
452  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_END_TRANSACTION);
-
453  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_END);
-
454  #endif
-
455 };
-
456 
-
457 #endif
+
442  // SPI interface (Arduino only)
+
443  #if defined(RADIOLIB_BUILD_ARDUINO)
+
444  SPIClass* _spi = NULL;
+
445  SPISettings _spiSettings = RADIOLIB_DEFAULT_SPI_SETTINGS;
+
446  bool _initInterface = false;
+
447  #endif
+
448 
+
449  // RF switch presence and pins
+
450  bool _useRfSwitch = false;
+
451  RADIOLIB_PIN_TYPE _rxEn = RADIOLIB_NC;
+
452  RADIOLIB_PIN_TYPE _txEn = RADIOLIB_NC;
+
453 
+
454  #if defined(RADIOLIB_INTERRUPT_TIMING)
+
455  uint32_t _prevTimingLen = 0;
+
456  #endif
+
457 
+
458  // hardware abstraction layer callbacks
+
459  // this is placed at the end of Module class because the callback generator macros
+
460  // screw with the private/public access specifiers
+
461  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_PIN_MODE);
+
462  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DIGITAL_WRITE);
+
463  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DIGITAL_READ);
+
464  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_TONE);
+
465  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_NO_TONE);
+
466  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_ATTACH_INTERRUPT);
+
467  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DETACH_INTERRUPT);
+
468  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_YIELD);
+
469  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DELAY);
+
470  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DELAY_MICROSECONDS);
+
471  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_MILLIS);
+
472  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_MICROS);
+
473  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_PULSE_IN);
+
474 
+
475  #if defined(RADIOLIB_BUILD_ARDUINO)
+
476  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_BEGIN);
+
477  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION);
+
478  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_TRANSFER);
+
479  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_END_TRANSACTION);
+
480  RADIOLIB_GENERATE_CALLBACK_SPI(RADIOLIB_CB_ARGS_SPI_END);
+
481  #else
+
482  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_BEGIN);
+
483  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION);
+
484  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_TRANSFER);
+
485  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_END_TRANSACTION);
+
486  RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_SPI_END);
+
487  #endif
+
488 };
+
489 
+
490 #endif
-
Module::pinMode
void pinMode(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode)
Arduino core pinMode override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:254
-
Module::hexdump
static void hexdump(uint8_t *data, size_t len)
Function to dump data as hex into the debug port.
Definition: Module.cpp:490
-
Module::getIrq
RADIOLIB_PIN_TYPE getIrq() const
Access method to get the pin number of interrupt/GPIO.
Definition: Module.h:209
-
Module::digitalRead
RADIOLIB_PIN_STATUS digitalRead(RADIOLIB_PIN_TYPE pin)
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:268
+
Module::waitForMicroseconds
void waitForMicroseconds(uint32_t start, uint32_t len)
Wait for time to elapse, either using the microsecond timer, or the TimerFlag. Note that in interrupt...
Definition: Module.cpp:254
+
Module::pinMode
void pinMode(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode)
Arduino core pinMode override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:272
+
Module::hexdump
static void hexdump(uint8_t *data, size_t len)
Function to dump data as hex into the debug port.
Definition: Module.cpp:508
+
Module::getIrq
RADIOLIB_PIN_TYPE getIrq() const
Access method to get the pin number of interrupt/GPIO.
Definition: Module.h:228
+
Module::digitalRead
RADIOLIB_PIN_STATUS digitalRead(RADIOLIB_PIN_TYPE pin)
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:286
Module::SPItransfer
void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t *dataOut, uint8_t *dataIn, uint8_t numBytes)
SPI single transfer method.
Definition: Module.cpp:207
-
Module::transfer
uint8_t transfer(uint8_t b)
Arduino core SPI transfer override.
Definition: Module.cpp:418
+
Module::transfer
uint8_t transfer(uint8_t b)
Arduino core SPI transfer override.
Definition: Module.cpp:436
Module::init
void init()
Initialize low-level module control.
Definition: Module.cpp:107
Module::SPIgetRegValue
int16_t SPIgetRegValue(uint8_t reg, uint8_t msb=7, uint8_t lsb=0)
SPI read method that automatically masks unused bits. This method is the preferred SPI read mechanism...
Definition: Module.cpp:130
-
Module::regdump
void regdump(uint8_t start, uint8_t len)
Function to dump device registers as hex into the debug port.
Definition: Module.cpp:522
-
Module::getRst
RADIOLIB_PIN_TYPE getRst() const
Access method to get the pin number of hardware reset pin.
Definition: Module.h:216
-
Module::begin
void begin()
Arduino core SPI begin override.
Definition: Module.cpp:400
+
Module::regdump
void regdump(uint8_t start, uint8_t len)
Function to dump device registers as hex into the debug port.
Definition: Module.cpp:540
+
Module::getRst
RADIOLIB_PIN_TYPE getRst() const
Access method to get the pin number of hardware reset pin.
Definition: Module.h:235
+
Module::begin
void begin()
Arduino core SPI begin override.
Definition: Module.cpp:418
Module::SPIwriteCommand
uint8_t SPIwriteCommand
Basic SPI write command. Defaults to 0x80.
Definition: Module.h:92
-
Module::delay
void delay(uint32_t ms)
Arduino core delay override.
Definition: Module.cpp:365
-
Module::yield
void yield()
Arduino core yield override.
Definition: Module.cpp:356
-
Module::digitalWrite
void digitalWrite(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS value)
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:261
-
Module::micros
uint32_t micros()
Arduino core micros override.
Definition: Module.cpp:386
-
Module::getCs
RADIOLIB_PIN_TYPE getCs() const
Access method to get the pin number of SPI chip select.
Definition: Module.h:202
+
Module::delay
void delay(uint32_t ms)
Arduino core delay override.
Definition: Module.cpp:383
+
Module::yield
void yield()
Arduino core yield override.
Definition: Module.cpp:374
+
Module::digitalWrite
void digitalWrite(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS value)
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin.
Definition: Module.cpp:279
+
Module::micros
uint32_t micros()
Arduino core micros override.
Definition: Module.cpp:404
+
Module::getCs
RADIOLIB_PIN_TYPE getCs() const
Access method to get the pin number of SPI chip select.
Definition: Module.h:221
Module::SPIsetRegValue
int16_t SPIsetRegValue(uint8_t reg, uint8_t value, uint8_t msb=7, uint8_t lsb=0, uint8_t checkInterval=2, uint8_t checkMask=0xFF)
Overwrite-safe SPI write method with verification. This method is the preferred SPI write mechanism.
Definition: Module.cpp:140
-
Module::tone
void tone(RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration=0)
Arduino core tone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPPOR...
Definition: Module.cpp:280
+
Module::tone
void tone(RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration=0)
Arduino core tone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPPOR...
Definition: Module.cpp:298
Module::SPIwriteRegister
void SPIwriteRegister(uint8_t reg, uint8_t data)
SPI basic write method. Use of this method is reserved for special cases, SPIsetRegValue should be us...
Definition: Module.cpp:203
-
Module::noTone
void noTone(RADIOLIB_PIN_TYPE pin)
Arduino core noTone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPP...
Definition: Module.cpp:315
-
Module::endTransaction
void endTransaction()
Arduino core SPI endTransaction override.
Definition: Module.cpp:427
-
Module::setRfSwitchPins
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn)
Some modules contain external RF switch controlled by two pins. This function gives RadioLib control ...
Definition: Module.cpp:535
-
Module::getGpio
RADIOLIB_PIN_TYPE getGpio() const
Access method to get the pin number of second interrupt/GPIO.
Definition: Module.h:223
+
Module::noTone
void noTone(RADIOLIB_PIN_TYPE pin)
Arduino core noTone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPP...
Definition: Module.cpp:333
+
Module::endTransaction
void endTransaction()
Arduino core SPI endTransaction override.
Definition: Module.cpp:445
+
Module::setRfSwitchPins
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn)
Some modules contain external RF switch controlled by two pins. This function gives RadioLib control ...
Definition: Module.cpp:553
+
Module::getGpio
RADIOLIB_PIN_TYPE getGpio() const
Access method to get the pin number of second interrupt/GPIO.
Definition: Module.h:242
Module::Module
Module(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE gpio=RADIOLIB_NC)
Default constructor.
Definition: Module.cpp:81
-
Module::flipBits16
static uint16_t flipBits16(uint16_t i)
Function to reflect bits within an integer.
Definition: Module.cpp:482
+
Module::flipBits16
static uint16_t flipBits16(uint16_t i)
Function to reflect bits within an integer.
Definition: Module.cpp:500
Module::SPIreadRegister
uint8_t SPIreadRegister(uint8_t reg)
SPI basic read method. Use of this method is reserved for special cases, SPIgetRegValue should be use...
Definition: Module.cpp:193
Module
Implements all common low-level methods to control the wireless module. Every module class contains o...
Definition: Module.h:16
Module::operator=
Module & operator=(const Module &mod)
Overload for assignment operator.
Definition: Module.cpp:96
-
Module::end
void end()
Arduino core SPI end override.
Definition: Module.cpp:436
+
Module::end
void end()
Arduino core SPI end override.
Definition: Module.cpp:454
Module::term
void term()
Terminate low-level module control.
Definition: Module.cpp:117
Module::SPIreadCommand
uint8_t SPIreadCommand
Basic SPI read command. Defaults to 0x00.
Definition: Module.h:87
-
Module::detachInterrupt
void detachInterrupt(RADIOLIB_PIN_TYPE interruptNum)
Arduino core detachInterrupt override.
Definition: Module.cpp:349
-
Module::setRfSwitchState
void setRfSwitchState(RADIOLIB_PIN_STATUS rxPinState, RADIOLIB_PIN_STATUS txPinState)
Set RF switch state.
Definition: Module.cpp:543
+
Module::detachInterrupt
void detachInterrupt(RADIOLIB_PIN_TYPE interruptNum)
Arduino core detachInterrupt override.
Definition: Module.cpp:367
+
Module::setRfSwitchState
void setRfSwitchState(RADIOLIB_PIN_STATUS rxPinState, RADIOLIB_PIN_STATUS txPinState)
Set RF switch state.
Definition: Module.cpp:561
Module::SPIreadRegisterBurst
void SPIreadRegisterBurst(uint8_t reg, uint8_t numBytes, uint8_t *inBytes)
SPI burst read method.
Definition: Module.cpp:189
-
Module::pulseIn
uint32_t pulseIn(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS state, uint32_t timeout)
Arduino core pulseIn override.
Definition: Module.cpp:393
-
Module::flipBits
static uint8_t flipBits(uint8_t b)
Function to reflect bits within a byte.
Definition: Module.cpp:475
-
Module::millis
uint32_t millis()
Arduino core millis override.
Definition: Module.cpp:379
-
Module::delayMicroseconds
void delayMicroseconds(uint32_t us)
Arduino core delayMicroseconds override.
Definition: Module.cpp:372
-
Module::attachInterrupt
void attachInterrupt(RADIOLIB_PIN_TYPE interruptNum, void(*userFunc)(void), RADIOLIB_INTERRUPT_STATUS mode)
Arduino core attachInterrupt override.
Definition: Module.cpp:342
-
Module::beginTransaction
void beginTransaction()
Arduino core SPI beginTransaction override.
Definition: Module.cpp:409
+
Module::pulseIn
uint32_t pulseIn(RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS state, uint32_t timeout)
Arduino core pulseIn override.
Definition: Module.cpp:411
+
Module::flipBits
static uint8_t flipBits(uint8_t b)
Function to reflect bits within a byte.
Definition: Module.cpp:493
+
Module::millis
uint32_t millis()
Arduino core millis override.
Definition: Module.cpp:397
+
Module::delayMicroseconds
void delayMicroseconds(uint32_t us)
Arduino core delayMicroseconds override.
Definition: Module.cpp:390
+
Module::attachInterrupt
void attachInterrupt(RADIOLIB_PIN_TYPE interruptNum, void(*userFunc)(void), RADIOLIB_INTERRUPT_STATUS mode)
Arduino core attachInterrupt override.
Definition: Module.cpp:360
+
Module::beginTransaction
void beginTransaction()
Arduino core SPI beginTransaction override.
Definition: Module.cpp:427
Module::SPIwriteRegisterBurst
void SPIwriteRegisterBurst(uint8_t reg, uint8_t *data, uint8_t numBytes)
SPI burst write method.
Definition: Module.cpp:199
PhysicalLayer::transmit
int16_t transmit(__FlashStringHelper *fstr, uint8_t addr=0)
Arduino Flash String transmit method.
Definition: PhysicalLayer.cpp:12
diff --git a/_r_t_t_y_8h_source.html b/_r_t_t_y_8h_source.html index 4971660f..cb800b83 100644 --- a/_r_t_t_y_8h_source.html +++ b/_r_t_t_y_8h_source.html @@ -214,7 +214,7 @@ $(document).ready(function(){initNavTree('_r_t_t_y_8h_source.html',''); initResi
192 #endif
-
RTTYClient::standby
int16_t standby()
Stops transmitting.
Definition: RTTY.cpp:533
+
RTTYClient::standby
int16_t standby()
Stops transmitting.
Definition: RTTY.cpp:529
ITA2String::length
size_t length()
Gets the length of the ITA2 string. This number is not the same as the length of ASCII-encoded string...
Definition: RTTY.cpp:28
RTTYClient::idle
void idle()
Send out idle condition (RF tone at mark frequency).
Definition: RTTY.cpp:174
AFSKClient
Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direc...
Definition: AFSK.h:17
diff --git a/class_module-members.html b/class_module-members.html index 8744373f..b8748509 100644 --- a/class_module-members.html +++ b/class_module-members.html @@ -133,7 +133,8 @@ $(document).ready(function(){initNavTree('class_module.html',''); initResizable( term()Module tone(RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration=0)Module transfer(uint8_t b)Module - yield()Module + waitForMicroseconds(uint32_t start, uint32_t len)Module + yield()Module diff --git a/class_module.html b/class_module.html index 93cdce83..ce9a9129 100644 --- a/class_module.html +++ b/class_module.html @@ -155,6 +155,9 @@ void void setRfSwitchState (RADIOLIB_PIN_STATUS rxPinState, RADIOLIB_PIN_STATUS txPinState)  Set RF switch state. More...
  +void waitForMicroseconds (uint32_t start, uint32_t len) + Wait for time to elapse, either using the microsecond timer, or the TimerFlag. Note that in interrupt timing mode, it is up to the user to set up the timing interrupt! More...
+  void pinMode (RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode)  Arduino core pinMode override that checks RADIOLIB_NC as alias for unused pin. More...
  @@ -1242,6 +1245,43 @@ uint8_t  +

◆ waitForMicroseconds()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void Module::waitForMicroseconds (uint32_t start,
uint32_t len 
)
+
+ +

Wait for time to elapse, either using the microsecond timer, or the TimerFlag. Note that in interrupt timing mode, it is up to the user to set up the timing interrupt!

+
Parameters
+ + + +
startWaiting start timestamp, in microseconds.
lenWaiting duration, in microseconds;
+
+
+

The documentation for this class was generated from the following files: