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: radio/radio.h
- Revision:
- 63:5b9d391244dc
- Parent:
- 61:08b50780eb91
- Child:
- 65:b2d98328fcba
diff -r 835c5e20834e -r 5b9d391244dc radio/radio.h --- a/radio/radio.h Mon Jun 05 01:35:40 2017 +0200 +++ b/radio/radio.h Thu Jun 29 19:30:24 2017 +0200 @@ -130,11 +130,11 @@ /*! * @brief Tx Done callback prototype. */ - void ( *TxDone )(void *radio); + void ( *TxDone )(void *radio, void *userThisPtr, void *userData); /*! * @brief Tx Timeout callback prototype. */ - void ( *TxTimeout )(void *radio); + void ( *TxTimeout )(void *radio, void *userThisPtr, void *userData); /*! * @brief Rx Done callback prototype. * @@ -145,28 +145,42 @@ * FSK : N/A ( set to 0 ) * LoRa: SNR value in dB */ - void ( *RxDone )(void *radio, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ); + void ( *RxDone )(void *radio, void *userThisPtr, void *userData, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ); /*! * @brief Rx Timeout callback prototype. */ - void ( *RxTimeout )(void *radio); + void ( *RxTimeout )(void *radio, void *userThisPtr, void *userData); /*! * @brief Rx Error callback prototype. */ - void ( *RxError )(void *radio); + void ( *RxError )(void *radio, void *userThisPtr, void *userData); /*! * \brief FHSS Change Channel callback prototype. * * \param [IN] currentChannel Index number of the current channel */ - void ( *FhssChangeChannel )(void *radio, uint8_t currentChannel ); + void ( *FhssChangeChannel )(void *radio, void *userThisPtr, void *userData, uint8_t currentChannel ); /*! * @brief CAD Done callback prototype. * * @param [IN] channelDetected Channel Activity detected during the CAD */ - void ( *CadDone ) (void *radio, bool channelActivityDetected ); + void ( *CadDone ) (void *radio, void *userThisPtr, void *userData, bool channelActivityDetected ); + + /* + * Optional data which is being provided in callbacks + * can be used e.g. for the C++ this pointer. + */ + void *userThisPtr; + + /* + * Optional data which allows to bring in data structures pointer + * for a given radio. As callbacks are being called in interrupt level + * the userData is perfect to know the context without iterating this + * data structures. + */ + void *userData; }RadioEvents_t;