wdttb: xwdttb_winwdt_intr_example.c File Reference

| wdttb Xilinx SDK Drivers API Documentation

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

Macros | Functions
xwdttb_winwdt_intr_example.c File Reference

## Overview

This file contains a design example using the TimeBase Watchdog Timer Device (WdtTb) driver and hardware device using interrupt mode (for the WDT interrupt).

Note

This example assumes that the reset output of the WdtTb device is not connected to the reset of the processor. This example will not return if the interrupts are not working.

MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    4.0   sha  02/04/16 First release

## Macros
#define | WIN_WDT_SW_COUNT 0xF00000
| Number of clock cycles for second window. More...
#define | WIN_WDT_SBC_COUNT 16
| Selected byte count. More...
#define | WIN_WDT_BSS_COUNT 2
| Byte segment selected. More...

## Functions
int | WinWdtIntrExample (INTC *IntcInstancePtr, XWdtTb *WdtTbInstancePtr, u16 WdtTbDeviceId, u16 WdtTbIntrId)
| This function tests the functioning of the Window Watchdog Timer in the interrupt mode. More...
int | main (void)
| Main function to call the WdtTb interrupt example. More...

## Macro Definition Documentation

#define WIN_WDT_BSS_COUNT 2

Byte segment selected.

Referenced by WinWdtIntrExample().

#define WIN_WDT_SBC_COUNT 16

Selected byte count.

Referenced by WinWdtIntrExample().

#define WIN_WDT_SW_COUNT 0xF00000

Number of clock cycles for second window.

Referenced by WinWdtIntrExample().

## Function Documentation

int main | ( | void |  | ) |

Main function to call the WdtTb interrupt example.

Parameters

  None. |

Returns
  - XST_SUCCESS if successful
  - XST_FAILURE, otherwise.

Note
  None.

References WinWdtIntrExample().

int WinWdtIntrExample | ( | INTC * | IntcInstancePtr,
|  | XWdtTb * | WdtTbInstancePtr,
|  | u16 | WdtTbDeviceId,
|  | u16 | WdtTbIntrId
| ) |  |

This function tests the functioning of the Window Watchdog Timer in the interrupt mode.

This function waits for interrupt programmed point in second window. If the interrupt has occurred, interrupt handler sets a flag and restarts the timer. This function then clears the interrupt, flag and waits for second interrupt to occur and continue waiting for second interrupt as mentioned above.

This function assumes that the reset output of the Window Watchdog Timer is not connected to the reset of the processor. The function allows the Window Watchdog Timer to timeout such that a reset will occur if it is connected.

Parameters

  IntcInstancePtr | is a pointer to the instance of the INTC driver.
  WdtTbInstancePtr | is a pointer to the instance of WdtTb driver.
  WdtTbDeviceId | is the Device ID of the WdtTb Device and is typically XPAR_<WDTTB_instance>_DEVICE_ID value from xparameters.h.
  WdtTbIntrId | is the Interrupt Id of the WatchDog and is typically XPAR_<INTC_instance>_<WDTTB_instance>_WDT_ INTERRUPT_VEC_ID value from xparameters.h.

Returns
  - XST_SUCCESS if interrupt example run successfully.
  - XST_FAILURE, if reset has occurred.

Note
  None.

References WIN_WDT_BSS_COUNT, WIN_WDT_SBC_COUNT, WIN_WDT_SW_COUNT, XWdtTb_DisableFailCounter(), XWdtTb_DisablePsm(), XWdtTb_DisableSst(), XWdtTb_Initialize(), XWdtTb_IntrClear(), XWDTTB_NO_BAD_EVENT, XWdtTb_SelfTest(), XWdtTb_SetByteCount(), XWdtTb_SetByteSegment(), XWdtTb_SetWindowCount(), XWdtTb_Start(), and XWdtTb_Stop().

Referenced by main().