mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(ext_32k): fix the external 32K issue on C3&S3 (v5.3)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "sdkconfig.h"
|
||||
#include "esp32c3/rom/rtc.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "esp_private/rtc_clk.h"
|
||||
#include "esp_hw_log.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -49,6 +50,8 @@ void rtc_clk_32k_enable(bool enable)
|
||||
|
||||
void rtc_clk_32k_enable_external(void)
|
||||
{
|
||||
PIN_INPUT_ENABLE(IO_MUX_GPIO0_REG);
|
||||
SET_PERI_REG_MASK(RTC_CNTL_PAD_HOLD_REG, RTC_CNTL_GPIO_PIN0_HOLD);
|
||||
clk_ll_xtal32k_enable(CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "sdkconfig.h"
|
||||
#include "esp32s3/rom/rtc.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "esp_private/rtc_clk.h"
|
||||
#include "soc/rtc_io_reg.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -20,6 +21,7 @@
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "esp_private/regi2c_ctrl.h"
|
||||
#include "soc/regi2c_dig_reg.h"
|
||||
#include "soc/sens_reg.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
static const char *TAG = "rtc_clk";
|
||||
@@ -62,8 +64,9 @@ void rtc_clk_32k_enable(bool enable)
|
||||
|
||||
void rtc_clk_32k_enable_external(void)
|
||||
{
|
||||
SET_PERI_REG_MASK(RTC_IO_XTAL_32P_PAD_REG, RTC_IO_X32P_MUX_SEL);
|
||||
SET_PERI_REG_MASK(RTC_IO_XTAL_32N_PAD_REG, RTC_IO_X32N_MUX_SEL);
|
||||
PIN_INPUT_ENABLE(IO_MUX_GPIO15_REG);
|
||||
SET_PERI_REG_MASK(SENS_SAR_PERI_CLK_GATE_CONF_REG, SENS_IOMUX_CLK_EN);
|
||||
SET_PERI_REG_MASK(RTC_CNTL_PAD_HOLD_REG, RTC_CNTL_X32P_HOLD);
|
||||
clk_ll_xtal32k_enable(CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user