Skip to content

Commit 3fbf8d6

Browse files
committed
format gpio metadata, add ZCD analog functions
1 parent 1af7874 commit 3fbf8d6

File tree

2 files changed

+72
-65
lines changed

2 files changed

+72
-65
lines changed

esp-metadata-generated/src/_generated_esp32c61.rs

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,11 +2664,16 @@ macro_rules! for_each_analog_function {
26642664
macro_rules! _for_each_inner_analog_function { $(($pattern) => $code;)* ($other :
26652665
tt) => {} } _for_each_inner_analog_function!((XTAL_32K_P, GPIO0));
26662666
_for_each_inner_analog_function!((XTAL_32K_N, GPIO1));
2667+
_for_each_inner_analog_function!((ZCD0, GPIO8));
2668+
_for_each_inner_analog_function!((ZCD1, GPIO9));
26672669
_for_each_inner_analog_function!((USB_DM, GPIO12));
26682670
_for_each_inner_analog_function!((USB_DP, GPIO13));
2671+
_for_each_inner_analog_function!(((ZCD0, ZCDn, 0), GPIO8));
2672+
_for_each_inner_analog_function!(((ZCD1, ZCDn, 1), GPIO9));
26692673
_for_each_inner_analog_function!((all(XTAL_32K_P, GPIO0), (XTAL_32K_N, GPIO1),
2670-
(USB_DM, GPIO12), (USB_DP, GPIO13)));
2671-
_for_each_inner_analog_function!((all_expanded));
2674+
(ZCD0, GPIO8), (ZCD1, GPIO9), (USB_DM, GPIO12), (USB_DP, GPIO13)));
2675+
_for_each_inner_analog_function!((all_expanded((ZCD0, ZCDn, 0), GPIO8), ((ZCD1,
2676+
ZCDn, 1), GPIO9)));
26722677
};
26732678
}
26742679
/// This macro can be used to generate code for each LP/RTC function of each GPIO.
@@ -2770,50 +2775,51 @@ macro_rules! define_io_mux_signals {
27702775
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
27712776
#[doc(hidden)]
27722777
pub enum OutputSignal {
2773-
LEDC_LS_SIG0 = 0,
2774-
LEDC_LS_SIG1 = 1,
2775-
LEDC_LS_SIG2 = 2,
2776-
LEDC_LS_SIG3 = 3,
2777-
LEDC_LS_SIG4 = 4,
2778-
LEDC_LS_SIG5 = 5,
2779-
U0TXD = 6,
2780-
U0RTS = 7,
2781-
U0DTR = 8,
2782-
U1TXD = 9,
2783-
U1RTS = 10,
2784-
U1DTR = 11,
2785-
I2S_MCLK = 12,
2786-
I2SO_BCK = 13,
2787-
I2SO_WS = 14,
2788-
I2SO_SD = 15,
2789-
I2SI_BCK = 16,
2790-
I2SI_WS = 17,
2791-
I2SO_SD1 = 18,
2792-
CPU_GPIO_0 = 27,
2793-
CPU_GPIO_1 = 28,
2794-
CPU_GPIO_2 = 29,
2795-
CPU_GPIO_3 = 30,
2796-
CPU_GPIO_4 = 31,
2797-
CPU_GPIO_5 = 32,
2798-
CPU_GPIO_6 = 33,
2799-
CPU_GPIO_7 = 34,
2800-
I2CEXT0_SCL = 46,
2801-
I2CEXT0_SDA = 47,
2802-
FSPICLK = 64,
2803-
FSPIQ = 65,
2804-
FSPID = 66,
2805-
FSPIHD = 67,
2806-
FSPIWP = 68,
2807-
FSPICS0 = 69,
2808-
U2TXD = 72,
2809-
U2RTS = 73,
2810-
U2DTR = 74,
2811-
FSPICS1 = 102,
2812-
FSPICS2 = 103,
2813-
FSPICS3 = 104,
2814-
FSPICS4 = 105,
2815-
FSPICS5 = 106,
2816-
GPIO = 256,
2778+
LEDC_LS_SIG0 = 0,
2779+
LEDC_LS_SIG1 = 1,
2780+
LEDC_LS_SIG2 = 2,
2781+
LEDC_LS_SIG3 = 3,
2782+
LEDC_LS_SIG4 = 4,
2783+
LEDC_LS_SIG5 = 5,
2784+
U0TXD = 6,
2785+
U0RTS = 7,
2786+
U0DTR = 8,
2787+
U1TXD = 9,
2788+
U1RTS = 10,
2789+
U1DTR = 11,
2790+
I2S_MCLK = 12,
2791+
I2SO_BCK = 13,
2792+
I2SO_WS = 14,
2793+
I2SO_SD = 15,
2794+
I2SI_BCK = 16,
2795+
I2SI_WS = 17,
2796+
I2SO_SD1 = 18,
2797+
CPU_GPIO_0 = 27,
2798+
CPU_GPIO_1 = 28,
2799+
CPU_GPIO_2 = 29,
2800+
CPU_GPIO_3 = 30,
2801+
CPU_GPIO_4 = 31,
2802+
CPU_GPIO_5 = 32,
2803+
CPU_GPIO_6 = 33,
2804+
CPU_GPIO_7 = 34,
2805+
I2CEXT0_SCL = 46,
2806+
I2CEXT0_SDA = 47,
2807+
FSPICLK = 64,
2808+
FSPIQ = 65,
2809+
FSPID = 66,
2810+
FSPIHD = 67,
2811+
FSPIWP = 68,
2812+
FSPICS0 = 69,
2813+
U2TXD = 72,
2814+
U2RTS = 73,
2815+
U2DTR = 74,
2816+
FSPICS1 = 102,
2817+
FSPICS2 = 103,
2818+
FSPICS3 = 104,
2819+
FSPICS4 = 105,
2820+
FSPICS5 = 106,
2821+
SDIO_TOHOST_INT = 124,
2822+
GPIO = 256,
28172823
}
28182824
};
28192825
}

esp-metadata/devices/esp32c61.toml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -207,28 +207,28 @@ gpio_function = 1
207207
constant_0_input = 0x60
208208
constant_1_input = 0x40
209209
pins = [
210-
{ pin = 0, analog = { 0 = "XTAL_32K_P" } },
211-
{ pin = 1, analog = { 0 = "XTAL_32K_N" } },
212-
{ pin = 2, functions = { 2 = "FSPIQ" } },
213-
{ pin = 3, functions = { 0 = "MTMS", 2 = "FSPIHD" }, limitations = ["strapping"] },
214-
{ pin = 4, functions = { 0 = "MTDI", 2 = "FSPIWP" }, limitations = ["strapping"] },
210+
{ pin = 0, analog = { 0 = "XTAL_32K_P" } },
211+
{ pin = 1, analog = { 0 = "XTAL_32K_N" } },
212+
{ pin = 2, functions = { 2 = "FSPIQ" } },
213+
{ pin = 3, functions = { 0 = "MTMS", 2 = "FSPIHD" }, limitations = ["strapping"] },
214+
{ pin = 4, functions = { 0 = "MTDI", 2 = "FSPIWP" }, limitations = ["strapping"] },
215215
{ pin = 5, functions = { 0 = "MTCK" } },
216-
{ pin = 6, functions = { 0 = "MTDO", 2 = "FSPICLK" } },
217-
{ pin = 7, functions = { 2 = "FSPID" }, limitations = ["strapping"] },
218-
{ pin = 8, functions = { 2 = "FSPICS0" }, limitations = ["strapping"] },
219-
{ pin = 9, limitations = ["strapping"] },
216+
{ pin = 6, functions = { 0 = "MTDO", 2 = "FSPICLK" } },
217+
{ pin = 7, functions = { 2 = "FSPID" }, limitations = ["strapping"] },
218+
{ pin = 8, functions = { 2 = "FSPICS0" }, limitations = ["strapping"], analog = { 0 = "ZCD0" } },
219+
{ pin = 9, limitations = ["strapping"], analog = { 0 = "ZCD1" } },
220220
{ pin = 10, functions = { 0 = "U0RXD" } },
221221
{ pin = 11, functions = { 0 = "U0TXD" } },
222-
{ pin = 12, analog = { 0 = "USB_DM" } },
223-
{ pin = 13, analog = { 0 = "USB_DP" } },
224-
{ pin = 14, functions = { 0 = "FSPICS1" }, limitations = ["spi_flash"] },
225-
{ pin = 15, functions = { 0 = "FSPICS0" }, limitations = ["spi_flash"] },
226-
{ pin = 16, functions = { 0 = "FSPIQ" }, limitations = ["spi_flash"] },
227-
{ pin = 17, functions = { 0 = "FSPIWP" }, limitations = ["spi_flash"] },
228-
{ pin = 18, limitations = ["spi_flash"] },
229-
{ pin = 19, functions = { 0 = "FSPIHD" }, limitations = ["spi_flash"] },
230-
{ pin = 20, functions = { 0 = "FSPICLK" }, limitations = ["spi_flash"] },
231-
{ pin = 21, functions = { 0 = "FSPID" }, limitations = ["spi_flash"] },
222+
{ pin = 12, analog = { 0 = "USB_DM" } },
223+
{ pin = 13, analog = { 0 = "USB_DP" } },
224+
{ pin = 14, functions = { 0 = "FSPICS1" }, limitations = ["spi_flash"] },
225+
{ pin = 15, functions = { 0 = "FSPICS0" }, limitations = ["spi_flash"] },
226+
{ pin = 16, functions = { 0 = "FSPIQ" }, limitations = ["spi_flash"] },
227+
{ pin = 17, functions = { 0 = "FSPIWP" }, limitations = ["spi_flash"] },
228+
{ pin = 18, limitations = ["spi_flash"] },
229+
{ pin = 19, functions = { 0 = "FSPIHD" }, limitations = ["spi_flash"] },
230+
{ pin = 20, functions = { 0 = "FSPICLK" }, limitations = ["spi_flash"] },
231+
{ pin = 21, functions = { 0 = "FSPID" }, limitations = ["spi_flash"] },
232232
{ pin = 22, functions = { 0 = "SDIO_DATA2" } },
233233
{ pin = 23, functions = { 0 = "SDIO_DATA3" } },
234234
{ pin = 24 },
@@ -332,6 +332,7 @@ output_signals = [
332332
{ name = "FSPICS3", id = 104 },
333333
{ name = "FSPICS4", id = 105 },
334334
{ name = "FSPICS5", id = 106 },
335+
{ name = "SDIO_TOHOST_INT", id = 124 },
335336
{ name = "GPIO", id = 256 },
336337
]
337338

0 commit comments

Comments
 (0)