XilinxProcessorIPLib/drivers/sysmon/src/xsysmon.c
u8 XSysMon_GetAvg(XSysMon *InstancePtr)
{
	u32 Average;

	/*
	 * Assert the arguments.
	 */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * Read the averaging value from the Configuration Register 0.
	 */
	Average = XSysMon_ReadReg(InstancePtr->Config.BaseAddress,
				  XSM_CFR0_OFFSET) & XSM_CFR0_AVG_VALID_MASK;

	return ((u8) (Average >> XSM_CFR0_AVG_SHIFT));
}
/****************************************************************************/
/**
*
* This function returns the number of samples of averaging configured for all
* the channels in the Configuration Register 0.
*
* @param	InstancePtr is a pointer to the XSysMon instance.
*
* @return	The averaging read from the Configuration Register 0 is
*		returned. Use the XSM_AVG_* bit definitions defined in xsysmon.h
*		file to interpret the returned value :
*		- XSM_AVG_0_SAMPLES means no averaging
*		- XSM_AVG_16_SAMPLES means 16 samples of averaging
*		- XSM_AVG_64_SAMPLES means 64 samples of averaging
*		- XSM_AVG_256_SAMPLES means 256 samples of averaging
*
* @note		None.
*
*****************************************************************************/
This function returns the number of samples of averaging configured for all
the channels in the Configuration Register 0.
This function returns the number of samples of averaging configured for all the channels in the Configuration Register 0 .
u8 XSysMon_GetAvg(XSysMon *InstancePtr)
{
	u32 Average;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Average = XSysMon_ReadReg(InstancePtr->Config.BaseAddress,
				  XSM_CFR0_OFFSET) & XSM_CFR0_AVG_VALID_MASK;
	return ((u8) (Average >> XSM_CFR0_AVG_SHIFT));
}
u8 XSysMon_GetAvg ( XSysMon * InstancePtr ) { u32 Average ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Average = XSysMon_ReadReg ( InstancePtr -> Config . BaseAddress , XSM_CFR0_OFFSET ) & XSM_CFR0_AVG_VALID_MASK ; return ( ( u8 ) ( Average >> XSM_CFR0_AVG_SHIFT ) ) ; }
This function returns the number of samples of averaging configured for all
the channels in the Configuration Register 0.
This function returns the number of samples of averaging configured for all the channels in the Configuration Register 0 .
/*
	 * Assert the arguments.
	 */ /*
	 * Read the averaging value from the Configuration Register 0.
	 */