![]() |
scuwdt
Vitis Drivers API Documentation
|
Data Structures | |
struct | XScuWdt_Config |
This typedef contains configuration information for the device. More... | |
struct | XScuWdt |
The XScuWdt driver instance data. More... | |
Macros | |
#define | XSCUWDT_H |
< prevent circular inclusions More... | |
#define | XScuWdt_IsWdtExpired(InstancePtr) |
This function is used to check if the watchdog has timed-out and the last reset was caused by the watchdog reset. More... | |
#define | XScuWdt_IsTimerExpired(InstancePtr) |
This function is used to check if the watchdog counter has reached 0 in timer mode. More... | |
#define | XScuWdt_RestartWdt(InstancePtr) |
Re-start the watchdog timer. More... | |
#define | XScuWdt_LoadWdt(InstancePtr, Value) |
Write to the watchdog timer load register. More... | |
#define | XScuWdt_SetWdMode(InstancePtr) |
Put the watchdog timer in Watchdog mode by setting the WD mode bit of the Watchdog control register. More... | |
#define | XScuWdt_SetTimerMode(InstancePtr) |
Put the watchdog timer in Timer mode by writing 0x12345678 and 0x87654321 successively to the Watchdog Disable Register. More... | |
#define | XScuWdt_GetControlReg(InstancePtr) |
Get the contents of the watchdog control register. More... | |
#define | XScuWdt_SetControlReg(InstancePtr, ControlReg) |
Write to the watchdog control register. More... | |
#define | XScuWdt_EnableAutoReload(InstancePtr) |
Enable auto-reload mode. More... | |
#define | XSCUWDT_HW_H |
< prevent circular inclusions More... | |
#define | XScuWdt_ReadReg(BaseAddr, RegOffset) Xil_In32((BaseAddr) + ((u32)RegOffset)) |
Read the given register. More... | |
#define | XScuWdt_WriteReg(BaseAddr, RegOffset, Data) Xil_Out32((BaseAddr) + ((u32)RegOffset), ((u32)Data)) |
Write the given register. More... | |
Functions | |
s32 | XScuWdt_CfgInitialize (XScuWdt *InstancePtr, XScuWdt_Config *ConfigPtr, u32 EffectiveAddress) |
Initialize a specific watchdog timer instance/driver. More... | |
void | XScuWdt_Start (XScuWdt *InstancePtr) |
Start the watchdog counter of the device. More... | |
void | XScuWdt_Stop (XScuWdt *InstancePtr) |
Stop the watchdog timer. More... | |
XScuWdt_Config * | XScuWdt_LookupConfig (u16 DeviceId) |
Lookup the device configuration based on the unique device ID. More... | |
s32 | XScuWdt_SelfTest (XScuWdt *InstancePtr) |
Run a self-test on the WDT. More... | |
Variables | |
XScuWdt_Config | XScuWdt_ConfigTable [] |
This table contains configuration information for each watchdog timer device in the system. More... | |
XScuWdt_Config | XScuWdt_ConfigTable [XPAR_XSCUWDT_NUM_INSTANCES] |
This table contains configuration information for each watchdog timer device in the system. More... | |
Register Map | |
Offsets of registers from the start of the device. The WDT registers start at an offset 0x20 | |
#define | XSCUWDT_LOAD_OFFSET 0x00U |
Watchdog Load Register. More... | |
#define | XSCUWDT_COUNTER_OFFSET 0x04U |
Watchdog Counter Register. More... | |
#define | XSCUWDT_CONTROL_OFFSET 0x08U |
Watchdog Control Register. More... | |
#define | XSCUWDT_ISR_OFFSET 0x0CU |
Watchdog Interrupt Status Register. More... | |
#define | XSCUWDT_RST_STS_OFFSET 0x10U |
Watchdog Reset Status Register. More... | |
#define | XSCUWDT_DISABLE_OFFSET 0x14U |
Watchdog Disable Register. More... | |
Watchdog Control register | |
This register bits control the prescaler, WD/Timer mode, Intr enable, auto-reload, watchdog enable. | |
#define | XSCUWDT_CONTROL_PRESCALER_MASK 0x0000FF00U |
Prescaler. More... | |
#define | XSCUWDT_CONTROL_PRESCALER_SHIFT 8U |
#define | XSCUWDT_CONTROL_WD_MODE_MASK 0x00000008U |
Watchdog/Timer mode. More... | |
#define | XSCUWDT_CONTROL_IT_ENABLE_MASK 0x00000004U |
Intr enable (in timer mode) More... | |
#define | XSCUWDT_CONTROL_AUTO_RELOAD_MASK 0x00000002U |
Auto-reload (in timer mode) More... | |
#define | XSCUWDT_CONTROL_WD_ENABLE_MASK 0x00000001U |
Watchdog enable. More... | |
Interrupt Status register | |
This register indicates the Counter register has reached zero in Counter mode. | |
#define | XSCUWDT_ISR_EVENT_FLAG_MASK 0x00000001U |
Event flag. More... | |
Reset Status register | |
This register indicates the Counter register has reached zero in Watchdog mode and a reset request is sent. | |
#define | XSCUWDT_RST_STS_RESET_FLAG_MASK 0x00000001U |
Time out occurred. More... | |
Disable register | |
This register is used to switch from watchdog mode to timer mode. The software must write 0x12345678 and 0x87654321 successively to the Watchdog Disable Register so that the watchdog mode bit in the Watchdog Control Register is set to zero. | |
#define | XSCUWDT_DISABLE_VALUE1 0x12345678U |
Watchdog mode disable value 1. More... | |
#define | XSCUWDT_DISABLE_VALUE2 0x87654321U |
Watchdog mode disable value 2. More... | |
#define XSCUWDT_CONTROL_AUTO_RELOAD_MASK 0x00000002U |
Auto-reload (in timer mode)
#define XSCUWDT_CONTROL_IT_ENABLE_MASK 0x00000004U |
Intr enable (in timer mode)
Referenced by ScuWdtIntrExample().
#define XSCUWDT_CONTROL_OFFSET 0x08U |
Watchdog Control Register.
Referenced by XScuWdt_Start(), and XScuWdt_Stop().
#define XSCUWDT_CONTROL_PRESCALER_MASK 0x0000FF00U |
Prescaler.
#define XSCUWDT_CONTROL_WD_ENABLE_MASK 0x00000001U |
Watchdog enable.
Referenced by XScuWdt_SelfTest(), XScuWdt_Start(), and XScuWdt_Stop().
#define XSCUWDT_CONTROL_WD_MODE_MASK 0x00000008U |
Watchdog/Timer mode.
#define XSCUWDT_COUNTER_OFFSET 0x04U |
Watchdog Counter Register.
Referenced by XScuWdt_SelfTest().
#define XSCUWDT_DISABLE_OFFSET 0x14U |
Watchdog Disable Register.
#define XSCUWDT_DISABLE_VALUE1 0x12345678U |
Watchdog mode disable value 1.
#define XSCUWDT_DISABLE_VALUE2 0x87654321U |
Watchdog mode disable value 2.
#define XScuWdt_EnableAutoReload | ( | InstancePtr | ) |
Enable auto-reload mode.
InstancePtr | is a pointer to the XScuWdt instance. |
#define XScuWdt_GetControlReg | ( | InstancePtr | ) |
Get the contents of the watchdog control register.
InstancePtr | is a pointer to the XScuWdt instance. |
Referenced by ScuWdtIntrExample(), and XScuWdt_SelfTest().
#define XSCUWDT_H |
< prevent circular inclusions
by using protection macros
#define XSCUWDT_HW_H |
< prevent circular inclusions
by using protection macros
#define XSCUWDT_ISR_EVENT_FLAG_MASK 0x00000001U |
Event flag.
Referenced by ScuWdtIntrExample().
#define XSCUWDT_ISR_OFFSET 0x0CU |
Watchdog Interrupt Status Register.
Referenced by ScuWdtIntrExample().
#define XScuWdt_IsTimerExpired | ( | InstancePtr | ) |
This function is used to check if the watchdog counter has reached 0 in timer mode.
InstancePtr | is a pointer to the XScuWdt instance. |
Referenced by ScuWdtIntrExample().
#define XScuWdt_IsWdtExpired | ( | InstancePtr | ) |
This function is used to check if the watchdog has timed-out and the last reset was caused by the watchdog reset.
InstancePtr | is a pointer to the XScuWdt instance. |
#define XSCUWDT_LOAD_OFFSET 0x00U |
Watchdog Load Register.
Referenced by XScuWdt_SelfTest().
#define XScuWdt_LoadWdt | ( | InstancePtr, | |
Value | |||
) |
Write to the watchdog timer load register.
This will also update the watchdog counter register with the new value. This macro can be used to change the time-out value.
InstancePtr | is a pointer to the XScuWdt instance. |
Value | is the value to be written to the Watchdog Load register. |
Referenced by ScuWdtIntrExample(), ScuWdtPolledExample(), and XScuWdt_SelfTest().
#define XScuWdt_ReadReg | ( | BaseAddr, | |
RegOffset | |||
) | Xil_In32((BaseAddr) + ((u32)RegOffset)) |
Read the given register.
BaseAddr | is the base address of the device |
RegOffset | is the register offset to be read |
Referenced by XScuWdt_SelfTest(), XScuWdt_Start(), and XScuWdt_Stop().
#define XScuWdt_RestartWdt | ( | InstancePtr | ) |
Re-start the watchdog timer.
This macro will read the watchdog load register and write the same value to load register to update the counter register. An application needs to call this function periodically to keep the watchdog from asserting the WDRESETREQ reset request output pin.
InstancePtr | is a pointer to the XScuWdt instance. |
Referenced by ScuWdtIntrExample(), and ScuWdtPolledExample().
#define XSCUWDT_RST_STS_OFFSET 0x10U |
Watchdog Reset Status Register.
#define XSCUWDT_RST_STS_RESET_FLAG_MASK 0x00000001U |
Time out occurred.
#define XScuWdt_SetControlReg | ( | InstancePtr, | |
ControlReg | |||
) |
Write to the watchdog control register.
InstancePtr | is a pointer to the XScuWdt instance. |
ControlReg | is the value to be written to the watchdog control register. |
Referenced by ScuWdtIntrExample(), and XScuWdt_SelfTest().
#define XScuWdt_SetTimerMode | ( | InstancePtr | ) |
Put the watchdog timer in Timer mode by writing 0x12345678 and 0x87654321 successively to the Watchdog Disable Register.
The software must write 0x12345678 and 0x87654321 successively to the Watchdog Disable Register so that the watchdog mode bit in the Watchdog Control Register is set to zero.
InstancePtr | is a pointer to the XScuWdt instance. |
Referenced by ScuWdtIntrExample().
#define XScuWdt_SetWdMode | ( | InstancePtr | ) |
Put the watchdog timer in Watchdog mode by setting the WD mode bit of the Watchdog control register.
InstancePtr | is a pointer to the XScuWdt instance. |
Referenced by ScuWdtPolledExample(), and XScuWdt_CfgInitialize().
#define XScuWdt_WriteReg | ( | BaseAddr, | |
RegOffset, | |||
Data | |||
) | Xil_Out32((BaseAddr) + ((u32)RegOffset), ((u32)Data)) |
Write the given register.
BaseAddr | is the base address of the device |
RegOffset | is the register offset to be written |
Data | is the 32-bit value to write to the register |
Referenced by ScuWdtIntrExample(), XScuWdt_Start(), and XScuWdt_Stop().
s32 XScuWdt_CfgInitialize | ( | XScuWdt * | InstancePtr, |
XScuWdt_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 XScuWdt 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. |
References XScuWdt_Config::BaseAddr, XScuWdt::Config, XScuWdt_Config::DeviceId, XScuWdt::IsReady, XScuWdt::IsStarted, and XScuWdt_SetWdMode.
Referenced by ScuWdtIntrExample(), and ScuWdtPolledExample().
XScuWdt_Config * XScuWdt_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. |
References XScuWdt_ConfigTable.
Referenced by ScuWdtIntrExample(), and ScuWdtPolledExample().
s32 XScuWdt_SelfTest | ( | XScuWdt * | InstancePtr | ) |
Run a self-test on the WDT.
This test stops the watchdog, writes a value to the watchdog load register, starts the watchdog and verifies that the value read from the counter register is less that the value written to the load register. It then restores the control register and the watchdog load register.
InstancePtr | is a pointer to the XScuWdt instance. |
References XScuWdt::IsReady, XSCUWDT_CONTROL_WD_ENABLE_MASK, XSCUWDT_COUNTER_OFFSET, XScuWdt_GetControlReg, XSCUWDT_LOAD_OFFSET, XScuWdt_LoadWdt, XScuWdt_ReadReg, and XScuWdt_SetControlReg.
Referenced by ScuWdtIntrExample().
void XScuWdt_Start | ( | XScuWdt * | InstancePtr | ) |
Start the watchdog counter of the device.
InstancePtr | is a pointer to the XScuWdt instance. |
References XScuWdt_Config::BaseAddr, XScuWdt::Config, XScuWdt::IsReady, XScuWdt::IsStarted, XSCUWDT_CONTROL_OFFSET, XSCUWDT_CONTROL_WD_ENABLE_MASK, XScuWdt_ReadReg, and XScuWdt_WriteReg.
Referenced by ScuWdtIntrExample(), and ScuWdtPolledExample().
void XScuWdt_Stop | ( | XScuWdt * | InstancePtr | ) |
Stop the watchdog timer.
InstancePtr | is a pointer to the XScuWdt instance. |
References XScuWdt_Config::BaseAddr, XScuWdt::Config, XScuWdt::IsReady, XScuWdt::IsStarted, XSCUWDT_CONTROL_OFFSET, XSCUWDT_CONTROL_WD_ENABLE_MASK, XScuWdt_ReadReg, and XScuWdt_WriteReg.
Referenced by ScuWdtIntrExample(), and ScuWdtPolledExample().
XScuWdt_Config XScuWdt_ConfigTable[XPAR_XSCUWDT_NUM_INSTANCES] |
This table contains configuration information for each watchdog timer device in the system.
Referenced by XScuWdt_LookupConfig().
XScuWdt_Config XScuWdt_ConfigTable[] |
This table contains configuration information for each watchdog timer device in the system.
Referenced by XScuWdt_LookupConfig().