Serial Peripheral Interface (SPI)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
407
9:8
TMOD
R/W
00
Transfer Mode. Relevant only when the SPI is configured as a serial-master device.
Selects the mode of transfer for serial communication. This field does not affect the
transfer duplicity. Only indicates whether the receive or transmit data are valid.
In transmit-only mode, data received from the external device is not valid and is not
stored in the receive FIFO memory; it is overwritten on the next transfer.
In receive-only mode, transmitted data are not valid. After the first write to the
transmit FIFO, the same word is retransmitted for the duration of the transfer.
In transmit-and-receive mode, both transmit and receive data are valid. The
transfer continues until the transmit FIFO is empty. Data received from the external
device are stored into the receive FIFO memory, where it can be accessed by the
host processor.
00 – Transmit & Receive
01 – Transmit Only
10 – Receive Only
7
SCPOL
R/W
0
Serial Clock Polarity. Valid when the frame format (FRF) is set to Motorola SPI. Used
to select the polarity of the inactive serial clock, which is held inactive when the SPI
master is not actively transferring data on the serial bus.
0 – Inactive state of serial clock is low
1 – Inactive state of serial clock is high
6
SCPH
R/W
0
Serial Clock Phase. Valid when the frame format (FRF) is set to Motorola SPI. The
serial clock phase selects the relationship of the serial clock with the slave select
signal.
When SCPH = 0, data are captured on the first edge of the serial clock. When SCPH
= 1, the serial clock starts toggling one cycle after the slave select line is activated,
and data are captured on the second edge of the serial clock.
0 – Serial clock toggles in middle of the first data bit
1 – Serial clock toggles at start of the first data bit
5:4
FRF
R/W
00
Frame Format. Selects which serial protocol transfers the data.
00 – Motorola SPI
Other – Reserved
3:0
DFS
R/W
0111
Data Frame Size. Selects the data frame length. When the data frame size is
programmed to be less than 16 bits, the receive data are automatically right-
justified by the receive logic, with the upper bits of the receive FIFO zero-padded.
You must right-justify transmit data before writing into the transmit FIFO. The
transmit logic ignores the upper unused bits when transmitting the data. For the
field decode, refer to Table 19-2.
Table 19-2 DFS decode
DFS value
Description
0000
Reserved – undefined operation
0001
Reserved – undefined operation
0010
Reserved – undefined operation
0011
4-bit serial data transfer
0100
5-bit serial data transfer
0101
6-bit serial data transfer
0110
7-bit serial data transfer
0111
8-bit serial data transfer
1000
9-bit serial data transfer
1001
10-bit serial data transfer
1010
11-bit serial data transfer
1011
12-bit serial data transfer
1100
13-bit serial data transfer
1101
14-bit serial data transfer
1110
15-bit serial data transfer
1111
16-bit serial data transfer
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03