mirror of
https://github.com/espressif/esp-idf
synced 2025-03-31 03:41:07 -04:00
fix(bod): Remove config for bod on p4 v0.x
This commit is contained in:
parent
4049f2b5fb
commit
0a437b0ea0
@ -10,55 +10,30 @@ menu "Brownout Detector"
|
|||||||
|
|
||||||
choice ESP_BROWNOUT_DET_LVL_SEL
|
choice ESP_BROWNOUT_DET_LVL_SEL
|
||||||
prompt "Brownout voltage level"
|
prompt "Brownout voltage level"
|
||||||
depends on ESP_BROWNOUT_DET && (ESP32P4_REV_MIN_FULL <= 1)
|
|
||||||
default ESP_BROWNOUT_DET_LVL_SEL_7
|
default ESP_BROWNOUT_DET_LVL_SEL_7
|
||||||
|
depends on ESP_BROWNOUT_DET
|
||||||
help
|
help
|
||||||
The brownout detector will reset the chip when the supply voltage is approximately
|
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
|
below this level. Note that there may be some variation of brownout voltage level
|
||||||
between each chip.
|
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
|
#The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
|
||||||
#of the brownout threshold levels.
|
#of the brownout threshold levels.
|
||||||
config ESP_BROWNOUT_DET_LVL_SEL_7
|
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
|
|
||||||
|
|
||||||
choice ESP_BROWNOUT_DET_LVL_SEL_V2
|
|
||||||
prompt "Brownout voltage level"
|
|
||||||
default ESP_BROWNOUT_DET_LVL_SEL_7_V2
|
|
||||||
depends on ESP_BROWNOUT_DET && (ESP32P4_REV_MIN_FULL >= 100)
|
|
||||||
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_V2
|
|
||||||
bool "2.6V"
|
bool "2.6V"
|
||||||
config ESP_BROWNOUT_DET_LVL_SEL_6_V2
|
config ESP_BROWNOUT_DET_LVL_SEL_6
|
||||||
bool "2.52V"
|
bool "2.52V"
|
||||||
config ESP_BROWNOUT_DET_LVL_SEL_5_V2
|
config ESP_BROWNOUT_DET_LVL_SEL_5
|
||||||
bool "2.42V"
|
bool "2.42V"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config ESP_BROWNOUT_DET_LVL
|
config ESP_BROWNOUT_DET_LVL
|
||||||
int
|
int
|
||||||
default 2 if ESP_BROWNOUT_DET_LVL_SEL_2
|
default 5 if ESP_BROWNOUT_DET_LVL_SEL_5
|
||||||
default 3 if ESP_BROWNOUT_DET_LVL_SEL_3
|
default 6 if ESP_BROWNOUT_DET_LVL_SEL_6
|
||||||
default 4 if ESP_BROWNOUT_DET_LVL_SEL_4
|
default 7 if ESP_BROWNOUT_DET_LVL_SEL_7
|
||||||
default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 || ESP_BROWNOUT_DET_LVL_SEL_5_V2
|
|
||||||
default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 || ESP_BROWNOUT_DET_LVL_SEL_6_V2
|
|
||||||
default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 || ESP_BROWNOUT_DET_LVL_SEL_7_V2
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
#include "soc/lp_analog_peri_struct.h"
|
#include "soc/lp_analog_peri_struct.h"
|
||||||
#include "hal/regi2c_ctrl.h"
|
#include "hal/regi2c_ctrl.h"
|
||||||
#include "soc/regi2c_brownout.h"
|
#include "soc/regi2c_brownout.h"
|
||||||
|
#include "hal/efuse_hal.h"
|
||||||
|
#include "soc/chip_revision.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -62,6 +64,9 @@ static inline void brownout_ll_reset_config(bool reset_ena, uint32_t reset_wait,
|
|||||||
*/
|
*/
|
||||||
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
||||||
{
|
{
|
||||||
|
if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 100)) {
|
||||||
|
threshold = 0; // Fix this level as 0 so that on v0.x brownout value will be fixed around 2.52v.
|
||||||
|
}
|
||||||
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_L, threshold);
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_L, threshold);
|
||||||
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_H, threshold);
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_H, threshold);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user