XilinxProcessorIPLib/drivers/uartpsv/src/xuartpsv_intr.c
void XUartPsv_InterruptHandler(XUartPsv *InstancePtr)
{
	u32 Imsc;
	u32 IsrStatus;

	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * Read the Mask Set/Clear register to determine which
	 * interrupts are enabled
	 */

	Imsc = XUartPsv_ReadReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTIMSC_OFFSET);
	/*
	 * Read the raw interrupt status register to determine which
	 * interrupt is active
	 */

	IsrStatus = XUartPsv_ReadReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTRIS_OFFSET);

	IsrStatus &= Imsc;

	/* Clear the interrupt status. */
	XUartPsv_WriteReg(InstancePtr->Config.BaseAddress,
			XUARTPSV_UARTICR_OFFSET, IsrStatus);

	if (IsrStatus != 0U) {

		/* Dispatch an appropriate handler. */

			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_RXRIS |
					XUARTPSV_UARTRIS_RTRIS)) != (u32)0) {
				/* Received data interrupt */
				XUartPsv_ReceiveDataHandler(InstancePtr);
			}

			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_TXRIS)) != (u32)0) {
				/* Transmit data interrupt */
				XUartPsv_SendDataHandler(InstancePtr);
			}

			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_DSRRMIS |
					(u32)XUARTPSV_UARTRIS_DCDRMIS	|
					(u32)XUARTPSV_UARTRIS_CTSRMIS |
					(u32)XUARTPSV_UARTRIS_RIRMIS)) !=
							(u32)0) {
				/* Modem status interrupt */
				XUartPsv_ModemHandler(InstancePtr);
			}

			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_FERIS |
					(u32)XUARTPSV_UARTRIS_PERIS |
					(u32)XUARTPSV_UARTRIS_BERIS)) !=
							(u32)0) {
				/* Frame/Parity/Break error interrupt*/
				InstancePtr->Handler(InstancePtr->CallBackRef,
						XUARTPSV_EVENT_PARE_FRAME_BRKE, IsrStatus);
			}

			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_OERIS)) != (u32)0) {
				/* Overrun Error Interrupt */
				XUartPsv_ReceiveErrorHandler(InstancePtr);
			}
		}
}
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the driver.
* It must be connected to an interrupt system by the application such that it
* can be called when an interrupt occurs.
*
* @param	InstancePtr contains a pointer to the driver instance
*
* @return	None.
*
* @note 	None.
*
******************************************************************************/
This function is the interrupt handler for the driver.
It must be connected to an interrupt system by the application such that it
can be called when an interrupt occurs.
This function is the interrupt handler for the driver . It must be connected to an interrupt system by the application such that it can be called when an interrupt occurs .
void XUartPsv_InterruptHandler(XUartPsv *InstancePtr)
{
	u32 Imsc;
	u32 IsrStatus;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Imsc = XUartPsv_ReadReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTIMSC_OFFSET);
	IsrStatus = XUartPsv_ReadReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTRIS_OFFSET);
	IsrStatus &= Imsc;
	XUartPsv_WriteReg(InstancePtr->Config.BaseAddress,
			XUARTPSV_UARTICR_OFFSET, IsrStatus);
	if (IsrStatus != 0U) {
			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_RXRIS |
					XUARTPSV_UARTRIS_RTRIS)) != (u32)0) {
				XUartPsv_ReceiveDataHandler(InstancePtr);
			}
			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_TXRIS)) != (u32)0) {
				XUartPsv_SendDataHandler(InstancePtr);
			}
			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_DSRRMIS |
					(u32)XUARTPSV_UARTRIS_DCDRMIS	|
					(u32)XUARTPSV_UARTRIS_CTSRMIS |
					(u32)XUARTPSV_UARTRIS_RIRMIS)) !=
							(u32)0) {
				XUartPsv_ModemHandler(InstancePtr);
			}
			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_FERIS |
					(u32)XUARTPSV_UARTRIS_PERIS |
					(u32)XUARTPSV_UARTRIS_BERIS)) !=
							(u32)0) {
				InstancePtr->Handler(InstancePtr->CallBackRef,
						XUARTPSV_EVENT_PARE_FRAME_BRKE, IsrStatus);
			}
			if ((IsrStatus & ((u32)XUARTPSV_UARTRIS_OERIS)) != (u32)0) {
				XUartPsv_ReceiveErrorHandler(InstancePtr);
			}
		}
}
void XUartPsv_InterruptHandler ( XUartPsv * InstancePtr ) { u32 Imsc ; u32 IsrStatus ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Imsc = XUartPsv_ReadReg ( InstancePtr -> Config . BaseAddress , XUARTPSV_UARTIMSC_OFFSET ) ; IsrStatus = XUartPsv_ReadReg ( InstancePtr -> Config . BaseAddress , XUARTPSV_UARTRIS_OFFSET ) ; IsrStatus &= Imsc ; XUartPsv_WriteReg ( InstancePtr -> Config . BaseAddress , XUARTPSV_UARTICR_OFFSET , IsrStatus ) ; if ( IsrStatus != 0U ) { if ( ( IsrStatus & ( ( u32 ) XUARTPSV_UARTRIS_RXRIS | XUARTPSV_UARTRIS_RTRIS ) ) != ( u32 ) 0 ) { XUartPsv_ReceiveDataHandler ( InstancePtr ) ; } if ( ( IsrStatus & ( ( u32 ) XUARTPSV_UARTRIS_TXRIS ) ) != ( u32 ) 0 ) { XUartPsv_SendDataHandler ( InstancePtr ) ; } if ( ( IsrStatus & ( ( u32 ) XUARTPSV_UARTRIS_DSRRMIS | ( u32 ) XUARTPSV_UARTRIS_DCDRMIS | ( u32 ) XUARTPSV_UARTRIS_CTSRMIS | ( u32 ) XUARTPSV_UARTRIS_RIRMIS ) ) != ( u32 ) 0 ) { XUartPsv_ModemHandler ( InstancePtr ) ; } if ( ( IsrStatus & ( ( u32 ) XUARTPSV_UARTRIS_FERIS | ( u32 ) XUARTPSV_UARTRIS_PERIS | ( u32 ) XUARTPSV_UARTRIS_BERIS ) ) != ( u32 ) 0 ) { InstancePtr -> Handler ( InstancePtr -> CallBackRef , XUARTPSV_EVENT_PARE_FRAME_BRKE , IsrStatus ) ; } if ( ( IsrStatus & ( ( u32 ) XUARTPSV_UARTRIS_OERIS ) ) != ( u32 ) 0 ) { XUartPsv_ReceiveErrorHandler ( InstancePtr ) ; } } }
This function is the interrupt handler for the driver.
This function is the interrupt handler for the driver .
/*
	 * Read the Mask Set/Clear register to determine which
	 * interrupts are enabled
	 */ /*
	 * Read the raw interrupt status register to determine which
	 * interrupt is active
	 */ /* Clear the interrupt status. */ /* Dispatch an appropriate handler. */ /* Received data interrupt */ /* Transmit data interrupt */ /* Modem status interrupt */ /* Frame/Parity/Break error interrupt*/ /* Overrun Error Interrupt */