XilinxProcessorIPLib/drivers/sysmonpsu/src/xsysmonpsu.c
s32 XSysMonPsu_SetSeqInputMode(XSysMonPsu *InstancePtr, u64 InputModeChMask,
		u32 SysmonBlk)
{
	s32 Status;
	UINTPTR EffectiveBaseAddress;

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

	/*
	 * The sequencer must be in the Safe Mode before writing to
	 * these registers. Return XST_FAILURE if the channel sequencer
	 * is enabled.
	 */
	if ((XSysMonPsu_GetSequencerMode(InstancePtr,SysmonBlk)
	                                      != XSM_SEQ_MODE_SAFE)) {
		Status = (s32)XST_FAILURE;
		goto End;
	}

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

	/*
	 * Set the input mode for the specified channels in the ADC Channel
	 * Analog-Input Mode Sequencer Registers.
	 */
	XSysmonPsu_WriteReg(EffectiveBaseAddress +
			XSYSMONPSU_SEQ_INPUT_MDE0_OFFSET,
			 (u32)(InputModeChMask & XSYSMONPSU_SEQ_INPUT_MDE0_MASK));

	XSysmonPsu_WriteReg(EffectiveBaseAddress +
			XSYSMONPSU_SEQ_INPUT_MDE1_OFFSET,
			 (u32)(InputModeChMask >> XSM_SEQ_CH_SHIFT) &
			 XSYSMONPSU_SEQ_INPUT_MDE1_MASK);

	XSysmonPsu_WriteReg(EffectiveBaseAddress +
		XSYSMONPSU_SEQ_INPUT_MDE2_OFFSET,
		(u32)(InputModeChMask >> XSM_SEQ_CH2_SHIFT) &
		 XSYSMONPSU_SEQ_INPUT_MDE2_MASK);

	Status = (s32)XST_SUCCESS;

End:
	return Status;
}
/****************************************************************************/
/**
*
* This function sets the Analog input mode for the specified channels in the
* ADC Channel Analog-Input Mode Sequencer Registers. The sequencer must be in
* the Safe Mode before writing to these registers.
*
* @param	InstancePtr is a pointer to the XSysMonPsu instance.
* @param	InputModeChMask is the bit mask of all the channels for which
*		the input mode is differential mode. Use XSYSMONPSU_SEQ_INPUT_MDE*
*		defined in xsysmonpsu_hw.h to specify the channel numbers. Differential
*		or  Bipolar input mode will be set for bit masks of 1 and unipolar input
*		mode for bit masks of 0.
*		The InputModeChMask is a 64 bit mask that is written to the three
*		16 bit ADC Channel Analog-Input Mode Sequencer Registers.
* @param	SysmonBlk is the value that tells whether it is for PS Sysmon
*       block or PL Sysmon block register region.
*
* @return
*		- XST_SUCCESS if the given values were written successfully to
*		the ADC Channel Analog-Input Mode Sequencer Registers.
*		- XST_FAILURE if the channel sequencer is enabled.
*
* @note		None.
*
*****************************************************************************/
This function sets the Analog input mode for the specified channels in the
ADC Channel Analog-Input Mode Sequencer Registers. The sequencer must be in
the Safe Mode before writing to these registers.
This function sets the Analog input mode for the specified channels in the ADC Channel Analog - Input Mode Sequencer Registers . The sequencer must be in the Safe Mode before writing to these registers .
s32 XSysMonPsu_SetSeqInputMode(XSysMonPsu *InstancePtr, u64 InputModeChMask,
		u32 SysmonBlk)
{
	s32 Status;
	UINTPTR EffectiveBaseAddress;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((SysmonBlk == XSYSMON_PS)||(SysmonBlk == XSYSMON_PL));
	if ((XSysMonPsu_GetSequencerMode(InstancePtr,SysmonBlk)
	                                      != XSM_SEQ_MODE_SAFE)) {
		Status = (s32)XST_FAILURE;
		goto End;
	}
	EffectiveBaseAddress =
			XSysMonPsu_GetEffBaseAddress(InstancePtr->Config.BaseAddress,
					SysmonBlk);
	XSysmonPsu_WriteReg(EffectiveBaseAddress +
			XSYSMONPSU_SEQ_INPUT_MDE0_OFFSET,
			 (u32)(InputModeChMask & XSYSMONPSU_SEQ_INPUT_MDE0_MASK));
	XSysmonPsu_WriteReg(EffectiveBaseAddress +
			XSYSMONPSU_SEQ_INPUT_MDE1_OFFSET,
			 (u32)(InputModeChMask >> XSM_SEQ_CH_SHIFT) &
			 XSYSMONPSU_SEQ_INPUT_MDE1_MASK);
	XSysmonPsu_WriteReg(EffectiveBaseAddress +
		XSYSMONPSU_SEQ_INPUT_MDE2_OFFSET,
		(u32)(InputModeChMask >> XSM_SEQ_CH2_SHIFT) &
		 XSYSMONPSU_SEQ_INPUT_MDE2_MASK);
	Status = (s32)XST_SUCCESS;
End:
	return Status;
}
s32 XSysMonPsu_SetSeqInputMode ( XSysMonPsu * InstancePtr , u64 InputModeChMask , u32 SysmonBlk ) { s32 Status ; UINTPTR EffectiveBaseAddress ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( ( SysmonBlk == XSYSMON_PS ) || ( SysmonBlk == XSYSMON_PL ) ) ; if ( ( XSysMonPsu_GetSequencerMode ( InstancePtr , SysmonBlk ) != XSM_SEQ_MODE_SAFE ) ) { Status = ( s32 ) XST_FAILURE ; goto End ; } EffectiveBaseAddress = XSysMonPsu_GetEffBaseAddress ( InstancePtr -> Config . BaseAddress , SysmonBlk ) ; XSysmonPsu_WriteReg ( EffectiveBaseAddress + XSYSMONPSU_SEQ_INPUT_MDE0_OFFSET , ( u32 ) ( InputModeChMask & XSYSMONPSU_SEQ_INPUT_MDE0_MASK ) ) ; XSysmonPsu_WriteReg ( EffectiveBaseAddress + XSYSMONPSU_SEQ_INPUT_MDE1_OFFSET , ( u32 ) ( InputModeChMask >> XSM_SEQ_CH_SHIFT ) & XSYSMONPSU_SEQ_INPUT_MDE1_MASK ) ; XSysmonPsu_WriteReg ( EffectiveBaseAddress + XSYSMONPSU_SEQ_INPUT_MDE2_OFFSET , ( u32 ) ( InputModeChMask >> XSM_SEQ_CH2_SHIFT ) & XSYSMONPSU_SEQ_INPUT_MDE2_MASK ) ; Status = ( s32 ) XST_SUCCESS ; End : return Status ; }
This function sets the Analog input mode for the specified channels in the
ADC Channel Analog-Input Mode Sequencer Registers.
This function sets the Analog input mode for the specified channels in the ADC Channel Analog - Input Mode Sequencer Registers .
/* Assert the arguments. */ /*
	 * The sequencer must be in the Safe Mode before writing to
	 * these registers. Return XST_FAILURE if the channel sequencer
	 * is enabled.
	 */ /* Calculate the effective baseaddress based on the Sysmon instance. */ /*
	 * Set the input mode for the specified channels in the ADC Channel
	 * Analog-Input Mode Sequencer Registers.
	 */