Zephyr API Documentation 4.4.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
watchdog.h File Reference

Main header file for watchdog driver API. More...

#include <zephyr/types.h>
#include <zephyr/sys/util.h>
#include <zephyr/device.h>
#include <zephyr/syscalls/watchdog.h>

Go to the source code of this file.

Data Structures

struct  wdt_window
 Watchdog timeout window. More...
struct  wdt_timeout_cfg
 Watchdog timeout configuration. More...
struct  wdt_driver_api
  Driver Operations Watchdog driver operations More...

Macros

Watchdog options

#define WDT_OPT_PAUSE_IN_SLEEP   BIT(0)
 Pause watchdog timer when CPU is in sleep state.
#define WDT_OPT_PAUSE_HALTED_BY_DBG   BIT(1)
 Pause watchdog timer when CPU is halted by the debugger.
Watchdog behavior flags

#define WDT_FLAG_RESET_NONE   (0 << WDT_FLAG_RESET_SHIFT)
 Reset: none.
#define WDT_FLAG_RESET_CPU_CORE   (1 << WDT_FLAG_RESET_SHIFT)
 Reset: CPU core.
#define WDT_FLAG_RESET_SOC   (2 << WDT_FLAG_RESET_SHIFT)
 Reset: SoC.

Typedefs

typedef void(* wdt_callback_t) (const struct device *dev, int channel_id)
 Watchdog callback.
typedef int(* wdt_api_setup) (const struct device *dev, uint8_t options)
 Callback API to set up a watchdog instance.
typedef int(* wdt_api_disable) (const struct device *dev)
 Callback API to disable a watchdog instance.
typedef int(* wdt_api_install_timeout) (const struct device *dev, const struct wdt_timeout_cfg *cfg)
 Callback API to install a new timeout.
typedef int(* wdt_api_feed) (const struct device *dev, int channel_id)
 Callback API to feed a specified watchdog timeout.

Functions

int wdt_setup (const struct device *dev, uint8_t options)
 Set up watchdog instance.
int wdt_disable (const struct device *dev)
 Disable watchdog instance.
static int wdt_install_timeout (const struct device *dev, const struct wdt_timeout_cfg *cfg)
 Install a new timeout.
int wdt_feed (const struct device *dev, int channel_id)
 Feed specified watchdog timeout.

Detailed Description

Main header file for watchdog driver API.