[RF69] Added direct reception support

This commit is contained in:
jgromes 2021-06-14 21:14:55 +02:00
parent 06d40c78bc
commit 536829452f
2 changed files with 22 additions and 0 deletions

View file

@ -819,6 +819,14 @@ uint8_t RF69::random() {
return(randByte); return(randByte);
} }
void RF69::setDirectAction(void (*func)(void)) {
setDio1Action(func);
}
void RF69::readBit(RADIOLIB_PIN_TYPE pin) {
updateDirectBuffer((uint8_t)digitalRead(pin));
}
int16_t RF69::getChipVersion() { int16_t RF69::getChipVersion() {
return(_mod->SPIgetRegValue(RF69_REG_VERSION)); return(_mod->SPIgetRegValue(RF69_REG_VERSION));
} }

View file

@ -869,6 +869,20 @@ class RF69: public PhysicalLayer {
*/ */
int16_t getChipVersion(); int16_t getChipVersion();
/*!
\brief Set interrupt service routine function to call when data bit is receveid in direct mode.
\param func Pointer to interrupt service routine.
*/
void setDirectAction(void (*func)(void));
/*!
\brief Function to read and process data bit in direct reception mode.
\param pin Pin on which to read.
*/
void readBit(RADIOLIB_PIN_TYPE pin);
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) #if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
protected: protected:
#endif #endif