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

Overview

This file contains a design example using the System Watchdog Timer driver (XWdtPs) and hardware device.

This function assumes that the reset output of the Watchdog timer device is not connected to the reset of the processor.

Note

None.

MODIFICATION HISTORY:

 Ver   Who    Date     Changes


1.00a ecm/jz 01/15/10 First release 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 "xil_printf.h"

Functions

int WdtPsPolledExample (UINTPTR BaseAddress)
 This function does a minimal test on the System Watchdog Timer device and driver as a design example. More...
 
int main (void)
 Main function to call the Wdt polled mode example. More...
 

Function Documentation

int main ( void  )

Main function to call the Wdt polled mode example.

Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful
Note
None

References WdtPsPolledExample().

int WdtPsPolledExample ( UINTPTR  BaseAddress)

This function does a minimal test on the System Watchdog Timer device and driver as a design example.

The purpose of this function is to illustrate how to use the XWdtPs driver.

This function assumes that the reset output of the Watchdog timer 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. If the interrupt output is connected to an interrupt input, the user must handle the interrupts appropriately if the output is enabled.

This function may require some time (seconds or even minutes) to execute because it waits for the Watchdog Timer to expire.

Parameters
BaseAddresscontains the base address of the device
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XWdtPs_Config::BaseAddress, XWDTPS_CCR_PSCALE_0008, XWdtPs_CfgInitialize(), XWDTPS_CLK_PRESCALE, XWDTPS_COUNTER_RESET, XWdtPs_DisableOutput(), XWdtPs_IsWdtExpired, XWdtPs_LookupConfig(), XWDTPS_RESET_SIGNAL, XWdtPs_RestartWdt, XWdtPs_SetControlValue(), and XWdtPs_Start().

Referenced by main().