[PHY] Added support for interrupt-based timing
This commit is contained in:
parent
04357cb306
commit
c3d6700e76
2 changed files with 28 additions and 0 deletions
|
@ -266,3 +266,15 @@ int16_t PhysicalLayer::setDIOMapping(RADIOLIB_PIN_TYPE pin, uint8_t value) {
|
||||||
(void)value;
|
(void)value;
|
||||||
return(RADIOLIB_ERR_UNSUPPORTED);
|
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
|
||||||
|
|
|
@ -344,6 +344,22 @@ class PhysicalLayer {
|
||||||
*/
|
*/
|
||||||
virtual int16_t setDIOMapping(RADIOLIB_PIN_TYPE pin, uint8_t value);
|
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)
|
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
|
||||||
protected:
|
protected:
|
||||||
void updateDirectBuffer(uint8_t bit);
|
void updateDirectBuffer(uint8_t bit);
|
||||||
|
|
Loading…
Add table
Reference in a new issue