![]() |
wdtps
Vitis Drivers API Documentation
|
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
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... | |
| int main | ( | void | ) |
Main function to call the Wdt interrupt example.
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.
| WdtInstancePtr | is a pointer to the instance of XWdtPs driver. |
| BaseAddress | contains the base address of the device |
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().