wdttb: xwdttb_winwdt_example.c File Reference

| wdttb Xilinx SDK Drivers API Documentation

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

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

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

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

Parameters

  None. |

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if unsuccessful.

Note
  None.

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

  DeviceId | is 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.