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

◆ WIN_WDT_BSS_COUNT

#define WIN_WDT_BSS_COUNT   2

Byte segment selected.

◆ WIN_WDT_SBC_COUNT

#define WIN_WDT_SBC_COUNT   16

Selected byte count.

◆ WIN_WDT_SW_COUNT

#define WIN_WDT_SW_COUNT   0xF00000

Number of clock cycles for second window.

Function Documentation

◆ main()

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().

◆ 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
IntcInstancePtris a pointer to the instance of the INTC driver.
WdtTbInstancePtris a pointer to the instance of WdtTb driver.
WdtTbDeviceIdis the Device ID of the WdtTb Device and is typically XPAR_<WDTTB_instance>_DEVICE_ID value from xparameters.h.
WdtTbIntrIdis 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 XWdtTb_Initialize(), and XWdtTb_SelfTest().

Referenced by main().