XilinxProcessorIPLib/drivers/sysmonpsu/examples/xsysmonpsu_intr_example.c
static void SysMonPsuInterruptHandler(void *CallBackRef)
{
	u64 IntrStatusValue;
	XSysMonPsu *SysMonPtr = (XSysMonPsu *)CallBackRef;

	/* Get the interrupt status from the device and check the value. */
	IntrStatusValue = XSysMonPsu_IntrGetStatus(SysMonPtr);

#ifdef PL_EXAMPLE
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_0_MASK) {
		/*
		 * Set Temperature interrupt flag so the code
		 * in application context can be aware of this interrupt.
		 */
		TempIntrActive = TRUE;
	}

	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_1_MASK) {
		/*
		 * Set Supply 1 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */
		Supply1Intr = TRUE;
	}

	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_3_MASK) {
		/*
		 * Set Supply 3 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */
		Supply3Intr = TRUE;
	}

#else

	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_0_MASK) {
		/*
		 * Set Temperature interrupt flag so the code
		 * in application context can be aware of this interrupt.
		 */
		TempIntrActive = TRUE;
	}

	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_1_MASK) {
		/*
		 * Set Supply 1 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */
		Supply1Intr = TRUE;
	}

	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_3_MASK) {
		/*
		 * Set Supply 3 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */
		Supply3Intr = TRUE;
	}
#endif
	/* Clear all bits in Interrupt Status Register. */
	XSysMonPsu_IntrClear(SysMonPtr, IntrStatusValue);

	/*
	 * Disable Alarm 0 interrupt for on-chip temperature,
	 * Alarm 1 interrupt for on-chip Supply 1 and
	 * Alarm 3 interrupt for on-chip Supply 3.
	 */
#ifdef PL_EXAMPLE
	XSysMonPsu_IntrDisable(SysMonPtr,
			XSYSMONPSU_IER_0_PL_ALM_0_MASK |
			XSYSMONPSU_IER_0_PL_ALM_1_MASK |
			XSYSMONPSU_IER_0_PL_ALM_3_MASK );
#else
	XSysMonPsu_IntrDisable(SysMonPtr,
			XSYSMONPSU_IER_0_PS_ALM_0_MASK |
			XSYSMONPSU_IER_0_PS_ALM_1_MASK |
			XSYSMONPSU_IER_0_PS_ALM_3_MASK );
#endif
 }
/*****************************************************************************/
/**
*
* This function is the Interrupt Service Routine for the System Monitor device.
* It will be called by the processor whenever an interrupt is asserted
* by the device.
*
* This function only handles ALARM 0, ALARM 1 and ALARM 2 interrupts.
* User of this code may need to modify the code to meet the needs of the
* application.
*
* @param	CallBackRef is the callback reference passed from the Interrupt
*		controller driver, which in our case is a pointer to the
*		driver instance.
*
* @return	None.
*
* @note		This function is called within interrupt context.
*
******************************************************************************/
This function is the Interrupt Service Routine for the System Monitor device.
It will be called by the processor whenever an interrupt is asserted
by the device.

This function only handles ALARM 0, ALARM 1 and ALARM 2 interrupts.
User of this code may need to modify the code to meet the needs of the
application.
This function is the Interrupt Service Routine for the System Monitor device . It will be called by the processor whenever an interrupt is asserted by the device . This function only handles ALARM 0 ALARM 1 and ALARM 2 interrupts . User of this code may need to modify the code to meet the needs of the application .
static void SysMonPsuInterruptHandler(void *CallBackRef)
{
	u64 IntrStatusValue;
	XSysMonPsu *SysMonPtr = (XSysMonPsu *)CallBackRef;
	IntrStatusValue = XSysMonPsu_IntrGetStatus(SysMonPtr);
#ifdef PL_EXAMPLE
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_0_MASK) {
		TempIntrActive = TRUE;
	}
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_1_MASK) {
		Supply1Intr = TRUE;
	}
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_3_MASK) {
		Supply3Intr = TRUE;
	}
#else
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_0_MASK) {
		TempIntrActive = TRUE;
	}
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_1_MASK) {
		Supply1Intr = TRUE;
	}
	if (IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_3_MASK) {
		Supply3Intr = TRUE;
	}
#endif
	XSysMonPsu_IntrClear(SysMonPtr, IntrStatusValue);
#ifdef PL_EXAMPLE
	XSysMonPsu_IntrDisable(SysMonPtr,
			XSYSMONPSU_IER_0_PL_ALM_0_MASK |
			XSYSMONPSU_IER_0_PL_ALM_1_MASK |
			XSYSMONPSU_IER_0_PL_ALM_3_MASK );
#else
	XSysMonPsu_IntrDisable(SysMonPtr,
			XSYSMONPSU_IER_0_PS_ALM_0_MASK |
			XSYSMONPSU_IER_0_PS_ALM_1_MASK |
			XSYSMONPSU_IER_0_PS_ALM_3_MASK );
#endif
 }
static void SysMonPsuInterruptHandler ( void * CallBackRef ) { u64 IntrStatusValue ; XSysMonPsu * SysMonPtr = ( XSysMonPsu * ) CallBackRef ; IntrStatusValue = XSysMonPsu_IntrGetStatus ( SysMonPtr ) ; #ifdef PL_EXAMPLE if ( IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_0_MASK ) { TempIntrActive = TRUE ; } if ( IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_1_MASK ) { Supply1Intr = TRUE ; } if ( IntrStatusValue & XSYSMONPSU_ISR_0_PL_ALM_3_MASK ) { Supply3Intr = TRUE ; } #else if ( IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_0_MASK ) { TempIntrActive = TRUE ; } if ( IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_1_MASK ) { Supply1Intr = TRUE ; } if ( IntrStatusValue & XSYSMONPSU_ISR_0_PS_ALM_3_MASK ) { Supply3Intr = TRUE ; } #endif XSysMonPsu_IntrClear ( SysMonPtr , IntrStatusValue ) ; #ifdef PL_EXAMPLE XSysMonPsu_IntrDisable ( SysMonPtr , XSYSMONPSU_IER_0_PL_ALM_0_MASK | XSYSMONPSU_IER_0_PL_ALM_1_MASK | XSYSMONPSU_IER_0_PL_ALM_3_MASK ) ; #else XSysMonPsu_IntrDisable ( SysMonPtr , XSYSMONPSU_IER_0_PS_ALM_0_MASK | XSYSMONPSU_IER_0_PS_ALM_1_MASK | XSYSMONPSU_IER_0_PS_ALM_3_MASK ) ; #endif }
This function is the Interrupt Service Routine for the System Monitor device.
This function is the Interrupt Service Routine for the System Monitor device .
/* Get the interrupt status from the device and check the value. */ /*
		 * Set Temperature interrupt flag so the code
		 * in application context can be aware of this interrupt.
		 */ /*
		 * Set Supply 1 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */ /*
		 * Set Supply 3 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */ /*
		 * Set Temperature interrupt flag so the code
		 * in application context can be aware of this interrupt.
		 */ /*
		 * Set Supply 1 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */ /*
		 * Set Supply 3 interrupt flag so the code in application context
		 * can be aware of this interrupt.
		 */ /* Clear all bits in Interrupt Status Register. */ /*
	 * Disable Alarm 0 interrupt for on-chip temperature,
	 * Alarm 1 interrupt for on-chip Supply 1 and
	 * Alarm 3 interrupt for on-chip Supply 3.
	 */