XilinxProcessorIPLib/drivers/wdtps/examples/xwdtps_selftest_example.c
int WdtPsSelfTestExample(u16 DeviceId)
{
	int Status;
	XWdtPs_Config *ConfigPtr;

	/*
	 * Initialize the watchdog timer so that it is ready to use
	 */
	ConfigPtr = XWdtPs_LookupConfig(DeviceId);
	if (NULL == ConfigPtr) {
		return XST_FAILURE;
	}
	/*
	 * This is where the virtual address would be used, this example
	 * uses physical address.
	 */
	Status = XWdtPs_CfgInitialize(&Watchdog, ConfigPtr,
				       ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Run the SelfTest
	 */
	Status = XWdtPs_SelfTest(&Watchdog);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function does a minimal test on the watchdog timer device and driver
* as a design example. The purpose of this function is to illustrate how to use
* the XWdtPs driver.
*
* This function may require some time (seconds or even minutes) to execute
* because it waits for the watchdog timer to expire.
*
* @param	DeviceId is the unique device id of the device.
*
* @return	XST_SUCCESS if successful, otherwise XST_FAILURE.
*
* @note		None.
*
****************************************************************************/
This function does a minimal test on the watchdog timer device and driver
as a design example. The purpose of this function is to illustrate how to use
the XWdtPs driver.

This function may require some time (seconds or even minutes) to execute
because it waits for the watchdog timer to expire.
This function does a minimal test on the watchdog timer device and driver as a design example . The purpose of this function is to illustrate how to use the XWdtPs driver . This function may require some time ( seconds or even minutes ) to execute because it waits for the watchdog timer to expire .
int WdtPsSelfTestExample(u16 DeviceId)
{
	int Status;
	XWdtPs_Config *ConfigPtr;
	ConfigPtr = XWdtPs_LookupConfig(DeviceId);
	if (NULL == ConfigPtr) {
		return XST_FAILURE;
	}
	Status = XWdtPs_CfgInitialize(&Watchdog, ConfigPtr,
				       ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XWdtPs_SelfTest(&Watchdog);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int WdtPsSelfTestExample ( u16 DeviceId ) { int Status ; XWdtPs_Config * ConfigPtr ; ConfigPtr = XWdtPs_LookupConfig ( DeviceId ) ; if ( NULL == ConfigPtr ) { return XST_FAILURE ; } Status = XWdtPs_CfgInitialize ( & Watchdog , ConfigPtr , ConfigPtr -> BaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XWdtPs_SelfTest ( & Watchdog ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function does a minimal test on the watchdog timer device and driver
as a design example.
This function does a minimal test on the watchdog timer device and driver as a design example .
/*
	 * Initialize the watchdog timer so that it is ready to use
	 */ /*
	 * This is where the virtual address would be used, this example
	 * uses physical address.
	 */ /*
	 * Run the SelfTest
	 */