Jump to main content

##

# 2.109.4 SENTx_ErrorCallbackRegister 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 encountering an error during data reception for the SENTx Peripheral.

## Description

This function registers a callback upon encountering an error during data reception. The callback function allows the user to define custom actions to be taken when error occurs, 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_ERROR_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 MyErrorReceiveCompleteCallback(uintptr_t context) {
        /*Custom actions to be taken upon encountering an error during reception
        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.