diff --git a/components/esp_hal_pmu/esp32h21/include/hal/brownout_ll.h b/components/esp_hal_pmu/esp32h21/include/hal/brownout_ll.h index ca37ffd9ae8..78e3c279994 100644 --- a/components/esp_hal_pmu/esp32h21/include/hal/brownout_ll.h +++ b/components/esp_hal_pmu/esp32h21/include/hal/brownout_ll.h @@ -14,6 +14,7 @@ #include #include "esp_bit_defs.h" #include "soc/lp_analog_peri_struct.h" +#include "hal/assert.h" #include "hal/regi2c_ctrl.h" #include "hal/psdet_types.h" #include "soc/regi2c_brownout.h" @@ -65,10 +66,13 @@ static inline void brownout_ll_reset_config(bool reset_ena, uint32_t reset_wait, /** * @brief Set brown out threshold voltage * - * @param threshold brownout threshold + * @note Only level 7 (~2.96V) is valid on ESP32-H21. + * + * @param threshold dcdc_brno from CONFIG_ESP_BROWNOUT_DET_LVL */ static inline void brownout_ll_set_threshold(uint8_t threshold) { + HAL_ASSERT(threshold == 7); REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD, threshold); } diff --git a/components/esp_hal_pmu/esp32h4/include/hal/brownout_ll.h b/components/esp_hal_pmu/esp32h4/include/hal/brownout_ll.h index ca37ffd9ae8..0d456902298 100644 --- a/components/esp_hal_pmu/esp32h4/include/hal/brownout_ll.h +++ b/components/esp_hal_pmu/esp32h4/include/hal/brownout_ll.h @@ -14,6 +14,7 @@ #include #include "esp_bit_defs.h" #include "soc/lp_analog_peri_struct.h" +#include "hal/assert.h" #include "hal/regi2c_ctrl.h" #include "hal/psdet_types.h" #include "soc/regi2c_brownout.h" @@ -65,10 +66,13 @@ static inline void brownout_ll_reset_config(bool reset_ena, uint32_t reset_wait, /** * @brief Set brown out threshold voltage * - * @param threshold brownout threshold + * @note Only level 7 (~2.96V) is valid on ESP32-H4. + * + * @param threshold dcdc_brno from CONFIG_ESP_BROWNOUT_DET_LVL */ static inline void brownout_ll_set_threshold(uint8_t threshold) { + HAL_ASSERT(threshold == 7); REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD, threshold); } diff --git a/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power index 9a4e9f73b67..e2bc1222076 100644 --- a/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power +++ b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power @@ -13,62 +13,18 @@ menu "Power Supplier" choice ESP_BROWNOUT_DET_LVL_SEL prompt "Brownout voltage level" depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_4 + default ESP_BROWNOUT_DET_LVL_SEL_7 help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each chip. + Only level 7 is supported on ESP32-H21 (~2.96V). Other values would also + affect PCM/LDO/VDD_DIG and are not offered. - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP_BROWNOUT_DET_LVL_SEL_15 - bool "3.77V" - config ESP_BROWNOUT_DET_LVL_SEL_14 - bool "3.68V" - config ESP_BROWNOUT_DET_LVL_SEL_13 - bool "3.58V" - config ESP_BROWNOUT_DET_LVL_SEL_12 - bool "3.47V" - config ESP_BROWNOUT_DET_LVL_SEL_11 - bool "3.37V" - config ESP_BROWNOUT_DET_LVL_SEL_10 - bool "3.26V" - config ESP_BROWNOUT_DET_LVL_SEL_9 - bool "3.16V" - config ESP_BROWNOUT_DET_LVL_SEL_8 - bool "3.06V" config ESP_BROWNOUT_DET_LVL_SEL_7 bool "2.96V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.86V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.75V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.66V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.55V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.45V" - endchoice config ESP_BROWNOUT_DET_LVL int - default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 - default 8 if ESP_BROWNOUT_DET_LVL_SEL_8 - default 9 if ESP_BROWNOUT_DET_LVL_SEL_9 - default 10 if ESP_BROWNOUT_DET_LVL_SEL_10 - default 11 if ESP_BROWNOUT_DET_LVL_SEL_11 - default 12 if ESP_BROWNOUT_DET_LVL_SEL_12 - default 13 if ESP_BROWNOUT_DET_LVL_SEL_13 - default 14 if ESP_BROWNOUT_DET_LVL_SEL_14 - default 15 if ESP_BROWNOUT_DET_LVL_SEL_15 - config ESP_BROWNOUT_USE_INTR bool diff --git a/components/esp_hw_support/power_supply/port/esp32h4/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32h4/Kconfig.power index 67bce99b87c..dc132a84f11 100644 --- a/components/esp_hw_support/power_supply/port/esp32h4/Kconfig.power +++ b/components/esp_hw_support/power_supply/port/esp32h4/Kconfig.power @@ -13,62 +13,18 @@ menu "Power Supplier" choice ESP_BROWNOUT_DET_LVL_SEL prompt "Brownout voltage level" depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_4 + default ESP_BROWNOUT_DET_LVL_SEL_7 help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each chip. + Only level 7 is supported on ESP32-H4 (~2.96V). Other values would also + affect PCM/LDO/VDD_DIG and are not offered. - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP_BROWNOUT_DET_LVL_SEL_15 - bool "3.77V" - config ESP_BROWNOUT_DET_LVL_SEL_14 - bool "3.68V" - config ESP_BROWNOUT_DET_LVL_SEL_13 - bool "3.58V" - config ESP_BROWNOUT_DET_LVL_SEL_12 - bool "3.47V" - config ESP_BROWNOUT_DET_LVL_SEL_11 - bool "3.37V" - config ESP_BROWNOUT_DET_LVL_SEL_10 - bool "3.26V" - config ESP_BROWNOUT_DET_LVL_SEL_9 - bool "3.16V" - config ESP_BROWNOUT_DET_LVL_SEL_8 - bool "3.06V" config ESP_BROWNOUT_DET_LVL_SEL_7 bool "2.96V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.86V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.75V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.66V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.55V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.45V" - endchoice config ESP_BROWNOUT_DET_LVL int - default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 - default 8 if ESP_BROWNOUT_DET_LVL_SEL_8 - default 9 if ESP_BROWNOUT_DET_LVL_SEL_9 - default 10 if ESP_BROWNOUT_DET_LVL_SEL_10 - default 11 if ESP_BROWNOUT_DET_LVL_SEL_11 - default 12 if ESP_BROWNOUT_DET_LVL_SEL_12 - default 13 if ESP_BROWNOUT_DET_LVL_SEL_13 - default 14 if ESP_BROWNOUT_DET_LVL_SEL_14 - default 15 if ESP_BROWNOUT_DET_LVL_SEL_15 - config ESP_BROWNOUT_USE_INTR bool