XilinxProcessorIPLib/drivers/sysmonpsu/src/xsysmonpsu.c
u16 XSysMonPsu_GetAlarmThreshold(XSysMonPsu *InstancePtr, u8 AlarmThrReg,
		u32 SysmonBlk)
{
	u16 AlarmThreshold;
	UINTPTR EffectiveBaseAddress;

	/* Assert the arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((AlarmThrReg <= XSM_ATR_TEMP_RMTE_UPPER) ||
			((AlarmThrReg >= XSM_ATR_SUP7_LOWER) &&
			(AlarmThrReg <= XSM_ATR_TEMP_RMTE_LOWER)));
	Xil_AssertNonvoid((SysmonBlk == XSYSMON_PS)||(SysmonBlk == XSYSMON_PL));

	/* Calculate the effective baseaddress based on the Sysmon instance. */
	EffectiveBaseAddress =
			XSysMonPsu_GetEffBaseAddress(InstancePtr->Config.BaseAddress,
					SysmonBlk);

	/*
	 * Read the specified Alarm Threshold Register and return
	 * the value.
	 */
	AlarmThreshold = (u16) XSysmonPsu_ReadReg(EffectiveBaseAddress +
			XSYSMONPSU_ALRM_TEMP_UPR_OFFSET + ((u32)AlarmThrReg << 2));

	return AlarmThreshold;
}
/****************************************************************************/
/**
*
* This function returns the contents of the specified Alarm Threshold Register.
*
* @param	InstancePtr is a pointer to the XSysMonPsu instance.
* @param	AlarmThrReg is the index of an Alarm Threshold Register
*		to be read. Use XSM_ATR_* constants defined in xsysmonpsu.h
*		to specify the index.
* @param	SysmonBlk is the value that tells whether it is for PS Sysmon
*       block or PL Sysmon block register region.
*
* @return	A 16-bit value representing the contents of the selected Alarm
*		Threshold Register.
*
* @note		None.
*
*****************************************************************************/
This function returns the contents of the specified Alarm Threshold Register.
This function returns the contents of the specified Alarm Threshold Register .
u16 XSysMonPsu_GetAlarmThreshold(XSysMonPsu *InstancePtr, u8 AlarmThrReg,
		u32 SysmonBlk)
{
	u16 AlarmThreshold;
	UINTPTR EffectiveBaseAddress;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((AlarmThrReg <= XSM_ATR_TEMP_RMTE_UPPER) ||
			((AlarmThrReg >= XSM_ATR_SUP7_LOWER) &&
			(AlarmThrReg <= XSM_ATR_TEMP_RMTE_LOWER)));
	Xil_AssertNonvoid((SysmonBlk == XSYSMON_PS)||(SysmonBlk == XSYSMON_PL));
	EffectiveBaseAddress =
			XSysMonPsu_GetEffBaseAddress(InstancePtr->Config.BaseAddress,
					SysmonBlk);
	AlarmThreshold = (u16) XSysmonPsu_ReadReg(EffectiveBaseAddress +
			XSYSMONPSU_ALRM_TEMP_UPR_OFFSET + ((u32)AlarmThrReg << 2));
	return AlarmThreshold;
}
u16 XSysMonPsu_GetAlarmThreshold ( XSysMonPsu * InstancePtr , u8 AlarmThrReg , u32 SysmonBlk ) { u16 AlarmThreshold ; UINTPTR EffectiveBaseAddress ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( ( AlarmThrReg <= XSM_ATR_TEMP_RMTE_UPPER ) || ( ( AlarmThrReg >= XSM_ATR_SUP7_LOWER ) && ( AlarmThrReg <= XSM_ATR_TEMP_RMTE_LOWER ) ) ) ; Xil_AssertNonvoid ( ( SysmonBlk == XSYSMON_PS ) || ( SysmonBlk == XSYSMON_PL ) ) ; EffectiveBaseAddress = XSysMonPsu_GetEffBaseAddress ( InstancePtr -> Config . BaseAddress , SysmonBlk ) ; AlarmThreshold = ( u16 ) XSysmonPsu_ReadReg ( EffectiveBaseAddress + XSYSMONPSU_ALRM_TEMP_UPR_OFFSET + ( ( u32 ) AlarmThrReg << 2 ) ) ; return AlarmThreshold ; }
This function returns the contents of the specified Alarm Threshold Register.
This function returns the contents of the specified Alarm Threshold Register .
/* Assert the arguments. */ /* Calculate the effective baseaddress based on the Sysmon instance. */ /*
	 * Read the specified Alarm Threshold Register and return
	 * the value.
	 */