XilinxProcessorIPLib/drivers/i2stx/src/xi2stx_intr.c
int XI2s_Tx_SetHandler(XI2s_Tx *InstancePtr,
		XI2s_Tx_HandlerType HandlerType,
		XI2s_Tx_Callback FuncPtr,
		void *CallbackRef)
{
	int Status = XST_SUCCESS;
	/* Verify arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid((HandlerType >= XI2S_TX_HANDLER_AES_BLKCMPLT) &&
			(HandlerType <  XI2S_TX_NUM_HANDLERS));
	Xil_AssertNonvoid(FuncPtr != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);

	/* Check for handler type */
	switch (HandlerType) {
		case (XI2S_TX_HANDLER_AES_BLKCMPLT):
			InstancePtr->AesBlkCmpltHandler = FuncPtr;
			InstancePtr->AesBlkCmpltRef = CallbackRef;
			break;

		case (XI2S_TX_HANDLER_AES_BLKSYNCERR):
			InstancePtr->AesBlkSyncErrHandler = FuncPtr;
			InstancePtr->AesBlkSyncErrRef = CallbackRef;
			break;

		case (XI2S_TX_HANDLER_AES_CHSTSUPD):
			InstancePtr->AesChStsUpdHandler = FuncPtr;
			InstancePtr->AesChStsUpdRef = CallbackRef;
			break;

		case (XI2S_TX_HANDLER_AUD_UNDRFLW):
			InstancePtr->AudUndrflwHandler = FuncPtr;
			InstancePtr->AudUndrflwRef = CallbackRef;
			break;

		default:
			Status = XST_INVALID_PARAM;
			break;
	}
	return Status;
}
/*****************************************************************************/
/**
 *
 * This function installs an asynchronous callback function for the given
 * HandlerType:
 *
 * <pre>
 * HandlerType                              Callback Function
 * --------------------------------         -------------------------
 * (XI2S_TX_HANDLER_AES_BLKCMPLT)            AesBlkCmpltHandler
 * (XI2S_TX_HANDLER_AES_BLKSYNCERR)          AesBlkSyncErrHandler
 * (XI2S_TX_HANDLER_AES_CHSTSUPD)            AesChStsUpdHandler
 * (XI2S_TX_HANDLER_AUD_UNDRFLW)             AudUndrflwHandler
 * </pre>
 *
 * @param InstancePtr is a pointer to the XI2s_Tx core instance.
 * @param HandlerType specifies the type of handler.
 * @param FuncPtr is a pointer to the callback function.
 * @param CallbackRef is a reference pointer passed on actual
 *        calling of the callback function.
 *
 * @return
 *  - XST_SUCCESS if callback function installed successfully.
 *  - XST_INVALID_PARAM when HandlerType is invalid.
 *
 * @note Invoking this function for a handler that already has been
 *       installed replaces it with the new handler.
 *
 *****************************************************************************/
This function installs an asynchronous callback function for the given
HandlerType.



@param InstancePtr is a pointer to the XI2s_Tx core instance.
@param HandlerType specifies the type of handler.
@param FuncPtr is a pointer to the callback function.
@param CallbackRef is a reference pointer passed on actual
calling of the callback function.

@return
- XST_SUCCESS if callback function installed successfully.

@note Invoking this function for a handler that already has been
installed replaces it with the new handler.
This function installs an asynchronous callback function for the given HandlerType . @param InstancePtr is a pointer to the XI2s_Tx core instance . @param HandlerType specifies the type of handler . @param FuncPtr is a pointer to the callback function . @param CallbackRef is a reference pointer passed on actual calling of the callback function . @return - XST_SUCCESS if callback function installed successfully . @note Invoking this function for a handler that already has been installed replaces it with the new handler .
int XI2s_Tx_SetHandler(XI2s_Tx *InstancePtr,
		XI2s_Tx_HandlerType HandlerType,
		XI2s_Tx_Callback FuncPtr,
		void *CallbackRef)
{
	int Status = XST_SUCCESS;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid((HandlerType >= XI2S_TX_HANDLER_AES_BLKCMPLT) &&
			(HandlerType <  XI2S_TX_NUM_HANDLERS));
	Xil_AssertNonvoid(FuncPtr != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);
	switch (HandlerType) {
		case (XI2S_TX_HANDLER_AES_BLKCMPLT):
			InstancePtr->AesBlkCmpltHandler = FuncPtr;
			InstancePtr->AesBlkCmpltRef = CallbackRef;
			break;
		case (XI2S_TX_HANDLER_AES_BLKSYNCERR):
			InstancePtr->AesBlkSyncErrHandler = FuncPtr;
			InstancePtr->AesBlkSyncErrRef = CallbackRef;
			break;
		case (XI2S_TX_HANDLER_AES_CHSTSUPD):
			InstancePtr->AesChStsUpdHandler = FuncPtr;
			InstancePtr->AesChStsUpdRef = CallbackRef;
			break;
		case (XI2S_TX_HANDLER_AUD_UNDRFLW):
			InstancePtr->AudUndrflwHandler = FuncPtr;
			InstancePtr->AudUndrflwRef = CallbackRef;
			break;
		default:
			Status = XST_INVALID_PARAM;
			break;
	}
	return Status;
}
int XI2s_Tx_SetHandler ( XI2s_Tx * InstancePtr , XI2s_Tx_HandlerType HandlerType , XI2s_Tx_Callback FuncPtr , void * CallbackRef ) { int Status = XST_SUCCESS ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( ( HandlerType >= XI2S_TX_HANDLER_AES_BLKCMPLT ) && ( HandlerType < XI2S_TX_NUM_HANDLERS ) ) ; Xil_AssertNonvoid ( FuncPtr != NULL ) ; Xil_AssertNonvoid ( CallbackRef != NULL ) ; switch ( HandlerType ) { case ( XI2S_TX_HANDLER_AES_BLKCMPLT ) : InstancePtr -> AesBlkCmpltHandler = FuncPtr ; InstancePtr -> AesBlkCmpltRef = CallbackRef ; break ; case ( XI2S_TX_HANDLER_AES_BLKSYNCERR ) : InstancePtr -> AesBlkSyncErrHandler = FuncPtr ; InstancePtr -> AesBlkSyncErrRef = CallbackRef ; break ; case ( XI2S_TX_HANDLER_AES_CHSTSUPD ) : InstancePtr -> AesChStsUpdHandler = FuncPtr ; InstancePtr -> AesChStsUpdRef = CallbackRef ; break ; case ( XI2S_TX_HANDLER_AUD_UNDRFLW ) : InstancePtr -> AudUndrflwHandler = FuncPtr ; InstancePtr -> AudUndrflwRef = CallbackRef ; break ; default : Status = XST_INVALID_PARAM ; break ; } return Status ; }
This function installs an asynchronous callback function for the given
 HandlerType:
This function installs an asynchronous callback function for the given HandlerType :
/* Verify arguments */ /* Check for handler type */