Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
Infuse watchdog API . More...
Macros | |
#define | INFUSE_WATCHDOG_DEV DEVICE_DT_GET(DT_ALIAS(watchdog0)) |
Infuse watchdog device. | |
#define | INFUSE_WATCHDOG_FEED_PERIOD K_MSEC(CONFIG_INFUSE_WATCHDOG_PERIOD_MS - CONFIG_INFUSE_WATCHDOG_FEED_EARLY_MS) |
Maximum duration to sleep before waking up to feed watchdog. | |
#define | INFUSE_WATCHDOG_DEFAULT_TIMEOUT_CFG |
Default timeout configuration for subsystems. | |
#define | INFUSE_WATCHDOG_REGISTER_SYS_INIT(name, dependency, chan_name, period_name) |
Install a watchdog timeout at boot. | |
Functions | |
void | infuse_watchdog_warning (const struct device *dev, int channel_id) |
Function that is called just prior to watchdog expiry. | |
void | infuse_watchdog_expired (const struct device *dev, int channel_id) |
Function that is called on watchdog expiry. | |
int | infuse_watchdog_install (k_timeout_t *feed_period) |
Install an Infuse watchdog channel. | |
void | infuse_watchdog_thread_register (int wdog_channel, k_tid_t thread) |
Register a watchdog channel against a thread. | |
int | infuse_watchdog_thread_state_lookup (int wdog_channel, uint32_t *info1, uint32_t *info2) |
Determine state of the thread responsible for watchdog channel. | |
int | infuse_watchdog_start (void) |
Start the Infuse watchdog. | |
void | infuse_watchdog_feed (int wdog_channel) |
Feed an Infuse watchdog channel. | |
void | infuse_watchdog_feed_all (void) |
Feed all Infuse watchdog channels. | |
Infuse watchdog API .
#define INFUSE_WATCHDOG_DEFAULT_TIMEOUT_CFG |
#include <infuse/drivers/watchdog.h>
Default timeout configuration for subsystems.
#define INFUSE_WATCHDOG_DEV DEVICE_DT_GET(DT_ALIAS(watchdog0)) |
#include <infuse/drivers/watchdog.h>
Infuse watchdog device.
#define INFUSE_WATCHDOG_FEED_PERIOD K_MSEC(CONFIG_INFUSE_WATCHDOG_PERIOD_MS - CONFIG_INFUSE_WATCHDOG_FEED_EARLY_MS) |
#include <infuse/drivers/watchdog.h>
Maximum duration to sleep before waking up to feed watchdog.
#define INFUSE_WATCHDOG_REGISTER_SYS_INIT | ( | name, | |
dependency, | |||
chan_name, | |||
period_name ) |
#include <infuse/drivers/watchdog.h>
Install a watchdog timeout at boot.
name | Unique prefix for constructed variables |
dependency | Timeout only installed if IS_ENABLED(dependency) |
chan_name | Name of the variable for the channel ID |
period_name | Name of the variable for the channel feed period |
void infuse_watchdog_expired | ( | const struct device * | dev, |
int | channel_id ) |
#include <infuse/drivers/watchdog.h>
Function that is called on watchdog expiry.
The standard implementation of this function is in lib/reboot.c
dev | Watchdog instance that expired |
channel_id | Channel ID that expired |
void infuse_watchdog_feed | ( | int | wdog_channel | ) |
#include <infuse/drivers/watchdog.h>
Feed an Infuse watchdog channel.
wdog_channel | Channel from infuse_watchdog_install |
void infuse_watchdog_feed_all | ( | void | ) |
#include <infuse/drivers/watchdog.h>
Feed all Infuse watchdog channels.
int infuse_watchdog_install | ( | k_timeout_t * | feed_period | ) |
#include <infuse/drivers/watchdog.h>
Install an Infuse watchdog channel.
int infuse_watchdog_start | ( | void | ) |
void infuse_watchdog_thread_register | ( | int | wdog_channel, |
k_tid_t | thread ) |
#include <infuse/drivers/watchdog.h>
Register a watchdog channel against a thread.
This allows thread state to be determined by infuse_watchdog_thread_state_lookup in the event that the channel expires.
wdog_channel | Watchdog channel to register |
thread | Thread responsible for feeding the channel |
int infuse_watchdog_thread_state_lookup | ( | int | wdog_channel, |
uint32_t * | info1, | ||
uint32_t * | info2 ) |
#include <infuse/drivers/watchdog.h>
Determine state of the thread responsible for watchdog channel.
Data format, compatible with the Infuse Reboot API.
info1: bits 16-31: Reserved for future use bits 8-15: Common thread state bits (_THREAD_PENDING, etc) bits 0- 7: Watchdog channel ID
info2: If thread is pending on an object (_THREAD_PENDING), address of that object 0 otherwise
wdog_channel | Watchdog channel to lookup thread state for |
info1 | Thread info per above |
info2 | Thread info per above |
0 | on success |
-EINVAL | wdog_channel has not been associated with a thread |
void infuse_watchdog_warning | ( | const struct device * | dev, |
int | channel_id ) |
#include <infuse/drivers/watchdog.h>
Function that is called just prior to watchdog expiry.
The standard implementation of this function is in lib/reboot.c
dev | Watchdog instance that is about to expire |
channel_id | Channel ID that is about to expire |