I made a fork of a generic library that was developed with support for RFM95 LoRa module that I found online. I Made a few changes and made it compatible with hardware limitations of the MAX32620FTHR and MAX32630FTHR module.
Dependents: MAX326xxFTHR_LoRa_RFM95 MAX326xxFTHR_LoRa_PingPong MAX326xxFTHR_RFM95_LoRa_PingPong MAX326xxFTHR_LoRa_RFM95_PingPong_Example ... more
Fork of SX1276GenericLib by
Diff: sx1276/sx1276-mbed-hal.cpp
- Revision:
- 42:72deced1a4c4
- Parent:
- 41:2dbc4afedf61
- Child:
- 43:90de42f3c1fd
- Child:
- 44:544add59b26d
--- a/sx1276/sx1276-mbed-hal.cpp Mon May 08 15:39:42 2017 +0200 +++ b/sx1276/sx1276-mbed-hal.cpp Mon May 08 22:52:31 2017 +0200 @@ -347,9 +347,30 @@ } } -void SX1276Generic::SetTimeout(Timeout_t timer, int timeout_ms) +void SX1276Generic::SetTimeout(TimeoutTimer_t timer, int timeout_ms) { - + SX1276 *sx = this; + switch(timer) { + case RXTimeoutTimer: + if (timeout_ms) + rxTimeoutTimer.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + rxTimeoutTimer.detach(); + break; + case TXTimeoutTimer: + if (timeout_ms) + txTimeoutTimer.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + txTimeoutTimer.detach(); + break; + case RXTimeoutSyncWorldTimer: + if (timeout_ms) + rxTimeoutSyncWord.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + rxTimeoutSyncWord.detach(); + break; + break; + } } bool SX1276Generic::CheckRfFrequency( uint32_t frequency )