|
K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
|
Data Structures | |
| struct | kfsw_platform_watchdog_info |
Enumerations | |
| enum | kfsw_platform_watchdog_state { KFSW_PLATFORM_WATCHDOG_UNCONFIGURED = 0 , KFSW_PLATFORM_WATCHDOG_CONFIGURED = 1 , KFSW_PLATFORM_WATCHDOG_RUNNING = 2 , KFSW_PLATFORM_WATCHDOG_STARVED = 3 } |
Functions | |
| uint32_t | kfsw_platform_watchdog_feed_interval_ms (uint32_t timeout_ms) |
| uint32_t | kfsw_platform_watchdog_configured_timeout_ms (void) |
| int | kfsw_platform_watchdog_init (void) |
| int | kfsw_platform_watchdog_start (void) |
| int | kfsw_platform_watchdog_feed (void) |
| int | kfsw_platform_watchdog_release (void) |
| int | kfsw_platform_watchdog_stop_feeding (void) |
| int | kfsw_platform_watchdog_get_info (struct kfsw_platform_watchdog_info *info) |
Arm, feed and stop feeding a hardware watchdog.
The health service can take over the feeding. Most parts, including the STM32 independent watchdog, can't be disarmed once started.
#include <watchdog.h>
Watchdog lifecycle state.
| uint32_t kfsw_platform_watchdog_configured_timeout_ms | ( | void | ) |
#include <watchdog.h>
Watchdog timeout selected for this board, available before init.
| int kfsw_platform_watchdog_feed | ( | void | ) |
#include <watchdog.h>
Feed the watchdog once.
A starved watchdog can't be fed again.
| 0 | The watchdog was fed. |
| -ENODEV | No watchdog device is bound. |
| -EINVAL | The watchdog is not running. |
| -EPERM | Feeding was stopped. |
| uint32_t kfsw_platform_watchdog_feed_interval_ms | ( | uint32_t | timeout_ms | ) |
#include <watchdog.h>
Feed interval for a timeout: a third of it, at least 1 ms.
| timeout_ms | Configured timeout in milliseconds. |
| int kfsw_platform_watchdog_get_info | ( | struct kfsw_platform_watchdog_info * | info | ) |
#include <watchdog.h>
Read a consistent snapshot of watchdog state.
| [out] | info | Destination snapshot. |
| 0 | The snapshot was written. |
| -EINVAL | info is NULL. |
| int kfsw_platform_watchdog_init | ( | void | ) |
#include <watchdog.h>
Bind the watchdog device and install the configured timeout.
Does not arm the hardware; call kfsw_platform_watchdog_start for that.
| 0 | The timeout was installed. |
| -ENODEV | No watchdog device is bound to the kfsw,watchdog chosen property, or the device is not ready. |
| -EALREADY | Initialization has already run. |
| int kfsw_platform_watchdog_release | ( | void | ) |
#include <watchdog.h>
Stop the built-in keep-alive and let the caller feed the watchdog.
The watchdog stays armed. The caller must feed it at least every kfsw_platform_watchdog_feed_interval_ms or the part resets.
| 0 | The keep-alive stopped. |
| -EWOULDBLOCK | Called outside a preemptible thread or from the system workqueue. |
| -ENODEV | No watchdog device is bound. |
| -EINVAL | The watchdog is not running. |
| int kfsw_platform_watchdog_start | ( | void | ) |
#include <watchdog.h>
Arm the hardware and start the keep-alive.
| 0 | The watchdog is running. |
| -ENODEV | No watchdog device is bound. |
| -EINVAL | Initialization has not run. |
| int kfsw_platform_watchdog_stop_feeding | ( | void | ) |
#include <watchdog.h>
Stop feeding the watchdog so that it expires.
The part resets within one timeout, and this can't be undone.
| 0 | The keep-alive was stopped. |
| -ENODEV | No watchdog device is bound. |
| -EINVAL | The watchdog is not running. |