XilinxProcessorIPLib/drivers/wdtps/src/xwdtps.c
u32 XWdtPs_GetControlValue(XWdtPs *InstancePtr, u8 Control)
{
	u32 Register;
	u32 ReturnValue = 0U;

	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((Control == XWDTPS_CLK_PRESCALE) ||
			(Control == XWDTPS_COUNTER_RESET));

	/*
	 * Read the contents of the CCR register.
	 */
	Register = XWdtPs_ReadReg(InstancePtr->Config.BaseAddress,
			 XWDTPS_CCR_OFFSET);

	if (Control == XWDTPS_CLK_PRESCALE) {
		/*
		 * Mask off the field in the register.
		 */
		ReturnValue = Register & XWDTPS_CCR_CLKSEL_MASK;

	} else {
		/*
		 * Mask off the field in the register.
		 */
		Register &= XWDTPS_CCR_CRV_MASK;

		/*
		 * Shift over to the right most positions.
		 */
		ReturnValue = Register >> XWDTPS_CCR_CRV_SHIFT;
	}

	return ReturnValue;
}
/****************************************************************************/
/**
*
* Returns the current control setting for the indicated signal/output.
* The register referenced is the Counter Control Register (XWDTPS_CCR_OFFSET)
*
* @param	InstancePtr is a pointer to the XWdtPs instance.
* @param	Control is the desired signal/output.
*		Valid Control Values are XWDTPS_CLK_PRESCALE and
*		XWDTPS_COUNTER_RESET. Only one of them can be specified at a
*		time.
*
* @return	The contents of the requested control field in the Counter
*		Control Register (XWDTPS_CCR_OFFSET).
*		If the Control is XWDTPS_CLK_PRESCALE then use the
*		definitions XWDTEPB_CCR_PSCALE_XXXX.
*		If the Control is XWDTPS_COUNTER_RESET then the values are
*		0x0 to 0xFFF. This is the Counter Restart value in the CCR
*		register.
*
* @note		None.
*
******************************************************************************/
Returns the current control setting for the indicated signal/output.
The register referenced is the Counter Control Register (XWDTPS_CCR_OFFSET)
Returns the current control setting for the indicated signal / output . The register referenced is the Counter Control Register ( XWDTPS_CCR_OFFSET )
u32 XWdtPs_GetControlValue(XWdtPs *InstancePtr, u8 Control)
{
	u32 Register;
	u32 ReturnValue = 0U;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((Control == XWDTPS_CLK_PRESCALE) ||
			(Control == XWDTPS_COUNTER_RESET));
	Register = XWdtPs_ReadReg(InstancePtr->Config.BaseAddress,
			 XWDTPS_CCR_OFFSET);
	if (Control == XWDTPS_CLK_PRESCALE) {
		ReturnValue = Register & XWDTPS_CCR_CLKSEL_MASK;
	} else {
		Register &= XWDTPS_CCR_CRV_MASK;
		ReturnValue = Register >> XWDTPS_CCR_CRV_SHIFT;
	}
	return ReturnValue;
}
u32 XWdtPs_GetControlValue ( XWdtPs * InstancePtr , u8 Control ) { u32 Register ; u32 ReturnValue = 0U ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( ( Control == XWDTPS_CLK_PRESCALE ) || ( Control == XWDTPS_COUNTER_RESET ) ) ; Register = XWdtPs_ReadReg ( InstancePtr -> Config . BaseAddress , XWDTPS_CCR_OFFSET ) ; if ( Control == XWDTPS_CLK_PRESCALE ) { ReturnValue = Register & XWDTPS_CCR_CLKSEL_MASK ; } else { Register &= XWDTPS_CCR_CRV_MASK ; ReturnValue = Register >> XWDTPS_CCR_CRV_SHIFT ; } return ReturnValue ; }
Returns the current control setting for the indicated signal/output.
Returns the current control setting for the indicated signal / output .
/*
	 * Read the contents of the CCR register.
	 */ /*
		 * Mask off the field in the register.
		 */ /*
		 * Mask off the field in the register.
		 */ /*
		 * Shift over to the right most positions.
		 */