Loading...
Searching...
No Matches
wdt.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Technische Universität Berlin
3 * (C) 2019 Inria
4 * (C) 2019 ML!PA Consulting GmbH
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
11#pragma once
12
208#include <stdint.h>
209#include "periph_cpu.h"
210
211#ifdef __cplusplus
212extern "C" {
213#endif
214
220#if defined(DOXYGEN)
221#define NWDT_TIME_LOWER_LIMIT
222#endif
228#if defined(DOXYGEN)
229#define NWDT_TIME_UPPER_LIMIT
230#endif
236#if defined(DOXYGEN)
237#define WWDT_TIME_LOWER_LIMIT
238#endif
244#if defined(DOXYGEN)
245#define WWDT_TIME_UPPER_LIMIT
246#endif
247
253#ifndef WDT_HAS_STOP
254#define WDT_HAS_STOP (0)
255#endif
261#ifndef WDT_HAS_INIT
262#define WDT_HAS_INIT (0)
263#endif
264
269#ifndef CONFIG_PERIPH_WDT_WIN_MIN_MS
270#define CONFIG_PERIPH_WDT_WIN_MIN_MS (0)
271#endif
272
278#ifndef CONFIG_PERIPH_WDT_WIN_MAX_MS
279#define CONFIG_PERIPH_WDT_WIN_MAX_MS (1024)
280#endif
281
285void wdt_start(void);
286
293void wdt_stop(void);
294
298void wdt_kick(void);
299
311void wdt_setup_reboot(uint32_t min_time, uint32_t max_time);
312
319void wdt_init(void);
320
321#if defined(MODULE_PERIPH_WDT_CB) || defined(DOXYGEN)
334#ifndef CONFIG_WDT_WARNING_PERIOD
335#define CONFIG_WDT_WARNING_PERIOD (1)
336#endif
345typedef void (*wdt_cb_t)(void *arg);
346
361void wdt_setup_reboot_with_callback(uint32_t min_time, uint32_t max_time,
362 wdt_cb_t wdt_cb, void *arg);
363#endif
364
365#ifdef __cplusplus
366}
367#endif
368
void wdt_kick(void)
Reset the watchdog timer counter, delay system reset.
void wdt_setup_reboot(uint32_t min_time, uint32_t max_time)
Set up the wdt timer.
void wdt_stop(void)
Stop watchdog timer.
void(* wdt_cb_t)(void *arg)
Signature for the watchdog early warning callback.
Definition wdt.h:345
void wdt_setup_reboot_with_callback(uint32_t min_time, uint32_t max_time, wdt_cb_t wdt_cb, void *arg)
Set up the wdt timer with callback.
void wdt_start(void)
Start watchdog timer.
void wdt_init(void)
Initialize WDT module.