1menu "Brownout Detector"
2    config ESP_BROWNOUT_DET
3        bool "Hardware brownout detect & reset"
4        depends on !IDF_ENV_FPGA
5        default y
6        help
7            The ESP32-C6 has a built-in brownout detector which can detect if the voltage is lower than
8            a specific value. If this happens, it will reset the chip in order to prevent unintended
9            behaviour.
10
11    choice ESP_BROWNOUT_DET_LVL_SEL
12        prompt "Brownout voltage level"
13        depends on ESP_BROWNOUT_DET
14        default ESP_BROWNOUT_DET_LVL_SEL_7
15        help
16            The brownout detector will reset the chip when the supply voltage is approximately
17            below this level. Note that there may be some variation of brownout voltage level
18            between each chip.
19
20            #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
21            #of the brownout threshold levels.
22        config ESP_BROWNOUT_DET_LVL_SEL_7
23            bool "2.51V"
24        config ESP_BROWNOUT_DET_LVL_SEL_6
25            bool "2.64V"
26        config ESP_BROWNOUT_DET_LVL_SEL_5
27            bool "2.76V"
28        config ESP_BROWNOUT_DET_LVL_SEL_4
29            bool "2.92V"
30        config ESP_BROWNOUT_DET_LVL_SEL_3
31            bool "3.10V"
32        config ESP_BROWNOUT_DET_LVL_SEL_2
33            bool "3.27V"
34    endchoice
35
36    config ESP_BROWNOUT_DET_LVL
37        int
38        default 2 if ESP_BROWNOUT_DET_LVL_SEL_2
39        default 3 if ESP_BROWNOUT_DET_LVL_SEL_3
40        default 4 if ESP_BROWNOUT_DET_LVL_SEL_4
41        default 5 if ESP_BROWNOUT_DET_LVL_SEL_5
42        default 6 if ESP_BROWNOUT_DET_LVL_SEL_6
43        default 7 if ESP_BROWNOUT_DET_LVL_SEL_7
44
45endmenu
46