Hardware Libraries  20.1
Stratix 10 SoC Hardware Manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Watchdog Timer Manager API

Description

This module defines the Watchdog Timer Manager API for accessing, configuring, and controlling the HPS Watchdog Timer resources.

A typical initialization might be:

ALT_STATUS_CODE ret;
ret = alt_wdog_int_clear(ALT_WDOG0);
if (ret == ALT_E_SUCCESS) {ret = alt_wdog_counter_set(ALT_WDOG0, ALT_WDOG_USER15_OR_2G); }
if (ret == ALT_E_SUCCESS) {ret = alt_wdog_response_mode_set(ALT_WDOG0, ALT_WDOG_WARM_RESET); }
if (ret == ALT_E_SUCCESS) {ret = alt_wdog_start(ALT_WDOG0); }

Then periodically (before it runs out) call this function to restart the watchdog:

alt_wdog_reset(ALT_WDOG0);

If the interrupt is enabled in the interrupt manager and is triggered, it can be cleared like this:

alt_wdog_int_clear(ALT_WDOG0);

If the interrupt is not enabled in the interrupt manager, you can still poll to see if it hit zero and clear any pending interrupts like this:

alt_wdog_int_if_pending_clear(ALT_WDOG0);

Members

 Watchdog Timer Enable, Disable, Restart, Status
 
 Watchdog Timer Counter Configuration
 
 Watchdog Timer Interrupt Management
 

Typedefs

typedef enum ALT_WDOG_TIMER_e ALT_WDOG_TIMER_t
 
typedef enum ALT_WDOG_TIMEOUT_e ALT_WDOG_TIMEOUT_t
 
typedef enum ALT_WDOG_RESET_TYPE_e ALT_WDOG_RESET_TYPE_t
 

ENUMS

enum  ALT_WDOG_TIMER_e {
  ALT_WDOG0, ALT_WDOG1, ALT_WDOG2, ALT_WDOG3,
  ALT_WDOG0_INIT, ALT_WDOG1_INIT, ALT_WDOG2_INIT, ALT_WDOG3_INIT
}
 
enum  ALT_WDOG_TIMEOUT_e {
  ALT_WDOG_USER0_OR_64K, ALT_WDOG_USER1_OR_128K, ALT_WDOG_USER2_OR_256K, ALT_WDOG_USER3_OR_512K,
  ALT_WDOG_USER4_OR_1M, ALT_WDOG_USER5_OR_2M, ALT_WDOG_USER6_OR_4M, ALT_WDOG_USER7_OR_8M,
  ALT_WDOG_USER8_OR_16M, ALT_WDOG_USER9_OR_32M, ALT_WDOG_USER10_OR_64M, ALT_WDOG_USER11_OR_128M,
  ALT_WDOG_USER12_OR_256M, ALT_WDOG_USER13_OR_512M, ALT_WDOG_USER14_OR_1G, ALT_WDOG_USER15_OR_2G
}
 
enum  ALT_WDOG_RESET_TYPE_e { ALT_WDOG_UNKNOWN, ALT_WDOG_WARM_RESET, ALT_WDOG_INT_THEN_RESET }
 

Typedef Documentation

This type definition enumerates the names of the timers managed by the Watchdog Timers Manager.

This type definition enumerates the encoded countdown values that ALT_WATCHDOGx and ALT_WATCHDOGx_INITIAL can be set to use.

This type definition enumerates the reset types that the watchdog timers can be set to trigger.

Enumeration Type Documentation

This type definition enumerates the names of the timers managed by the Watchdog Timers Manager.

Enumerator:
ALT_WDOG0 

watchdog_timer0 - Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG1 

watchdog_timer1 - Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG2 

watchdog_timer2 - Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG3 

watchdog_timer3 - Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG0_INIT 

watchdog_init_timer0 - This is for the initial timout only (not necessarily immediately after system restart), watchdog_timer0 is then used for all subsequent timeouts. Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG1_INIT 

watchdog_init_timer1 - This is for the initial timout only (not necessarily immediately after system restart), watchdog_timer1 is then used for all subsequent timeouts. Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG2_INIT 

watchdog_init_timer2 - This is for the initial timout only (not necessarily immediately after system restart), watchdog_timer2 is then used for all subsequent timeouts. Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

ALT_WDOG3_INIT 

watchdog_init_timer3 - This is for the initial timout only (not necessarily immediately after system restart), watchdog_timer3 is then used for all subsequent timeouts. Connected to the L4_sys bus clocked by l4_sys_free_clk. Counter values are limited to powers of two between 16 and 31 and there is no prescaler.

This type definition enumerates the encoded countdown values that ALT_WATCHDOGx and ALT_WATCHDOGx_INITIAL can be set to use.

Enumerator:
ALT_WDOG_USER0_OR_64K 

ALT_WDOG_USER0_OR_64K - Timeout = 65,536 l4_sys_free_clk periods.

ALT_WDOG_USER1_OR_128K 

ALT_WDOG_USER1_OR_128K - Timeout = 131,072 l4_sys_free_clk periods.

ALT_WDOG_USER2_OR_256K 

ALT_WDOG_USER2_OR_256K - Timeout = 262,144 l4_sys_free_clk periods.

ALT_WDOG_USER3_OR_512K 

ALT_WDOG_USER3_OR_512K - Timeout = 524,288 l4_sys_free_clk periods.

ALT_WDOG_USER4_OR_1M 

ALT_WDOG_USER4_OR_1M - Timeout = 1,048,576 l4_sys_free_clk periods.

ALT_WDOG_USER5_OR_2M 

ALT_WDOG_USER5_OR_2M - Timeout = 2,097,152 l4_sys_free_clk periods.

ALT_WDOG_USER6_OR_4M 

ALT_WDOG_USER6_OR_4M - Timeout = 4,194,304 l4_sys_free_clk periods.

ALT_WDOG_USER7_OR_8M 

ALT_WDOG_USER7_OR_8M - Timeout = 8,388,608 l4_sys_free_clk periods.

ALT_WDOG_USER8_OR_16M 

ALT_WDOG_USER8_OR_16M - Timeout = 16,777,216 l4_sys_free_clk periods.

ALT_WDOG_USER9_OR_32M 

ALT_WDOG_USER9_OR_32M - Timeout = 33,554,432 l4_sys_free_clk periods.

ALT_WDOG_USER10_OR_64M 

ALT_WDOG_USER10_OR_64M - Timeout = 67,108,864 l4_sys_free_clk periods.

ALT_WDOG_USER11_OR_128M 

ALT_WDOG_USER11_OR_128M - Timeout = 134,217,728 l4_sys_free_clk periods.

ALT_WDOG_USER12_OR_256M 

ALT_WDOG_USER12_OR_256M - Timeout = 268,435,456 l4_sys_free_clk periods.

ALT_WDOG_USER13_OR_512M 

ALT_WDOG_USER13_OR_512M - Timeout = 536,870,912 l4_sys_free_clk periods.

ALT_WDOG_USER14_OR_1G 

ALT_WDOG_USER14_OR_1G - Timeout = 1,073,741,824 l4_sys_free_clk periods.

ALT_WDOG_USER15_OR_2G 

ALT_WDOG_USER15_OR_2G - Timeout = 2,147,483,648 l4_sys_free_clk periods.

This type definition enumerates the reset types that the watchdog timers can be set to trigger.

Enumerator:
ALT_WDOG_UNKNOWN 

Unkown - For indicating an error

ALT_WDOG_WARM_RESET 

Reset - For ALT_WATCHDOGx or ALT_WATCHDOGx_INITIAL, if the counter reaches zero without being reset, generate a system-wide warm reset request. This is the default mode out of reset.

ALT_WDOG_INT_THEN_RESET 

Interrupt_First - When the counter reaches zero without being reset, generate an interrupt. For ALT_WATCHDOGx or ALT_WATCHDOGx_INITIAL, if the interrupt is not cleared by the time a second timeout occurs, then generate a system warm reset request.