mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-30 06:09:44 +01:00
34 lines
1.1 KiB
C
34 lines
1.1 KiB
C
|
|
/*
|
||
|
|
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
#include <stdbool.h>
|
||
|
|
#include "soc/soc.h"
|
||
|
|
#include "soc/lp_analog_peri_reg.h"
|
||
|
|
|
||
|
|
void bootloader_ana_super_wdt_reset_config(bool enable)
|
||
|
|
{
|
||
|
|
// ESP32H2 has removed the super wdt
|
||
|
|
}
|
||
|
|
|
||
|
|
void bootloader_ana_bod_reset_config(bool enable)
|
||
|
|
{
|
||
|
|
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOR_RST);
|
||
|
|
if (enable) {
|
||
|
|
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||
|
|
} else {
|
||
|
|
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||
|
|
{
|
||
|
|
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_GLITCH_RST);
|
||
|
|
if (enable) {
|
||
|
|
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
|
||
|
|
} else {
|
||
|
|
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
|
||
|
|
}
|
||
|
|
}
|