SPI stands for Serial Peripheral interface. It is a unit which can read and write data via a simple interface, typically consisting of a
- CLK (Clock, supplied by Master)
- MOSI (Master out, Slave in data)
- MISO (Master in, Slave out data)
- CS (Chip select (optional))
Most SPI interfaces are configurable when it comes to number of bits to send and receive at once (where for obvious reasons 8 bits at a time is most common). SPI is probably the simplest communication interface. One side acts as Master (supplying the clock) and the other side as Slave, receiving the clock. How data is changed and sampled is typically configurable. The most common way is probably to change data on rising edge of clock and to sample on falling edge. The advantage of an SPI over a UART is that Master and Slave do not have to "agree" on a particular baudrate, as they have to do in case of a UART.