XilinxProcessorIPLib/drivers/sysmonpsu/src/xsysmonpsu.c
u16 XSysMonPsu_GetCalibCoefficient(XSysMonPsu *InstancePtr, u8 CoeffType,
		u32 SysmonBlk)
{
	u16 CalibData;
	UINTPTR EffectiveBaseAddress;

	/* Assert the arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid(CoeffType <= XSM_CALIB_GAIN_ERROR_COEFF);
	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 selected calibration coefficient. */
	CalibData = (u16) XSysmonPsu_ReadReg(EffectiveBaseAddress +
			XSYSMONPSU_CAL_SUP_OFF_OFFSET + ((u32)CoeffType << 2U));

	return CalibData;
}
/****************************************************************************/
/**
*
* This function gets the calibration coefficient data for the specified
* parameter.
*
* @param	InstancePtr is a pointer to the XSysMonPsu instance.
* @param	CoeffType specifies the calibration coefficient
*		to be read. Use XSM_CALIB_* constants defined in xsysmonpsu.h to
*		specify the calibration coefficient 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 calibration coefficient.
*		The System Monitor device guarantees a 10 bit resolution for
*		the ADC converted data and data is the 10 MSB bits of the 16
*		data read from the device.
*
* @note		None.
*
*****************************************************************************/
This function gets the calibration coefficient data for the specified
parameter.
This function gets the calibration coefficient data for the specified parameter .
u16 XSysMonPsu_GetCalibCoefficient(XSysMonPsu *InstancePtr, u8 CoeffType,
		u32 SysmonBlk)
{
	u16 CalibData;
	UINTPTR EffectiveBaseAddress;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid(CoeffType <= XSM_CALIB_GAIN_ERROR_COEFF);
	Xil_AssertNonvoid((SysmonBlk == XSYSMON_PS)||(SysmonBlk == XSYSMON_PL));
	EffectiveBaseAddress =
			XSysMonPsu_GetEffBaseAddress(InstancePtr->Config.BaseAddress,
					SysmonBlk);
	CalibData = (u16) XSysmonPsu_ReadReg(EffectiveBaseAddress +
			XSYSMONPSU_CAL_SUP_OFF_OFFSET + ((u32)CoeffType << 2U));
	return CalibData;
}
u16 XSysMonPsu_GetCalibCoefficient ( XSysMonPsu * InstancePtr , u8 CoeffType , u32 SysmonBlk ) { u16 CalibData ; UINTPTR EffectiveBaseAddress ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( CoeffType <= XSM_CALIB_GAIN_ERROR_COEFF ) ; Xil_AssertNonvoid ( ( SysmonBlk == XSYSMON_PS ) || ( SysmonBlk == XSYSMON_PL ) ) ; EffectiveBaseAddress = XSysMonPsu_GetEffBaseAddress ( InstancePtr -> Config . BaseAddress , SysmonBlk ) ; CalibData = ( u16 ) XSysmonPsu_ReadReg ( EffectiveBaseAddress + XSYSMONPSU_CAL_SUP_OFF_OFFSET + ( ( u32 ) CoeffType << 2U ) ) ; return CalibData ; }
This function gets the calibration coefficient data for the specified
parameter.
This function gets the calibration coefficient data for the specified parameter .
/* Assert the arguments. */ /* Calculate the effective baseaddress based on the Sysmon instance. */ /* Read the selected calibration coefficient. */