Software Drivers

xwdttb.h File Reference

#include "xil_types.h"
#include "xil_assert.h"
#include "xstatus.h"
#include "xwdttb_l.h"

Classes

struct  XWdtTb_Config
struct  XWdtTb

Defines

#define XWDTTB_H

Functions

int XWdtTb_Initialize (XWdtTb *InstancePtr, u16 DeviceId)
void XWdtTb_Start (XWdtTb *InstancePtr)
int XWdtTb_Stop (XWdtTb *InstancePtr)
int XWdtTb_IsWdtExpired (XWdtTb *InstancePtr)
void XWdtTb_RestartWdt (XWdtTb *InstancePtr)
u32 XWdtTb_GetTbValue (XWdtTb *InstancePtr)
XWdtTb_ConfigXWdtTb_LookupConfig (u16 DeviceId)
int XWdtTb_SelfTest (XWdtTb *InstancePtr)

Detailed Description


Define Documentation

#define XWDTTB_H

Function Documentation

u32 XWdtTb_GetTbValue ( XWdtTb InstancePtr  ) 

Returns the current contents of the timebase.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
The contents of the timebase.
Note:
None.
int XWdtTb_Initialize ( XWdtTb InstancePtr,
u16  DeviceId 
)

Initialize a specific watchdog timer/timebase instance/driver. This function must be called before other functions of the driver are called.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
DeviceId is the unique id of the device controlled by this XWdtTb instance. Passing in a device id associates the generic XWdtTb instance to a specific device, as chosen by the caller or application developer.
Returns:
  • XST_SUCCESS if initialization was successful
  • XST_DEVICE_IS_STARTED if the device has already been started
  • XST_DEVICE_NOT_FOUND if the configuration for device ID was not found
Note:
None.
int XWdtTb_IsWdtExpired ( XWdtTb InstancePtr  ) 

Check if the watchdog timer has expired. This function is used for polled mode and it is also used to check if the last reset was caused by the watchdog timer.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
TRUE if the watchdog has expired, and FALSE otherwise.
Note:
None.
XWdtTb_Config* XWdtTb_LookupConfig ( u16  DeviceId  ) 
void XWdtTb_RestartWdt ( XWdtTb InstancePtr  ) 

Restart the watchdog timer. An application needs to call this function periodically to keep the timer from asserting the reset output.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
None.
Note:
None.
int XWdtTb_SelfTest ( XWdtTb InstancePtr  ) 

Run a self-test on the timebase. This test verifies that the timebase is incrementing. The watchdog timer is not tested due to the time required to wait for the watchdog timer to expire. The time consumed by this test is dependant on the system clock and the configuration of the dividers in for the input clock of the timebase.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
  • XST_SUCCESS if self-test was successful
  • XST_WDTTB_TIMER_FAILED if the timebase is not incrementing
Note:
None.
void XWdtTb_Start ( XWdtTb InstancePtr  ) 

Start the watchdog timer of the device.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
None.
Note:
The Timebase is reset to 0 when the Watchdog Timer is started. The Timebase is always incrementing
int XWdtTb_Stop ( XWdtTb InstancePtr  ) 

Disable the watchdog timer.

It is the caller's responsibility to disconnect the interrupt handler of the watchdog timer from the interrupt source, typically an interrupt controller, and disable the interrupt in the interrupt controller.

Parameters:
InstancePtr is a pointer to the XWdtTb instance to be worked on.
Returns:
  • XST_SUCCESS if the watchdog was stopped successfully
  • XST_NO_FEATURE if the watchdog cannot be stopped
Note:

The hardware configuration controls this functionality. If it is not allowed by the hardware the failure will be returned and the timer will continue without interruption.