The devices embed three serial peripheral interfaces (SPI) that can be used to communicate with external devices while using the specific synchronous protocol. The SPI protocol supports half‑duplex, full‑duplex, and simplex synchronous, serial communication with external devices.
Table 10. SPI features| SPI feature |
SPI2S1, SPI2S2, SPI2S3 (full feature set instances)
|
|---|
| Data size | Configurable from 4 to 32-bit |
| CRC computation | CRC polynomial length configurable from 5 to 32‑bit |
| Size of FIFOs | 16 × 8-bit |
| Number of transferred data | Unlimited, expandable |
| I2S feature | Yes |
The serial peripheral interface (SPI) can be used to communicate with external devices while using the specific synchronous protocol. The SPI protocol supports half-duplex, full-duplex, and simplex synchronous, serial communication with external devices. The interface can be configured as master or slave and can operate in multimaster or multislave configurations. The device configured as master provides a communication clock (SCK) to the slave device. The slave select (SS) and ready (RDY) signals can be applied optionally just to set up communication with a specific slave and to ensure it handles the data flow properly. The Motorola® data format is used by default, but some other specific modes are supported as well.
The SPI main features are:
- Full-duplex synchronous transfers on three lines
- Half-duplex synchronous transfer on two lines (with bidirectional data line)
- Simplex synchronous transfers on two lines (with unidirectional data line)
- From 4-bit up to 32-bit data size selection
- Multimaster or multislave mode capability
- Dual clock domain, the peripheral kernel clock is independent from the APB bus clock
- Baud rate prescaler up to kernel frequency/2 or bypass from RCC in master mode
- Protection of configuration and setting
- Hardware or software management of SS for both master and slave
- Adjustable minimum delays between data and between SS and data flow
- Configurable SS signal polarity and timing, MISO × MOSI swap capability
- Programmable clock polarity and phase
- Programmable data order with MSB-first or LSB-first shifting
- Programmable number of data within a transaction to control SS and CRC
- Dedicated transmission and reception flags with interrupt capability
- SPI Motorola and TI format support
- Hardware CRC can verify the integrity of the communication at the end of a transaction by:
- Adding CRC value in Tx mode
- Automatic CRC error checking for Rx mode
- Error detection with interrupt capability in case of data overrun, CRC error, data underrun, mode fault, and frame error, depending on the operating mode
- Two 8-bit width embedded Rx and Tx FIFOs (FIFO size depends on instance)
- Configurable FIFO thresholds (data packing)
- Capability to handle data streams by system DMA controller
- Configurable behavior at slave underrun condition (support of cascaded circular buffers)
- Optional status pin RDY signaling that the slave device is ready to handle the data flow
The I2S main features are:
- Full duplex communication
- Simplex communication (only transmitter or receiver)
- Master or slave operations
- 8-bit programmable linear prescaler
- Data length can be 16, 24, or 32 bits
- Channel length can be 16 or 32 in master, any value in slave
- Programmable clock polarity
- Error flags signaling for improved reliability: Underrun, overrun, and frame errors
- Embedded Rx and Tx FIFOs
- Supported I2S protocols:
- I2S Philips standard
- MSB-justified standard (left-justified)
- LSB-justified standard (right-justified)
- PCM standard (with short and long frame synchronization)
- Data ordering programmable (LSB or MSB first)
- DMA capability for transmission and reception
- Master clock can be output to drive an external audio component:
- FMCK = 256 × FWS for all I2S modes
- FMCK = 128 × FWS for all PCM modes