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

Description

This functional group implements setting, configuring and reading the counters of the watchdog timers.

Functions

ALT_STATUS_CODE alt_wdog_counter_set (ALT_WDOG_TIMER_t tmr_id, ALT_WDOG_TIMEOUT_t val)
 
uint32_t alt_wdog_counter_get_current (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_counter_get_curtime_millisecs (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_counter_get_init (ALT_WDOG_TIMER_t tmr_id)
 
uint64_t alt_wdog_counter_get_inittime_nanosecs (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_counter_get_inittime_millisecs (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_counter_get_max (ALT_WDOG_TIMER_t tmr_id)
 
uint64_t alt_wdog_counter_get_max_nanosecs (ALT_WDOG_TIMER_t tmr_id)
 
uint32_t alt_wdog_counter_get_max_millisecs (ALT_WDOG_TIMER_t tmr_id)
 

Function Documentation

ALT_STATUS_CODE alt_wdog_counter_set ( ALT_WDOG_TIMER_t  tmr_id,
ALT_WDOG_TIMEOUT_t  val 
)

Sets the countdown value of the specified timer. For tmr_id = ALT_WATCHDOGx or ALT_WATCHDOGx_INITIAL This is an encoded power-of-two value such that 2**(16 + val).
If this value is set before the watchdog timer is started, then this value is used from the start. If this value is set after the timer has been started, it takes effect when the timer rolls over or the next time it is started.

Parameters
tmr_idThe watchdog timer identifier.
valThe counter value to load. It is the ALT_WDOG_TIMEOUT_t data. min is ALT_WDOG_USER0_OR_64K. max is ALT_WDOG_USER15_OR_2G
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGTried to write an invalid watchdog timer or timeout value.
uint32_t alt_wdog_counter_get_current ( ALT_WDOG_TIMER_t  tmr_id)

Returns the current counter value of the specified timer.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe current 32-bit counter value.
uint32_t alt_wdog_counter_get_curtime_millisecs ( ALT_WDOG_TIMER_t  tmr_id)

Returns the current counter value of the specified timer, as measured in milliseconds.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe current 32-bit counter value (in milliseconds).
uint32_t alt_wdog_counter_get_init ( ALT_WDOG_TIMER_t  tmr_id)

Returns the initial counter value of the specified timer as a 32-bit integer value. This is the value that will be reloaded when the timer is reset or restarted. For the timers where this value is set as an encoded powers-of-two between 16 and 31, the value is converted into the equivalent binary value before returning it.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe current 32-bit counter value. 0 Indicates an error.
uint64_t alt_wdog_counter_get_inittime_nanosecs ( ALT_WDOG_TIMER_t  tmr_id)

Returns the initial value of the specified timer in nanoseconds. This is the value that will be reloaded when the timer is reset or restarted. This call returns a more precise result than alt_wdog_counter_get_inittime_millisecs(), but as an unsigned 64-bit integer.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint64_tThe currently-selected watchdog delay time (in nanoseconds).
uint32_t alt_wdog_counter_get_inittime_millisecs ( ALT_WDOG_TIMER_t  tmr_id)

Returns the initialized value of the specified timer in milliseconds. This is the value that will be reloaded when the timer is reset or restarted. This call returns a 32-bit unsigned integer, though is less precise than alt_wdog_counter_get_inittime_nanosecs().

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe currently-selected watchdog delay time (in milliseconds). 0 Indicates an error.
uint32_t alt_wdog_counter_get_max ( ALT_WDOG_TIMER_t  tmr_id)

Returns the maximum possible counter value of the specified timer as a 32-bit value. For the timers where this value is encoded (as powers-of-two between 16 and 31), the encoded value is converted into the equivalent binary value before returning it.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe current 32-bit counter value.
uint64_t alt_wdog_counter_get_max_nanosecs ( ALT_WDOG_TIMER_t  tmr_id)

Returns the maximum possible delay time of the specified timer specified in nanoseconds. This call returns a more precise reading of the counter than alt_wdog_counter_get_max_millisecs(), though in an unsigned 64-bit integer.

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint64_tThe maximum delay time before timeout (in nanoseconds).
uint32_t alt_wdog_counter_get_max_millisecs ( ALT_WDOG_TIMER_t  tmr_id)

Returns the maximum possible delay time of the specified timer specified in milliseconds. This call returns a 32-bit unsigned integer, though is less precise than alt_wdog_counter_get_max_nanosecs().

Parameters
tmr_idThe watchdog timer identifier.
Return values
uint32_tThe maximum delay time before timeout (in milliseconds).