wdttb
Xilinx SDK Drivers API Documentation
Wdttb_v4_3

Data Structures

struct  XWdtTb_Config
 This typedef contains configuration information for the device. More...
 
struct  XWdtTb
 The XWdtTb driver instance data. More...
 

Macros

#define XWDTTB_HW_H_
 Prevent circular inclusions by using protection macros. More...
 

Enumerations

enum  XWdtTb_Event { XWDTTB_NO_BAD_EVENT = 0, XWDTTB_RS_KICK_EVENT, XWDTTB_TSR_MM_EVENT, XWDTTB_SEC_WIN_EVENT }
 This typedef contains enumeration of different events in basic mode. More...
 

Functions

s32 XWdtTb_CfgInitialize (XWdtTb *InstancePtr, XWdtTb_Config *CfgPtr, u32 EffectiveAddr)
 This function initializes the AXI Timebase Watchdog Timer core. More...
 
s32 XWdtTb_Initialize (XWdtTb *InstancePtr, u16 DeviceId)
 Initialize a specific legacy/window watchdog timer/timebase instance/driver. More...
 
void XWdtTb_Start (XWdtTb *InstancePtr)
 This function starts the legacy or window watchdog timer. More...
 
s32 XWdtTb_Stop (XWdtTb *InstancePtr)
 This function disables the legacy or window watchdog timer. More...
 
u32 XWdtTb_IsWdtExpired (XWdtTb *InstancePtr)
 This function checks if the legacy watchdog timer has expired or window watchdog timer either in second window or not in second window. More...
 
void XWdtTb_RestartWdt (XWdtTb *InstancePtr)
 This function restarts the legacy or window watchdog timer. More...
 
void XWdtTb_AlwaysEnable (XWdtTb *InstancePtr)
 This function keeps Window Watchdog Timer always enabled. More...
 
void XWdtTb_ClearLastEvent (XWdtTb *InstancePtr)
 This function clears event(s) that present after system reset. More...
 
void XWdtTb_ClearResetPending (XWdtTb *InstancePtr)
 This function clears the window watchdog reset pending. More...
 
void XWdtTb_IntrClear (XWdtTb *InstancePtr)
 This function clears window watchdog timer interrupt (WINT) bit. More...
 
void XWdtTb_SetByteCount (XWdtTb *InstancePtr, u32 ByteCount)
 This function sets byte count to determine the interrupt assertion point in the second window configuration. More...
 
u32 XWdtTb_GetByteCount (XWdtTb *InstancePtr)
 This function provides byte count value of the selected byte count in the second window configuration. More...
 
void XWdtTb_SetByteSegment (XWdtTb *InstancePtr, u32 ByteSegment)
 This function sets byte segment selection to determine the interrupt assertion point in the second window configuration. More...
 
u32 XWdtTb_GetByteSegment (XWdtTb *InstancePtr)
 This function provides byte segment selection in the second window configuration. More...
 
void XWdtTb_EnableSst (XWdtTb *InstancePtr)
 This function enables Second Sequence Timer (SST) function. More...
 
void XWdtTb_DisableSst (XWdtTb *InstancePtr)
 This function disables Second Sequence Timer (SST) function. More...
 
void XWdtTb_EnablePsm (XWdtTb *InstancePtr)
 This function enables Program Sequence Monitor (PSM) function. More...
 
void XWdtTb_DisablePsm (XWdtTb *InstancePtr)
 This function disables Program Sequence Monitor (PSM) function. More...
 
void XWdtTb_EnableFailCounter (XWdtTb *InstancePtr)
 This function enables Fail Counter (FC) function. More...
 
void XWdtTb_DisableFailCounter (XWdtTb *InstancePtr)
 This function disables Fail Counter (FC) function. More...
 
void XWdtTb_EnableExtraProtection (XWdtTb *InstancePtr)
 This function provides extra safeguard against unintentional clear of WEN bit. More...
 
void XWdtTb_DisableExtraProtection (XWdtTb *InstancePtr)
 This function enables unintentional clear of WEN bit. More...
 
void XWdtTb_SetWindowCount (XWdtTb *InstancePtr, u32 FirstWinCount, u32 SecondWinCount)
 This function sets the count value for the first and second window. More...
 
u32 XWdtTb_ProgramWDTWidth (XWdtTb *InstancePtr, u32 width)
 This function programs the width of Watchdog Timer. More...
 
XWdtTb_ConfigXWdtTb_LookupConfig (u16 DeviceId)
 This function returns a reference to an XWdtTb_Config structure based on the core id, DeviceId. More...
 
s32 XWdtTb_SelfTest (XWdtTb *InstancePtr)
 This function runs a self-test on the timebase or window if enabled. More...
 

Register offsets for the AXI Timebase WDT core. Each register is 32

bits.

#define XWT_TWCSR0_OFFSET   0x00U
 Control/Status Register 0 Offset. More...
 
#define XWT_TWCSR1_OFFSET   0x04U
 Control/Status Register 1 Offset. More...
 
#define XWT_TBR_OFFSET   0x08U
 Timebase Register Offset. More...
 

Register offsets for the AXI Timebase WDT core with windowing

feature with basic mode.

Each register is 32 bits.

#define XWT_MWR_OFFSET   0x0CU
 Master Write Control Register Offset. More...
 
#define XWT_ESR_OFFSET   0x10U
 Enable & Status Register Offset. More...
 
#define XWT_FCR_OFFSET   0x14U
 Function Control Register Offset. More...
 
#define XWT_FWR_OFFSET   0x18U
 First Window Configuration Register Offset. More...
 
#define XWT_SWR_OFFSET   0x1CU
 Second Window Configuration Register Offset. More...
 
#define XWT_TSR0_OFFSET   0x20U
 Task Signature Register 0 Offset. More...
 
#define XWT_TSR1_OFFSET   0x24U
 Task Signature Register 1 Offset. More...
 
#define XWT_STR_OFFSET   0x28U
 Second Sequence Timer Register Offset. More...
 

Control/Status Register 0 bits

#define XWT_CSR0_WRS_MASK   0x00000008U
 Reset status Mask. More...
 
#define XWT_CSR0_WDS_MASK   0x00000004U
 Timer state Mask. More...
 
#define XWT_CSR0_EWDT1_MASK   0x00000002U
 Enable bit 1 Mask. More...
 

Control/Status Register 0/1 bits

#define XWT_CSRX_EWDT2_MASK   0x00000001U
 Enable bit 2 Mask. More...
 

Master Write Control bits

#define XWT_MWR_AEN_MASK   0x00000002U
 Always Enable Mask. More...
 
#define XWT_MWR_MWC_MASK   0x00000001U
 Master Write Control Mask. More...
 

Enable & Status Register bits

#define XWT_ESR_LBE_MASK   0x07000000U
 Last Bad Event Mask. More...
 
#define XWT_ESR_FCV_MASK   0x00700000U
 Fail Counter Value Mask. More...
 
#define XWT_ESR_WRP_MASK   0x00020000U
 Watchdog Reset Pending Mask. More...
 
#define XWT_ESR_WINT_MASK   0x00010000U
 Watchdog Interrupt Mask. More...
 
#define XWT_ESR_WSW_MASK   0x00000100U
 Watchdog Second Window Mask. More...
 
#define XWT_ESR_WCFG_MASK   0x00000002U
 Wrong Configuration Mask. More...
 
#define XWT_ESR_WEN_MASK   0x00000001U
 Window WDT Enable Mask. More...
 
#define XWT_ESR_LBE_SHIFT   24
 Last Bad Event Shift. More...
 
#define XWT_ESR_FCV_SHIFT   20
 Fail Counter Value Shift. More...
 
#define XWT_ESR_WRP_SHIFT   17
 Watchdog Reset Pending Shift. More...
 
#define XWT_ESR_WINT_SHIFT   16
 Watchdog Interrupt Shift. More...
 
#define XWT_ESR_WSW_SHIFT   8
 Watchdog Second Window Shift. More...
 
#define XWT_ESR_WCFG_SHIFT   1
 Wrong Configuration Shift. More...
 

Function Control Register bits

#define XWT_FCR_SBC_MASK   0x0000FF00U
 Selected Byte Count Mask. More...
 
#define XWT_FCR_BSS_MASK   0x000000C0U
 Byte Segment Selection Mask. More...
 
#define XWT_FCR_SSTE_MASK   0x00000010U
 Second Sequence Timer Enable Mask. More...
 
#define XWT_FCR_PSME_MASK   0x00000008U
 Program Sequence Monitor Enable Mask. More...
 
#define XWT_FCR_FCE_MASK   0x00000004U
 Fail Counter Enable Mask. More...
 
#define XWT_FCR_WM_MASK   0x00000002U
 Window WDT Mode Mask. More...
 
#define XWT_FCR_WDP_MASK   0x00000001U
 Window WDT Disable Protection Mask. More...
 
#define XWT_FCR_SBC_SHIFT   8
 Selected Byte Count Shift. More...
 
#define XWT_FCR_BSS_SHIFT   6
 Byte Segment Selection Shift. More...
 
#define XWT_FCR_SSTE_SHIFT   4
 Second Sequence Timer Enable Shift. More...
 
#define XWT_FCR_WM_SHIFT   1
 Window WDT Mode Shift. More...
 

Register access macro definition

#define XWdtTb_In32   Xil_In32
 Input Operations. More...
 
#define XWdtTb_Out32   Xil_Out32
 Output Operations. More...
 
#define XWdtTb_ReadReg(BaseAddress, RegOffset)   XWdtTb_In32((BaseAddress) + ((u32)RegOffset))
 Read from the specified WdtTb core's register. More...
 
#define XWdtTb_WriteReg(BaseAddress, RegOffset, RegisterValue)   XWdtTb_Out32((BaseAddress) + ((u32)RegOffset), (u32)(RegisterValue))
 Write to the specified WdtTb core's register. More...
 

Macro Definition Documentation

◆ XWDTTB_HW_H_

#define XWDTTB_HW_H_

#include <xwdttb_hw.h>

Prevent circular inclusions by using protection macros.

◆ XWdtTb_In32

#define XWdtTb_In32   Xil_In32

#include <xwdttb_hw.h>

Input Operations.

◆ XWdtTb_Out32

#define XWdtTb_Out32   Xil_Out32

#include <xwdttb_hw.h>

Output Operations.

◆ XWdtTb_ReadReg

#define XWdtTb_ReadReg (   BaseAddress,
  RegOffset 
)    XWdtTb_In32((BaseAddress) + ((u32)RegOffset))

#include <xwdttb_hw.h>

Read from the specified WdtTb core's register.

Parameters
BaseAddresscontains the base address of the core.
RegOffsetcontains the offset from the 1st register of the core to select the specific register.
Returns
The value read from the register.
Note
C-Style signature: u32 XWdtTb_ReadReg(u32 BaseAddress, u32 RegOffset);

Referenced by WdtTbExample(), XWdtTb_AlwaysEnable(), XWdtTb_ClearLastEvent(), XWdtTb_ClearResetPending(), XWdtTb_DisableExtraProtection(), XWdtTb_DisableFailCounter(), XWdtTb_DisablePsm(), XWdtTb_DisableSst(), XWdtTb_EnableExtraProtection(), XWdtTb_EnableFailCounter(), XWdtTb_EnablePsm(), XWdtTb_EnableSst(), XWdtTb_GetByteCount(), XWdtTb_GetByteSegment(), XWdtTb_IntrClear(), XWdtTb_IsWdtExpired(), XWdtTb_LowLevelExample(), XWdtTb_RestartWdt(), XWdtTb_SetByteCount(), and XWdtTb_SetByteSegment().

◆ XWdtTb_WriteReg

#define XWdtTb_WriteReg (   BaseAddress,
  RegOffset,
  RegisterValue 
)    XWdtTb_Out32((BaseAddress) + ((u32)RegOffset), (u32)(RegisterValue))

#include <xwdttb_hw.h>

Write to the specified WdtTb core's register.

Parameters
BaseAddresscontains the base address of the core.
RegOffsetcontains the offset from the 1st register of the core to select the specific register.
RegisterValueis the value to be written to the register.
Returns
None.
Note
C-Style signature: void XWdtTb_WriteReg(u32 BaseAddress, u32 RegOffset, u32 RegisterValue);

Referenced by XWdtTb_AlwaysEnable(), XWdtTb_ClearLastEvent(), XWdtTb_ClearResetPending(), XWdtTb_DisableExtraProtection(), XWdtTb_DisableFailCounter(), XWdtTb_DisablePsm(), XWdtTb_DisableSst(), XWdtTb_EnableExtraProtection(), XWdtTb_EnableFailCounter(), XWdtTb_EnablePsm(), XWdtTb_EnableSst(), XWdtTb_IntrClear(), XWdtTb_LowLevelExample(), XWdtTb_ProgramWDTWidth(), XWdtTb_RestartWdt(), XWdtTb_SelfTest(), XWdtTb_SetByteCount(), XWdtTb_SetByteSegment(), and XWdtTb_SetWindowCount().

◆ XWT_CSR0_EWDT1_MASK

#define XWT_CSR0_EWDT1_MASK   0x00000002U

#include <xwdttb_hw.h>

Enable bit 1 Mask.

Referenced by XWdtTb_LowLevelExample().

◆ XWT_CSR0_WDS_MASK

#define XWT_CSR0_WDS_MASK   0x00000004U

#include <xwdttb_hw.h>

Timer state Mask.

Referenced by XWdtTb_IsWdtExpired(), XWdtTb_LowLevelExample(), and XWdtTb_RestartWdt().

◆ XWT_CSR0_WRS_MASK

#define XWT_CSR0_WRS_MASK   0x00000008U

◆ XWT_CSRX_EWDT2_MASK

#define XWT_CSRX_EWDT2_MASK   0x00000001U

#include <xwdttb_hw.h>

Enable bit 2 Mask.

Referenced by XWdtTb_LowLevelExample().

◆ XWT_ESR_FCV_MASK

#define XWT_ESR_FCV_MASK   0x00700000U

#include <xwdttb_hw.h>

Fail Counter Value Mask.

◆ XWT_ESR_FCV_SHIFT

#define XWT_ESR_FCV_SHIFT   20

#include <xwdttb_hw.h>

Fail Counter Value Shift.

◆ XWT_ESR_LBE_MASK

#define XWT_ESR_LBE_MASK   0x07000000U

#include <xwdttb_hw.h>

Last Bad Event Mask.

Referenced by XWdtTb_ClearLastEvent().

◆ XWT_ESR_LBE_SHIFT

#define XWT_ESR_LBE_SHIFT   24

#include <xwdttb_hw.h>

Last Bad Event Shift.

◆ XWT_ESR_OFFSET

#define XWT_ESR_OFFSET   0x10U

◆ XWT_ESR_WCFG_MASK

#define XWT_ESR_WCFG_MASK   0x00000002U

#include <xwdttb_hw.h>

Wrong Configuration Mask.

◆ XWT_ESR_WCFG_SHIFT

#define XWT_ESR_WCFG_SHIFT   1

#include <xwdttb_hw.h>

Wrong Configuration Shift.

◆ XWT_ESR_WEN_MASK

#define XWT_ESR_WEN_MASK   0x00000001U

#include <xwdttb_hw.h>

Window WDT Enable Mask.

◆ XWT_ESR_WINT_MASK

#define XWT_ESR_WINT_MASK   0x00010000U

#include <xwdttb_hw.h>

Watchdog Interrupt Mask.

Referenced by XWdtTb_IntrClear().

◆ XWT_ESR_WINT_SHIFT

#define XWT_ESR_WINT_SHIFT   16

#include <xwdttb_hw.h>

Watchdog Interrupt Shift.

◆ XWT_ESR_WRP_MASK

#define XWT_ESR_WRP_MASK   0x00020000U

#include <xwdttb_hw.h>

Watchdog Reset Pending Mask.

Referenced by XWdtTb_ClearResetPending().

◆ XWT_ESR_WRP_SHIFT

#define XWT_ESR_WRP_SHIFT   17

#include <xwdttb_hw.h>

Watchdog Reset Pending Shift.

◆ XWT_ESR_WSW_MASK

#define XWT_ESR_WSW_MASK   0x00000100U

#include <xwdttb_hw.h>

Watchdog Second Window Mask.

Referenced by XWdtTb_ClearLastEvent(), XWdtTb_IntrClear(), XWdtTb_IsWdtExpired(), and XWdtTb_RestartWdt().

◆ XWT_ESR_WSW_SHIFT

#define XWT_ESR_WSW_SHIFT   8

#include <xwdttb_hw.h>

Watchdog Second Window Shift.

Referenced by XWdtTb_ClearLastEvent(), XWdtTb_IntrClear(), and XWdtTb_IsWdtExpired().

◆ XWT_FCR_BSS_MASK

#define XWT_FCR_BSS_MASK   0x000000C0U

#include <xwdttb_hw.h>

Byte Segment Selection Mask.

Referenced by XWdtTb_GetByteSegment(), and XWdtTb_SetByteSegment().

◆ XWT_FCR_BSS_SHIFT

#define XWT_FCR_BSS_SHIFT   6

#include <xwdttb_hw.h>

Byte Segment Selection Shift.

Referenced by XWdtTb_GetByteSegment(), and XWdtTb_SetByteSegment().

◆ XWT_FCR_FCE_MASK

#define XWT_FCR_FCE_MASK   0x00000004U

#include <xwdttb_hw.h>

Fail Counter Enable Mask.

Referenced by XWdtTb_DisableFailCounter(), and XWdtTb_EnableFailCounter().

◆ XWT_FCR_OFFSET

◆ XWT_FCR_PSME_MASK

#define XWT_FCR_PSME_MASK   0x00000008U

#include <xwdttb_hw.h>

Program Sequence Monitor Enable Mask.

Referenced by XWdtTb_DisablePsm(), and XWdtTb_EnablePsm().

◆ XWT_FCR_SBC_MASK

#define XWT_FCR_SBC_MASK   0x0000FF00U

#include <xwdttb_hw.h>

Selected Byte Count Mask.

Referenced by XWdtTb_GetByteCount(), and XWdtTb_SetByteCount().

◆ XWT_FCR_SBC_SHIFT

#define XWT_FCR_SBC_SHIFT   8

#include <xwdttb_hw.h>

Selected Byte Count Shift.

Referenced by XWdtTb_GetByteCount(), and XWdtTb_SetByteCount().

◆ XWT_FCR_SSTE_MASK

#define XWT_FCR_SSTE_MASK   0x00000010U

#include <xwdttb_hw.h>

Second Sequence Timer Enable Mask.

Referenced by XWdtTb_DisableSst(), and XWdtTb_EnableSst().

◆ XWT_FCR_SSTE_SHIFT

#define XWT_FCR_SSTE_SHIFT   4

#include <xwdttb_hw.h>

Second Sequence Timer Enable Shift.

◆ XWT_FCR_WDP_MASK

#define XWT_FCR_WDP_MASK   0x00000001U

#include <xwdttb_hw.h>

Window WDT Disable Protection Mask.

Referenced by XWdtTb_DisableExtraProtection(), and XWdtTb_EnableExtraProtection().

◆ XWT_FCR_WM_MASK

#define XWT_FCR_WM_MASK   0x00000002U

#include <xwdttb_hw.h>

Window WDT Mode Mask.

◆ XWT_FCR_WM_SHIFT

#define XWT_FCR_WM_SHIFT   1

#include <xwdttb_hw.h>

Window WDT Mode Shift.

◆ XWT_FWR_OFFSET

#define XWT_FWR_OFFSET   0x18U

#include <xwdttb_hw.h>

First Window Configuration Register Offset.

Referenced by XWdtTb_SelfTest(), and XWdtTb_SetWindowCount().

◆ XWT_MWR_AEN_MASK

#define XWT_MWR_AEN_MASK   0x00000002U

#include <xwdttb_hw.h>

Always Enable Mask.

Referenced by XWdtTb_AlwaysEnable().

◆ XWT_MWR_MWC_MASK

#define XWT_MWR_MWC_MASK   0x00000001U

#include <xwdttb_hw.h>

Master Write Control Mask.

◆ XWT_MWR_OFFSET

#define XWT_MWR_OFFSET   0x0CU

#include <xwdttb_hw.h>

Master Write Control Register Offset.

Referenced by XWdtTb_AlwaysEnable(), and XWdtTb_ProgramWDTWidth().

◆ XWT_STR_OFFSET

#define XWT_STR_OFFSET   0x28U

#include <xwdttb_hw.h>

Second Sequence Timer Register Offset.

◆ XWT_SWR_OFFSET

#define XWT_SWR_OFFSET   0x1CU

#include <xwdttb_hw.h>

Second Window Configuration Register Offset.

Referenced by XWdtTb_SetWindowCount().

◆ XWT_TBR_OFFSET

#define XWT_TBR_OFFSET   0x08U

#include <xwdttb_hw.h>

Timebase Register Offset.

◆ XWT_TSR0_OFFSET

#define XWT_TSR0_OFFSET   0x20U

#include <xwdttb_hw.h>

Task Signature Register 0 Offset.

◆ XWT_TSR1_OFFSET

#define XWT_TSR1_OFFSET   0x24U

#include <xwdttb_hw.h>

Task Signature Register 1 Offset.

◆ XWT_TWCSR0_OFFSET

#define XWT_TWCSR0_OFFSET   0x00U

#include <xwdttb_hw.h>

Control/Status Register 0 Offset.

Referenced by WdtTbExample(), XWdtTb_IsWdtExpired(), XWdtTb_LowLevelExample(), and XWdtTb_RestartWdt().

◆ XWT_TWCSR1_OFFSET

#define XWT_TWCSR1_OFFSET   0x04U

#include <xwdttb_hw.h>

Control/Status Register 1 Offset.

Referenced by XWdtTb_LowLevelExample().

Enumeration Type Documentation

◆ XWdtTb_Event

#include <xwdttb.h>

This typedef contains enumeration of different events in basic mode.

Enumerator
XWDTTB_NO_BAD_EVENT 

No bad event.

XWDTTB_RS_KICK_EVENT 

Restart kick or disable attempt in first window.

XWDTTB_TSR_MM_EVENT 

TSR mismatch.

XWDTTB_SEC_WIN_EVENT 

Second window overflow.

Function Documentation

◆ XWdtTb_AlwaysEnable()

void XWdtTb_AlwaysEnable ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function keeps Window Watchdog Timer always enabled.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This must be called before Window WDT is enabled. Once Window WDT is enabled, it can only be disabled by applying reset.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_MWR_AEN_MASK, and XWT_MWR_OFFSET.

◆ XWdtTb_CfgInitialize()

s32 XWdtTb_CfgInitialize ( XWdtTb InstancePtr,
XWdtTb_Config CfgPtr,
u32  EffectiveAddr 
)

#include <xwdttb.c>

This function initializes the AXI Timebase Watchdog Timer core.

This function must be called prior to using the core. Initialization of the core includes setting up the instance data and ensuring the hardware is in a quiescent state.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
CfgPtrpoints to the configuration structure associated with the AXI Timebase Watchdog Timer core.
EffectiveAddris the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
Returns
  • XST_SUCCESS if initialization was successful.
  • XST_DEVICE_IS_STARTED if the device has already been started.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::DeviceId, XWdtTb::EnableFailCounter, XWdtTb_Config::EnableWinWdt, XWdtTb::IsReady, XWdtTb::IsStarted, XWdtTb_Config::MaxCountWidth, and XWdtTb_Config::SstCountWidth.

Referenced by WdtTbExample(), and WdtTbSelfTestExample().

◆ XWdtTb_ClearLastEvent()

void XWdtTb_ClearLastEvent ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function clears event(s) that present after system reset.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
Event can be cleared by applying reset to the core followed by writing 111. Writing any other pattern has no effect.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_ESR_LBE_MASK, XWT_ESR_OFFSET, XWT_ESR_WSW_MASK, and XWT_ESR_WSW_SHIFT.

◆ XWdtTb_ClearResetPending()

void XWdtTb_ClearResetPending ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function clears the window watchdog reset pending.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_ESR_OFFSET, and XWT_ESR_WRP_MASK.

◆ XWdtTb_DisableExtraProtection()

void XWdtTb_DisableExtraProtection ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function enables unintentional clear of WEN bit.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_WDP_MASK.

◆ XWdtTb_DisableFailCounter()

void XWdtTb_DisableFailCounter ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function disables Fail Counter (FC) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb::EnableFailCounter, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_FCE_MASK, and XWT_FCR_OFFSET.

◆ XWdtTb_DisablePsm()

void XWdtTb_DisablePsm ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function disables Program Sequence Monitor (PSM) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_PSME_MASK.

◆ XWdtTb_DisableSst()

void XWdtTb_DisableSst ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function disables Second Sequence Timer (SST) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_SSTE_MASK.

◆ XWdtTb_EnableExtraProtection()

void XWdtTb_EnableExtraProtection ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function provides extra safeguard against unintentional clear of WEN bit.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_WDP_MASK.

◆ XWdtTb_EnableFailCounter()

void XWdtTb_EnableFailCounter ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function enables Fail Counter (FC) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
  • This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • When fail counter is enabled, reset is generated when fail counter is 7 and another bad event happens.
  • When fail counter is disabled, one bad event triggers reset either immediately when SST is disabled or after SST count delay when SST is enabled.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb::EnableFailCounter, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_FCE_MASK, and XWT_FCR_OFFSET.

◆ XWdtTb_EnablePsm()

void XWdtTb_EnablePsm ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function enables Program Sequence Monitor (PSM) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
  • This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • PSM enables Task Signature Register comparison. When PSM is enabled, core checks and compares the contents of TSR0 and TSR1 registers at the restart kick/disablement of Window WDT in second window. If they match, no effect. If they do not match, reset is generated either immediately when SST is disabled or after SST count delay when SST is enabled.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_PSME_MASK.

◆ XWdtTb_EnableSst()

void XWdtTb_EnableSst ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function enables Second Sequence Timer (SST) function.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
  • This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • SST provides additional time to software by delaying the inevitable window watchdog reset generation by SST count (SC) delay. This is an independent function and can be enabled in any mode w/ or w/o other options.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, and XWT_FCR_SSTE_MASK.

◆ XWdtTb_GetByteCount()

u32 XWdtTb_GetByteCount ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function provides byte count value of the selected byte count in the second window configuration.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
Byte count value of the selected byte count in the second window configuration.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWT_FCR_OFFSET, XWT_FCR_SBC_MASK, and XWT_FCR_SBC_SHIFT.

◆ XWdtTb_GetByteSegment()

u32 XWdtTb_GetByteSegment ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function provides byte segment selection in the second window configuration.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
Byte segment selection value as
  • 0 = Second window byte 0 selected.
  • 1 = Second window byte 1 selected.
  • 2 = Second window byte 2 selected.
  • 3 = Second window byte 3 selected.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWT_FCR_BSS_MASK, XWT_FCR_BSS_SHIFT, and XWT_FCR_OFFSET.

◆ XWdtTb_Initialize()

s32 XWdtTb_Initialize ( XWdtTb InstancePtr,
u16  DeviceId 
)

#include <xwdttb.c>

Initialize a specific legacy/window watchdog timer/timebase instance/driver.

This function must be called before other functions of the driver are called.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
DeviceIdis 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.

References XWdtTb::Config, XWdtTb::EnableFailCounter, XWdtTb::IsReady, XWdtTb::IsStarted, and XWdtTb_LookupConfig().

Referenced by WinWdtIntrExample().

◆ XWdtTb_IntrClear()

void XWdtTb_IntrClear ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function clears window watchdog timer interrupt (WINT) bit.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_ESR_OFFSET, XWT_ESR_WINT_MASK, XWT_ESR_WSW_MASK, and XWT_ESR_WSW_SHIFT.

◆ XWdtTb_IsWdtExpired()

u32 XWdtTb_IsWdtExpired ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function checks if the legacy watchdog timer has expired or window watchdog timer either in second window or not in second window.

This function is used for polled mode in legacy watchdog timer.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
  • TRUE, if the legacy watchdog timer has expired or window watchdog timer is not in second window.
  • FALSE if the legacy watchdog is not expired or window watchdog is in second window.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb::IsReady, XWdtTb_ReadReg, XWT_CSR0_WDS_MASK, XWT_CSR0_WRS_MASK, XWT_ESR_OFFSET, XWT_ESR_WSW_MASK, XWT_ESR_WSW_SHIFT, and XWT_TWCSR0_OFFSET.

Referenced by WdtTbExample().

◆ XWdtTb_LookupConfig()

XWdtTb_Config* XWdtTb_LookupConfig ( u16  DeviceId)

#include <xwdttb.h>

This function returns a reference to an XWdtTb_Config structure based on the core id, DeviceId.

The return value will refer to an entry in the device configuration table defined in the xwdttb_g.c file.

Parameters
DeviceIdis the unique core ID of the XWdtTb core for the lookup operation.
Returns
XWdtTb_LookupConfig returns a reference to a config record in the configuration table (in xwdttb_g.c) corresponding to DeviceId, or NULL if no match is found.
Note
None.

Referenced by WdtTbExample(), WdtTbSelfTestExample(), and XWdtTb_Initialize().

◆ XWdtTb_ProgramWDTWidth()

u32 XWdtTb_ProgramWDTWidth ( XWdtTb InstancePtr,
u32  width 
)

#include <xwdttb.c>

This function programs the width of Watchdog Timer.

Parameters
InstancePtr- InstancePtr is a pointer to the XWdtTb instance to be worked on. width - width of the Watchdog Timer.
Returns
  • XST_SUCESS, if window mode is disabled and the width is programmed correctly.
  • XST_FAILURE, if Window mode is enabled or if the width is not in the range of 8-31
Note
  • This function is applicable only when the window mode is disabled.
  • This function should be called before starting the timer. Valid values for the width are 8-31. Programming any other value returns failure.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_WriteReg, and XWT_MWR_OFFSET.

◆ XWdtTb_RestartWdt()

void XWdtTb_RestartWdt ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function restarts the legacy or window watchdog timer.

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

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb::IsReady, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_CSR0_WDS_MASK, XWT_CSR0_WRS_MASK, XWT_ESR_OFFSET, XWT_ESR_WSW_MASK, and XWT_TWCSR0_OFFSET.

Referenced by WdtTbExample().

◆ XWdtTb_SelfTest()

s32 XWdtTb_SelfTest ( XWdtTb InstancePtr)

#include <xwdttb.h>

This function runs a self-test on the timebase or window if enabled.

Timebase 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.

Window test verifies that the windowing feature does not generate bad event after enabling window feature with first and second window count. It disables window feature immediately.

Parameters
InstancePtris 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.
  • XST_FAILURE if self-test was failed.
Note
None.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb::IsReady, XWdtTb_WriteReg, and XWT_FWR_OFFSET.

Referenced by WdtTbExample(), WdtTbSelfTestExample(), and WinWdtIntrExample().

◆ XWdtTb_SetByteCount()

void XWdtTb_SetByteCount ( XWdtTb InstancePtr,
u32  ByteCount 
)

#include <xwdttb.c>

This function sets byte count to determine the interrupt assertion point in the second window configuration.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
ByteCountspecifies the selected byte count value to be set in the second window configuration.
Returns
None.
Note
  • This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • This function must be used along with XWdtTb_SetByteSegment.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_OFFSET, XWT_FCR_SBC_MASK, and XWT_FCR_SBC_SHIFT.

◆ XWdtTb_SetByteSegment()

void XWdtTb_SetByteSegment ( XWdtTb InstancePtr,
u32  ByteSegment 
)

#include <xwdttb.c>

This function sets byte segment selection to determine the interrupt assertion point in the second window configuration.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
ByteSegmentspecifies the byte segment selected.
  • 0 = Second window byte 0 selected.
  • 1 = Second window byte 1 selected.
  • 2 = Second window byte 2 selected.
  • 3 = Second window byte 3 selected.
Returns
None.
Note
  • This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • This function must be used along with XWdtTb_SetByteCount.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_ReadReg, XWdtTb_WriteReg, XWT_FCR_BSS_MASK, XWT_FCR_BSS_SHIFT, and XWT_FCR_OFFSET.

◆ XWdtTb_SetWindowCount()

void XWdtTb_SetWindowCount ( XWdtTb InstancePtr,
u32  FirstWinCount,
u32  SecondWinCount 
)

#include <xwdttb.c>

This function sets the count value for the first and second window.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
FirstWinCountspecifies the first window count value.
SecondWinCountspecifies the second window count value.
Returns
None.
Note
This function must be called before Window WDT start/enable or after Window WDT stop/disable.
  • For first window, it is recommended that minimum non-zero value should be 15 or more.
  • For second window, minimum value should be sufficiently large to complete required AXILite write transactions at system level.
  • Setting second window count value to zero causes wrong configuration and disables Window WDT feature by clearing WEN bit irrespective of WDP settings.

References XWdtTb_Config::BaseAddr, XWdtTb::Config, XWdtTb_Config::EnableWinWdt, XWdtTb_WriteReg, XWT_FWR_OFFSET, and XWT_SWR_OFFSET.

◆ XWdtTb_Start()

void XWdtTb_Start ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function starts the legacy or window watchdog timer.

Parameters
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
None.
Note
  • For legacy, the Timebase is reset to 0 when the Watchdog Timer is started. The Timebase is always incrementing.
  • For window, this generates first kick and starts the first window. This step auto clears MWC bit to make address space read only.

References XWdtTb::Config, XWdtTb_Config::EnableWinWdt, and XWdtTb::IsReady.

Referenced by WdtTbExample().

◆ XWdtTb_Stop()

s32 XWdtTb_Stop ( XWdtTb InstancePtr)

#include <xwdttb.c>

This function disables the legacy or window 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
InstancePtris a pointer to the XWdtTb instance to be worked on.
Returns
  • XST_SUCCESS if the legacy/window watchdog was stopped successfully.
  • XST_NO_FEATURE if disable is not supported in legacy watchdog timer.
  • XST_FAILURE if the window watchdog timer cannot be stopped.
Note
  • For legacy, 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.

References XWdtTb::Config, XWdtTb_Config::EnableWinWdt, and XWdtTb::IsReady.

Referenced by WdtTbExample().