Function riot_sys::spi_init

source ·
pub unsafe extern "C" fn spi_init(bus: spi_t)
Expand description

@brief Basic initialization of the given SPI bus

This function does the basic initialization including pin configuration for MISO, MOSI, and CLK pins. After initialization, the given device should be in power down state.

This function is intended to be called by the board initialization code during system startup to prepare the (shared) SPI device for further usage. It uses the board specific initialization parameters as defined in the board’s periph_conf.h.

Errors (e.g. invalid @p bus parameter) are not signaled through a return value, but should be signaled using the assert() function internally.

@note This function MUST not be called more than once per bus!

@param[in] bus SPI device to initialize