Macro esp_ward::init_spi_custom

source ·
macro_rules! init_spi_custom {
    ($peripherals:ident, $clocks:ident, $clk:expr, $mosi:expr, $miso:expr, $cs:expr, $freq:expr) => { ... };
}
Expand description

Initializes a custom SPI configuration, allowing for arbitrary CLK, MOSI, MISO, and CS pins and frequency.

§Arguments

  • $peripherals: The peripherals instance taken from the board.
  • $clocks: The system clocks initialized beforehand.
  • $clk: The pin to use for CLK.
  • $mosi: The pin to use for MOSI.
  • $miso: The pin to use for MISO.
  • $cs: The pin to use for CS.
  • $freq: The frequency for SPI communication.

§Examples

let peripherals = esp_ward::take_periph!();
let (clocks, pins) = esp_ward::init_chip!(peripherals);
let spi = esp_ward::init_spi_custom!(
    peripherals,
    clocks,
    pins.gpio18,
    pins.gpio23,
    pins.gpio19,
    pins.gpio5,
    100u32.MHz()
);