Skip to content

Commit 8902d86

Browse files
committed
feat(regi2c): regi2c periph reg enable/disable ll
1 parent df20258 commit 8902d86

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

components/hal/esp32h2/include/hal/regi2c_ctrl_ll.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -11,6 +11,7 @@
1111
#include "soc/soc.h"
1212
#include "soc/regi2c_defs.h"
1313
#include "soc/i2c_ana_mst_reg.h"
14+
#include "soc/pmu_reg.h"
1415
#include "modem/modem_lpcon_struct.h"
1516

1617
#ifdef __cplusplus
@@ -112,6 +113,22 @@ static inline void regi2c_ctrl_ll_i2c_saradc_disable(void)
112113
SET_PERI_REG_MASK(I2C_MST_ANA_CONF2_REG, ANA_I2C_SAR_FORCE_PD);
113114
}
114115

116+
/**
117+
* @brief Enable regi2c controlled periph registers
118+
*/
119+
static inline void regi2c_ctrl_ll_i2c_periph_enable(void)
120+
{
121+
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
122+
}
123+
124+
/**
125+
* @brief Disable regi2c controlled periph registers
126+
*/
127+
static inline void regi2c_ctrl_ll_i2c_periph_disable(void)
128+
{
129+
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
130+
}
131+
115132
#ifdef __cplusplus
116133
}
117134
#endif

0 commit comments

Comments
 (0)