Line data Source code
1 0 : /*
2 : * Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_
8 : #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_
9 :
10 : #if defined(CONFIG_SOC_SERIES_ESP32)
11 : #include <zephyr/dt-bindings/clock/esp32_clock.h>
12 : #elif defined(CONFIG_SOC_SERIES_ESP32S2)
13 : #include <zephyr/dt-bindings/clock/esp32s2_clock.h>
14 : #elif defined(CONFIG_SOC_SERIES_ESP32S3)
15 : #include <zephyr/dt-bindings/clock/esp32s3_clock.h>
16 : #elif defined(CONFIG_SOC_SERIES_ESP32C2)
17 : #include <zephyr/dt-bindings/clock/esp32c2_clock.h>
18 : #elif defined(CONFIG_SOC_SERIES_ESP32C3)
19 : #include <zephyr/dt-bindings/clock/esp32c3_clock.h>
20 : #elif defined(CONFIG_SOC_SERIES_ESP32C6)
21 : #include <zephyr/dt-bindings/clock/esp32c6_clock.h>
22 : #elif defined(CONFIG_SOC_SERIES_ESP32H2)
23 : #include <zephyr/dt-bindings/clock/esp32h2_clock.h>
24 : #endif /* CONFIG_SOC_SERIES_ESP32xx */
25 :
26 0 : #define ESP32_CLOCK_CONTROL_SUBSYS_CPU 50
27 0 : #define ESP32_CLOCK_CONTROL_SUBSYS_RTC_FAST 51
28 0 : #define ESP32_CLOCK_CONTROL_SUBSYS_RTC_SLOW 52
29 :
30 0 : struct esp32_cpu_clock_config {
31 0 : int clk_src;
32 0 : uint32_t cpu_freq;
33 0 : uint32_t xtal_freq;
34 : };
35 :
36 0 : struct esp32_rtc_clock_config {
37 0 : uint32_t rtc_fast_clock_src;
38 0 : uint32_t rtc_slow_clock_src;
39 : };
40 :
41 0 : struct esp32_clock_config {
42 0 : struct esp32_cpu_clock_config cpu;
43 0 : struct esp32_rtc_clock_config rtc;
44 : };
45 :
46 : #endif /* ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_ */
|