local for mbed5
Diff: radio.h
- Revision:
- 3:7e3595a9ebe0
- Parent:
- 0:deaafdfde3bb
- Child:
- 4:c6ef863d0b07
--- a/radio.h Fri Sep 23 09:38:34 2016 +0000 +++ b/radio.h Wed Oct 12 08:49:58 2016 +0000 @@ -33,26 +33,13 @@ }RadioStatus_t; /*! - * \brief Structure describing the ranging codes for callback functions - */ -enum IrqRangingCode_t -{ - IRQ_RANGING_SLAVE_ERROR_CODE, - IRQ_RANGING_SLAVE_VALID_CODE, - IRQ_RANGING_SLAVE_RESPONSE_DONE_CODE, - IRQ_RANGING_MASTER_TIMEOUT_CODE, - IRQ_RANGING_MASTER_VALID_CODE, -}; - -/*! * \brief Structure describing the error codes for callback functions */ enum IrqErrorCode_t { IRQ_HEADER_ERROR_CODE = 0x01, IRQ_SYNCWORD_ERROR_CODE = 0x02, - IRQ_GFSK_ERROR_CODE = 0x04, - IRQ_LORA_CRC_ERROR_CODE = 0x04, + IRQ_CRC_ERROR_CODE = 0x04, }; @@ -60,7 +47,14 @@ { IRQ_PBL_DETECT_CODE = 0x01, IRQ_SYNCWORD_VALID_CODE = 0x02, - IRQ_hEADER_VALID_CODE = 0x04, + IRQ_HEADER_VALID_CODE = 0x04, +}; + +enum IrqTimeoutCode_t +{ + IRQ_RX_TIMEOUT = 0x00, + IRQ_TX_TIMEOUT = 0x01, + IRQ_XYZ = 0xFF, }; /*! @@ -96,8 +90,10 @@ /*! * \brief Callback on Rx Tx timeout interrupt + * + * \param [out] errCode A code indicating the source of the Timeout interrupt */ - void ( *rxTxTimeout )( ); + void ( *rxTxTimeout )( IrqTimeoutCode_t timeoutCode ); /*! * \brief Callback on Rx error interrupt @@ -107,13 +103,6 @@ void ( *rxError )( IrqErrorCode_t errCode ); /*! - * \brief Callback on ranging done interrupt - * - * \param [out] val A flag indicating the type of interrupt (Master/Slave and Valid/Error) - */ - void ( *rangingDone )( IrqRangingCode_t val ); - - /*! * \brief Callback on Channel Activity Detection done interrupt * * \param [out] cadFlag Flag for channel activity detected or not @@ -127,7 +116,7 @@ * Sets the callbacks functions pointers */ Radio( void ( *txDone )( ), void ( *rxDone )( ), void ( *rxPblSyncWordHeader )(IrqPblSyncHeaderCode_t val ), - void ( *rxTxTimeout )( ), void ( *rxError )( IrqErrorCode_t errorCode ), void ( *rangingDone )( IrqRangingCode_t val ), + void ( *rxTxTimeout )( IrqTimeoutCode_t timeoutCode ), void ( *rxError )( IrqErrorCode_t errorCode ), void ( *cadDone )( bool channelActivityDetected ) ) { this->txDone = txDone; @@ -135,7 +124,6 @@ this->rxPblSyncWordHeader = rxPblSyncWordHeader; this->rxTxTimeout = rxTxTimeout; this->rxError = rxError; - this->rangingDone = rangingDone; this->cadDone = cadDone; } virtual ~Radio( ){ };