![]() |
Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
|
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) |
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.
tmr_id | The timer identifier. |
type | ALT_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. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | Specified 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.
tmr_id | The timer identifier. |
ALT_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 | Raise 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_ONESHOT | Core watchdog timer is set to timer mode and one-shot operation is selected. |
ALT_WDOG_TIMER_MODE_FREERUN | Core watchdog timer is set to timer mode and free-run operation is selected. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | Specified 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.
tmr_id | The timer identifier. |
uint32_t | The component code of the module. It should be 0x44570120. |
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.
tmr_id | The timer identifier. |
uint32_t | The encoded revision number of the module. |