wdttb
Vitis Drivers API Documentation
xwdttb_selftest_example.c File Reference

Overview

This file contains a example for using the Watchdog Timer Timebase hardware and driver.

Note

None

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.00a sv 04/27/05 Initial release for TestApp integration. 2.00a ktn 22/10/09 Updated the example to use the HAL APIs/macros. 4.0 sha 02/04/16 Added debug messages. Calling XWdtTb_LookupConfig and XWdtTb_CfgInitialize functions instead of XWdtTb_Initialize for initialization. 4.4 sne 02/12/19 Added support for Versal 4.5 sne 09/27/19 Updated example file to support AXI Timebase WDT and WWDT. 5.0 sne 03/11/20 Added XWdtTb_ConfigureWDTMode api to configure mode. 5.7 sb 07/12/23 Added support for system device-tree flow.

 

Functions

int WdtTbSelfTestExample (u16 DeviceId)
 This function does a minimal test on the watchdog timer timebase device and driver as a design example. More...
 
int main (void)
 Main function to call the example.This function is not included if the example is generated from the TestAppGen test tool. More...
 

Function Documentation

int main ( void  )

Main function to call the example.This function is not included if the example is generated from the TestAppGen test tool.

Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if unsuccessful.
Note
None.

References WdtTbSelfTestExample().

int WdtTbSelfTestExample ( u16  DeviceId)

This function does a minimal test on the watchdog timer timebase device and driver as a design example.

The purpose of this function is to illustrate how to use the XWdtTb component.

This function assumes that the reset output of the watchdog timer timebase device is not connected to the reset of the processor. The function allows the watchdog timer to timeout such that a reset will occur if it is connected. It the interrupt output is connected to an interrupt input, the user must handle the interrupts appropriately.

This function may require some time (seconds or even minutes) to execute because it waits for the watchdog timer to expire.

Parameters
DeviceIdis the XPAR_<WDTB_instance>_DEVICE_ID value from xparameters.h.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if unsuccessful.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::IsPl, XWdtTb_CfgInitialize(), XWdtTb_LookupConfig(), XWdtTb_SelfTest(), and XWT_WWDT.

Referenced by main().