macro_rules! for_each_gpio {
($($pattern:tt => $code:tt;)*) => { ... };
}Available on crate feature
_device-selected only.Expand description
This macro can be used to generate code for each GPIOn instance.
For an explanation on the general syntax, as well as usage of individual/repeated matchers, refer to the crate-level documentation.
This macro has one option for its “Individual matcher” case:
Syntax: ($n:literal, $gpio:ident ($($digital_input_function:ident => $digital_input_signal:ident)*) ($($digital_output_function:ident => $digital_output_signal:ident)*) ($([$pin_attribute:ident])*))
Macro fragments:
$n: the number of the GPIO. ForGPIO0,$nis 0.$gpio: the name of the GPIO.$digital_input_function: the number of the digital function, as an identifier (i.e. for function 0 this is_0).$digital_input_function: the name of the digital function, as an identifier.$digital_output_function: the number of the digital function, as an identifier (i.e. for function 0 this is_0).$digital_output_function: the name of the digital function, as an identifier.$pin_attribute:Inputand/orOutput, marks the possible directions of the GPIO. Bracketed so that they can also be matched as optional fragments. Order is always Input first.
Example data: (0, GPIO0 (_5 => EMAC_TX_CLK) (_1 => CLK_OUT1 _5 => EMAC_TX_CLK) ([Input] [Output]))