1choice RTC_CLK_SRC
2    prompt "RTC clock source"
3    default RTC_CLK_SRC_INT_RC
4    help
5        Choose which clock is used as RTC clock source.
6
7    config RTC_CLK_SRC_INT_RC
8        bool "Internal 136kHz RC oscillator"
9    config RTC_CLK_SRC_EXT_CRYS
10        bool "External 32kHz crystal"
11        select ESP_SYSTEM_RTC_EXT_XTAL
12    config RTC_CLK_SRC_EXT_OSC
13        bool "External 32kHz oscillator at 32K_XP pin"
14        select ESP_SYSTEM_RTC_EXT_OSC
15    config RTC_CLK_SRC_INT_8MD256
16        bool "Internal 17.5MHz oscillator, divided by 256"
17endchoice
18
19config RTC_CLK_CAL_CYCLES
20    int "Number of cycles for RTC_SLOW_CLK calibration"
21    default 3000 if RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC || RTC_CLK_SRC_INT_8MD256
22    default 1024 if RTC_CLK_SRC_INT_RC
23    range 0 8190 if RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC || RTC_CLK_SRC_INT_8MD256
24    range 0 32766 if RTC_CLK_SRC_INT_RC
25    help
26        When the startup code initializes RTC_SLOW_CLK, it can perform
27        calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
28        frequency. This option sets the number of RTC_SLOW_CLK cycles measured
29        by the calibration routine. Higher numbers increase calibration
30        precision, which may be important for applications which spend a lot of
31        time in deep sleep. Lower numbers reduce startup time.
32
33        When this option is set to 0, clock calibration will not be performed at
34        startup, and approximate clock frequencies will be assumed:
35
36        - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
37        - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
38            In case more value will help improve the definition of the launch of the crystal.
39            If the crystal could not start, it will be switched to internal RC.
40