wdtps: xwdtps_intr_example.c File Reference

| wdtps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
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

## Functions
int | WdtPsIntrExample (XScuGic *IntcInstancePtr, XWdtPs *WdtInstancePtr, u16 WdtDeviceId, u16 WdtIntrId)
| 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.

Parameters

  None. |

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

References WdtPsIntrExample().

int WdtPsIntrExample | ( | XScuGic * | IntcInstancePtr,
|  | XWdtPs * | WdtInstancePtr,
|  | u16 | WdtDeviceId,
|  | u16 | WdtIntrId
| ) |  |

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

  IntcInstancePtr | is a pointer to the instance of the XScuGic driver.
  WdtInstancePtr | is a pointer to the instance of XWdtPs driver.
  WdtDeviceId | is the Device ID of the XWdtPs device.
  WdtIntrId | is the Interrupt Id of the XWdtPs device.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

References XWdtPs_Config::BaseAddress, 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().