wdttb: xwdttb_low_level_example.c File Reference

| wdttb Xilinx SDK Drivers API Documentation

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

Functions
xwdttb_low_level_example.c File Reference

## Overview

This file contains a design example using the low-level driver macros of the Watchdog Timer Timebase driver.

These macros are found in xwdttb_l.h.

Note

None.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes

     1.00b rpm  04/26/02 First release
     1.00b sv   04/26/05 Minor changes to comply to Doxygen and coding guidelines
     2.00a ktn  22/10/09 Updated the example to use the HAL APIs/macros.
                          The following macros defined in xwdttb_l.h file have been
                          removed - XWdtTb_mEnableWdt, XWdtTb_mDisbleWdt,
                          XWdtTb_mRestartWdt, XWdtTb_mGetTimebaseReg and
                          XWdtTb_mHasReset.
                          The example is updated to use XWdtTb_ReadReg and
                          XWdtTb_WriteReg macros to achieve the functionality of the
                          macros that were removed.
                          Updated this example to check for Watchdog timer reset
                          condition instead of timer expiry state to avoid a race
                          condition
     4.0   sha  02/04/16 Added debug messages.

## Functions
int | XWdtTb_LowLevelExample (u32 WdtTbBaseAddress)
| This function assumes that the reset output of the watchdog timer timebase device is not connected to the reset of the processor. More...
int | main (void)
| Main function to call the Wdttb low level example. More...

## Function Documentation

int main | ( | void |  | ) |

Main function to call the Wdttb low level example.

Parameters

  None. |

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if unsuccessful.

Note
  None.

References XWdtTb_LowLevelExample().

int XWdtTb_LowLevelExample | ( | u32 | WdtTbBaseAddress | ) |

This function assumes that the reset output of the watchdog timer timebase 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. This also assumes the interrupt output is not connected to an interrupt input.

This function checks for Watchdog timer reset condition in two timer expiry state. This function may require some time (seconds or even minutes) to execute because it waits for the watchdog timer to expire.

Parameters

  WdtTbBaseAddress | is the base address of the device.

Returns
  - XST_SUCCESS if WRS bit is not set in next two subsequent timer expiry state.
  - XST_FAILURE, otherwise.

Note
  None.

References XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_CSR0_EWDT1_MASK, XWT_CSR0_WDS_MASK, XWT_CSR0_WRS_MASK, XWT_CSRX_EWDT2_MASK, XWT_TWCSR0_OFFSET, and XWT_TWCSR1_OFFSET.

Referenced by main().