feat(vbat): Add vbat support on esp32h2

This commit is contained in:
C.S.M
2025-01-16 15:45:56 +08:00
parent 14573ca6ed
commit f37de0d8d0
5 changed files with 340 additions and 7 deletions
@@ -179,6 +179,10 @@ config SOC_BOD_SUPPORTED
bool
default y
config SOC_VBAT_SUPPORTED
bool
default y
config SOC_APM_SUPPORTED
bool
default y
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -19,12 +19,12 @@
#define I2C_BOD I2C_PMU
#define I2C_BOD_HOSTID I2C_PMU_HOSTID
#define I2C_PMU_OR_DREFL_VBAT 17
#define I2C_PMU_OR_DREFL_VBAT_MSB 4
#define I2C_PMU_OR_DREFL_VBAT_LSB 2
#define I2C_PMU_OR_DREFH_VBAT 17
#define I2C_PMU_OR_DREFH_VBAT_MSB 7
#define I2C_PMU_OR_DREFH_VBAT_LSB 5
#define I2C_PMU_OR_DREF_VBAT_L 17
#define I2C_PMU_OR_DREF_VBAT_L_MSB 4
#define I2C_PMU_OR_DREF_VBAT_L_LSB 2
#define I2C_PMU_OR_DREF_VBAT_H 17
#define I2C_PMU_OR_DREF_VBAT_H_MSB 7
#define I2C_PMU_OR_DREF_VBAT_H_LSB 5
#define I2C_PMU_OR_XPD_DIGDET 18
#define I2C_PMU_OR_XPD_DIGDET_MSB 0
@@ -44,6 +44,22 @@
#define I2C_PMU_OR_DREFH_VDDA_MSB 7
#define I2C_PMU_OR_DREFH_VDDA_LSB 5
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_L 20
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_L_MSB 4
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_L_LSB 2
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_H 20
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_H_MSB 7
#define I2C_BIAS_OR_DREF_VBAT_CHARGER_H_LSB 5
#define I2C_BIAS_OR_FORCE_PU_VBAT_CHARGER 20
#define I2C_BIAS_OR_FORCE_PU_VBAT_CHARGER_MSB 0
#define I2C_BIAS_OR_FORCE_PU_VBAT_CHARGER_LSB 0
/** Change the charging current by adjusting the value of the series resistor. 1kΩ + N * 0.5kΩ */
#define I2C_BIAS_OR_DRES_CHARGER 15
#define I2C_BIAS_OR_DRES_CHARGER_MSB 7
#define I2C_BIAS_OR_DRES_CHARGER_LSB 4
#define I2C_BOD_THRESHOLD_L I2C_PMU_OR_DREFL_VDDA
#define I2C_BOD_THRESHOLD_L_MSB I2C_PMU_OR_DREFL_VDDA_MSB
#define I2C_BOD_THRESHOLD_L_LSB I2C_PMU_OR_DREFL_VDDA_LSB
@@ -77,6 +77,7 @@
#define SOC_FLASH_ENC_SUPPORTED 1
#define SOC_SECURE_BOOT_SUPPORTED 1
#define SOC_BOD_SUPPORTED 1
#define SOC_VBAT_SUPPORTED 1
#define SOC_APM_SUPPORTED 1 /*!< Support for APM peripheral */
#define SOC_PMU_SUPPORTED 1
#define SOC_LP_TIMER_SUPPORTED 1