1menu "ESP32C3-Specific"
2    visible if IDF_TARGET_ESP32C3
3
4    choice ESP32C3_DEFAULT_CPU_FREQ_MHZ
5        prompt "CPU frequency"
6        default ESP32C3_DEFAULT_CPU_FREQ_40 if IDF_ENV_FPGA
7        default ESP32C3_DEFAULT_CPU_FREQ_160 if !IDF_ENV_FPGA
8        help
9            CPU frequency to be set on application startup.
10
11        config ESP32C3_DEFAULT_CPU_FREQ_40
12            bool "40 MHz"
13            depends on IDF_ENV_FPGA
14        config ESP32C3_DEFAULT_CPU_FREQ_80
15            bool "80 MHz"
16        config ESP32C3_DEFAULT_CPU_FREQ_160
17            bool "160 MHz"
18    endchoice
19
20    config ESP32C3_DEFAULT_CPU_FREQ_MHZ
21        int
22        default 40 if ESP32C3_DEFAULT_CPU_FREQ_40
23        default 80 if ESP32C3_DEFAULT_CPU_FREQ_80
24        default 160 if ESP32C3_DEFAULT_CPU_FREQ_160
25
26    choice ESP32C3_REV_MIN
27        prompt "Minimum Supported ESP32-C3 Revision"
28        default ESP32C3_REV_MIN_3
29        help
30            Minimum revision that ESP-IDF would support.
31
32            Only supporting higher chip revisions can reduce binary size.
33
34        config ESP32C3_REV_MIN_0
35            bool "Rev 0"
36        config ESP32C3_REV_MIN_1
37            bool "Rev 1"
38        config ESP32C3_REV_MIN_2
39            bool "Rev 2"
40        config ESP32C3_REV_MIN_3
41            bool "Rev 3"
42    endchoice
43
44    config ESP32C3_REV_MIN
45        int
46        default 0 if ESP32C3_REV_MIN_0
47        default 1 if ESP32C3_REV_MIN_1
48        default 2 if ESP32C3_REV_MIN_2
49        default 3 if ESP32C3_REV_MIN_3
50
51    config ESP32C3_DEBUG_OCDAWARE
52        bool "Make exception and panic handlers JTAG/OCD aware"
53        default y
54        select FREERTOS_DEBUG_OCDAWARE
55        help
56            The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and
57            instead of panicking, have the debugger stop on the offending instruction.
58
59    config ESP32C3_BROWNOUT_DET
60        bool "Hardware brownout detect & reset"
61        depends on !IDF_ENV_FPGA
62        default y
63        help
64            The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than
65            a specific value. If this happens, it will reset the chip in order to prevent unintended
66            behaviour.
67
68    choice ESP32C3_BROWNOUT_DET_LVL_SEL
69        prompt "Brownout voltage level"
70        depends on ESP32C3_BROWNOUT_DET
71        default ESP32C3_BROWNOUT_DET_LVL_SEL_7
72        help
73            The brownout detector will reset the chip when the supply voltage is approximately
74            below this level. Note that there may be some variation of brownout voltage level
75            between each chip.
76
77            #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
78            #of the brownout threshold levels.
79        config ESP32C3_BROWNOUT_DET_LVL_SEL_7
80            bool "2.51V"
81        config ESP32C3_BROWNOUT_DET_LVL_SEL_6
82            bool "2.64V"
83        config ESP32C3_BROWNOUT_DET_LVL_SEL_5
84            bool "2.76V"
85        config ESP32C3_BROWNOUT_DET_LVL_SEL_4
86            bool "2.92V"
87        config ESP32C3_BROWNOUT_DET_LVL_SEL_3
88            bool "3.10V"
89        config ESP32C3_BROWNOUT_DET_LVL_SEL_2
90            bool "3.27V"
91    endchoice
92
93    config ESP32C3_BROWNOUT_DET_LVL
94        int
95        default 2 if ESP32C3_BROWNOUT_DET_LVL_SEL_2
96        default 3 if ESP32C3_BROWNOUT_DET_LVL_SEL_3
97        default 4 if ESP32C3_BROWNOUT_DET_LVL_SEL_4
98        default 5 if ESP32C3_BROWNOUT_DET_LVL_SEL_5
99        default 6 if ESP32C3_BROWNOUT_DET_LVL_SEL_6
100        default 7 if ESP32C3_BROWNOUT_DET_LVL_SEL_7
101
102    choice ESP32C3_TIME_SYSCALL
103        prompt "Timers used for gettimeofday function"
104        default ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER
105        help
106            This setting defines which hardware timers are used to
107            implement 'gettimeofday' and 'time' functions in C library.
108
109            - If both high-resolution (systimer) and RTC timers are used, timekeeping will
110              continue in deep sleep. Time will be reported at 1 microsecond
111              resolution. This is the default, and the recommended option.
112            - If only high-resolution timer (systimer) is used, gettimeofday will
113              provide time at microsecond resolution.
114              Time will not be preserved when going into deep sleep mode.
115            - If only RTC timer is used, timekeeping will continue in
116              deep sleep, but time will be measured at 6.(6) microsecond
117              resolution. Also the gettimeofday function itself may take
118              longer to run.
119            - If no timers are used, gettimeofday and time functions
120              return -1 and set errno to ENOSYS.
121            - When RTC is used for timekeeping, two RTC_STORE registers are
122              used to keep time in deep sleep mode.
123
124        config ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER
125            bool "RTC and high-resolution timer"
126            select ESP_TIME_FUNCS_USE_RTC_TIMER
127            select ESP_TIME_FUNCS_USE_ESP_TIMER
128        config ESP32C3_TIME_SYSCALL_USE_RTC
129            bool "RTC"
130            select ESP_TIME_FUNCS_USE_RTC_TIMER
131        config ESP32C3_TIME_SYSCALL_USE_SYSTIMER
132            bool "High-resolution timer"
133            select ESP_TIME_FUNCS_USE_ESP_TIMER
134        config ESP32C3_TIME_SYSCALL_USE_NONE
135            bool "None"
136            select ESP_TIME_FUNCS_USE_NONE
137    endchoice
138
139    choice ESP32C3_RTC_CLK_SRC
140        prompt "RTC clock source"
141        default ESP32C3_RTC_CLK_SRC_INT_RC
142        help
143            Choose which clock is used as RTC clock source.
144
145        config ESP32C3_RTC_CLK_SRC_INT_RC
146            bool "Internal 150kHz RC oscillator"
147        config ESP32C3_RTC_CLK_SRC_EXT_CRYS
148            bool "External 32kHz crystal"
149            select ESP_SYSTEM_RTC_EXT_XTAL
150        config ESP32C3_RTC_CLK_SRC_EXT_OSC
151            bool "External 32kHz oscillator at 32K_XP pin"
152            select ESP_SYSTEM_RTC_EXT_OSC
153        config ESP32C3_RTC_CLK_SRC_INT_8MD256
154            bool "Internal 8MHz oscillator, divided by 256 (~32kHz)"
155    endchoice
156
157    config ESP32C3_RTC_CLK_CAL_CYCLES
158        int "Number of cycles for RTC_SLOW_CLK calibration"
159        default 3000 if ESP32C3_RTC_CLK_SRC_EXT_CRYS || ESP32C3_RTC_CLK_SRC_EXT_OSC || ESP32C3_RTC_CLK_SRC_INT_8MD256
160        default 1024 if ESP32C3_RTC_CLK_SRC_INT_RC
161        range 0 27000 if ESP32C3_RTC_CLK_SRC_EXT_CRYS || ESP32C3_RTC_CLK_SRC_EXT_OSC || ESP32C3_RTC_CLK_SRC_INT_8MD256
162        range 0 32766 if ESP32C3_RTC_CLK_SRC_INT_RC
163        help
164            When the startup code initializes RTC_SLOW_CLK, it can perform
165            calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
166            frequency. This option sets the number of RTC_SLOW_CLK cycles measured
167            by the calibration routine. Higher numbers increase calibration
168            precision, which may be important for applications which spend a lot of
169            time in deep sleep. Lower numbers reduce startup time.
170
171            When this option is set to 0, clock calibration will not be performed at
172            startup, and approximate clock frequencies will be assumed:
173
174            - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
175            - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
176              In case more value will help improve the definition of the launch of the crystal.
177              If the crystal could not start, it will be switched to internal RC.
178
179    config ESP32C3_NO_BLOBS
180        bool "No Binary Blobs"
181        depends on !BT_ENABLED
182        default n
183        help
184            If enabled, this disables the linking of binary libraries in the application build. Note
185            that after enabling this Wi-Fi/Bluetooth will not work.
186
187endmenu  # ESP32C3-Specific
188