Calculate watchdog register values
calc_watchdog_timeoutComputes the register values of a watchdog for a timeout, with the real timeout. Use it to set up a watchdog instead of working the prescaler and the reload value out by hand. It knows the STM32 independent watchdog (IWDG_PR and IWDG_RLR), the STM32 window watchdog (WDGTB and the counter) and the nRF watchdog (CRV). The timeout is never shorter than the one asked for.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"watchdog": "<watchdog>",
"timeout_ms": "<timeout_ms>"
},
"name": "calc_watchdog_timeout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clock_hz | No | The clock of the watchdog in Hz. Default 32000 for stm32-iwdg (LSI) and 32768 for nrf-wdt. Required for stm32-wwdg: its APB clock. | |
| watchdog | Yes | stm32-iwdg, stm32-wwdg or nrf-wdt. | |
| timeout_ms | Yes | The wanted timeout in milliseconds. |