XilinxProcessorIPLib/drivers/sysmonpsu/src/xsysmonpsu.c
u16 XSysMonPsu_GetMinMaxMeasurement(XSysMonPsu *InstancePtr, u8 MeasurementType,
		u32 SysmonBlk)
{
	u16 MinMaxData;
	UINTPTR EffectiveBaseAddress;

	/* Assert the arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((MeasurementType <= XSM_MAX_SUPPLY6) ||
			((MeasurementType >= XSM_MIN_SUPPLY4) &&
			(MeasurementType <= XSM_MIN_SUPPLY6)) ||
			((MeasurementType >= XSM_MAX_SUPPLY7) &&
			(MeasurementType <= XSM_MAX_TEMP_REMOTE)) ||
			((MeasurementType >= XSM_MIN_SUPPLY7) &&
			(MeasurementType <= XSM_MIN_TEMP_REMOTE)));
	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 and return the specified Minimum/Maximum measurement. */
	MinMaxData = (u16) (XSysmonPsu_ReadReg(EffectiveBaseAddress +
							XSM_MIN_MAX_CH_OFFSET + ((u32)MeasurementType << 2U)));

	return MinMaxData;
}
/****************************************************************************/
/**
*
* This function reads the Minimum/Maximum measurement for one of the
* XSM_MIN_* or XSM_MAX_* constants defined in xsysmonpsu.h
*
* @param	InstancePtr is a pointer to the XSysMonPsu instance.
* @param	MeasurementType specifies the parameter for which the
*		Minimum/Maximum measurement has to be read.
*		Use XSM_MAX_* and XSM_MIN_* constants defined in xsysmonpsu.h to
*		specify the data to be read.
* @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 maximum/minimum measurement for
*		specified parameter.
*		The System Monitor device guarantees a 10 bit resolution for
*		the ADC converted data and data is the 10 MSB bits of  16 bit
*		data read from the device.
*
*****************************************************************************/
This function reads the Minimum/Maximum measurement for one of the
XSM_MIN_* or XSM_MAX_* constants defined in xsysmonpsu.h
This function reads the Minimum / Maximum measurement for one of the XSM_MIN_ * or XSM_MAX_ * constants defined in xsysmonpsu . h
u16 XSysMonPsu_GetMinMaxMeasurement(XSysMonPsu *InstancePtr, u8 MeasurementType,
		u32 SysmonBlk)
{
	u16 MinMaxData;
	UINTPTR EffectiveBaseAddress;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((MeasurementType <= XSM_MAX_SUPPLY6) ||
			((MeasurementType >= XSM_MIN_SUPPLY4) &&
			(MeasurementType <= XSM_MIN_SUPPLY6)) ||
			((MeasurementType >= XSM_MAX_SUPPLY7) &&
			(MeasurementType <= XSM_MAX_TEMP_REMOTE)) ||
			((MeasurementType >= XSM_MIN_SUPPLY7) &&
			(MeasurementType <= XSM_MIN_TEMP_REMOTE)));
	Xil_AssertNonvoid((SysmonBlk == XSYSMON_PS)||(SysmonBlk == XSYSMON_PL));
	EffectiveBaseAddress =
			XSysMonPsu_GetEffBaseAddress(InstancePtr->Config.BaseAddress,
					SysmonBlk);
	MinMaxData = (u16) (XSysmonPsu_ReadReg(EffectiveBaseAddress +
							XSM_MIN_MAX_CH_OFFSET + ((u32)MeasurementType << 2U)));
	return MinMaxData;
}
u16 XSysMonPsu_GetMinMaxMeasurement ( XSysMonPsu * InstancePtr , u8 MeasurementType , u32 SysmonBlk ) { u16 MinMaxData ; UINTPTR EffectiveBaseAddress ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( ( MeasurementType <= XSM_MAX_SUPPLY6 ) || ( ( MeasurementType >= XSM_MIN_SUPPLY4 ) && ( MeasurementType <= XSM_MIN_SUPPLY6 ) ) || ( ( MeasurementType >= XSM_MAX_SUPPLY7 ) && ( MeasurementType <= XSM_MAX_TEMP_REMOTE ) ) || ( ( MeasurementType >= XSM_MIN_SUPPLY7 ) && ( MeasurementType <= XSM_MIN_TEMP_REMOTE ) ) ) ; Xil_AssertNonvoid ( ( SysmonBlk == XSYSMON_PS ) || ( SysmonBlk == XSYSMON_PL ) ) ; EffectiveBaseAddress = XSysMonPsu_GetEffBaseAddress ( InstancePtr -> Config . BaseAddress , SysmonBlk ) ; MinMaxData = ( u16 ) ( XSysmonPsu_ReadReg ( EffectiveBaseAddress + XSM_MIN_MAX_CH_OFFSET + ( ( u32 ) MeasurementType << 2U ) ) ) ; return MinMaxData ; }
This function reads the Minimum/Maximum measurement for one of the
XSM_MIN_* or XSM_MAX_* constants defined in xsysmonpsu.h
This function reads the Minimum / Maximum measurement for one of the XSM_MIN_ * or XSM_MAX_ * constants defined in xsysmonpsu . h
/* Assert the arguments. */ /* Calculate the effective baseaddress based on the Sysmon instance. */ /* Read and return the specified Minimum/Maximum measurement. */