DocID018909 Rev 11
909/1731
RM0090
Serial peripheral interface (SPI)
918
28.5
SPI and I
2
S registers
Refer to
Section: List of abbreviations for registers
.
The peripheral registers have to be accessed by half-words (16 bits) or words (32 bits).
28.5.1
SPI control register 1 (SPI_CR1) (not used in I
2
S mode)
Address offset: 0x00
Reset value: 0x0000
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
BIDI
MODE
BIDI
OE
CRC
EN
CRC
NEXT
DFF
RX
ONLY
SSM
SSI
LSB
FIRST
SPE
BR [2:0]
MSTR
CPOL
CPHA
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
Bit 15
BIDIMODE:
Bidirectional data mode enable
0: 2-line unidirectional data mode selected
1: 1-line bidirectional data mode selected
Note: This bit is not used in I
2
S mode
Bit
14
BIDIOE:
Output enable in bidirectional mode
This bit combined with the BIDImode bit selects the direction of transfer in bidirectional mode
0: Output disabled (receive-only mode)
1: Output enabled (transmit-only mode)
Note: This bit is not used in I
2
S mode.
In master mode, the MOSI pin is used while the MISO pin is used in slave mode.
Bit
13
CRCEN:
Hardware CRC calculation enable
0: CRC calculation disabled
1: CRC calculation enabled
Note: This bit should be written only when SPI is disabled (SPE = ‘0’) for correct operation.
It is not used in I
2
S mode.
Bit
12
CRCNEXT:
CRC transfer next
0: Data phase (no CRC phase)
1: Next transfer is CRC (CRC phase)
Note: When the SPI is configured in full duplex or transmitter only modes, CRCNEXT must be
written as soon as the last data is written to the SPI_DR register.
When the SPI is configured in receiver only mode, CRCNEXT must be set after the
second last data reception.
This bit should be kept cleared when the transfers are managed by DMA.
It is not used in I
2
S mode.
Bit
11
DFF:
Data frame format
0: 8-bit data frame format is selected for transmission/reception
1: 16-bit data frame format is selected for transmission/reception
Note: This bit should be written only when SPI is disabled (SPE = ‘0’) for correct operation.
It is not used in I
2
S mode.