Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Watchdog Timer Miscellaneous Configuration

Description

This functional group implements setting and reading the current timer mode as well as reading the module component code and version code.

Functions

ALT_STATUS_CODE alt_wdog_response_mode_set (ALT_WDOG_TIMER_t tmr_id, ALT_WDOG_RESET_TYPE_t type)
 
int32_t alt_wdog_response_mode_get (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_compcode_get (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_ver_get (ALT_WDOG_TIMER_t tmr_id)
 

Function Documentation

ALT_STATUS_CODE alt_wdog_response_mode_set ( ALT_WDOG_TIMER_t  tmr_id,
ALT_WDOG_RESET_TYPE_t  type 
)

Sets the timeout response mode of the specified watchdog timer. For ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL, the options are to generate a system reset or to generate an interrupt and then generate a system reset if the interrupt is not cleared by the next time the watchdog timer counter rolls over.
For ALT_CPU_WATCHDOG, the options are to trigger an interrupt request (with the result set in the interrupt manager) or a reset request (with the result set in the reset manager) plus two more options available when it is used as a general-purpose timer.

Parameters
tmr_idThe timer identifier.
typeALT_WDOG_WARM_RESET - For ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL, reset the core immediately.
For ALT_CPU_WATCHDOG, the action is determined by the current setting in the reset manager.

ALT_WDOG_INT_THEN_RESET - For ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL, raise an interrupt. If the interrupt is not cleared before the timer counts down to zero again, reset the CPU cores.
For ALT_CPU_WATCHDOG, raise an interrupt.

ALT_WDOG_TIMER_MODE_ONESHOT - For ALT_CPU_WATCHDOG, watchdog timer is set to timer mode and one-shot operation is selected.

ALT_WDOG_TIMER_MODE_FREERUN - For ALT_CPU_WATCHDOG, watchdog timer is set to timer mode and free-run operation is selected.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGSpecified an incorrect timer or an unsupported response mode for the specified timer.
int32_t alt_wdog_response_mode_get ( ALT_WDOG_TIMER_t  tmr_id)

Returns the response mode of the specified timer.

Parameters
tmr_idThe timer identifier.
Return values
ALT_WDOG_WARM_RESETFor ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL, reset the core immediately.
For ALT_CPU_WATCHDOG, the action is determined by the current setting in the reset manager.
ALT_WDOG_INT_THEN_RESETRaise an interrupt. For ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL, if the interrupt is not cleared before timer wraps around again, reset the CPU cores.
For ALT_CPU_WATCHDOG, the action is determined by the current setting in the interrupt manager.
ALT_WDOG_TIMER_MODE_ONESHOTCore watchdog timer is set to timer mode and one-shot operation is selected.
ALT_WDOG_TIMER_MODE_FREERUNCore watchdog timer is set to timer mode and free-run operation is selected.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGSpecified an invalid timer.
uint32_t alt_wdog_compcode_get ( ALT_WDOG_TIMER_t  tmr_id)

Returns the component code of the watchdog timer module.
Only valid for ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL.

Parameters
tmr_idThe timer identifier.
Return values
uint32_tThe component code of the module. It should be 0x44570120.
Note
This is an Altera Internal Only function
uint32_t alt_wdog_ver_get ( ALT_WDOG_TIMER_t  tmr_id)

Returns the version code of the watchdog timer module.
Only valid for ALT_WATCHDOG0, ALT_WATCHDOG1, ALT_WATCHDOG0_INITIAL or ALT_WATCHDOG1_INITIAL.

Parameters
tmr_idThe timer identifier.
Return values
uint32_tThe encoded revision number of the module.
Note
This is an Altera Internal Only function