Lines Matching +full:interrupt +full:- +full:nmi

4  * SPDX-License-Identifier: Apache-2.0
23 * TI CC13xx/CC26xx watchdog is a 32-bit timer that runs on the MCU clock
30 * The watchdog will issue reset only on second in turn time-out (if the timer
31 * or the interrupt aren't reset after the first time-out). By default, regular
32 * interrupt is generated but platform supports also NMI (can be enabled by
33 * setting the `interrupt-nmi` boolean DT property).
58 struct wdt_cc13xx_cc26xx_data *data = dev->data; in wdt_cc13xx_cc26xx_install_timeout()
61 if (cfg->window.min != 0U || cfg->window.max == 0U) { in wdt_cc13xx_cc26xx_install_timeout()
62 return -EINVAL; in wdt_cc13xx_cc26xx_install_timeout()
69 if (cfg->window.max > WATCHDOG_MAX_RELOAD_MS) { in wdt_cc13xx_cc26xx_install_timeout()
70 return -EINVAL; in wdt_cc13xx_cc26xx_install_timeout()
72 data->reload = WATCHDOG_MS_TO_TICKS(cfg->window.max); in wdt_cc13xx_cc26xx_install_timeout()
73 data->cb = cfg->callback; in wdt_cc13xx_cc26xx_install_timeout()
74 data->flags = cfg->flags; in wdt_cc13xx_cc26xx_install_timeout()
75 LOG_DBG("raw reload value: %d", data->reload); in wdt_cc13xx_cc26xx_install_timeout()
81 const struct wdt_cc13xx_cc26xx_cfg *config = dev->config; in wdt_cc13xx_cc26xx_setup()
82 struct wdt_cc13xx_cc26xx_data *data = dev->data; in wdt_cc13xx_cc26xx_setup()
86 * want to dynamically re-configure its options (e.g., decrease the reload in wdt_cc13xx_cc26xx_setup()
92 /* clear any previous interrupt flags */ in wdt_cc13xx_cc26xx_setup()
105 * > return -ENOTSUP; in wdt_cc13xx_cc26xx_setup()
110 WatchdogReloadSet(data->reload); in wdt_cc13xx_cc26xx_setup()
112 /* use the Device Tree-configured interrupt type */ in wdt_cc13xx_cc26xx_setup()
113 if (config->irq_nmi) { in wdt_cc13xx_cc26xx_setup()
114 LOG_DBG("NMI enabled"); in wdt_cc13xx_cc26xx_setup()
120 switch ((data->flags & WDT_FLAG_RESET_MASK)) { in wdt_cc13xx_cc26xx_setup()
131 return -ENOTSUP; in wdt_cc13xx_cc26xx_setup()
134 data->enabled = 1; in wdt_cc13xx_cc26xx_setup()
144 struct wdt_cc13xx_cc26xx_data *data = dev->data; in wdt_cc13xx_cc26xx_disable()
147 return -EFAULT; in wdt_cc13xx_cc26xx_disable()
152 * All we can do is disable the timeout reset, but the interrupt in wdt_cc13xx_cc26xx_disable()
156 data->enabled = 0; in wdt_cc13xx_cc26xx_disable()
166 struct wdt_cc13xx_cc26xx_data *data = dev->data; in wdt_cc13xx_cc26xx_feed()
170 WatchdogReloadSet(data->reload); in wdt_cc13xx_cc26xx_feed()
172 LOG_DBG("feed %i", data->reload); in wdt_cc13xx_cc26xx_feed()
178 struct wdt_cc13xx_cc26xx_data *data = dev->data; in wdt_cc13xx_cc26xx_isr()
181 if (!data->enabled) { in wdt_cc13xx_cc26xx_isr()
186 * Note: don't clear the interrupt here, leave it for the callback in wdt_cc13xx_cc26xx_isr()
191 if (data->cb) { in wdt_cc13xx_cc26xx_isr()
192 data->cb(dev, 0); in wdt_cc13xx_cc26xx_isr()
198 const struct wdt_cc13xx_cc26xx_cfg *config = dev->config; in wdt_cc13xx_cc26xx_init()
202 config->irq_cfg_func(); in wdt_cc13xx_cc26xx_init()
227 return; /* NMI interrupt is used */ \