From 349d1dbd33ffe60de2f9bcc10d8c2eab828b6ecd Mon Sep 17 00:00:00 2001 From: "C.S.M" Date: Wed, 15 Jan 2025 11:41:35 +0800 Subject: [PATCH] refactor(bod): Rename kconfig.bod to kconfig.power --- .../power_supply/port/esp32/Kconfig.bod | 64 ------- .../power_supply/port/esp32/Kconfig.power | 68 ++++++++ .../power_supply/port/esp32c2/Kconfig.bod | 55 ------ .../power_supply/port/esp32c2/Kconfig.power | 59 +++++++ .../power_supply/port/esp32c3/Kconfig.bod | 55 ------ .../power_supply/port/esp32c3/Kconfig.power | 59 +++++++ .../power_supply/port/esp32c5/Kconfig.bod | 55 ------ .../power_supply/port/esp32c5/Kconfig.power | 59 +++++++ .../power_supply/port/esp32c6/Kconfig.bod | 55 ------ .../power_supply/port/esp32c6/Kconfig.power | 59 +++++++ .../power_supply/port/esp32c61/Kconfig.bod | 55 ------ .../power_supply/port/esp32c61/Kconfig.power | 59 +++++++ .../power_supply/port/esp32h2/Kconfig.bod | 61 ------- .../power_supply/port/esp32h2/Kconfig.power | 65 +++++++ .../power_supply/port/esp32h21/Kconfig.bod | 61 ------- .../power_supply/port/esp32h21/Kconfig.power | 65 +++++++ .../power_supply/port/esp32p4/Kconfig.bod | 49 ------ .../power_supply/port/esp32p4/Kconfig.power | 159 ++++++++++++++++++ .../power_supply/port/esp32s2/Kconfig.bod | 59 ------- .../power_supply/port/esp32s2/Kconfig.power | 63 +++++++ .../power_supply/port/esp32s3/Kconfig.bod | 59 ------- .../power_supply/port/esp32s3/Kconfig.power | 63 +++++++ 22 files changed, 778 insertions(+), 628 deletions(-) delete mode 100644 components/esp_hw_support/power_supply/port/esp32/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32c2/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32c3/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32c5/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32c6/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32c61/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32h2/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32p4/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32s2/Kconfig.power delete mode 100644 components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod create mode 100644 components/esp_hw_support/power_supply/port/esp32s3/Kconfig.power diff --git a/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod deleted file mode 100644 index b79c97eb6b..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod +++ /dev/null @@ -1,64 +0,0 @@ -menu "Brownout Detector" - - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_0 - 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 ESP chip. - - #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_0 - bool "2.43V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "2.48V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.58V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.62V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.67V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.70V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.77V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_7 - bool "2.80V +/- 0.05" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - Two occasions need to restart the chip with interrupt so far. - (1). For ESP32 version 1, brown-out reset function doesn't work (see ESP32 errata 3.4). - So that we must restart from interrupt. - (2). For special workflow, the chip needs do more things instead of restarting directly. This part - needs to be done in callback function of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32/Kconfig.power new file mode 100644 index 0000000000..628b3bfa8d --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32/Kconfig.power @@ -0,0 +1,68 @@ +menu "Power Supplier" + + menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_0 + 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 ESP chip. + + #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_0 + bool "2.43V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "2.48V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "2.58V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.62V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.67V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.70V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.77V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.80V +/- 0.05" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + Two occasions need to restart the chip with interrupt so far. + (1). For ESP32 version 1, brown-out reset function doesn't work (see ESP32 errata 3.4). + So that we must restart from interrupt. + (2). For special workflow, the chip needs do more things instead of restarting directly. This part + needs to be done in callback function of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod deleted file mode 100644 index 0d0fb822e7..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod +++ /dev/null @@ -1,55 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-C2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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. - - #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_7 - bool "2.51V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.power new file mode 100644 index 0000000000..a57499977b --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.power @@ -0,0 +1,59 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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. + + #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_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod deleted file mode 100644 index 19eb8e94d9..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod +++ /dev/null @@ -1,55 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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. - - #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_7 - bool "2.51V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.power new file mode 100644 index 0000000000..4b0903f401 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.power @@ -0,0 +1,59 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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. + + #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_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod deleted file mode 100644 index 4583c6bee3..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod +++ /dev/null @@ -1,55 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA && SOC_BOD_SUPPORTED - default y - help - The ESP32-C5 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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. - - #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_7 - bool "2.51V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.power new file mode 100644 index 0000000000..1bc2552c8b --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.power @@ -0,0 +1,59 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C5 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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. + + #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_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod deleted file mode 100644 index 5c3d440e83..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod +++ /dev/null @@ -1,55 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-C6 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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. - - #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_7 - bool "2.51V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.power new file mode 100644 index 0000000000..cccc749093 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.power @@ -0,0 +1,59 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C6 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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. + + #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_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod deleted file mode 100644 index f1b083e18a..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod +++ /dev/null @@ -1,55 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-C61 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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. - - #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_7 - bool "2.51V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.power new file mode 100644 index 0000000000..50291ad626 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.power @@ -0,0 +1,59 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C61 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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. + + #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_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod deleted file mode 100644 index d0a38ee74f..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod +++ /dev/null @@ -1,61 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-H2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_0 - 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. - - #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_7 - bool "2.94V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.88V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.83V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.78V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.73V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.67V" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "2.62V" - config ESP_BROWNOUT_DET_LVL_SEL_0 - bool "2.57V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.power new file mode 100644 index 0000000000..441d6d5683 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.power @@ -0,0 +1,65 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-H2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_0 + 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. + + #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_7 + bool "2.94V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.88V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.83V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.78V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.73V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "2.62V" + config ESP_BROWNOUT_DET_LVL_SEL_0 + bool "2.57V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod deleted file mode 100644 index 61eca9bba6..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod +++ /dev/null @@ -1,61 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-H21 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_0 - 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. - - #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_7 - bool "2.94V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.88V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.83V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.78V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.73V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.67V" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "2.62V" - config ESP_BROWNOUT_DET_LVL_SEL_0 - bool "2.57V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power new file mode 100644 index 0000000000..d01bbdfe72 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.power @@ -0,0 +1,65 @@ +menu "Power Supplier" + + menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-H21 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_0 + 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. + + #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_7 + bool "2.94V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.88V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.83V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.78V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.73V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "2.62V" + config ESP_BROWNOUT_DET_LVL_SEL_0 + bool "2.57V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod deleted file mode 100644 index 14a7a2dc23..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod +++ /dev/null @@ -1,49 +0,0 @@ -menu "Brownout Detector" - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-P4 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - default ESP_BROWNOUT_DET_LVL_SEL_7 - depends on ESP_BROWNOUT_DET - 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. - - Please note that this config is only valid when P4 SOC version is above v1.0. When you are using a - earlier P4 SOC version (v0.x), the brownout value should be fixed around 2.52V and not configurable. - - #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_7 - bool "2.6V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.52V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.42V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.power new file mode 100644 index 0000000000..2e308de598 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.power @@ -0,0 +1,159 @@ +menu "Power Supplier" + + menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-P4 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + default ESP_BROWNOUT_DET_LVL_SEL_7 + depends on ESP_BROWNOUT_DET + 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. + + Please note that this config is only valid when P4 SOC version is above v1.0. When you are using a + earlier P4 SOC version (v0.x), the brownout value should be fixed around 2.52V and not configurable. + + #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_7 + bool "2.6V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.52V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.42V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + + menu "RTC Backup Battery" + + config ESP_VBAT_INIT_AUTO + bool "Enable VBAT power supply for RTC battery" + default n + depends on SOC_VBAT_SUPPORTED + help + Enable this option to allow the use of a button cell battery to power the RTC (Real-Time Clock) domain. + When this option is enabled, the hardware will configure VBAT as the power supply source for the RTC. + + - Ensure a compatible battery (2.5V ~ 3.6V) is connected to the VBAT pin. + - The VBAT battery provides power to retain RTC state and keep low-power peripherals active + during deep sleep. + - When this option is disabled, the RTC battery input (VBAT) must not be left floating. + + config ESP_VBAT_USE_RECHARGEABLE_BATTERY + bool "The battery for RTC battery is a rechargeable battery" + default n + depends on ESP_VBAT_INIT_AUTO + help + Select this option if the RTC backup battery used in your design is a rechargeable battery. + + When enabled, the system will configure the RTC battery management circuitry to operate + in a mode suitable for charging a rechargeable battery. This includes enabling + charging current regulation via resistor and voltage monitoring to ensure safe and efficient charging. + + Use this option carefully to avoid damage to non-rechargeable batteries. + + choice ESP_VBAT_DET_LVL_LOW_SEL + prompt "VBAT start charging voltage level" + default ESP_VBAT_DET_LVL_LOW_SEL_6 + depends on ESP_VBAT_USE_RECHARGEABLE_BATTERY + help + The brownout detector will start charging when the supply voltage drops below the selected threshold. + This ensures that the power supply is maintained at a stable level. + + config ESP_VBAT_DET_LVL_LOW_SEL_7 + bool "2.6V" + config ESP_VBAT_DET_LVL_LOW_SEL_6 + bool "2.52V" + config ESP_VBAT_DET_LVL_LOW_SEL_5 + bool "2.42V" + endchoice + + choice ESP_VBAT_DET_LVL_HIGH_SEL + prompt "VBAT stop charging voltage level" + default ESP_VBAT_DET_LVL_HIGH_SEL_7 + depends on ESP_VBAT_USE_RECHARGEABLE_BATTERY + help + The brownout detector will stop charging when the supply voltage arrives the selected threshold. + + config ESP_VBAT_DET_LVL_HIGH_SEL_7 + bool "2.6V" + config ESP_VBAT_DET_LVL_HIGH_SEL_6 + bool "2.52V" + config ESP_VBAT_DET_LVL_HIGH_SEL_5 + bool "2.42V" + endchoice + + choice ESP_VBAT_BROWNOUT_DET_LVL_SEL + prompt "VBAT brownout voltage level" + default ESP_VBAT_BROWNOUT_DET_LVL_SEL_5 + depends on ESP_VBAT_INIT_AUTO + help + The brownout detector will git a brownout signal when vbat brownout detected. + + config ESP_VBAT_BROWNOUT_DET_LVL_SEL_7 + bool "2.6V" + config ESP_VBAT_BROWNOUT_DET_LVL_SEL_6 + bool "2.52V" + config ESP_VBAT_BROWNOUT_DET_LVL_SEL_5 + bool "2.42V" + endchoice + + config ESP_VBAT_DET_LVL_LOW + int + depends on ESP_VBAT_USE_RECHARGEABLE_BATTERY + default 5 if ESP_VBAT_DET_LVL_LOW_SEL_5 + default 6 if ESP_VBAT_DET_LVL_LOW_SEL_6 + default 7 if ESP_VBAT_DET_LVL_LOW_SEL_7 + + config ESP_VBAT_DET_LVL_HIGH + int + depends on ESP_VBAT_USE_RECHARGEABLE_BATTERY + default 5 if ESP_VBAT_DET_LVL_HIGH_SEL_5 + default 6 if ESP_VBAT_DET_LVL_HIGH_SEL_6 + default 7 if ESP_VBAT_DET_LVL_HIGH_SEL_7 + + config ESP_VBAT_BROWNOUT_DET_LVL + int + default 5 if ESP_VBAT_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_VBAT_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_VBAT_BROWNOUT_DET_LVL_SEL_7 + + config ESP_VBAT_CHARGER_CIRCUIT_RESISTOR_VAL + int "vbat charger circuit resistor value (ohms), should be multiple of 500" + depends on ESP_VBAT_USE_RECHARGEABLE_BATTERY + range 1000 8500 + default 1000 + help + The resistor value of charger circuit. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod deleted file mode 100644 index d7103f235c..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod +++ /dev/null @@ -1,59 +0,0 @@ -menu "Brownout Detector" - - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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 ESP3-S2 chip. - - #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_7 - bool "2.44V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.56V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.67V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.84V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.98V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.19V" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "3.30V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.power new file mode 100644 index 0000000000..56611086c3 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.power @@ -0,0 +1,63 @@ +menu "Power Supplier" + + menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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 ESP3-S2 chip. + + #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_7 + bool "2.44V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.56V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.84V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.98V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.19V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "3.30V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod deleted file mode 100644 index 6db64c1147..0000000000 --- a/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod +++ /dev/null @@ -1,59 +0,0 @@ -menu "Brownout Detector" - - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-S3 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - 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 ESP3-S3 chip. - - #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_7 - bool "2.44V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.56V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.67V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.84V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.98V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.19V" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "3.30V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - 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 - - config ESP_BROWNOUT_USE_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - This is because for some special workflow, the chip needs do more things when brownout happens - before restart instead of restarting directly. This part needs to be done in callback function - of interrupt. - -endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.power b/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.power new file mode 100644 index 0000000000..d8a3d5ac10 --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.power @@ -0,0 +1,63 @@ +menu "Power Supplier" + + menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-S3 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + 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 ESP3-S3 chip. + + #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_7 + bool "2.44V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.56V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.84V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.98V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.19V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "3.30V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + 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 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + + endmenu + +endmenu