
M451
May. 4, 2018
Page
742
of
1006
Rev.2.08
M4
51
S
E
RI
E
S
T
E
CH
NICA
L RE
F
E
R
E
NC
E
M
A
NU
A
L
TX FIFO Buffer:
The transmit FIFO buffer is a 4-/8-level depth, 32-bit wide, first-in, first-out register buffer. The data
can be written to the transmit FIFO buffer in advance through software by writing the SPI_TX register.
RX FIFO Buffer:
The received FIFO buffer is also a 4-/8-level depth, 32-bit wide, first-in, first-out register buffer. The
receive control logic will store the received data to this buffer. The FIFO buffer data can be read from
SPI_RX register by software.
TX Shift Register:
The transmit shift register is a 32-bit wide register buffer. The transmit data is loaded from the TX
FIFO buffer and shifted out bit-by-bit to the skew buffer.
RX Shift Register:
The receive shift register is also a 32-bit wide register buffer. The receive data is shifted in bit-by-bit
from the skew buffer and is loaded into RX FIFO buffer when a transaction done.
Skew Buffer:
The skew buffer is a 4-level 1-bit buffer.
For transmitting, it is written from shift register by peripheral clock and read out by SPI bus clock.
Three bit data is loaded into this buffer first and the 4
th
bit data is written into the buffer after 1-bit data
is read out by the SPI bus clock.
For receiving, the serial data in the bus of SPIn_MOSI (in slave mode) is written into the skew buffer
basing on the SPI bus clock and it is read out and written into the RX shift register by SPI peripheral
clock after there is no empty in the RX skew buffer.
6.16.4 Basic Configuration
The basic configurations of SPI0 are as follows:
SPI0 pins are configured in SYS_GPB_MFPL
or SYS_GPE_MFPH registers.
Select the source of SPI0 peripheral clock on SPI0SEL (CLK_CLKSEL2[3:2]).
Enable SPI0 peripheral clock in SPI0CKEN (CLK_APBCLK0[12]).
Reset SPI0 controller in SPI0RST (SYS_IPRST1[12]).
The basic configurations of SPI1 are as follows:
SPI1 pins are configured in SYS_GPA_MFPL
,
SYS_GPB_MFPL, SYS_GPD_MFPL or
SYS_GPE_MFPH registers.
Select the source of SPI1 peripheral clock on SPI1SEL (CLK_CLKSEL2[5:4]).
Enable SPI1 peripheral clock in SPI1CKEN (CLK_APBCLK0[13]).
Reset SPI1 controller in SPI1RST (SYS_IPRST1[13]).
The basic configurations of SPI2 are as follows:
SPI2 pins are configured in SYS_GPC_MFPL, SYS_GPC_MFPH, SYS_GPD_MFPH
or
SYS_GPE_MFPL registers.