esp_metadata_generated/
_generated_esp32c6.rs

1// Do NOT edit this file directly. Make your changes to esp-metadata,
2// then run `cargo xtask update-metadata`.
3
4/// The name of the chip as `&str`
5///
6/// # Example
7///
8/// ```rust, no_run
9/// use esp_hal::chip;
10/// let chip_name = chip!();
11#[doc = concat!("assert_eq!(chip_name, ", chip!(), ")")]
12/// ```
13#[macro_export]
14#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
15macro_rules! chip {
16    () => {
17        "esp32c6"
18    };
19}
20/// The properties of this chip and its drivers.
21#[macro_export]
22#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
23macro_rules! property {
24    ("chip") => {
25        "esp32c6"
26    };
27    ("arch") => {
28        "riscv"
29    };
30    ("cores") => {
31        1
32    };
33    ("cores", str) => {
34        stringify!(1)
35    };
36    ("trm") => {
37        "https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf"
38    };
39    ("assist_debug.has_sp_monitor") => {
40        true
41    };
42    ("assist_debug.has_region_monitor") => {
43        true
44    };
45    ("gpio.has_bank_1") => {
46        false
47    };
48    ("gpio.gpio_function") => {
49        1
50    };
51    ("gpio.gpio_function", str) => {
52        stringify!(1)
53    };
54    ("gpio.constant_0_input") => {
55        60
56    };
57    ("gpio.constant_0_input", str) => {
58        stringify!(60)
59    };
60    ("gpio.constant_1_input") => {
61        56
62    };
63    ("gpio.constant_1_input", str) => {
64        stringify!(56)
65    };
66    ("gpio.remap_iomux_pin_registers") => {
67        false
68    };
69    ("gpio.func_in_sel_offset") => {
70        0
71    };
72    ("gpio.func_in_sel_offset", str) => {
73        stringify!(0)
74    };
75    ("gpio.input_signal_max") => {
76        124
77    };
78    ("gpio.input_signal_max", str) => {
79        stringify!(124)
80    };
81    ("gpio.output_signal_max") => {
82        128
83    };
84    ("gpio.output_signal_max", str) => {
85        stringify!(128)
86    };
87    ("i2c_master.has_fsm_timeouts") => {
88        true
89    };
90    ("i2c_master.has_hw_bus_clear") => {
91        true
92    };
93    ("i2c_master.has_bus_timeout_enable") => {
94        true
95    };
96    ("i2c_master.separate_filter_config_registers") => {
97        false
98    };
99    ("i2c_master.can_estimate_nack_reason") => {
100        true
101    };
102    ("i2c_master.has_conf_update") => {
103        true
104    };
105    ("i2c_master.has_reliable_fsm_reset") => {
106        true
107    };
108    ("i2c_master.has_arbitration_en") => {
109        true
110    };
111    ("i2c_master.has_tx_fifo_watermark") => {
112        true
113    };
114    ("i2c_master.bus_timeout_is_exponential") => {
115        true
116    };
117    ("i2c_master.max_bus_timeout") => {
118        31
119    };
120    ("i2c_master.max_bus_timeout", str) => {
121        stringify!(31)
122    };
123    ("i2c_master.ll_intr_mask") => {
124        262143
125    };
126    ("i2c_master.ll_intr_mask", str) => {
127        stringify!(262143)
128    };
129    ("i2c_master.fifo_size") => {
130        32
131    };
132    ("i2c_master.fifo_size", str) => {
133        stringify!(32)
134    };
135    ("interrupts.status_registers") => {
136        3
137    };
138    ("interrupts.status_registers", str) => {
139        stringify!(3)
140    };
141    ("rmt.ram_start") => {
142        1610638336
143    };
144    ("rmt.ram_start", str) => {
145        stringify!(1610638336)
146    };
147    ("rmt.channel_ram_size") => {
148        48
149    };
150    ("rmt.channel_ram_size", str) => {
151        stringify!(48)
152    };
153    ("spi_master.has_octal") => {
154        false
155    };
156    ("timergroup.timg_has_timer1") => {
157        false
158    };
159    ("wifi.has_wifi6") => {
160        true
161    };
162}
163/// Macro to get the address range of the given memory region.
164#[macro_export]
165#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
166macro_rules! memory_range {
167    ("DRAM") => {
168        1082130432..1082654720
169    };
170}
171/// This macro can be used to generate code for each peripheral instance of the I2C master driver.
172///
173/// For an explanation on the general syntax, as well as usage of individual/repeated
174/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
175///
176/// This macro has one option for its "Individual matcher" case:
177///
178/// Syntax: `($instance:ident, $sys:ident, $scl:ident, $sda:ident)`
179///
180/// Macro fragments:
181///
182/// - `$instance`: the name of the I2C instance
183/// - `$sys`: the name of the instance as it is in the `esp_hal::system::Peripheral` enum.
184/// - `$scl`, `$sda`: peripheral signal names.
185///
186/// Example data: `(I2C0, I2cExt0, I2CEXT0_SCL, I2CEXT0_SDA)`
187#[macro_export]
188#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
189macro_rules! for_each_i2c_master {
190    ($($pattern:tt => $code:tt;)*) => {
191        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
192        _for_each_inner!((I2C0, I2cExt0, I2CEXT0_SCL, I2CEXT0_SDA));
193        _for_each_inner!((all(I2C0, I2cExt0, I2CEXT0_SCL, I2CEXT0_SDA)));
194    };
195}
196/// This macro can be used to generate code for each peripheral instance of the UART driver.
197///
198/// For an explanation on the general syntax, as well as usage of individual/repeated
199/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
200///
201/// This macro has one option for its "Individual matcher" case:
202///
203/// Syntax: `($instance:ident, $sys:ident, $rx:ident, $tx:ident, $cts:ident, $rts:ident)`
204///
205/// Macro fragments:
206///
207/// - `$instance`: the name of the UART instance
208/// - `$sys`: the name of the instance as it is in the `esp_hal::system::Peripheral` enum.
209/// - `$rx`, `$tx`, `$cts`, `$rts`: signal names.
210///
211/// Example data: `(UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS)`
212#[macro_export]
213#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
214macro_rules! for_each_uart {
215    ($($pattern:tt => $code:tt;)*) => {
216        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
217        _for_each_inner!((UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS));
218        _for_each_inner!((UART1, Uart1, U1RXD, U1TXD, U1CTS, U1RTS));
219        _for_each_inner!((all(UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS), (UART1, Uart1,
220        U1RXD, U1TXD, U1CTS, U1RTS)));
221    };
222}
223/// This macro can be used to generate code for each peripheral instance of the SPI master driver.
224///
225/// For an explanation on the general syntax, as well as usage of individual/repeated
226/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
227///
228/// This macro has one option for its "Individual matcher" case:
229///
230/// Syntax: `($instance:ident, $sys:ident, $sclk:ident, [$($cs:ident),*] [$($sio:ident),*
231/// $($is_qspi:iteral)?])`
232///
233/// Macro fragments:
234///
235/// - `$instance`: the name of the SPI instance
236/// - `$sys`: the name of the instance as it is in the `esp_hal::system::Peripheral` enum.
237/// - `$cs`, `$sio`: chip select and SIO signal names.
238/// - `$is_qspi`: a `true` literal present if the SPI instance supports QSPI.
239///
240/// Example data:
241/// - `(SPI2, Spi2, FSPICLK [FSPICS0, FSPICS1, FSPICS2, FSPICS3, FSPICS4, FSPICS5] [FSPID, FSPIQ,
242///   FSPIWP, FSPIHD, FSPIIO4, FSPIIO5, FSPIIO6, FSPIIO7], true)`
243/// - `(SPI3, Spi3, SPI3_CLK [SPI3_CS0, SPI3_CS1, SPI3_CS2] [SPI3_D, SPI3_Q])`
244#[macro_export]
245#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
246macro_rules! for_each_spi_master {
247    ($($pattern:tt => $code:tt;)*) => {
248        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
249        _for_each_inner!((SPI2, Spi2, FSPICLK[FSPICS0, FSPICS1, FSPICS2, FSPICS3,
250        FSPICS4, FSPICS5] [FSPID, FSPIQ, FSPIWP, FSPIHD], true));
251        _for_each_inner!((all(SPI2, Spi2, FSPICLK[FSPICS0, FSPICS1, FSPICS2, FSPICS3,
252        FSPICS4, FSPICS5] [FSPID, FSPIQ, FSPIWP, FSPIHD], true)));
253    };
254}
255/// This macro can be used to generate code for each peripheral instance of the SPI slave driver.
256///
257/// For an explanation on the general syntax, as well as usage of individual/repeated
258/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
259///
260/// This macro has one option for its "Individual matcher" case:
261///
262/// Syntax: `($instance:ident, $sys:ident, $sclk:ident, $mosi:ident, $miso:ident, $cs:ident)`
263///
264/// Macro fragments:
265///
266/// - `$instance`: the name of the I2C instance
267/// - `$sys`: the name of the instance as it is in the `esp_hal::system::Peripheral` enum.
268/// - `$mosi`, `$miso`, `$cs`: signal names.
269///
270/// Example data: `(SPI2, Spi2, FSPICLK, FSPID, FSPIQ, FSPICS0)`
271#[macro_export]
272#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
273macro_rules! for_each_spi_slave {
274    ($($pattern:tt => $code:tt;)*) => {
275        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
276        _for_each_inner!((SPI2, Spi2, FSPICLK, FSPID, FSPIQ, FSPICS0));
277        _for_each_inner!((all(SPI2, Spi2, FSPICLK, FSPID, FSPIQ, FSPICS0)));
278    };
279}
280#[macro_export]
281#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
282macro_rules! for_each_peripheral {
283    ($($pattern:tt => $code:tt;)*) => {
284        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
285        _for_each_inner!((GPIO0 <= virtual())); _for_each_inner!((GPIO1 <= virtual()));
286        _for_each_inner!((GPIO2 <= virtual())); _for_each_inner!((GPIO3 <= virtual()));
287        _for_each_inner!((GPIO4 <= virtual())); _for_each_inner!((GPIO5 <= virtual()));
288        _for_each_inner!((GPIO6 <= virtual())); _for_each_inner!((GPIO7 <= virtual()));
289        _for_each_inner!((GPIO8 <= virtual())); _for_each_inner!((GPIO9 <= virtual()));
290        _for_each_inner!((GPIO10 <= virtual())); _for_each_inner!((GPIO11 <= virtual()));
291        _for_each_inner!((GPIO12 <= virtual())); _for_each_inner!((GPIO13 <= virtual()));
292        _for_each_inner!((GPIO14 <= virtual())); _for_each_inner!((GPIO15 <= virtual()));
293        _for_each_inner!((GPIO16 <= virtual())); _for_each_inner!((GPIO17 <= virtual()));
294        _for_each_inner!((GPIO18 <= virtual())); _for_each_inner!((GPIO19 <= virtual()));
295        _for_each_inner!((GPIO20 <= virtual())); _for_each_inner!((GPIO21 <= virtual()));
296        _for_each_inner!((GPIO22 <= virtual())); _for_each_inner!((GPIO23 <= virtual()));
297        _for_each_inner!((GPIO24 <= virtual())); _for_each_inner!((GPIO25 <= virtual()));
298        _for_each_inner!((GPIO26 <= virtual())); _for_each_inner!((GPIO27 <= virtual()));
299        _for_each_inner!((GPIO28 <= virtual())); _for_each_inner!((GPIO29 <= virtual()));
300        _for_each_inner!((GPIO30 <= virtual())); _for_each_inner!((AES <= AES()
301        (unstable))); _for_each_inner!((APB_SARADC <= APB_SARADC() (unstable)));
302        _for_each_inner!((ASSIST_DEBUG <= ASSIST_DEBUG() (unstable)));
303        _for_each_inner!((ATOMIC <= ATOMIC() (unstable))); _for_each_inner!((DMA <= DMA()
304        (unstable))); _for_each_inner!((DS <= DS() (unstable))); _for_each_inner!((ECC <=
305        ECC() (unstable))); _for_each_inner!((EFUSE <= EFUSE() (unstable)));
306        _for_each_inner!((EXTMEM <= EXTMEM() (unstable))); _for_each_inner!((GPIO <=
307        GPIO() (unstable))); _for_each_inner!((GPIO_SD <= GPIO_SD() (unstable)));
308        _for_each_inner!((HINF <= HINF() (unstable))); _for_each_inner!((HMAC <= HMAC()
309        (unstable))); _for_each_inner!((HP_APM <= HP_APM() (unstable)));
310        _for_each_inner!((HP_SYS <= HP_SYS() (unstable))); _for_each_inner!((I2C_ANA_MST
311        <= I2C_ANA_MST() (unstable))); _for_each_inner!((I2C0 <= I2C0(I2C_EXT0 : {
312        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })));
313        _for_each_inner!((I2S0 <= I2S0(I2S0 : { bind_peri_interrupt,
314        enable_peri_interrupt, disable_peri_interrupt }) (unstable)));
315        _for_each_inner!((IEEE802154 <= IEEE802154() (unstable)));
316        _for_each_inner!((INTERRUPT_CORE0 <= INTERRUPT_CORE0() (unstable)));
317        _for_each_inner!((INTPRI <= INTPRI() (unstable))); _for_each_inner!((IO_MUX <=
318        IO_MUX() (unstable))); _for_each_inner!((LEDC <= LEDC() (unstable)));
319        _for_each_inner!((LP_ANA <= LP_ANA() (unstable))); _for_each_inner!((LP_AON <=
320        LP_AON() (unstable))); _for_each_inner!((LP_APM <= LP_APM() (unstable)));
321        _for_each_inner!((LP_APM0 <= LP_APM0() (unstable))); _for_each_inner!((LP_CLKRST
322        <= LP_CLKRST() (unstable))); _for_each_inner!((LP_I2C0 <= LP_I2C0() (unstable)));
323        _for_each_inner!((LP_I2C_ANA_MST <= LP_I2C_ANA_MST() (unstable)));
324        _for_each_inner!((LP_IO <= LP_IO() (unstable))); _for_each_inner!((LP_PERI <=
325        LP_PERI() (unstable))); _for_each_inner!((LP_TEE <= LP_TEE() (unstable)));
326        _for_each_inner!((LP_TIMER <= LP_TIMER() (unstable))); _for_each_inner!((LP_UART
327        <= LP_UART() (unstable))); _for_each_inner!((LP_WDT <= LP_WDT() (unstable)));
328        _for_each_inner!((LPWR <= LP_CLKRST() (unstable))); _for_each_inner!((MCPWM0 <=
329        MCPWM0() (unstable))); _for_each_inner!((MEM_MONITOR <= MEM_MONITOR()
330        (unstable))); _for_each_inner!((MODEM_LPCON <= MODEM_LPCON() (unstable)));
331        _for_each_inner!((MODEM_SYSCON <= MODEM_SYSCON() (unstable)));
332        _for_each_inner!((OTP_DEBUG <= OTP_DEBUG() (unstable)));
333        _for_each_inner!((PARL_IO <= PARL_IO(PARL_IO : { bind_peri_interrupt,
334        enable_peri_interrupt, disable_peri_interrupt }) (unstable)));
335        _for_each_inner!((PAU <= PAU() (unstable))); _for_each_inner!((PCNT <= PCNT()
336        (unstable))); _for_each_inner!((PCR <= PCR() (unstable)));
337        _for_each_inner!((PLIC_MX <= PLIC_MX() (unstable))); _for_each_inner!((PMU <=
338        PMU() (unstable))); _for_each_inner!((RMT <= RMT() (unstable)));
339        _for_each_inner!((RNG <= RNG() (unstable))); _for_each_inner!((RSA <= RSA()
340        (unstable))); _for_each_inner!((SHA <= SHA() (unstable)));
341        _for_each_inner!((SLCHOST <= SLCHOST() (unstable))); _for_each_inner!((ETM <=
342        SOC_ETM() (unstable))); _for_each_inner!((SPI0 <= SPI0() (unstable)));
343        _for_each_inner!((SPI1 <= SPI1() (unstable))); _for_each_inner!((SPI2 <=
344        SPI2(SPI2 : { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt
345        }))); _for_each_inner!((SYSTEM <= PCR() (unstable))); _for_each_inner!((SYSTIMER
346        <= SYSTIMER() (unstable))); _for_each_inner!((TEE <= TEE() (unstable)));
347        _for_each_inner!((TIMG0 <= TIMG0() (unstable))); _for_each_inner!((TIMG1 <=
348        TIMG1() (unstable))); _for_each_inner!((TRACE0 <= TRACE() (unstable)));
349        _for_each_inner!((TWAI0 <= TWAI0() (unstable))); _for_each_inner!((TWAI1 <=
350        TWAI1() (unstable))); _for_each_inner!((UART0 <= UART0(UART0 : {
351        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })));
352        _for_each_inner!((UART1 <= UART1(UART1 : { bind_peri_interrupt,
353        enable_peri_interrupt, disable_peri_interrupt }))); _for_each_inner!((UHCI0 <=
354        UHCI0() (unstable))); _for_each_inner!((USB_DEVICE <= USB_DEVICE(USB_DEVICE : {
355        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
356        (unstable))); _for_each_inner!((DMA_CH0 <= virtual() (unstable)));
357        _for_each_inner!((DMA_CH1 <= virtual() (unstable))); _for_each_inner!((DMA_CH2 <=
358        virtual() (unstable))); _for_each_inner!((ADC1 <= virtual() (unstable)));
359        _for_each_inner!((BT <= virtual() (unstable))); _for_each_inner!((LP_CORE <=
360        virtual() (unstable))); _for_each_inner!((SW_INTERRUPT <= virtual() (unstable)));
361        _for_each_inner!((TSENS <= virtual() (unstable))); _for_each_inner!((WIFI <=
362        virtual() (unstable))); _for_each_inner!((MEM2MEM1 <= virtual() (unstable)));
363        _for_each_inner!((MEM2MEM4 <= virtual() (unstable))); _for_each_inner!((MEM2MEM5
364        <= virtual() (unstable))); _for_each_inner!((MEM2MEM10 <= virtual() (unstable)));
365        _for_each_inner!((MEM2MEM11 <= virtual() (unstable)));
366        _for_each_inner!((MEM2MEM12 <= virtual() (unstable)));
367        _for_each_inner!((MEM2MEM13 <= virtual() (unstable)));
368        _for_each_inner!((MEM2MEM14 <= virtual() (unstable)));
369        _for_each_inner!((MEM2MEM15 <= virtual() (unstable)));
370        _for_each_inner!((all(GPIO0 <= virtual()), (GPIO1 <= virtual()), (GPIO2 <=
371        virtual()), (GPIO3 <= virtual()), (GPIO4 <= virtual()), (GPIO5 <= virtual()),
372        (GPIO6 <= virtual()), (GPIO7 <= virtual()), (GPIO8 <= virtual()), (GPIO9 <=
373        virtual()), (GPIO10 <= virtual()), (GPIO11 <= virtual()), (GPIO12 <= virtual()),
374        (GPIO13 <= virtual()), (GPIO14 <= virtual()), (GPIO15 <= virtual()), (GPIO16 <=
375        virtual()), (GPIO17 <= virtual()), (GPIO18 <= virtual()), (GPIO19 <= virtual()),
376        (GPIO20 <= virtual()), (GPIO21 <= virtual()), (GPIO22 <= virtual()), (GPIO23 <=
377        virtual()), (GPIO24 <= virtual()), (GPIO25 <= virtual()), (GPIO26 <= virtual()),
378        (GPIO27 <= virtual()), (GPIO28 <= virtual()), (GPIO29 <= virtual()), (GPIO30 <=
379        virtual()), (AES <= AES() (unstable)), (APB_SARADC <= APB_SARADC() (unstable)),
380        (ASSIST_DEBUG <= ASSIST_DEBUG() (unstable)), (ATOMIC <= ATOMIC() (unstable)),
381        (DMA <= DMA() (unstable)), (DS <= DS() (unstable)), (ECC <= ECC() (unstable)),
382        (EFUSE <= EFUSE() (unstable)), (EXTMEM <= EXTMEM() (unstable)), (GPIO <= GPIO()
383        (unstable)), (GPIO_SD <= GPIO_SD() (unstable)), (HINF <= HINF() (unstable)),
384        (HMAC <= HMAC() (unstable)), (HP_APM <= HP_APM() (unstable)), (HP_SYS <= HP_SYS()
385        (unstable)), (I2C_ANA_MST <= I2C_ANA_MST() (unstable)), (I2C0 <= I2C0(I2C_EXT0 :
386        { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (I2S0
387        <= I2S0(I2S0 : { bind_peri_interrupt, enable_peri_interrupt,
388        disable_peri_interrupt }) (unstable)), (IEEE802154 <= IEEE802154() (unstable)),
389        (INTERRUPT_CORE0 <= INTERRUPT_CORE0() (unstable)), (INTPRI <= INTPRI()
390        (unstable)), (IO_MUX <= IO_MUX() (unstable)), (LEDC <= LEDC() (unstable)),
391        (LP_ANA <= LP_ANA() (unstable)), (LP_AON <= LP_AON() (unstable)), (LP_APM <=
392        LP_APM() (unstable)), (LP_APM0 <= LP_APM0() (unstable)), (LP_CLKRST <=
393        LP_CLKRST() (unstable)), (LP_I2C0 <= LP_I2C0() (unstable)), (LP_I2C_ANA_MST <=
394        LP_I2C_ANA_MST() (unstable)), (LP_IO <= LP_IO() (unstable)), (LP_PERI <=
395        LP_PERI() (unstable)), (LP_TEE <= LP_TEE() (unstable)), (LP_TIMER <= LP_TIMER()
396        (unstable)), (LP_UART <= LP_UART() (unstable)), (LP_WDT <= LP_WDT() (unstable)),
397        (LPWR <= LP_CLKRST() (unstable)), (MCPWM0 <= MCPWM0() (unstable)), (MEM_MONITOR
398        <= MEM_MONITOR() (unstable)), (MODEM_LPCON <= MODEM_LPCON() (unstable)),
399        (MODEM_SYSCON <= MODEM_SYSCON() (unstable)), (OTP_DEBUG <= OTP_DEBUG()
400        (unstable)), (PARL_IO <= PARL_IO(PARL_IO : { bind_peri_interrupt,
401        enable_peri_interrupt, disable_peri_interrupt }) (unstable)), (PAU <= PAU()
402        (unstable)), (PCNT <= PCNT() (unstable)), (PCR <= PCR() (unstable)), (PLIC_MX <=
403        PLIC_MX() (unstable)), (PMU <= PMU() (unstable)), (RMT <= RMT() (unstable)), (RNG
404        <= RNG() (unstable)), (RSA <= RSA() (unstable)), (SHA <= SHA() (unstable)),
405        (SLCHOST <= SLCHOST() (unstable)), (ETM <= SOC_ETM() (unstable)), (SPI0 <= SPI0()
406        (unstable)), (SPI1 <= SPI1() (unstable)), (SPI2 <= SPI2(SPI2 : {
407        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (SYSTEM
408        <= PCR() (unstable)), (SYSTIMER <= SYSTIMER() (unstable)), (TEE <= TEE()
409        (unstable)), (TIMG0 <= TIMG0() (unstable)), (TIMG1 <= TIMG1() (unstable)),
410        (TRACE0 <= TRACE() (unstable)), (TWAI0 <= TWAI0() (unstable)), (TWAI1 <= TWAI1()
411        (unstable)), (UART0 <= UART0(UART0 : { bind_peri_interrupt,
412        enable_peri_interrupt, disable_peri_interrupt })), (UART1 <= UART1(UART1 : {
413        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (UHCI0 <=
414        UHCI0() (unstable)), (USB_DEVICE <= USB_DEVICE(USB_DEVICE : {
415        bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
416        (unstable)), (DMA_CH0 <= virtual() (unstable)), (DMA_CH1 <= virtual()
417        (unstable)), (DMA_CH2 <= virtual() (unstable)), (ADC1 <= virtual() (unstable)),
418        (BT <= virtual() (unstable)), (LP_CORE <= virtual() (unstable)), (SW_INTERRUPT <=
419        virtual() (unstable)), (TSENS <= virtual() (unstable)), (WIFI <= virtual()
420        (unstable)), (MEM2MEM1 <= virtual() (unstable)), (MEM2MEM4 <= virtual()
421        (unstable)), (MEM2MEM5 <= virtual() (unstable)), (MEM2MEM10 <= virtual()
422        (unstable)), (MEM2MEM11 <= virtual() (unstable)), (MEM2MEM12 <= virtual()
423        (unstable)), (MEM2MEM13 <= virtual() (unstable)), (MEM2MEM14 <= virtual()
424        (unstable)), (MEM2MEM15 <= virtual() (unstable))));
425    };
426}
427/// This macro can be used to generate code for each `GPIOn` instance.
428///
429/// For an explanation on the general syntax, as well as usage of individual/repeated
430/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
431///
432/// This macro has one option for its "Individual matcher" case:
433///
434/// Syntax: `($n:literal, $gpio:ident ($($digital_input_function:ident =>
435/// $digital_input_signal:ident)*) ($($digital_output_function:ident =>
436/// $digital_output_signal:ident)*) ($([$pin_attribute:ident])*))`
437///
438/// Macro fragments:
439///
440/// - `$n`: the number of the GPIO. For `GPIO0`, `$n` is 0.
441/// - `$gpio`: the name of the GPIO.
442/// - `$digital_input_function`: the number of the digital function, as an identifier (i.e. for
443///   function 0 this is `_0`).
444/// - `$digital_input_function`: the name of the digital function, as an identifier.
445/// - `$digital_output_function`: the number of the digital function, as an identifier (i.e. for
446///   function 0 this is `_0`).
447/// - `$digital_output_function`: the name of the digital function, as an identifier.
448/// - `$pin_attribute`: `Input` and/or `Output`, marks the possible directions of the GPIO.
449///   Bracketed so that they can also be matched as optional fragments. Order is always Input first.
450///
451/// Example data: `(0, GPIO0 (_5 => EMAC_TX_CLK) (_1 => CLK_OUT1 _5 => EMAC_TX_CLK) ([Input]
452/// [Output]))`
453#[macro_export]
454#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
455macro_rules! for_each_gpio {
456    ($($pattern:tt => $code:tt;)*) => {
457        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
458        _for_each_inner!((0, GPIO0() () ([Input] [Output]))); _for_each_inner!((1,
459        GPIO1() () ([Input] [Output]))); _for_each_inner!((2, GPIO2(_2 => FSPIQ) (_2 =>
460        FSPIQ) ([Input] [Output]))); _for_each_inner!((3, GPIO3() () ([Input]
461        [Output]))); _for_each_inner!((4, GPIO4(_0 => MTMS _2 => FSPIHD) (_2 => FSPIHD)
462        ([Input] [Output]))); _for_each_inner!((5, GPIO5(_0 => MTDI _2 => FSPIWP) (_2 =>
463        FSPIWP) ([Input] [Output]))); _for_each_inner!((6, GPIO6(_0 => MTCK _2 =>
464        FSPICLK) (_2 => FSPICLK) ([Input] [Output]))); _for_each_inner!((7, GPIO7(_2 =>
465        FSPID) (_0 => MTDO _2 => FSPID) ([Input] [Output]))); _for_each_inner!((8,
466        GPIO8() () ([Input] [Output]))); _for_each_inner!((9, GPIO9() () ([Input]
467        [Output]))); _for_each_inner!((10, GPIO10() () ([Input] [Output])));
468        _for_each_inner!((11, GPIO11() () ([Input] [Output]))); _for_each_inner!((12,
469        GPIO12() () ([Input] [Output]))); _for_each_inner!((13, GPIO13() () ([Input]
470        [Output]))); _for_each_inner!((14, GPIO14() () ([Input] [Output])));
471        _for_each_inner!((15, GPIO15() () ([Input] [Output]))); _for_each_inner!((16,
472        GPIO16(_2 => FSPICS0) (_0 => U0TXD _2 => FSPICS0) ([Input] [Output])));
473        _for_each_inner!((17, GPIO17(_0 => U0RXD) (_2 => FSPICS1) ([Input] [Output])));
474        _for_each_inner!((18, GPIO18(_0 => SDIO_CMD) (_0 => SDIO_CMD _2 => FSPICS2)
475        ([Input] [Output]))); _for_each_inner!((19, GPIO19() (_0 => SDIO_CLK _2 =>
476        FSPICS3) ([Input] [Output]))); _for_each_inner!((20, GPIO20(_0 => SDIO_DATA0) (_0
477        => SDIO_DATA0 _2 => FSPICS4) ([Input] [Output]))); _for_each_inner!((21,
478        GPIO21(_0 => SDIO_DATA1) (_0 => SDIO_DATA1 _2 => FSPICS5) ([Input] [Output])));
479        _for_each_inner!((22, GPIO22(_0 => SDIO_DATA2) (_0 => SDIO_DATA2) ([Input]
480        [Output]))); _for_each_inner!((23, GPIO23(_0 => SDIO_DATA3) (_0 => SDIO_DATA3)
481        ([Input] [Output]))); _for_each_inner!((24, GPIO24() (_0 => SPICS0) ([Input]
482        [Output]))); _for_each_inner!((25, GPIO25(_0 => SPIQ) (_0 => SPIQ) ([Input]
483        [Output]))); _for_each_inner!((26, GPIO26(_0 => SPIWP) (_0 => SPIWP) ([Input]
484        [Output]))); _for_each_inner!((27, GPIO27() () ([Input] [Output])));
485        _for_each_inner!((28, GPIO28(_0 => SPIHD) (_0 => SPIHD) ([Input] [Output])));
486        _for_each_inner!((29, GPIO29() (_0 => SPICLK) ([Input] [Output])));
487        _for_each_inner!((30, GPIO30(_0 => SPID) (_0 => SPID) ([Input] [Output])));
488        _for_each_inner!((all(0, GPIO0() () ([Input] [Output])), (1, GPIO1() () ([Input]
489        [Output])), (2, GPIO2(_2 => FSPIQ) (_2 => FSPIQ) ([Input] [Output])), (3, GPIO3()
490        () ([Input] [Output])), (4, GPIO4(_0 => MTMS _2 => FSPIHD) (_2 => FSPIHD)
491        ([Input] [Output])), (5, GPIO5(_0 => MTDI _2 => FSPIWP) (_2 => FSPIWP) ([Input]
492        [Output])), (6, GPIO6(_0 => MTCK _2 => FSPICLK) (_2 => FSPICLK) ([Input]
493        [Output])), (7, GPIO7(_2 => FSPID) (_0 => MTDO _2 => FSPID) ([Input] [Output])),
494        (8, GPIO8() () ([Input] [Output])), (9, GPIO9() () ([Input] [Output])), (10,
495        GPIO10() () ([Input] [Output])), (11, GPIO11() () ([Input] [Output])), (12,
496        GPIO12() () ([Input] [Output])), (13, GPIO13() () ([Input] [Output])), (14,
497        GPIO14() () ([Input] [Output])), (15, GPIO15() () ([Input] [Output])), (16,
498        GPIO16(_2 => FSPICS0) (_0 => U0TXD _2 => FSPICS0) ([Input] [Output])), (17,
499        GPIO17(_0 => U0RXD) (_2 => FSPICS1) ([Input] [Output])), (18, GPIO18(_0 =>
500        SDIO_CMD) (_0 => SDIO_CMD _2 => FSPICS2) ([Input] [Output])), (19, GPIO19() (_0
501        => SDIO_CLK _2 => FSPICS3) ([Input] [Output])), (20, GPIO20(_0 => SDIO_DATA0) (_0
502        => SDIO_DATA0 _2 => FSPICS4) ([Input] [Output])), (21, GPIO21(_0 => SDIO_DATA1)
503        (_0 => SDIO_DATA1 _2 => FSPICS5) ([Input] [Output])), (22, GPIO22(_0 =>
504        SDIO_DATA2) (_0 => SDIO_DATA2) ([Input] [Output])), (23, GPIO23(_0 => SDIO_DATA3)
505        (_0 => SDIO_DATA3) ([Input] [Output])), (24, GPIO24() (_0 => SPICS0) ([Input]
506        [Output])), (25, GPIO25(_0 => SPIQ) (_0 => SPIQ) ([Input] [Output])), (26,
507        GPIO26(_0 => SPIWP) (_0 => SPIWP) ([Input] [Output])), (27, GPIO27() () ([Input]
508        [Output])), (28, GPIO28(_0 => SPIHD) (_0 => SPIHD) ([Input] [Output])), (29,
509        GPIO29() (_0 => SPICLK) ([Input] [Output])), (30, GPIO30(_0 => SPID) (_0 => SPID)
510        ([Input] [Output]))));
511    };
512}
513/// This macro can be used to generate code for each analog function of each GPIO.
514///
515/// For an explanation on the general syntax, as well as usage of individual/repeated
516/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
517///
518/// This macro has two options for its "Individual matcher" case:
519///
520/// - `all`: `($signal:ident, $gpio:ident)` - simple case where you only need identifiers
521/// - `all_expanded`: `(($signal:ident, $group:ident $(, $number:literal)+), $gpio:ident)` -
522///   expanded signal case, where you need the number(s) of a signal, or the general group to which
523///   the signal belongs. For example, in case of `ADC2_CH3` the expanded form looks like
524///   `(ADC2_CH3, ADCn_CHm, 2, 3)`.
525///
526/// Macro fragments:
527///
528/// - `$signal`: the name of the signal.
529/// - `$group`: the name of the signal, with numbers replaced by placeholders. For `ADC2_CH3` this
530///   is `ADCn_CHm`.
531/// - `$number`: the numbers extracted from `$signal`.
532/// - `$gpio`: the name of the GPIO.
533///
534/// Example data:
535/// - `(ADC2_CH5, GPIO12)`
536/// - `((ADC2_CH5, ADCn_CHm, 2, 5), GPIO12)`
537///
538/// The expanded syntax is only available when the signal has at least one numbered component.
539#[macro_export]
540#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
541macro_rules! for_each_analog_function {
542    ($($pattern:tt => $code:tt;)*) => {
543        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
544        _for_each_inner!((XTAL_32K_P, GPIO0)); _for_each_inner!((ADC0_CH0, GPIO0));
545        _for_each_inner!((XTAL_32K_N, GPIO1)); _for_each_inner!((ADC0_CH1, GPIO1));
546        _for_each_inner!((ADC0_CH2, GPIO2)); _for_each_inner!((ADC0_CH3, GPIO3));
547        _for_each_inner!((ADC0_CH4, GPIO4)); _for_each_inner!((ADC0_CH5, GPIO5));
548        _for_each_inner!((ADC0_CH6, GPIO6)); _for_each_inner!((USB_DM, GPIO12));
549        _for_each_inner!((USB_DP, GPIO13)); _for_each_inner!(((ADC0_CH0, ADCn_CHm, 0, 0),
550        GPIO0)); _for_each_inner!(((ADC0_CH1, ADCn_CHm, 0, 1), GPIO1));
551        _for_each_inner!(((ADC0_CH2, ADCn_CHm, 0, 2), GPIO2));
552        _for_each_inner!(((ADC0_CH3, ADCn_CHm, 0, 3), GPIO3));
553        _for_each_inner!(((ADC0_CH4, ADCn_CHm, 0, 4), GPIO4));
554        _for_each_inner!(((ADC0_CH5, ADCn_CHm, 0, 5), GPIO5));
555        _for_each_inner!(((ADC0_CH6, ADCn_CHm, 0, 6), GPIO6));
556        _for_each_inner!((all(XTAL_32K_P, GPIO0), (ADC0_CH0, GPIO0), (XTAL_32K_N, GPIO1),
557        (ADC0_CH1, GPIO1), (ADC0_CH2, GPIO2), (ADC0_CH3, GPIO3), (ADC0_CH4, GPIO4),
558        (ADC0_CH5, GPIO5), (ADC0_CH6, GPIO6), (USB_DM, GPIO12), (USB_DP, GPIO13)));
559        _for_each_inner!((all_expanded((ADC0_CH0, ADCn_CHm, 0, 0), GPIO0), ((ADC0_CH1,
560        ADCn_CHm, 0, 1), GPIO1), ((ADC0_CH2, ADCn_CHm, 0, 2), GPIO2), ((ADC0_CH3,
561        ADCn_CHm, 0, 3), GPIO3), ((ADC0_CH4, ADCn_CHm, 0, 4), GPIO4), ((ADC0_CH5,
562        ADCn_CHm, 0, 5), GPIO5), ((ADC0_CH6, ADCn_CHm, 0, 6), GPIO6)));
563    };
564}
565/// This macro can be used to generate code for each LP/RTC function of each GPIO.
566///
567/// For an explanation on the general syntax, as well as usage of individual/repeated
568/// matchers, refer to [the crate-level documentation][crate#for_each-macros].
569///
570/// This macro has two options for its "Individual matcher" case:
571///
572/// - `all`: `($signal:ident, $gpio:ident)` - simple case where you only need identifiers
573/// - `all_expanded`: `(($signal:ident, $group:ident $(, $number:literal)+), $gpio:ident)` -
574///   expanded signal case, where you need the number(s) of a signal, or the general group to which
575///   the signal belongs. For example, in case of `SAR_I2C_SCL_1` the expanded form looks like
576///   `(SAR_I2C_SCL_1, SAR_I2C_SCL_n, 1)`.
577///
578/// Macro fragments:
579///
580/// - `$signal`: the name of the signal.
581/// - `$group`: the name of the signal, with numbers replaced by placeholders. For `ADC2_CH3` this
582///   is `ADCn_CHm`.
583/// - `$number`: the numbers extracted from `$signal`.
584/// - `$gpio`: the name of the GPIO.
585///
586/// Example data:
587/// - `(RTC_GPIO15, GPIO12)`
588/// - `((RTC_GPIO15, RTC_GPIOn, 15), GPIO12)`
589///
590/// The expanded syntax is only available when the signal has at least one numbered component.
591#[macro_export]
592#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
593macro_rules! for_each_lp_function {
594    ($($pattern:tt => $code:tt;)*) => {
595        macro_rules! _for_each_inner { $(($pattern) => $code;)* ($other : tt) => {} }
596        _for_each_inner!((LP_GPIO0, GPIO0)); _for_each_inner!((LP_UART_DTRN, GPIO0));
597        _for_each_inner!((LP_GPIO1, GPIO1)); _for_each_inner!((LP_UART_DSRN, GPIO1));
598        _for_each_inner!((LP_GPIO2, GPIO2)); _for_each_inner!((LP_UART_RTSN, GPIO2));
599        _for_each_inner!((LP_GPIO3, GPIO3)); _for_each_inner!((LP_UART_CTSN, GPIO3));
600        _for_each_inner!((LP_GPIO4, GPIO4)); _for_each_inner!((LP_UART_RXD, GPIO4));
601        _for_each_inner!((LP_GPIO5, GPIO5)); _for_each_inner!((LP_UART_TXD, GPIO5));
602        _for_each_inner!((LP_GPIO6, GPIO6)); _for_each_inner!((LP_I2C_SDA, GPIO6));
603        _for_each_inner!((LP_GPIO7, GPIO7)); _for_each_inner!((LP_I2C_SCL, GPIO7));
604        _for_each_inner!(((LP_GPIO0, LP_GPIOn, 0), GPIO0)); _for_each_inner!(((LP_GPIO1,
605        LP_GPIOn, 1), GPIO1)); _for_each_inner!(((LP_GPIO2, LP_GPIOn, 2), GPIO2));
606        _for_each_inner!(((LP_GPIO3, LP_GPIOn, 3), GPIO3)); _for_each_inner!(((LP_GPIO4,
607        LP_GPIOn, 4), GPIO4)); _for_each_inner!(((LP_GPIO5, LP_GPIOn, 5), GPIO5));
608        _for_each_inner!(((LP_GPIO6, LP_GPIOn, 6), GPIO6)); _for_each_inner!(((LP_GPIO7,
609        LP_GPIOn, 7), GPIO7)); _for_each_inner!((all(LP_GPIO0, GPIO0), (LP_UART_DTRN,
610        GPIO0), (LP_GPIO1, GPIO1), (LP_UART_DSRN, GPIO1), (LP_GPIO2, GPIO2),
611        (LP_UART_RTSN, GPIO2), (LP_GPIO3, GPIO3), (LP_UART_CTSN, GPIO3), (LP_GPIO4,
612        GPIO4), (LP_UART_RXD, GPIO4), (LP_GPIO5, GPIO5), (LP_UART_TXD, GPIO5), (LP_GPIO6,
613        GPIO6), (LP_I2C_SDA, GPIO6), (LP_GPIO7, GPIO7), (LP_I2C_SCL, GPIO7)));
614        _for_each_inner!((all_expanded((LP_GPIO0, LP_GPIOn, 0), GPIO0), ((LP_GPIO1,
615        LP_GPIOn, 1), GPIO1), ((LP_GPIO2, LP_GPIOn, 2), GPIO2), ((LP_GPIO3, LP_GPIOn, 3),
616        GPIO3), ((LP_GPIO4, LP_GPIOn, 4), GPIO4), ((LP_GPIO5, LP_GPIOn, 5), GPIO5),
617        ((LP_GPIO6, LP_GPIOn, 6), GPIO6), ((LP_GPIO7, LP_GPIOn, 7), GPIO7)));
618    };
619}
620/// Defines the `InputSignal` and `OutputSignal` enums.
621///
622/// This macro is intended to be called in esp-hal only.
623#[macro_export]
624#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
625macro_rules! define_io_mux_signals {
626    () => {
627        #[allow(non_camel_case_types, clippy::upper_case_acronyms)]
628        #[derive(Debug, PartialEq, Copy, Clone)]
629        #[cfg_attr(feature = "defmt", derive(defmt::Format))]
630        #[doc(hidden)]
631        pub enum InputSignal {
632            EXT_ADC_START       = 0,
633            U0RXD               = 6,
634            U0CTS               = 7,
635            U0DSR               = 8,
636            U1RXD               = 9,
637            U1CTS               = 10,
638            U1DSR               = 11,
639            I2S_MCLK            = 12,
640            I2SO_BCK            = 13,
641            I2SO_WS             = 14,
642            I2SI_SD             = 15,
643            I2SI_BCK            = 16,
644            I2SI_WS             = 17,
645            USB_JTAG_TDO_BRIDGE = 19,
646            CPU_TESTBUS0        = 20,
647            CPU_TESTBUS1        = 21,
648            CPU_TESTBUS2        = 22,
649            CPU_TESTBUS3        = 23,
650            CPU_TESTBUS4        = 24,
651            CPU_TESTBUS5        = 25,
652            CPU_TESTBUS6        = 26,
653            CPU_TESTBUS7        = 27,
654            CPU_GPIO_IN0        = 28,
655            CPU_GPIO_IN1        = 29,
656            CPU_GPIO_IN2        = 30,
657            CPU_GPIO_IN3        = 31,
658            CPU_GPIO_IN4        = 32,
659            CPU_GPIO_IN5        = 33,
660            CPU_GPIO_IN6        = 34,
661            CPU_GPIO_IN7        = 35,
662            USB_JTAG_TMS        = 37,
663            USB_EXTPHY_OEN      = 40,
664            USB_EXTPHY_VM       = 41,
665            USB_EXTPHY_VPO      = 42,
666            I2CEXT0_SCL         = 45,
667            I2CEXT0_SDA         = 46,
668            PARL_RX_DATA0       = 47,
669            PARL_RX_DATA1       = 48,
670            PARL_RX_DATA2       = 49,
671            PARL_RX_DATA3       = 50,
672            PARL_RX_DATA4       = 51,
673            PARL_RX_DATA5       = 52,
674            PARL_RX_DATA6       = 53,
675            PARL_RX_DATA7       = 54,
676            PARL_RX_DATA8       = 55,
677            PARL_RX_DATA9       = 56,
678            PARL_RX_DATA10      = 57,
679            PARL_RX_DATA11      = 58,
680            PARL_RX_DATA12      = 59,
681            PARL_RX_DATA13      = 60,
682            PARL_RX_DATA14      = 61,
683            PARL_RX_DATA15      = 62,
684            FSPICLK             = 63,
685            FSPIQ               = 64,
686            FSPID               = 65,
687            FSPIHD              = 66,
688            FSPIWP              = 67,
689            FSPICS0             = 68,
690            PARL_RX_CLK         = 69,
691            PARL_TX_CLK         = 70,
692            RMT_SIG_0           = 71,
693            RMT_SIG_1           = 72,
694            TWAI0_RX            = 73,
695            TWAI1_RX            = 77,
696            PWM0_SYNC0          = 87,
697            PWM0_SYNC1          = 88,
698            PWM0_SYNC2          = 89,
699            PWM0_F0             = 90,
700            PWM0_F1             = 91,
701            PWM0_F2             = 92,
702            PWM0_CAP0           = 93,
703            PWM0_CAP1           = 94,
704            PWM0_CAP2           = 95,
705            SIG_IN_FUNC97       = 97,
706            SIG_IN_FUNC98       = 98,
707            SIG_IN_FUNC99       = 99,
708            SIG_IN_FUNC100      = 100,
709            PCNT0_SIG_CH0       = 101,
710            PCNT0_SIG_CH1       = 102,
711            PCNT0_CTRL_CH0      = 103,
712            PCNT0_CTRL_CH1      = 104,
713            PCNT1_SIG_CH0       = 105,
714            PCNT1_SIG_CH1       = 106,
715            PCNT1_CTRL_CH0      = 107,
716            PCNT1_CTRL_CH1      = 108,
717            PCNT2_SIG_CH0       = 109,
718            PCNT2_SIG_CH1       = 110,
719            PCNT2_CTRL_CH0      = 111,
720            PCNT2_CTRL_CH1      = 112,
721            PCNT3_SIG_CH0       = 113,
722            PCNT3_SIG_CH1       = 114,
723            PCNT3_CTRL_CH0      = 115,
724            PCNT3_CTRL_CH1      = 116,
725            SPIQ                = 121,
726            SPID                = 122,
727            SPIHD               = 123,
728            SPIWP               = 124,
729            SDIO_CMD,
730            SDIO_DATA0,
731            SDIO_DATA1,
732            SDIO_DATA2,
733            SDIO_DATA3,
734            MTDI,
735            MTCK,
736            MTMS,
737        }
738        #[allow(non_camel_case_types, clippy::upper_case_acronyms)]
739        #[derive(Debug, PartialEq, Copy, Clone)]
740        #[cfg_attr(feature = "defmt", derive(defmt::Format))]
741        #[doc(hidden)]
742        pub enum OutputSignal {
743            LEDC_LS_SIG0          = 0,
744            LEDC_LS_SIG1          = 1,
745            LEDC_LS_SIG2          = 2,
746            LEDC_LS_SIG3          = 3,
747            LEDC_LS_SIG4          = 4,
748            LEDC_LS_SIG5          = 5,
749            U0TXD                 = 6,
750            U0RTS                 = 7,
751            U0DTR                 = 8,
752            U1TXD                 = 9,
753            U1RTS                 = 10,
754            U1DTR                 = 11,
755            I2S_MCLK              = 12,
756            I2SO_BCK              = 13,
757            I2SO_WS               = 14,
758            I2SO_SD               = 15,
759            I2SI_BCK              = 16,
760            I2SI_WS               = 17,
761            I2SO_SD1              = 18,
762            USB_JTAG_TDO_BRIDGE   = 19,
763            CPU_TESTBUS0          = 20,
764            CPU_TESTBUS1          = 21,
765            CPU_TESTBUS2          = 22,
766            CPU_TESTBUS3          = 23,
767            CPU_TESTBUS4          = 24,
768            CPU_TESTBUS5          = 25,
769            CPU_TESTBUS6          = 26,
770            CPU_TESTBUS7          = 27,
771            CPU_GPIO_OUT0         = 28,
772            CPU_GPIO_OUT1         = 29,
773            CPU_GPIO_OUT2         = 30,
774            CPU_GPIO_OUT3         = 31,
775            CPU_GPIO_OUT4         = 32,
776            CPU_GPIO_OUT5         = 33,
777            CPU_GPIO_OUT6         = 34,
778            CPU_GPIO_OUT7         = 35,
779            USB_JTAG_TCK          = 36,
780            USB_JTAG_TMS          = 37,
781            USB_JTAG_TDI          = 38,
782            USB_JTAG_TDO          = 39,
783            I2CEXT0_SCL           = 45,
784            I2CEXT0_SDA           = 46,
785            PARL_TX_DATA0         = 47,
786            PARL_TX_DATA1         = 48,
787            PARL_TX_DATA2         = 49,
788            PARL_TX_DATA3         = 50,
789            PARL_TX_DATA4         = 51,
790            PARL_TX_DATA5         = 52,
791            PARL_TX_DATA6         = 53,
792            PARL_TX_DATA7         = 54,
793            PARL_TX_DATA8         = 55,
794            PARL_TX_DATA9         = 56,
795            PARL_TX_DATA10        = 57,
796            PARL_TX_DATA11        = 58,
797            PARL_TX_DATA12        = 59,
798            PARL_TX_DATA13        = 60,
799            PARL_TX_DATA14        = 61,
800            PARL_TX_DATA15        = 62,
801            FSPICLK               = 63,
802            FSPIQ                 = 64,
803            FSPID                 = 65,
804            FSPIHD                = 66,
805            FSPIWP                = 67,
806            FSPICS0               = 68,
807            SDIO_TOHOST_INT       = 69,
808            PARL_TX_CLK           = 70,
809            RMT_SIG_0             = 71,
810            RMT_SIG_1             = 72,
811            TWAI0_TX              = 73,
812            TWAI0_BUS_OFF_ON      = 74,
813            TWAI0_CLKOUT          = 75,
814            TWAI0_STANDBY         = 76,
815            TWAI1_TX              = 77,
816            TWAI1_BUS_OFF_ON      = 78,
817            TWAI1_CLKOUT          = 79,
818            TWAI1_STANDBY         = 80,
819            GPIO_SD0              = 83,
820            GPIO_SD1              = 84,
821            GPIO_SD2              = 85,
822            GPIO_SD3              = 86,
823            PWM0_0A               = 87,
824            PWM0_0B               = 88,
825            PWM0_1A               = 89,
826            PWM0_1B               = 90,
827            PWM0_2A               = 91,
828            PWM0_2B               = 92,
829            SIG_IN_FUNC97         = 97,
830            SIG_IN_FUNC98         = 98,
831            SIG_IN_FUNC99         = 99,
832            SIG_IN_FUNC100        = 100,
833            FSPICS1               = 101,
834            FSPICS2               = 102,
835            FSPICS3               = 103,
836            FSPICS4               = 104,
837            FSPICS5               = 105,
838            SPICLK                = 114,
839            SPICS0                = 115,
840            SPICS1                = 116,
841            GPIO_TASK_MATRIX_OUT0 = 117,
842            GPIO_TASK_MATRIX_OUT1 = 118,
843            GPIO_TASK_MATRIX_OUT2 = 119,
844            GPIO_TASK_MATRIX_OUT3 = 120,
845            SPIQ                  = 121,
846            SPID                  = 122,
847            SPIHD                 = 123,
848            SPIWP                 = 124,
849            CLK_OUT_OUT1          = 125,
850            CLK_OUT_OUT2          = 126,
851            CLK_OUT_OUT3          = 127,
852            GPIO                  = 128,
853            SDIO_CLK,
854            SDIO_CMD,
855            SDIO_DATA0,
856            SDIO_DATA1,
857            SDIO_DATA2,
858            SDIO_DATA3,
859            MTDO,
860        }
861    };
862}
863/// Defines and implements the `io_mux_reg` function.
864///
865/// The generated function has the following signature:
866///
867/// ```rust,ignore
868/// pub(crate) fn io_mux_reg(gpio_num: u8) -> &'static crate::pac::io_mux::GPIO0 {
869///     // ...
870/// # unimplemented!()
871/// }
872/// ```
873///
874/// This macro is intended to be called in esp-hal only.
875#[macro_export]
876#[expect(clippy::crate_in_macro_def)]
877#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
878macro_rules! define_io_mux_reg {
879    () => {
880        pub(crate) fn io_mux_reg(gpio_num: u8) -> &'static crate::pac::io_mux::GPIO {
881            crate::peripherals::IO_MUX::regs().gpio(gpio_num as usize)
882        }
883    };
884}