[PHY] Added support for interrupt-based timing

This commit is contained in:
jgromes 2022-11-18 17:04:52 +01:00
parent 04357cb306
commit c3d6700e76
2 changed files with 28 additions and 0 deletions

View file

@ -266,3 +266,15 @@ int16_t PhysicalLayer::setDIOMapping(RADIOLIB_PIN_TYPE pin, uint8_t value) {
(void)value;
return(RADIOLIB_ERR_UNSUPPORTED);
}
#if defined(RADIOLIB_INTERRUPT_TIMING)
void PhysicalLayer::setInterruptSetup(void (*func)(uint32_t)) {
Module* mod = getMod();
mod->TimerSetupCb = func;
}
void PhysicalLayer::setTimerFlag() {
Module* mod = getMod();
mod->TimerFlag = true;
}
#endif

View file

@ -344,6 +344,22 @@ class PhysicalLayer {
*/
virtual int16_t setDIOMapping(RADIOLIB_PIN_TYPE pin, uint8_t value);
#if defined(RADIOLIB_INTERRUPT_TIMING)
/*!
\brief Set function to be called to set up the timing interrupt.
\param func Setup function to be called, with one argument (pulse length in microseconds).
*/
void setInterruptSetup(void (*func)(uint32_t));
/*!
\brief Set timing interrupt flag.
*/
void setTimerFlag();
#endif
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
protected:
void updateDirectBuffer(uint8_t bit);