macro_rules! gpio_for_signal {
(ADC1_CH0 $(, $_fallback:literal)?) => { ... };
(LP_GPIO0 $(, $_fallback:literal)?) => { ... };
(ADC1_CH1 $(, $_fallback:literal)?) => { ... };
(LP_GPIO1 $(, $_fallback:literal)?) => { ... };
(FSPIQ $(, $_fallback:literal)?) => { ... };
(ADC1_CH2 $(, $_fallback:literal)?) => { ... };
(LP_GPIO2 $(, $_fallback:literal)?) => { ... };
(ADC1_CH3 $(, $_fallback:literal)?) => { ... };
(LP_GPIO3 $(, $_fallback:literal)?) => { ... };
(MTMS $(, $_fallback:literal)?) => { ... };
(FSPIHD $(, $_fallback:literal)?) => { ... };
(ADC1_CH4 $(, $_fallback:literal)?) => { ... };
(LP_GPIO4 $(, $_fallback:literal)?) => { ... };
(MTDI $(, $_fallback:literal)?) => { ... };
(FSPIWP $(, $_fallback:literal)?) => { ... };
(LP_GPIO5 $(, $_fallback:literal)?) => { ... };
(MTCK $(, $_fallback:literal)?) => { ... };
(FSPICLK $(, $_fallback:literal)?) => { ... };
(MTDO $(, $_fallback:literal)?) => { ... };
(FSPID $(, $_fallback:literal)?) => { ... };
(FSPICS0 $(, $_fallback:literal)?) => { ... };
(SPIHD $(, $_fallback:literal)?) => { ... };
(SPIWP $(, $_fallback:literal)?) => { ... };
(SPICS0 $(, $_fallback:literal)?) => { ... };
(SPICLK $(, $_fallback:literal)?) => { ... };
(SPID $(, $_fallback:literal)?) => { ... };
(SPIQ $(, $_fallback:literal)?) => { ... };
(U0RXD $(, $_fallback:literal)?) => { ... };
(U0TXD $(, $_fallback:literal)?) => { ... };
($_signal:ident, $fallback:literal) => { ... };
}Available on crate feature
_device-selected only.Expand description
Returns the name of the GPIO that provides the given signal, as a string.
The macro takes the name of a direct function - a digital IO MUX function, an analog
function, or an LP IO MUX function - and expands to a string literal like "GPIO4". It
is meant to keep documentation free of per-chip pin lists.
Signals that are not wired to a pad on this chip have to be routed through the GPIO matrix, which can reach any pad. The macro has no pad to return for those, so it accepts an optional fallback to expand to instead. The fallback is not validated.
If multiple pads provide the signal, the macro returns one that is not reserved for some other purpose, such as booting or interfacing with flash.
Example usage:
gpio_for_signal!(ADC1_CH0)gpio_for_signal!(LP_I2C_SDA, "GPIO6")