Macro rp2040_hal::bsp_pins [−][src]
macro_rules! bsp_pins { ($($(#[$id_cfg : meta]) * $Id : ident { $(#[$name_doc : meta]) * name : $name : ident $(,) ? $(aliases : { $($(#[$alias_cfg : meta]) * $Mode : ident : $Alias : ident), + }) ? } $(,) ?) +) => { ... }; (@ aliases, $($($(#[$attr : meta]) * $Id : ident $Mode : ident $Alias : ident) +) ?) => { ... }; }
Expand description
Helper macro to give meaningful names to GPIO pins
The normal Pins
struct names each Pin
according to its PinId
.
However, BSP authors would prefer to name each Pin
according to its
function. This macro defines a new Pins
struct with custom field names
for each Pin
, and it defines type aliases and constants to make it
easier to work with the Pin
s and DynPin
s.
When specifying pin aliases, be sure to use a PinMode
. See
here for a list of the available PinMode
type aliases.
Example
…