Implements the Serial Peripheral Interface (SPI) protocol for synchronous serial communication. Supports both master and slave modes, configurable clock polarity, clock phase, bit order, and data frame size.