File tree Expand file tree Collapse file tree 33 files changed +216
-48
lines changed Expand file tree Collapse file tree 33 files changed +216
-48
lines changed Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -172,6 +172,11 @@ void rtc_clk_32k_enable(bool en);
172172 */
173173void rtc_clk_32k_enable_external (void );
174174
175+ /**
176+ * @brief Disable 32 kHz XTAL oscillator input.
177+ */
178+ void rtc_clk_32k_disable_external (void );
179+
175180/**
176181 * @brief Get the state of 32k XTAL oscillator
177182 * @return true if 32k XTAL oscillator has been enabled
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -115,6 +115,11 @@ void rtc_clk_32k_enable_external(void)
115115 rtc_clk_32k_enable_common (CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL );
116116}
117117
118+ void rtc_clk_32k_disable_external (void )
119+ {
120+ clk_ll_xtal32k_disable ();
121+ }
122+
118123/* Helping external 32kHz crystal to start up.
119124 * External crystal connected to outputs GPIO32 GPIO33.
120125 * Forms N pulses with a frequency of about 32KHz on the outputs of the crystal.
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -257,6 +257,11 @@ void rtc_clk_xtal_freq_update(soc_xtal_freq_t xtal_freq);
257257 */
258258void rtc_clk_32k_enable_external (void );
259259
260+ /**
261+ * @brief Disable 32KHz external oscillator
262+ */
263+ void rtc_clk_32k_disable_external (void );
264+
260265/**
261266 * @brief Enable or disable 8 MHz internal oscillator
262267 *
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -37,6 +37,12 @@ void rtc_clk_32k_enable_external(void)
3737 REG_SET_BIT (RTC_CNTL_PAD_HOLD_REG , BIT (EXT_OSC_SLOW_GPIO_NUM ));
3838}
3939
40+ void rtc_clk_32k_disable_external (void )
41+ {
42+ PIN_INPUT_DISABLE (IO_MUX_GPIO0_REG );
43+ REG_CLR_BIT (RTC_CNTL_PAD_HOLD_REG , BIT (EXT_OSC_SLOW_GPIO_NUM ));
44+ }
45+
4046void rtc_clk_8m_enable (bool clk_8m_en , bool d256_en )
4147{
4248 if (clk_8m_en ) {
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -263,6 +263,11 @@ void rtc_clk_32k_enable(bool en);
263263 */
264264void rtc_clk_32k_enable_external (void );
265265
266+ /**
267+ * @brief Disable 32 kHz XTAL oscillator input.
268+ */
269+ void rtc_clk_32k_disable_external (void );
270+
266271/**
267272 * @brief Get the state of 32k XTAL oscillator
268273 * @return true if 32k XTAL oscillator has been enabled
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -56,6 +56,13 @@ void rtc_clk_32k_enable_external(void)
5656 clk_ll_xtal32k_enable (CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL );
5757}
5858
59+ void rtc_clk_32k_disable_external (void )
60+ {
61+ PIN_INPUT_DISABLE (IO_MUX_GPIO0_REG );
62+ CLEAR_PERI_REG_MASK (RTC_CNTL_PAD_HOLD_REG , RTC_CNTL_GPIO_PIN0_HOLD );
63+ clk_ll_xtal32k_disable ();
64+ }
65+
5966void rtc_clk_32k_bootstrap (uint32_t cycle )
6067{
6168 /* No special bootstrapping needed for ESP32-C3, 'cycle' argument is to keep the signature
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -181,6 +181,11 @@ void rtc_clk_32k_enable(bool en);
181181 */
182182void rtc_clk_32k_enable_external (void );
183183
184+ /**
185+ * @brief Disable 32 kHz XTAL oscillator input.
186+ */
187+ void rtc_clk_32k_disable_external (void );
188+
184189/**
185190 * @brief Get the state of 32k XTAL oscillator
186191 * @return true if 32k XTAL oscillator has been enabled
Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -58,6 +58,13 @@ void rtc_clk_32k_enable_external(void)
5858 clk_ll_xtal32k_enable (CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL );
5959}
6060
61+ void rtc_clk_32k_disable_external (void )
62+ {
63+ gpio_ll_input_disable (& GPIO , EXT_OSC_SLOW_GPIO_NUM );
64+ REG_CLR_BIT (LP_AON_GPIO_HOLD0_REG , BIT (EXT_OSC_SLOW_GPIO_NUM ));
65+ clk_ll_xtal32k_disable ();
66+ }
67+
6168void rtc_clk_32k_bootstrap (uint32_t cycle )
6269{
6370 /* No special bootstrapping needed for ESP32-C5, 'cycle' argument is to keep the signature
Original file line number Diff line number Diff line change 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 */
@@ -205,6 +205,11 @@ void rtc_clk_32k_enable(bool en);
205205 */
206206void rtc_clk_32k_enable_external (void );
207207
208+ /**
209+ * @brief Disable 32 kHz XTAL oscillator input.
210+ */
211+ void rtc_clk_32k_disable_external (void );
212+
208213/**
209214 * @brief Get the state of 32k XTAL oscillator
210215 * @return true if 32k XTAL oscillator has been enabled
Original file line number Diff line number Diff line change 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 */
@@ -56,6 +56,13 @@ void rtc_clk_32k_enable_external(void)
5656 clk_ll_xtal32k_enable (CLK_LL_XTAL32K_ENABLE_MODE_EXTERNAL );
5757}
5858
59+ void rtc_clk_32k_disable_external (void )
60+ {
61+ PIN_INPUT_DISABLE (IO_MUX_GPIO0_REG );
62+ REG_CLR_BIT (LP_AON_GPIO_HOLD0_REG , BIT (EXT_OSC_SLOW_GPIO_NUM ));
63+ clk_ll_xtal32k_disable ();
64+ }
65+
5966void rtc_clk_32k_bootstrap (uint32_t cycle )
6067{
6168 /* No special bootstrapping needed for ESP32-C6, 'cycle' argument is to keep the signature
You can’t perform that action at this time.
0 commit comments