14#ifndef ZEPHYR_INCLUDE_DRIVERS_WATCHDOG_H_
15#define ZEPHYR_INCLUDE_DRIVERS_WATCHDOG_H_
41#define WDT_OPT_PAUSE_IN_SLEEP BIT(0)
44#define WDT_OPT_PAUSE_HALTED_BY_DBG BIT(1)
56#define WDT_FLAG_RESET_SHIFT (0)
58#define WDT_FLAG_RESET_MASK (0x3 << WDT_FLAG_RESET_SHIFT)
62#define WDT_FLAG_RESET_NONE (0 << WDT_FLAG_RESET_SHIFT)
64#define WDT_FLAG_RESET_CPU_CORE (1 << WDT_FLAG_RESET_SHIFT)
66#define WDT_FLAG_RESET_SOC (2 << WDT_FLAG_RESET_SHIFT)
101#if defined(CONFIG_WDT_MULTISTAGE) || defined(__DOXYGEN__)
184static inline int z_impl_wdt_setup(
const struct device *dev,
uint8_t options)
189 return api->setup(dev, options);
208static inline int z_impl_wdt_disable(
const struct device *dev)
213 return api->disable(dev);
262static inline int z_impl_wdt_feed(
const struct device *dev,
int channel_id)
267 return api->feed(dev, channel_id);
276#include <zephyr/syscalls/watchdog.h>
int(* wdt_api_feed)(const struct device *dev, int channel_id)
Callback API to feed a specified watchdog timeout.
Definition watchdog.h:148
int(* wdt_api_install_timeout)(const struct device *dev, const struct wdt_timeout_cfg *cfg)
Callback API to install a new timeout.
Definition watchdog.h:140
int(* wdt_api_setup)(const struct device *dev, uint8_t options)
Callback API to set up a watchdog instance.
Definition watchdog.h:126
int(* wdt_api_disable)(const struct device *dev)
Callback API to disable a watchdog instance.
Definition watchdog.h:133
void(* wdt_callback_t)(const struct device *dev, int channel_id)
Watchdog callback.
Definition watchdog.h:93
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.
Definition watchdog.h:238
int wdt_setup(const struct device *dev, uint8_t options)
Set up watchdog instance.
int wdt_feed(const struct device *dev, int channel_id)
Feed specified watchdog timeout.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:519
<span class="mlabel">Driver Operations</span> Watchdog driver operations
Definition watchdog.h:153
wdt_api_install_timeout install_timeout
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition watchdog.h:159
wdt_api_setup setup
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition watchdog.h:155
wdt_api_feed feed
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition watchdog.h:161
wdt_api_disable disable
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition watchdog.h:157
Watchdog timeout configuration.
Definition watchdog.h:96
wdt_callback_t callback
Timeout callback (can be NULL).
Definition watchdog.h:100
struct wdt_timeout_cfg * next
Pointer to the next timeout configuration.
Definition watchdog.h:109
uint8_t flags
Flags (see WDT_FLAGS).
Definition watchdog.h:112
struct wdt_window window
Timing parameters of watchdog timeout.
Definition watchdog.h:98
Watchdog timeout window.
Definition watchdog.h:80
uint32_t max
Upper limit of watchdog feed timeout in milliseconds.
Definition watchdog.h:84
uint32_t min
Lower limit of watchdog feed timeout in milliseconds.
Definition watchdog.h:82