#include "xil_types.h"
#include "xil_assert.h"
#include "xstatus.h"
#include "xwdtps_hw.h"
Classes | |
struct | XWdtPs_Config |
struct | XWdtPs |
Defines | |
#define | XWDTPS_H |
#define | XWDTPS_RESET_SIGNAL 1 |
#define | XWDTPS_IRQ_SIGNAL 2 |
#define | XWDTPS_CLK_PRESCALE 1 |
#define | XWDTPS_COUNTER_RESET 2 |
#define | XWdtPs_IsWdtExpired(InstancePtr) |
#define | XWdtPs_RestartWdt(InstancePtr) |
Functions | |
XWdtPs_Config * | XWdtPs_LookupConfig (u16 DeviceId) |
int | XWdtPs_CfgInitialize (XWdtPs *InstancePtr, XWdtPs_Config *ConfigPtr, u32 EffectiveAddress) |
void | XWdtPs_Start (XWdtPs *InstancePtr) |
void | XWdtPs_Stop (XWdtPs *InstancePtr) |
void | XWdtPs_EnableOutput (XWdtPs *InstancePtr, u8 Signal) |
void | XWdtPs_DisableOutput (XWdtPs *InstancePtr, u8 Signal) |
u32 | XWdtPs_GetControlValue (XWdtPs *InstancePtr, u8 Control) |
void | XWdtPs_SetControlValue (XWdtPs *InstancePtr, u8 Control, u32 Value) |
int | XWdtPs_SelfTest (XWdtPs *InstancePtr) |
#define XWDTPS_CLK_PRESCALE 1 |
Clock Prescale request
#define XWDTPS_COUNTER_RESET 2 |
Counter Reset request
#define XWDTPS_H |
#define XWDTPS_IRQ_SIGNAL 2 |
IRQ signal request
#define XWdtPs_IsWdtExpired | ( | InstancePtr | ) |
((XWdtPs_ReadReg((InstancePtr)->Config.BaseAddress, XWDTPS_SR_OFFSET) & \ XWDTPS_SR_WDZ_MASK) == XWDTPS_SR_WDZ_MASK)
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.
InstancePtr | is a pointer to the XWdtPs instance. |
#define XWDTPS_RESET_SIGNAL 1 |
Reset signal request
#define XWdtPs_RestartWdt | ( | InstancePtr | ) |
XWdtPs_WriteReg((InstancePtr)->Config.BaseAddress, \ XWDTPS_RESTART_OFFSET, XWDTPS_RESTART_KEY_VAL)
Restart the watchdog timer. An application needs to call this function periodically to keep the timer from asserting the enabled output.
InstancePtr | is a pointer to the XWdtPs instance. |
int XWdtPs_CfgInitialize | ( | XWdtPs * | InstancePtr, | |
XWdtPs_Config * | ConfigPtr, | |||
u32 | EffectiveAddress | |||
) |
Initialize a specific watchdog timer instance/driver. This function must be called before other functions of the driver are called.
InstancePtr | is a pointer to the XWdtPs instance. | |
ConfigPtr | is the config structure. | |
EffectiveAddress | is the base address for the device. It could be a virtual address if address translation is supported in the system, otherwise it is the physical address. |
void XWdtPs_DisableOutput | ( | XWdtPs * | InstancePtr, | |
u8 | Signal | |||
) |
Disables the indicated signal/output. Performs a read/modify/write cycle to update the value correctly.
InstancePtr | is a pointer to the XWdtPs instance. | |
Signal | is the desired signal/output. Valid Signal Values are XWDTPS_RESET_SIGNAL and XWDTPS_IRQ_SIGNAL Only one of them can be specified at a time. |
void XWdtPs_EnableOutput | ( | XWdtPs * | InstancePtr, | |
u8 | Signal | |||
) |
Enables the indicated signal/output. Performs a read/modify/write cycle to update the value correctly.
InstancePtr | is a pointer to the XWdtPs instance. | |
Signal | is the desired signal/output. Valid Signal Values are XWDTPS_RESET_SIGNAL and XWDTPS_IRQ_SIGNAL. Only one of them can be specified at a time. |
u32 XWdtPs_GetControlValue | ( | XWdtPs * | InstancePtr, | |
u8 | Control | |||
) |
Returns the current control setting for the indicated signal/output. The register referenced is the Counter Control Register (XWDTPS_CCR_OFFSET)
InstancePtr | is a pointer to the XWdtPs instance. | |
Control | is the desired signal/output. Valid Control Values are XWDTPS_CLK_PRESCALE and XWDTPS_COUNTER_RESET. Only one of them can be specified at a time. |
XWdtPs_Config* XWdtPs_LookupConfig | ( | u16 | DeviceId | ) |
Lookup the device configuration based on the unique device ID. The table contains the configuration info for each device in the system.
DeviceId | is the unique device ID of the device being looked up. |
int XWdtPs_SelfTest | ( | XWdtPs * | InstancePtr | ) |
Run a self-test on the timebase. This test verifies that the register access locking functions. This is tested by trying to alter a register without setting the key value and verifying that the register contents did not change.
InstancePtr | is a pointer to the XWdtPs instance. |
void XWdtPs_SetControlValue | ( | XWdtPs * | InstancePtr, | |
u8 | Control, | |||
u32 | Value | |||
) |
Updates the current control setting for the indicated signal/output with the provided value.
Performs a read/modify/write cycle to update the value correctly. The register referenced is the Counter Control Register (XWDTPS_CCR_OFFSET)
InstancePtr | is a pointer to the XWdtPs instance. | |
Control | is the desired signal/output. Valid Control Values are XWDTPS_CLK_PRESCALE and XWDTPS_COUNTER_RESET. Only one of them can be specified at a time. | |
Value | is the desired control value. If the Control is XWDTPS_CLK_PRESCALE then use the defintions XWDTEPB_CCR_PSCALE_XXXX. If the Control is XWDTPS_COUNTER_RESET then the valid values are 0x0 to 0xFFF, this sets the counter restart value of the CCR register. |
void XWdtPs_Start | ( | XWdtPs * | InstancePtr | ) |
Start the watchdog timer of the device.
InstancePtr | is a pointer to the XWdtPs instance. |
void XWdtPs_Stop | ( | XWdtPs * | 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.
InstancePtr | is a pointer to the XWdtPs instance. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.