![]() |
wdttb
Vitis Drivers API Documentation
|
This file contains a design example using the Generic Watchdog Timer Device (Gwdt) driver and hardware device using interrupt mode (for the GWDT interrupt).
This example assumes that the reset output of the GWDT 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.0 sne 03/26/20 First release 5.1 sne 06/01/20 Configured Generic watchdog offset value. 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. 5.12 vlt 12/18/25 Update Doxygen comments to include SDT flow details.
#include "xparameters.h"#include "xwdttb.h"#include "xil_exception.h"#include "xscugic.h"#include "xil_printf.h"#include "xinterrupt_wrap.h"Functions | |
| int | WdtTbIntrExample (XWdtTb *GWdtInstancePtr, UINTPTR BaseAddress) |
| This function tests the functioning of the Generic WatchDog Timer module in the Interrupt mode (for the gwdt_ws0 interrupt). More... | |
| int | main (void) |
| Main function to call the Generic Wdt interrupt example. More... | |
| int main | ( | void | ) |
Main function to call the Generic Wdt interrupt example.
References WdtTbIntrExample().
| int WdtTbIntrExample | ( | XWdtTb * | WdtTbInstancePtr, |
| UINTPTR | BaseAddress | ||
| ) |
This function tests the functioning of the Generic WatchDog Timer module in the Interrupt mode (for the gwdt_ws0 interrupt).
This function demonstrates the functioning of the Window Watchdog QA mode.
This function tests the functioning of the TimeBase WatchDog Timer module in the Interrupt mode (for the WDT interrupt).
After one expiration of the GWDT timeout interval, an interrupt is generated and the GWS[1] state bit is set to one in the Generic Watchdog Control and Status Register register. If the system can attempt to take corrective action that includes refreshing the watchdog within the second watch period. If the refresh is successful, the system returns to the previous normal operation. If it fails, then the second watch period expires and a second signal is generated. A GWDT reset sets the GWS[2] reset status bit in the status register so that the application code can determine if the last system reset was a WDT reset.
This function assumes that the reset output of the GWDT device is not connected to the reset of the processor. The function allows the watchdog timer to timeout such that a reset will occur if it is connected.
| GWdtInstancePtr | is a pointer to the instance of WdtTb driver. |
| BaseAddress | contains the base address of the device |
-This example will not return if the interrupts are not working.
After one expiration of the WDT timeout interval, an interrupt is generated and the WDT state bit is set to one in the status register. If the state bit is not cleared (by writing a 1 to the state bit) before the next expiration of the timeout interval, a WDT reset is generated. A WDT reset sets the WDT reset status bit in the status register so that the application code can determine if the last system reset was a WDT reset.
This function assumes that the reset output of the WdtTb device is not connected to the reset of the processor. The function allows the watchdog timer to timeout such that a reset will occur if it is connected.
| WdtTbInstancePtr | is a pointer to the instance of WdtTb driver. |
| BaseAddress | contains the base address of the device |
This function sets up WWDT in QA mode, enables interrupt subsystem. It programs the first (closed) and second (window) and sets up an interrupt to raise an interrupt in the open window In the closed window the function writes three correct responses to the relevant Token_Resp register. Once the interrupt is received in the open window, it writes the 4th correct response to the Token_resp register. The last (fourth) write ends the second (open window).
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.
| WdtTbInstancePtr | is a pointer to the instance of WdtTb driver. |
| BaseAddress | contains the base address of the device |
References XWdtTb_Config::BaseAddr, XWdtTb_Config::IntrId, XWdtTb_Config::IntrParent, XWdtTb_CfgInitialize(), XWdtTb_LookupConfig(), XWdtTb_SelfTest(), XWdtTb_SetGenericWdtWindow(), XWdtTb_Start(), and XWdtTb_Stop().
Referenced by main().