wdttb
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
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. 5.9 ht 07/22/24 Add support for peripheral tests in SDT flow. 5.12 vlt 12/18/25 Update Doxygen comments to include SDT flow details.

 
#include "xparameters.h"
#include "xwdttb.h"

Functions

int WdtTbSelfTestExample (UINTPTR BaseAddress)
 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 ( UINTPTR  BaseAddress)

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
BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if unsuccessful.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

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

Referenced by main().