/// List of stage of rtc watchdog. WDT has 4 stage.
typedefenum{
RTC_WDT_STAGE0=0,/*!< Stage 0 */
RTC_WDT_STAGE1=1,/*!< Stage 1 */
RTC_WDT_STAGE2=2,/*!< Stage 2 */
RTC_WDT_STAGE3=3/*!< Stage 3 */
}rtc_wdt_stage_t;
/// List of action. When the time of stage expires this action will be triggered.
typedefenum{
RTC_WDT_STAGE_ACTION_OFF=RTC_WDT_STG_SEL_OFF,/*!< Disabled. This stage will have no effects on the system. */
RTC_WDT_STAGE_ACTION_INTERRUPT=RTC_WDT_STG_SEL_INT,/*!< Trigger an interrupt. When the stage expires an interrupt is triggered. */
RTC_WDT_STAGE_ACTION_RESET_CPU=RTC_WDT_STG_SEL_RESET_CPU,/*!< Reset a CPU core. */
RTC_WDT_STAGE_ACTION_RESET_SYSTEM=RTC_WDT_STG_SEL_RESET_SYSTEM,/*!< Reset the main system includes the CPU and all peripherals. The RTC is an exception to this, and it will not be reset. */
RTC_WDT_STAGE_ACTION_RESET_RTC=RTC_WDT_STG_SEL_RESET_RTC/*!< Reset the main system and the RTC. */
}rtc_wdt_stage_action_t;
/// Type of reset signal
typedefenum{
RTC_WDT_SYS_RESET_SIG=0,/*!< System reset signal length selection */
RTC_WDT_CPU_RESET_SIG=1/*!< CPU reset signal length selection */
}rtc_wdt_reset_sig_t;
/// Length of reset signal
typedefenum{
RTC_WDT_LENGTH_100ns=0,/*!< 100 ns */
RTC_WDT_LENGTH_200ns=1,/*!< 200 ns */
RTC_WDT_LENGTH_300ns=2,/*!< 300 ns */
RTC_WDT_LENGTH_400ns=3,/*!< 400 ns */
RTC_WDT_LENGTH_500ns=4,/*!< 500 ns */
RTC_WDT_LENGTH_800ns=5,/*!< 800 ns */
RTC_WDT_LENGTH_1_6us=6,/*!< 1.6 us */
RTC_WDT_LENGTH_3_2us=7/*!< 3.2 us */
}rtc_wdt_length_sig_t;
/**
* @brief Get status of protect of rtc_wdt.
*
* @return
* - True if the protect of RTC_WDT is set
*/
boolrtc_wdt_get_protect_status(void);
/**
* @brief Set protect of rtc_wdt.
*/
voidrtc_wdt_protect_on(void);
/**
* @brief Reset protect of rtc_wdt.
*/
voidrtc_wdt_protect_off(void);
/**
* @brief Enable rtc_wdt.
*/
voidrtc_wdt_enable(void);
/**
* @brief Enable the flash boot protection procedure for WDT.
*
* Do not recommend to use it in the app.
* This function was added to be compatibility with the old bootloaders.
* This mode is disabled in bootloader or using rtc_wdt_disable() function.
*/
voidrtc_wdt_flashboot_mode_enable(void);
/**
* @brief Disable rtc_wdt.
*/
voidrtc_wdt_disable(void);
/**
* @brief Reset counter rtc_wdt.
*
* It returns to stage 0 and its expiry counter restarts from 0.
*/
voidrtc_wdt_feed(void);
/**
* @brief Set time for required stage.
*
* @param[in] stage Stage of rtc_wdt.
* @param[in] timeout_ms Timeout for this stage.
*
* @return
* - ESP_OK In case of success
* - ESP_ERR_INVALID_ARG If stage has invalid value