wdtps
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Groups Pages
xwdtps_intr_example.c File Reference

Overview

This file contains a design example using the System Watchdog Timer Device (WdtPs) driver and hardware device using interrupt mode.

This test assumes that the RESET OUTPUT OF WDT IS NOT CONNECTED to the processor and the IRQ output is connected to an interrupt controller attached to the processor

Note
MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00a ecm/jz 01/15/10 First release 3.1 sg 08/20/18 Updated interrupt example to fix interrupt ID conflict issue 3.6 sb 06/27/23 Added support for system device-tree flow. 3.9 vlt 12/18/25 Update Doxygen comments to include SDT flow details.

 
#include "xparameters.h"
#include "xwdtps.h"
#include "xscugic.h"
#include "xil_exception.h"
#include "xil_printf.h"
#include "xinterrupt_wrap.h"

Functions

int WdtPsIntrExample (XWdtPs *WdtInstancePtr, UINTPTR BaseAddress)
 This function tests the functioning of the System WatchDog Timer driver in the Interrupt mode. More...
 
int main (void)
 Main function to call the Wdt interrupt example. More...
 

Function Documentation

int main ( void  )

Main function to call the Wdt interrupt example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None.

References WdtPsIntrExample().

int WdtPsIntrExample ( XWdtPs WdtInstancePtr,
UINTPTR  BaseAddress 
)

This function tests the functioning of the System WatchDog Timer driver in the Interrupt mode.

After one expiration of the timeout interval, an interrupt is generated and the WDT state bit is set to one in the status register.

This function assumes that the reset output of the Wdt device is not connected to the reset of the processor, otherwise, the timer will cause the processor to reset when it expires.

Parameters
WdtInstancePtris a pointer to the instance of XWdtPs driver.
BaseAddresscontains the base address of the device
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
In XSCT/classic flow, WdtDeviceId and WdtIntrId are used to look up the device configuration and set up interrupt handling.

References XWdtPs_Config::BaseAddress, XWdtPs_Config::IntrId, XWdtPs_Config::IntrParent, XWDTPS_CCR_PSCALE_0008, XWdtPs_CfgInitialize(), XWDTPS_CLK_PRESCALE, XWDTPS_COUNTER_RESET, XWdtPs_DisableOutput(), XWdtPs_EnableOutput(), XWDTPS_IRQ_SIGNAL, XWdtPs_IsWdtExpired, XWdtPs_LookupConfig(), XWDTPS_RESET_SIGNAL, XWdtPs_RestartWdt, XWdtPs_SelfTest(), XWdtPs_SetControlValue(), XWdtPs_Start(), and XWdtPs_Stop().

Referenced by main().