macro_rules! for_each_spi_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 SPI 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, $sclk:ident, [$($cs:ident),*] [$($sio:ident),* $($is_qspi:iteral)?])
Macro fragments:
$instance
: the name of the SPI instance$sys
: the name of the instance as it is in theesp_hal::system::Peripheral
enum.$cs
,$sio
: chip select and SIO signal names.$is_qspi
: atrue
literal present if the SPI instance supports QSPI.
Example data:
(SPI2, Spi2, FSPICLK [FSPICS0, FSPICS1, FSPICS2, FSPICS3, FSPICS4, FSPICS5] [FSPID, FSPIQ, FSPIWP, FSPIHD, FSPIIO4, FSPIIO5, FSPIIO6, FSPIIO7], true)
(SPI3, Spi3, SPI3_CLK [SPI3_CS0, SPI3_CS1, SPI3_CS2] [SPI3_D, SPI3_Q])