xwdttb.c File Reference
#include "xil_types.h"
#include "xil_assert.h"
#include "xparameters.h"
#include "xil_io.h"
#include "xwdttb.h"
Detailed Description
Contains the required functions of the XWdtTb driver. See xwdttb.h for a description of the driver.
MODIFICATION HISTORY:
Ver Who Date Changes
----- ---- -------- -----------------------------------------------
1.00a ecm 08/16/01 First release
1.00b jhl 02/21/02 Repartitioned the driver for smaller files
1.00b rpm 04/26/02 Made LookupConfig public
1.10b mta 03/23/07 Updated to new coding style
2.00a ktn 10/22/09 Updated to use the HAL processor APIs/macros.
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.
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.
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.
Variable Documentation
This table contains configuration information for each watchdog timer device in the system.
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.