wdttb
Xilinx SDK Drivers API Documentation
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.

Macros

#define WDTTB_FW_COUNT   31
 Number of clock cycles for first window. More...
 
#define WDTTB_SW_COUNT   1000000000
 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...
 

Functions

int WinWdtTbExample (u16 DeviceId)
 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

◆ WDTTB_BYTE_COUNT

#define WDTTB_BYTE_COUNT   154

Selected byte count.

◆ WDTTB_BYTE_SEGMENT

#define WDTTB_BYTE_SEGMENT   2

Byte segment selected.

◆ WDTTB_FW_COUNT

#define WDTTB_FW_COUNT   31

Number of clock cycles for first window.

◆ WDTTB_SW_COUNT

#define WDTTB_SW_COUNT   1000000000

Number of clock cycles for second window.

Function Documentation

◆ main()

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.

◆ WinWdtTbExample()

int WinWdtTbExample ( u16  DeviceId)

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
DeviceIdis the XPAR_<WDTB_instance>_DEVICE_ID value from xparameters.h.
Returns
  • XST_SUCCESS, in window, there is no bad event.
  • XST_FAILURE, otherwise.
Note
None.