macro_rules! for_each_lp_function {
($($pattern:tt => $code:tt;)*) => { ... };
}
Available on crate feature
_device-selected
only.Expand description
This macro can be used to generate code for each LP/RTC function of each GPIO.
For an explanation on the general syntax, as well as usage of individual/repeated matchers, refer to the crate-level documentation.
This macro has two options for its “Individual matcher” case:
all
:($signal:ident, $gpio:ident)
- simple case where you only need identifiersall_expanded
:(($signal:ident, $group:ident $(, $number:literal)+), $gpio:ident)
- expanded signal case, where you need the number(s) of a signal, or the general group to which the signal belongs. For example, in case ofSAR_I2C_SCL_1
the expanded form looks like(SAR_I2C_SCL_1, SAR_I2C_SCL_n, 1)
.
Macro fragments:
$signal
: the name of the signal.$group
: the name of the signal, with numbers replaced by placeholders. ForADC2_CH3
this isADCn_CHm
.$number
: the numbers extracted from$signal
.$gpio
: the name of the GPIO.
Example data:
(RTC_GPIO15, GPIO12)
((RTC_GPIO15, RTC_GPIOn, 15), GPIO12)
The expanded syntax is only available when the signal has at least one numbered component.