Macro for_each_i2c_master

Source
macro_rules! for_each_i2c_master {
    ($($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 I2C master 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, $scl:ident, $sda:ident)

Macro fragments:

  • $instance: the name of the I2C instance
  • $sys: the name of the instance as it is in the esp_hal::system::Peripheral enum.
  • $scl, $sda: peripheral signal names.

Example data: (I2C0, I2cExt0, I2CEXT0_SCL, I2CEXT0_SDA)