2022-05-05 15:38:49 +08:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2016-10-25 18:18:11 +08:00
|
|
|
|
2022-05-05 17:04:59 +08:00
|
|
|
#pragma once
|
2016-10-25 18:18:11 +08:00
|
|
|
|
2022-07-07 14:54:15 +08:00
|
|
|
#include "system_internal.h"
|
|
|
|
#include "soc/periph_defs.h"
|
|
|
|
|
2016-10-25 18:18:11 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-07-07 14:54:15 +08:00
|
|
|
#if SOC_TIMER_GROUPS > 1
|
|
|
|
|
|
|
|
/* If we have two hardware timer groups, use the second one for interrupt watchdog. */
|
|
|
|
#define WDT_LEVEL_INTR_SOURCE ETS_TG1_WDT_LEVEL_INTR_SOURCE
|
|
|
|
#define IWDT_PRESCALER MWDT1_TICK_PRESCALER // Tick period of 500us if WDT source clock is 80MHz
|
|
|
|
#define IWDT_TICKS_PER_US MWDT1_TICKS_PER_US
|
|
|
|
#define IWDT_INSTANCE WDT_MWDT1
|
|
|
|
#define IWDT_INITIAL_TIMEOUT_S 5
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define WDT_LEVEL_INTR_SOURCE ETS_TG0_WDT_LEVEL_INTR_SOURCE
|
|
|
|
#define IWDT_PRESCALER MWDT0_TICK_PRESCALER // Tick period of 500us if WDT source clock is 80MHz
|
|
|
|
#define IWDT_TICKS_PER_US MWDT0_TICKS_PER_US
|
|
|
|
#define IWDT_INSTANCE WDT_MWDT0
|
|
|
|
#define IWDT_INITIAL_TIMEOUT_S 5
|
|
|
|
|
|
|
|
#endif // SOC_TIMER_GROUPS > 1
|
|
|
|
|
2016-10-25 18:18:11 +08:00
|
|
|
/**
|
2022-05-05 17:04:59 +08:00
|
|
|
* @brief Initialize the non-CPU-specific parts of interrupt watchdog.
|
|
|
|
*
|
|
|
|
* This function is automatically called during application startup if the
|
|
|
|
* interrupt watchdog is enabled in menuconfig.
|
|
|
|
*/
|
2019-07-16 16:33:30 +07:00
|
|
|
void esp_int_wdt_init(void);
|
2016-10-21 17:59:57 +08:00
|
|
|
|
2018-01-11 21:43:58 +08:00
|
|
|
/**
|
2022-05-05 17:04:59 +08:00
|
|
|
* @brief Enable the interrupt watchdog on the current CPU.
|
|
|
|
*
|
|
|
|
* This function is automatically called during application startup for each CPU
|
|
|
|
* that has enabled the interrupt watchdog in menuconfig.
|
|
|
|
*
|
|
|
|
* @note esp_int_wdt_init() must be called first before calling this function
|
|
|
|
*/
|
2019-07-16 16:33:30 +07:00
|
|
|
void esp_int_wdt_cpu_init(void);
|
2018-01-11 21:43:58 +08:00
|
|
|
|
2016-10-25 18:18:11 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|