1 2 /* 3 * SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #include "hal/brownout_ll.h" 9 #include "hal/brownout_hal.h" 10 brownout_hal_config(const brownout_hal_config_t * cfg)11void brownout_hal_config(const brownout_hal_config_t *cfg) 12 { 13 // If brownout software control is enabled, hw ana reset should be disabled, because it always has the highest priority. 14 brownout_ll_ana_reset_enable(false); 15 brownout_ll_set_intr_wait_cycles(2); 16 brownout_ll_enable_flash_power_down(cfg->flash_power_down); 17 brownout_ll_enable_rf_power_down(cfg->rf_power_down); 18 brownout_ll_clear_count(); 19 brownout_ll_reset_config(cfg->reset_enabled, 0x3ff, 1); 20 brownout_ll_set_threshold(cfg->threshold); 21 brownout_ll_bod_enable(cfg->enabled); 22 } 23