wdttb
Vitis 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).

This file contains an example that demonstrates Q&A functionality of the Window Watchdog.

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 5.0 sne 03/26/20 Updated example to support versal platform. 5.7 sb 06/27/23 Correct the interrupt ID for Versal-net platform. 5.7 sb 07/12/23 Added support for system device-tree flow.

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


5.6 asa 01/13/23 First release of Q&A mode example. 5.7 sb 06/27/23 Correct the interrupt ID for Versal-net platform. 5.7 sb 07/12/23 Added support for system device-tree flow.

 

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.

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
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_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::IsPl, WIN_WDT_BSS_COUNT, WIN_WDT_SBC_COUNT, WIN_WDT_SW_COUNT, XWdtTb_CfgInitialize(), XWdtTb_DisableFailCounter(), XWdtTb_DisablePsm(), XWdtTb_DisableSst(), XWdtTb_IntrClear(), XWdtTb_LookupConfig(), XWDTTB_NO_BAD_EVENT, XWdtTb_RestartWdt(), XWdtTb_SelfTest(), XWdtTb_SetByteCount(), XWdtTb_SetByteSegment(), XWdtTb_SetWindowCount(), XWdtTb_Start(), XWdtTb_Stop(), and XWT_WWDT.

Referenced by main().