This functional group implements setting, configuring and reading the counters of the watchdog timers.
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_id | The watchdog timer identifier. |
val | The 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_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | Tried to write an invalid watchdog timer or timeout value. |
Returns the current counter value of the specified timer.
- Parameters
-
tmr_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The current 32-bit counter value. |
Returns the current counter value of the specified timer, as measured in milliseconds.
- Parameters
-
tmr_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The current 32-bit counter value (in milliseconds). |
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_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The current 32-bit counter value. 0 Indicates an error. |
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_id | The watchdog timer identifier. |
- Return values
-
uint64_t | The currently-selected watchdog delay time (in nanoseconds). |
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_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The currently-selected watchdog delay time (in milliseconds). 0 Indicates an error. |
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_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The current 32-bit counter value. |
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_id | The watchdog timer identifier. |
- Return values
-
uint64_t | The maximum delay time before timeout (in nanoseconds). |
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_id | The watchdog timer identifier. |
- Return values
-
uint32_t | The maximum delay time before timeout (in milliseconds). |