XilinxProcessorIPLib/drivers/can/examples/xcan_intr_example.c
static void EventHandler(void *CallBackRef, u32 IntrMask)
{
	XCan *CanPtr = (XCan *)CallBackRef;

	if (IntrMask & XCAN_IXR_BSOFF_MASK) { /* Enter Bus off status */
		/*
		 * Entering Bus off status interrupt requires
		 * the CAN device be reset and re-configurated.
		 */
		XCan_Reset(CanPtr);
		Config(CanPtr);
		return;
	}

	if(IntrMask & XCAN_IXR_RXOFLW_MASK) { /* RX FIFO Overflow Interrupt */
		/*
		 * Code to handle RX FIFO Overflow
		 * Interrupt should be put here.
		 */
	}

	if(IntrMask & XCAN_IXR_RXUFLW_MASK) { /* RX FIFO Underflow Interrupt */
		/*
		 * Code to handle RX FIFO Underflow
		 * Interrupt should be put here.
		 */
	}

	if(IntrMask & XCAN_IXR_TXBFLL_MASK) { /* TX High Priority Full Intr */
		/*
		 * Code to handle TX High Priority Buffer Full
		 * Interrupt should be put here.
		 */
	}

	if(IntrMask & XCAN_IXR_TXFLL_MASK) { /* TX FIFO Full Interrupt */
		/*
		 * Code to handle TX FIFO Full
		 * Interrupt should be put here.
		 */
	}

	if (IntrMask & XCAN_IXR_WKUP_MASK) { /* Wake up from sleep mode */
		/*
		 * Code to handle Wake up from sleep mode
		 * Interrupt should be put here.
		 */
	}

	if (IntrMask & XCAN_IXR_SLP_MASK) { /* Enter sleep mode */
		/*
		 * Code to handle Enter sleep mode
		 * Interrupt should be put here.
		 */
	}

	if (IntrMask & XCAN_IXR_ARBLST_MASK) { /* Lost bus arbitration */

		/*
		 * Code to handle Lost bus arbitration
		 * Interrupt should be put here.
		 */
	}
}
/*****************************************************************************/
/**
*
* Callback function (called from interrupt handler) to handle the following
* interrupts:
*   - XCAN_IXR_BSOFF_MASK:  Bus Off Interrupt
*   - XCAN_IXR_RXOFLW_MASK: RX FIFO Overflow Interrupt
*   - XCAN_IXR_RXUFLW_MASK: RX FIFO Underflow Interrupt
*   - XCAN_IXR_TXBFLL_MASK: TX High Priority Buffer Full Interrupt
*   - XCAN_IXR_TXFLL_MASK:  TX FIFO Full Interrupt
*   - XCAN_IXR_WKUP_MASK:   Wake up Interrupt
*   - XCAN_IXR_SLP_MASK:    Sleep Interrupt
*   - XCAN_IXR_ARBLST_MASK: Arbitration Lost Interrupt
*
* Please feel free to change this function to meet specific application needs.
*
* @param	CallBackRef is the callback reference passed from the interrupt
*		handler, which in our case is a pointer to the driver instance.
* @param	IntrMask is a bit mask indicating pending interrupts. Its value
*		equals 'OR'ing one or more of the XCAN_IXR_*_MASK value(s)
*		mentioned above.
*
* @return	None.
*
* @note		This function is called by the driver within interrupt context.
*
******************************************************************************/


Please feel free to change this function to meet specific application needs.
Please feel free to change this function to meet specific application needs .
static void EventHandler(void *CallBackRef, u32 IntrMask)
{
	XCan *CanPtr = (XCan *)CallBackRef;
	if (IntrMask & XCAN_IXR_BSOFF_MASK) { 
		XCan_Reset(CanPtr);
		Config(CanPtr);
		return;
	}
	if(IntrMask & XCAN_IXR_RXOFLW_MASK) { 
	}
	if(IntrMask & XCAN_IXR_RXUFLW_MASK) { 
	}
	if(IntrMask & XCAN_IXR_TXBFLL_MASK) { 
	}
	if(IntrMask & XCAN_IXR_TXFLL_MASK) { 
	}
	if (IntrMask & XCAN_IXR_WKUP_MASK) { 
	}
	if (IntrMask & XCAN_IXR_SLP_MASK) { 
	}
	if (IntrMask & XCAN_IXR_ARBLST_MASK) { 
	}
}
static void EventHandler ( void * CallBackRef , u32 IntrMask ) { XCan * CanPtr = ( XCan * ) CallBackRef ; if ( IntrMask & XCAN_IXR_BSOFF_MASK ) { XCan_Reset ( CanPtr ) ; Config ( CanPtr ) ; return ; } if ( IntrMask & XCAN_IXR_RXOFLW_MASK ) { } if ( IntrMask & XCAN_IXR_RXUFLW_MASK ) { } if ( IntrMask & XCAN_IXR_TXBFLL_MASK ) { } if ( IntrMask & XCAN_IXR_TXFLL_MASK ) { } if ( IntrMask & XCAN_IXR_WKUP_MASK ) { } if ( IntrMask & XCAN_IXR_SLP_MASK ) { } if ( IntrMask & XCAN_IXR_ARBLST_MASK ) { } }
Callback function (called from interrupt handler) to handle the following
interrupts:
 XCAN_IXR_BSOFF_MASK:  Bus Off Interrupt
 XCAN_IXR_RXOFLW_MASK: RX FIFO Overflow Interrupt
 XCAN_IXR_RXUFLW_MASK: RX FIFO Underflow Interrupt
 XCAN_IXR_TXBFLL_MASK: TX High Priority Buffer Full Interrupt
 XCAN_IXR_TXFLL_MASK:  TX FIFO Full Interrupt
 XCAN_IXR_WKUP_MASK:   Wake up Interrupt
 XCAN_IXR_SLP_MASK:    Sleep Interrupt
 XCAN_IXR_ARBLST_MASK: Arbitration Lost Interrupt
Callback function ( called from interrupt handler ) to handle the following interrupts : XCAN_IXR_BSOFF_MASK : Bus Off Interrupt XCAN_IXR_RXOFLW_MASK : RX FIFO Overflow Interrupt XCAN_IXR_RXUFLW_MASK : RX FIFO Underflow Interrupt XCAN_IXR_TXBFLL_MASK : TX High Priority Buffer Full Interrupt XCAN_IXR_TXFLL_MASK : TX FIFO Full Interrupt XCAN_IXR_WKUP_MASK : Wake up Interrupt XCAN_IXR_SLP_MASK : Sleep Interrupt XCAN_IXR_ARBLST_MASK : Arbitration Lost Interrupt
/* Enter Bus off status */ /*
		 * Entering Bus off status interrupt requires
		 * the CAN device be reset and re-configurated.
		 */ /* RX FIFO Overflow Interrupt */ /*
		 * Code to handle RX FIFO Overflow
		 * Interrupt should be put here.
		 */ /* RX FIFO Underflow Interrupt */ /*
		 * Code to handle RX FIFO Underflow
		 * Interrupt should be put here.
		 */ /* TX High Priority Full Intr */ /*
		 * Code to handle TX High Priority Buffer Full
		 * Interrupt should be put here.
		 */ /* TX FIFO Full Interrupt */ /*
		 * Code to handle TX FIFO Full
		 * Interrupt should be put here.
		 */ /* Wake up from sleep mode */ /*
		 * Code to handle Wake up from sleep mode
		 * Interrupt should be put here.
		 */ /* Enter sleep mode */ /*
		 * Code to handle Enter sleep mode
		 * Interrupt should be put here.
		 */ /* Lost bus arbitration */ /*
		 * Code to handle Lost bus arbitration
		 * Interrupt should be put here.
		 */