XilinxProcessorIPLib/drivers/sysmon/src/xsysmon.c
void XSysMon_SetAvg(XSysMon *InstancePtr, u8 Average)
{
	u32 RegValue;

	/*
	 * Assert the arguments.
	 */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(Average <= XSM_AVG_256_SAMPLES);

	/*
	 * Write the averaging value into the Configuration Register 0.
	 */
	RegValue = XSysMon_ReadReg(InstancePtr->Config.BaseAddress,
				   XSM_CFR0_OFFSET) &
				   (~XSM_CFR0_AVG_VALID_MASK);
	RegValue |= (((u32) Average << XSM_CFR0_AVG_SHIFT));
	XSysMon_WriteReg(InstancePtr->Config.BaseAddress, XSM_CFR0_OFFSET,
			 RegValue);
}
/****************************************************************************/
/**
*
* This function sets the number of samples of averaging that is to be done for
* all the channels in both the single channel mode and sequence mode of
* operations.
*
* @param	InstancePtr is a pointer to the XSysMon instance.
* @param	Average is the number of samples of averaging programmed to the
*		Configuration Register 0. Use the XSM_AVG_* definitions defined
*		in xsysmon.h file :
*		- XSM_AVG_0_SAMPLES for no averaging
*		- XSM_AVG_16_SAMPLES for 16 samples of averaging
*		- XSM_AVG_64_SAMPLES for 64 samples of averaging
*		- XSM_AVG_256_SAMPLES for 256 samples of averaging
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
This function sets the number of samples of averaging that is to be done for
all the channels in both the single channel mode and sequence mode of
operations.
This function sets the number of samples of averaging that is to be done for all the channels in both the single channel mode and sequence mode of operations .
void XSysMon_SetAvg(XSysMon *InstancePtr, u8 Average)
{
	u32 RegValue;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(Average <= XSM_AVG_256_SAMPLES);
	RegValue = XSysMon_ReadReg(InstancePtr->Config.BaseAddress,
				   XSM_CFR0_OFFSET) &
				   (~XSM_CFR0_AVG_VALID_MASK);
	RegValue |= (((u32) Average << XSM_CFR0_AVG_SHIFT));
	XSysMon_WriteReg(InstancePtr->Config.BaseAddress, XSM_CFR0_OFFSET,
			 RegValue);
}
void XSysMon_SetAvg ( XSysMon * InstancePtr , u8 Average ) { u32 RegValue ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertVoid ( Average <= XSM_AVG_256_SAMPLES ) ; RegValue = XSysMon_ReadReg ( InstancePtr -> Config . BaseAddress , XSM_CFR0_OFFSET ) & ( ~ XSM_CFR0_AVG_VALID_MASK ) ; RegValue |= ( ( ( u32 ) Average << XSM_CFR0_AVG_SHIFT ) ) ; XSysMon_WriteReg ( InstancePtr -> Config . BaseAddress , XSM_CFR0_OFFSET , RegValue ) ; }
This function sets the number of samples of averaging that is to be done for
all the channels in both the single channel mode and sequence mode of
operations.
This function sets the number of samples of averaging that is to be done for all the channels in both the single channel mode and sequence mode of operations .
/*
	 * Assert the arguments.
	 */ /*
	 * Write the averaging value into the Configuration Register 0.
	 */