XilinxProcessorIPLib/drivers/hwicap/src/xhwicap_intr.c
void XHwIcap_IntrHandler(void *InstancePtr)
{
	XHwIcap *HwIcapPtr = (XHwIcap *) InstancePtr;
	u32 IntrStatus;
	u32 WrFifoVacancy;


	Xil_AssertVoid(InstancePtr != NULL);


	/*
	 * Get the Interrupt status.
	 */
	IntrStatus = XHwIcap_IntrGetStatus(HwIcapPtr);

	if (IntrStatus & XHI_IPIXR_WRP_MASK) {

		/*
		 * A transmit has just completed. Check for more data
		 * to transmit.
		 */
		if (HwIcapPtr->RemainingWords > 0) {

			/*
			 * Fill the FIFO with as many words as it will take (or
			 * as many as we have to write). We can use the Write
			 * FIFO vacancy to know if the device can take more data.
			 */
			WrFifoVacancy = XHwIcap_GetWrFifoVacancy(HwIcapPtr);
			while ((WrFifoVacancy != 0) &&
			       (HwIcapPtr->RemainingWords > 0)) {
				XHwIcap_FifoWrite(HwIcapPtr,
						*HwIcapPtr->SendBufferPtr);

				HwIcapPtr->RemainingWords--;
				WrFifoVacancy--;
				HwIcapPtr->SendBufferPtr++;
			}

			XHwIcap_StartConfig(HwIcapPtr);
		}
		else {

			if (HwIcapPtr->RequestedWords != 0) {

				/*
				 * No more data to send. Disable the interrupts
				 * by disabling the Global Interrupts.
				 * Inform the upper layer software that the
				 * transfer is done.
				 */
				XHwIcap_IntrGlobalDisable(HwIcapPtr);
				HwIcapPtr->IsTransferInProgress = FALSE;
				HwIcapPtr->StatusHandler(HwIcapPtr->StatusRef,
						    XST_HWICAP_WRITE_DONE,
						    HwIcapPtr->RequestedWords);
			}
		}
	}


	/*
	 * Clear the Interrupt status.
	 */
	XHwIcap_IntrClear(HwIcapPtr, IntrStatus);

}
/*****************************************************************************/
/**
*
* The interrupt handler for HwIcap interrupts. This function must be connected
* by the user to an interrupt source.
*
* @param	InstancePtr is a pointer to the XHwIcap instance.
*
* @return	None.
*
* @note		The interrupts are being used only while writing data to the
*		ICAP device. The reading of the data from the ICAP device is
*		done in polled mode.
*		In a worst case scenario the interrupt handler can
*		be busy writing large amount of data to the Write FIFO.
*
******************************************************************************/
The interrupt handler for HwIcap interrupts. This function must be connected
by the user to an interrupt source.
The interrupt handler for HwIcap interrupts . This function must be connected by the user to an interrupt source .
void XHwIcap_IntrHandler(void *InstancePtr)
{
	XHwIcap *HwIcapPtr = (XHwIcap *) InstancePtr;
	u32 IntrStatus;
	u32 WrFifoVacancy;
	Xil_AssertVoid(InstancePtr != NULL);
	IntrStatus = XHwIcap_IntrGetStatus(HwIcapPtr);
	if (IntrStatus & XHI_IPIXR_WRP_MASK) {
		if (HwIcapPtr->RemainingWords > 0) {
			WrFifoVacancy = XHwIcap_GetWrFifoVacancy(HwIcapPtr);
			while ((WrFifoVacancy != 0) &&
			       (HwIcapPtr->RemainingWords > 0)) {
				XHwIcap_FifoWrite(HwIcapPtr,
						*HwIcapPtr->SendBufferPtr);
				HwIcapPtr->RemainingWords--;
				WrFifoVacancy--;
				HwIcapPtr->SendBufferPtr++;
			}
			XHwIcap_StartConfig(HwIcapPtr);
		}
		else {
			if (HwIcapPtr->RequestedWords != 0) {
				XHwIcap_IntrGlobalDisable(HwIcapPtr);
				HwIcapPtr->IsTransferInProgress = FALSE;
				HwIcapPtr->StatusHandler(HwIcapPtr->StatusRef,
						    XST_HWICAP_WRITE_DONE,
						    HwIcapPtr->RequestedWords);
			}
		}
	}
	XHwIcap_IntrClear(HwIcapPtr, IntrStatus);
}
void XHwIcap_IntrHandler ( void * InstancePtr ) { XHwIcap * HwIcapPtr = ( XHwIcap * ) InstancePtr ; u32 IntrStatus ; u32 WrFifoVacancy ; Xil_AssertVoid ( InstancePtr != NULL ) ; IntrStatus = XHwIcap_IntrGetStatus ( HwIcapPtr ) ; if ( IntrStatus & XHI_IPIXR_WRP_MASK ) { if ( HwIcapPtr -> RemainingWords > 0 ) { WrFifoVacancy = XHwIcap_GetWrFifoVacancy ( HwIcapPtr ) ; while ( ( WrFifoVacancy != 0 ) && ( HwIcapPtr -> RemainingWords > 0 ) ) { XHwIcap_FifoWrite ( HwIcapPtr , * HwIcapPtr -> SendBufferPtr ) ; HwIcapPtr -> RemainingWords -- ; WrFifoVacancy -- ; HwIcapPtr -> SendBufferPtr ++ ; } XHwIcap_StartConfig ( HwIcapPtr ) ; } else { if ( HwIcapPtr -> RequestedWords != 0 ) { XHwIcap_IntrGlobalDisable ( HwIcapPtr ) ; HwIcapPtr -> IsTransferInProgress = FALSE ; HwIcapPtr -> StatusHandler ( HwIcapPtr -> StatusRef , XST_HWICAP_WRITE_DONE , HwIcapPtr -> RequestedWords ) ; } } } XHwIcap_IntrClear ( HwIcapPtr , IntrStatus ) ; }
The interrupt handler for HwIcap interrupts.
The interrupt handler for HwIcap interrupts .
/*
	 * Get the Interrupt status.
	 */ /*
		 * A transmit has just completed. Check for more data
		 * to transmit.
		 */ /*
			 * Fill the FIFO with as many words as it will take (or
			 * as many as we have to write). We can use the Write
			 * FIFO vacancy to know if the device can take more data.
			 */ /*
				 * No more data to send. Disable the interrupts
				 * by disabling the Global Interrupts.
				 * Inform the upper layer software that the
				 * transfer is done.
				 */ /*
	 * Clear the Interrupt status.
	 */