STM32F103 SPI (Serial Peripheral Interface) is a synchronous serial communication protocol. In this interface, in addition to transmit and receive lines, there is a third line that is used for clock line. Each slave device also has a chip select (enable) pin, that is used for activating the device. So to use SPI, we need 2 wires for data lines (MOSI, MISO), 1 wire for clock line, and 1 wire per device for chip select line. MOSI (Master Out Slave In) is used for data transfer from master device to slave device. MISO (Master In Slave Out) is used for data transfer from slave device to master device.