1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include "sdkconfig.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16  * @file esp_clk_internal.h
17  *
18  * Private clock-related functions
19  */
20 
21 /**
22  * @brief Initialize rtc-related settings
23  *
24  * Called from cpu_start.c, not intended to be called from other places.
25  * This function configures the power related stuff.
26  * After this the MSPI timing tuning can be done.
27  */
28 void esp_rtc_init(void);
29 
30 /**
31  * @brief Initialize clock-related settings
32  *
33  * Called from cpu_start.c, not intended to be called from other places.
34  * This function configures the CPU clock, RTC slow and fast clocks, and
35  * performs RTC slow clock calibration.
36  */
37 void esp_clk_init(void);
38 
39 
40 /**
41  * @brief Disables clock of some peripherals
42  *
43  * Called from cpu_start.c, not intended to be called from other places.
44  * This function disables clock of useless peripherals when cpu starts.
45  */
46 void esp_perip_clk_init(void);
47 
48 #if !CONFIG_IDF_TARGET_ESP32C2
49 /* Selects an external clock source (32 kHz) for RTC.
50  * Only internal use in unit test.
51  */
52 void rtc_clk_select_rtc_slow_clk(void);
53 #endif
54 
55 #ifdef __cplusplus
56 }
57 #endif
58