1 /*
2  * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include "sdkconfig.h"
10 #include "esp_err.h"
11 
12 #if CONFIG_ESP_TASK_WDT_EN
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /**
19  * @brief Type used to define the context of a Task WatchDog Timer implementation.
20  *        This is used internally in the TWDT driver, it is implementation specific.
21  */
22 typedef void* twdt_ctx_t;
23 
24 /**
25  * @brief Type of the function used as an ISR callback.
26  */
27 typedef void (*twdt_isr_callback)(void*);
28 
29 /**
30  * @brief   Stop the Task Watchdog Timer (TWDT)
31  *
32  * This function will temporarily stop the timer until it is restarted by a call to esp_task_wdt_restart().
33 
34  * @note esp_task_wdt_stop() must not be called by multiple tasks simultaneously.
35  * @return
36  *  - ESP_OK: TWDT successfully stopped
37  *  - Other: Failed to stop the TWDT
38  */
39 esp_err_t esp_task_wdt_stop(void);
40 
41 /**
42  * @brief   Restart the Task Watchdog Timer (TWDT)
43  *
44  * This function will restart the timer after it has been stopped by esp_task_wdt_stop().
45 
46  * @note esp_task_wdt_restart() must not be called by multiple tasks simultaneously.
47  * @return
48  *  - ESP_OK: TWDT successfully stopped
49  *  - Other: Failed to stop the TWDT
50  */
51 esp_err_t esp_task_wdt_restart(void);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif // CONFIG_ESP_TASK_WDT_EN
58