XilinxProcessorIPLib/drivers/uartns550/examples/xuartns550_intr_example.c
void UartNs550IntrHandler(void *CallBackRef, u32 Event, unsigned int EventData)
{
	u8 Errors;
	XUartNs550 *UartNs550Ptr = (XUartNs550 *)CallBackRef;

	/*
	 * All of the data has been sent.
	 */
	if (Event == XUN_EVENT_SENT_DATA) {
		TotalSentCount = EventData;
	}

	/*
	 * All of the data has been received.
	 */
	if (Event == XUN_EVENT_RECV_DATA) {
		TotalReceivedCount = EventData;
	}

	/*
	 * Data was received, but not the expected number of bytes, a
	 * timeout just indicates the data stopped for 4 character times.
	 */
	if (Event == XUN_EVENT_RECV_TIMEOUT) {
		TotalReceivedCount = EventData;
	}

	/*
	 * Data was received with an error, keep the data but determine
	 * what kind of errors occurred.
	 */
	if (Event == XUN_EVENT_RECV_ERROR) {
		TotalReceivedCount = EventData;
		TotalErrorCount++;
		Errors = XUartNs550_GetLastErrors(UartNs550Ptr);
	}
}
/*****************************************************************************/
/**
*
* This function is the handler which performs processing to handle data events
* from the UartNs550.  It is called from an interrupt context such that the
* amount of processing performed should be minimized.
*
* This handler provides an example of how to handle data for the UART and
* is application specific.
*
* @param	CallBackRef contains a callback reference from the driver,
*		in thiscase it is the instance pointer for the UART driver.
* @param	Event contains the specific kind of event that has occurred.
* @param	EventData contains the number of bytes sent or received for sent
*		and receive events.
*
* @return	None.
*
* @note		None.
*
*******************************************************************************/
This function is the handler which performs processing to handle data events
from the UartNs550.  It is called from an interrupt context such that the
amount of processing performed should be minimized.

This handler provides an example of how to handle data for the UART and
is application specific.
This function is the handler which performs processing to handle data events from the UartNs550 . It is called from an interrupt context such that the amount of processing performed should be minimized . This handler provides an example of how to handle data for the UART and is application specific .
void UartNs550IntrHandler(void *CallBackRef, u32 Event, unsigned int EventData)
{
	u8 Errors;
	XUartNs550 *UartNs550Ptr = (XUartNs550 *)CallBackRef;
	if (Event == XUN_EVENT_SENT_DATA) {
		TotalSentCount = EventData;
	}
	if (Event == XUN_EVENT_RECV_DATA) {
		TotalReceivedCount = EventData;
	}
	if (Event == XUN_EVENT_RECV_TIMEOUT) {
		TotalReceivedCount = EventData;
	}
	if (Event == XUN_EVENT_RECV_ERROR) {
		TotalReceivedCount = EventData;
		TotalErrorCount++;
		Errors = XUartNs550_GetLastErrors(UartNs550Ptr);
	}
}
void UartNs550IntrHandler ( void * CallBackRef , u32 Event , unsigned int EventData ) { u8 Errors ; XUartNs550 * UartNs550Ptr = ( XUartNs550 * ) CallBackRef ; if ( Event == XUN_EVENT_SENT_DATA ) { TotalSentCount = EventData ; } if ( Event == XUN_EVENT_RECV_DATA ) { TotalReceivedCount = EventData ; } if ( Event == XUN_EVENT_RECV_TIMEOUT ) { TotalReceivedCount = EventData ; } if ( Event == XUN_EVENT_RECV_ERROR ) { TotalReceivedCount = EventData ; TotalErrorCount ++ ; Errors = XUartNs550_GetLastErrors ( UartNs550Ptr ) ; } }
This function is the handler which performs processing to handle data events
from the UartNs550.
This function is the handler which performs processing to handle data events from the UartNs550 .
/*
	 * All of the data has been sent.
	 */ /*
	 * All of the data has been received.
	 */ /*
	 * Data was received, but not the expected number of bytes, a
	 * timeout just indicates the data stopped for 4 character times.
	 */ /*
	 * Data was received with an error, keep the data but determine
	 * what kind of errors occurred.
	 */