wdttb
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
xwdttb_winwdt_example.c File Reference

Overview

This file contains a design example using the Watchdog Timer Timebase (XWdtTb) driver with window feature.

The WDTTB core will be generated either in legacy or window feature.

Note

None

MODIFICATION HISTORY:

Ver   Who  Date     Changes


4.0 sha 02/04/16 First release. 4.4 sne 03/04/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.10 ht 10/28/24 Fix compilation warnings in SDT flow peripheral tests. 5.11 bkv 07/08/25 Fixed GCC Warning. 5.12 vlt 12/18/25 Update Doxygen comments to include SDT flow details.

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

Macros

#define WDTTB_FW_COUNT   31
 Number of clock cycles for first window. More...
 
#define WDTTB_SW_COUNT   0x01110000
 Number of clock cycles for second window. More...
 
#define WDTTB_BYTE_COUNT   154
 Selected byte count. More...
 
#define WDTTB_BYTE_SEGMENT   2
 Byte segment selected. More...
 
#define WDTTB_SST_COUNT   0x00011000
 Number of clock cycles for Second sequence Timer. More...
 

Functions

int WinWdtTbExample (XWdtTb *WdtTbInstancePtr, UINTPTR BaseAddress)
 This function tests the functioning of the TimeBase WatchDog Timer module with window feature in the polled mode. 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...
 

Macro Definition Documentation

#define WDTTB_BYTE_COUNT   154

Selected byte count.

#define WDTTB_BYTE_SEGMENT   2

Byte segment selected.

#define WDTTB_FW_COUNT   31

Number of clock cycles for first window.

#define WDTTB_SST_COUNT   0x00011000

Number of clock cycles for Second sequence Timer.

#define WDTTB_SW_COUNT   0x01110000

Number of clock cycles for second window.

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.
int WinWdtTbExample ( XWdtTb WdtTbInstancePtr,
UINTPTR  BaseAddress 
)

This function tests the functioning of the TimeBase WatchDog Timer module with window feature in the polled mode.

In window, this function polls interrupt programmed point in second window, checks the interrupt bit is set. If the bit is set clears the bit and restart the watchdog timer. If bit is not cleared before overflowing the second window, the watchdog timer resets.

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

Parameters
WdtTbInstancePtris a pointer to the instance of XWdtTb driver.
BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS, in window, there is no bad event.
  • XST_FAILURE, otherwise.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.