2.109.9 SENTx_ReceiveCompleteCallbackRegister Function
C
/* x refers to the instance number */
void SENTx_ReceiveCompleteCallbackRegister(SENT_RECEIVE_COMPLETE_CALLBACK callback_fn, uintptr_t context)
Summary
Registers a callback function to be called upon the completion of data reception for the SENTx Peripheral when it acts as a receiver.
Description
This function registers a callback upon completion of data reception. The callback function allows the user to define custom actions to be taken when data reception is complete, such as processing the received data or signaling other parts of the application.
Precondition
Ensure that the SENT instance is properly initialized and configured before calling this function. The function does not perform any error checking related to the initialization state of the SENT instance.
Parameters
| Param | Description |
|---|---|
| callback_fn | The user-defined callback function to be registered. This function should match the signature defined by `SENT_RECEIVE_COMPLETE_CALLBACK`. |
| context | A user-defined context value that will be passed to the callback function when it is invoked. This can be used to provide additional information or state to the callback function. |
Returns
None.
Example
void MyReceiveCompleteCallback(uintptr_t context) {
/*Custom actions to be taken upon data reception completion
The context parameter can be used to access additional information or state*/
}
/*Initialize and configure the SENT instance*/
SENT2_Initialize();
/*Register the receive complete callback*/
SENT2_ReceiveCompleteCallbackRegister(MyReceiveCompleteCallback, (uintptr_t)myContext);
Remarks
None.
