wdttb: xwdttb_selftest_example.c File Reference

| wdttb Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
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.

## 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.

Parameters

  None. |

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

  DeviceId | is 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::EnableWinMode, XWdtTb_Config::IsPl, XWdtTb_CfgInitialize(), XWdtTb_LookupConfig(), and XWdtTb_SelfTest().

Referenced by main().