1 /* 2 * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #include <stdbool.h> 7 #include "soc/soc.h" 8 #include "soc/rtc_cntl_reg.h" 9 bootloader_ana_super_wdt_reset_config(bool enable)10void bootloader_ana_super_wdt_reset_config(bool enable) 11 { 12 REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SUPER_WDT_RST); 13 14 if (enable) { 15 REG_CLR_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST); 16 } else { 17 REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST); 18 } 19 } 20 bootloader_ana_bod_reset_config(bool enable)21void bootloader_ana_bod_reset_config(bool enable) 22 { 23 REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST); 24 25 if (enable) { 26 REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN); 27 } else { 28 REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN); 29 } 30 } 31 bootloader_ana_clock_glitch_reset_config(bool enable)32void bootloader_ana_clock_glitch_reset_config(bool enable) 33 { 34 REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST); 35 36 if (enable) { 37 REG_SET_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_GLITCH_RST_EN); 38 } else { 39 REG_CLR_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_GLITCH_RST_EN); 40 } 41 } 42