[][src]Function esp_idf_sys::spi_slave_initialize

pub unsafe extern "C" fn spi_slave_initialize(
    host: spi_host_device_t,
    bus_config: *const spi_bus_config_t,
    slave_config: *const spi_slave_interface_config_t,
    dma_chan: c_int
) -> esp_err_t

@brief Initialize a SPI bus as a slave interface

@warning For now, only supports HSPI and VSPI.

@param host SPI peripheral to use as a SPI slave interface @param bus_config Pointer to a spi_bus_config_t struct specifying how the host should be initialized @param slave_config Pointer to a spi_slave_interface_config_t struct specifying the details for the slave interface @param dma_chan Either 1 or 2. A SPI bus used by this driver must have a DMA channel associated with it. The SPI hardware has two DMA channels to share. This parameter indicates which one to use.

@warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in DMA-capable memory.

@return - ESP_ERR_INVALID_ARG if configuration is invalid - ESP_ERR_INVALID_STATE if host already is in use - ESP_ERR_NO_MEM if out of memory - ESP_OK on success