We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a3b9b0 commit 713f40dCopy full SHA for 713f40d
ports/esp32/lockfiles/dependencies.lock.esp32c5
@@ -0,0 +1,21 @@
1
+dependencies:
2
+ espressif/mdns:
3
+ component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
4
+ dependencies:
5
+ - name: idf
6
+ require: private
7
+ version: '>=5.0'
8
+ source:
9
+ registry_url: https://components.espressif.com/
10
+ type: service
11
+ version: 1.1.0
12
+ idf:
13
14
+ type: idf
15
+ version: 5.5.1
16
+direct_dependencies:
17
+- espressif/mdns
18
+- idf
19
+manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
20
+target: esp32c5
21
+version: 2.0.0
ports/esp32/machine_adc.c
@@ -100,6 +100,13 @@ static const machine_adc_obj_t madc_obj[] = {
100
{{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_3, GPIO_NUM_3},
101
{{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_4, GPIO_NUM_4},
102
{{&machine_adc_type}, ADCBLOCK2, ADC_CHANNEL_0, GPIO_NUM_5},
103
+ #elif CONFIG_IDF_TARGET_ESP32C5
104
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_0, GPIO_NUM_1},
105
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_1, GPIO_NUM_2},
106
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_2, GPIO_NUM_3},
107
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_3, GPIO_NUM_4},
108
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_4, GPIO_NUM_5},
109
+ {{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_5, GPIO_NUM_6},
110
#elif CONFIG_IDF_TARGET_ESP32C6
111
{{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_0, GPIO_NUM_0},
112
{{&machine_adc_type}, ADCBLOCK1, ADC_CHANNEL_1, GPIO_NUM_1},
ports/esp32/machine_i2c.c
@@ -35,6 +35,7 @@
35
#include "driver/i2c_master.h"
36
#else
37
#include "driver/i2c.h"
38
+#include "esp_clk_tree.h"
39
#include "hal/i2c_ll.h"
40
#endif
41
@@ -224,6 +225,8 @@ int machine_hw_i2c_transfer(mp_obj_base_t *self_in, uint16_t addr, size_t n, mp_
224
225
#if SOC_I2C_SUPPORT_XTAL
226
#if CONFIG_XTAL_FREQ > 0
227
#define I2C_SCLK_FREQ (CONFIG_XTAL_FREQ * 1000000)
228
+#elif CONFIG_XTAL_FREQ == 0 && CONFIG_IDF_TARGET_ESP32C5
229
+// The crystal is auto-detected, so the I2C sclk frequency will be computed at runtime.
230
231
#error "I2C uses XTAL but no configured freq"
232
#endif // CONFIG_XTAL_FREQ
@@ -257,7 +260,13 @@ static void machine_hw_i2c_init(machine_hw_i2c_obj_t *self, bool first_init) {
257
260
.master.clk_speed = self->freq,
258
261
};
259
262
i2c_param_config(self->port, &conf);
- int timeout = i2c_ll_calculate_timeout_us_to_reg_val(I2C_SCLK_FREQ, self->timeout_us);
263
+ #if CONFIG_IDF_TARGET_ESP32C5
264
+ uint32_t i2c_sclk_freq;
265
+ check_esp_err(esp_clk_tree_src_get_freq_hz(I2C_CLK_SRC_DEFAULT, ESP_CLK_TREE_SRC_FREQ_PRECISION_APPROX, &i2c_sclk_freq));
266
+ #else
267
+ uint32_t i2c_sclk_freq = I2C_SCLK_FREQ;
268
+ #endif
269
+ int timeout = i2c_ll_calculate_timeout_us_to_reg_val(i2c_sclk_freq, self->timeout_us);
270
i2c_set_timeout(self->port, (timeout > I2C_LL_MAX_TIMEOUT) ? I2C_LL_MAX_TIMEOUT : timeout);
271
i2c_driver_install(self->port, I2C_MODE_MASTER, 0, 0, 0);
272
}
ports/esp32/machine_pin.c
@@ -152,7 +152,7 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_
152
// reset the pin to digital if this is a mode-setting init (grab it back from ADC)
153
if (args[ARG_mode].u_obj != mp_const_none) {
154
if (rtc_gpio_is_valid_gpio(index)) {
155
- #if !(CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6)
+ #if !(CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6)
156
rtc_gpio_deinit(index);
157
158
@@ -163,6 +163,11 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_
163
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
164
165
166
+ #if CONFIG_IDF_TARGET_ESP32C5 && !MICROPY_HW_ESP_USB_SERIAL_JTAG
167
+ if (index == 13 || index == 14) {
168
+ CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
169
+ }
170
171
#if CONFIG_IDF_TARGET_ESP32C6 && !MICROPY_HW_ESP_USB_SERIAL_JTAG
172
if (index == 12 || index == 13) {
173
ports/esp32/machine_pin.h
@@ -111,6 +111,32 @@
#define MICROPY_HW_ENABLE_GPIO20 (1)
#define MICROPY_HW_ENABLE_GPIO21 (1)
113
114
+#elif CONFIG_IDF_TARGET_ESP32C5
115
+
116
+#define MICROPY_HW_ENABLE_GPIO0 (1)
117
+#define MICROPY_HW_ENABLE_GPIO1 (1)
118
+#define MICROPY_HW_ENABLE_GPIO2 (1)
119
+#define MICROPY_HW_ENABLE_GPIO3 (1)
120
+#define MICROPY_HW_ENABLE_GPIO4 (1)
121
+#define MICROPY_HW_ENABLE_GPIO5 (1)
122
+#define MICROPY_HW_ENABLE_GPIO6 (1)
123
+#define MICROPY_HW_ENABLE_GPIO7 (1)
124
+#define MICROPY_HW_ENABLE_GPIO8 (1)
125
+#define MICROPY_HW_ENABLE_GPIO9 (1)
126
+#define MICROPY_HW_ENABLE_GPIO10 (1)
127
+#define MICROPY_HW_ENABLE_GPIO11 (1)
128
+#define MICROPY_HW_ENABLE_GPIO12 (1)
129
+#if !MICROPY_HW_ESP_USB_SERIAL_JTAG
130
+#define MICROPY_HW_ENABLE_GPIO13 (1)
131
+#define MICROPY_HW_ENABLE_GPIO14 (1)
132
+#endif
133
+#define MICROPY_HW_ENABLE_GPIO23 (1)
134
+#define MICROPY_HW_ENABLE_GPIO24 (1)
135
+#define MICROPY_HW_ENABLE_GPIO25 (1)
136
+#define MICROPY_HW_ENABLE_GPIO26 (1)
137
+#define MICROPY_HW_ENABLE_GPIO27 (1)
138
+#define MICROPY_HW_ENABLE_GPIO28 (1)
139
140
141
142
#define MICROPY_HW_ENABLE_GPIO0 (1)
ports/esp32/mpconfigport.h
@@ -172,6 +172,8 @@
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-esp32c2"
#elif CONFIG_IDF_TARGET_ESP32C3
174
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-esp32c3"
175
176
+#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-esp32c5"
177
178
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-esp32c6"
179
0 commit comments