[SX126x] Add public method to handle LR-FHSS hopping
This commit is contained in:
parent
fc6ff698b9
commit
c187960cc1
3 changed files with 19 additions and 2 deletions
|
@ -246,6 +246,7 @@ spectralScanAbort KEYWORD2
|
||||||
spectralScanGetStatus KEYWORD2
|
spectralScanGetStatus KEYWORD2
|
||||||
spectralScanGetResult KEYWORD2
|
spectralScanGetResult KEYWORD2
|
||||||
setPaRampTime KEYWORD2
|
setPaRampTime KEYWORD2
|
||||||
|
hopLRFHSS KEYWORD2
|
||||||
|
|
||||||
# nRF24
|
# nRF24
|
||||||
setIrqAction KEYWORD2
|
setIrqAction KEYWORD2
|
||||||
|
|
|
@ -235,8 +235,7 @@ int16_t SX126x::transmit(const uint8_t* data, size_t len, uint8_t addr) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// handle frequency hop
|
// handle frequency hop
|
||||||
this->setLRFHSSHop(this->lrFhssHopNum % 16);
|
this->hopLRFHSS();
|
||||||
clearIrqStatus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -477,6 +476,16 @@ int16_t SX126x::standby(uint8_t mode, bool wakeup) {
|
||||||
return(this->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_SET_STANDBY, data, 1));
|
return(this->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_SET_STANDBY, data, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t SX126x::hopLRFHSS() {
|
||||||
|
if(!(this->getIrqFlags() & RADIOLIB_SX126X_IRQ_LR_FHSS_HOP)) {
|
||||||
|
return(RADIOLIB_ERR_TX_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t state = this->setLRFHSSHop(this->lrFhssHopNum % 16);
|
||||||
|
RADIOLIB_ASSERT(state);
|
||||||
|
return(clearIrqStatus());
|
||||||
|
}
|
||||||
|
|
||||||
void SX126x::setDio1Action(void (*func)(void)) {
|
void SX126x::setDio1Action(void (*func)(void)) {
|
||||||
this->mod->hal->attachInterrupt(this->mod->hal->pinToInterrupt(this->mod->getIrq()), func, this->mod->hal->GpioInterruptRising);
|
this->mod->hal->attachInterrupt(this->mod->hal->pinToInterrupt(this->mod->getIrq()), func, this->mod->hal->GpioInterruptRising);
|
||||||
}
|
}
|
||||||
|
|
|
@ -628,6 +628,13 @@ class SX126x: public PhysicalLayer {
|
||||||
*/
|
*/
|
||||||
int16_t standby(uint8_t mode, bool wakeup = true);
|
int16_t standby(uint8_t mode, bool wakeup = true);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Handle LR-FHSS hop.
|
||||||
|
When using LR-FHSS in interrupt-driven mode, this method MUST be called each time an interrupt is triggered!
|
||||||
|
\returns \ref status_codes
|
||||||
|
*/
|
||||||
|
int16_t hopLRFHSS();
|
||||||
|
|
||||||
// interrupt methods
|
// interrupt methods
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Add table
Reference in a new issue