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
206#ifndef PERIPH_WDT_H
207#define PERIPH_WDT_H
208
209#include <stdint.h>
210#include "periph_cpu.h"
211
212#ifdef __cplusplus
213extern "C" {
214#endif
215
221#if defined(DOXYGEN)
222#define NWDT_TIME_LOWER_LIMIT
223#endif
229#if defined(DOXYGEN)
230#define NWDT_TIME_UPPER_LIMIT
231#endif
237#if defined(DOXYGEN)
238#define WWDT_TIME_LOWER_LIMIT
239#endif
245#if defined(DOXYGEN)
246#define WWDT_TIME_UPPER_LIMIT
247#endif
248
254#ifndef WDT_HAS_STOP
255#define WDT_HAS_STOP (0)
256#endif
262#ifndef WDT_HAS_INIT
263#define WDT_HAS_INIT (0)
264#endif
265
270#ifndef CONFIG_PERIPH_WDT_WIN_MIN_MS
271#define CONFIG_PERIPH_WDT_WIN_MIN_MS (0)
272#endif
273
279#ifndef CONFIG_PERIPH_WDT_WIN_MAX_MS
280#define CONFIG_PERIPH_WDT_WIN_MAX_MS (1024)
281#endif
282
286void wdt_start(void);
287
294void wdt_stop(void);
295
299void wdt_kick(void);
300
312void wdt_setup_reboot(uint32_t min_time, uint32_t max_time);
313
320void wdt_init(void);
321
322#if defined(MODULE_PERIPH_WDT_CB) || defined(DOXYGEN)
335#ifndef CONFIG_WDT_WARNING_PERIOD
336#define CONFIG_WDT_WARNING_PERIOD (1)
337#endif
346typedef void (*wdt_cb_t)(void *arg);
347
362void wdt_setup_reboot_with_callback(uint32_t min_time, uint32_t max_time,
363 wdt_cb_t wdt_cb, void *arg);
364#endif
365
366#ifdef __cplusplus
367}
368#endif
369
370#endif /* PERIPH_WDT_H */
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:346
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.