Macro for_each_uart

Source
macro_rules! for_each_uart {
    ($($pattern:tt => $code:tt;)*) => { ... };
}
Available on crate feature _device-selected only.
Expand description

This macro can be used to generate code for each peripheral instance of the UART driver.

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: ($instance:ident, $sys:ident, $rx:ident, $tx:ident, $cts:ident, $rts:ident)

Macro fragments:

  • $instance: the name of the UART instance
  • $sys: the name of the instance as it is in the esp_hal::system::Peripheral enum.
  • $rx, $tx, $cts, $rts: signal names.

Example data: (UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS)