![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 500](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794500.webp)
GD32E23x User Manual
500
Figure 18-5. SPI1 data frame right-aligned diagram
Data
frame
xx
7
6
0
5
Data
frame
00
7
6
0
5
Data
frame
xxxx
15
12
0
11
Data
frame
0000
0
15
12 11
Rx
Tx
Rx
Tx
DZ=5, the data le ngth is 6-bit
DZ=11, the data le ngth is 12-bit
18.3.4.
Separate transmission and reception FIFO
The separate 32-bit reception FIFO (RXFIFO) and transmission FIFO (TXFIFO) are used in
different directions for SPI data transactions, and they can enable the SPI to work in a
continuous flow (only available in SPI1).
Figure 18-6. Transmission and reception FIFO
Transmission/
Reception
shift register
RXFIFO
TXFIFO
Write SPI_DATA
Read SPI_DATA
TX
RX
When the current TXFIFO level is less than or equal to half of its capacity, the TXFIFO is
considered empty
(1)
and TBE is set to 1 by hardware at this time. When the TBE bit is set,
writing data to the SPI_DATA register will store the data at the end of the TXFIFO. Hardware
sets the RBNE bit when the RXFIFO is considered non-empty
(2)
. When the RBNE bit is set,
reading data from the SPI_DATA register will get the oldest data from the RXFIFO.
Note:
(1) For SPI1, the TXFIFO empty means that the TXFIFO level is less than or equal to
half of its capacity. The meaning of TXFIFO full is the opposite. Therefore, when the data
frame format is not greater than 8 bits, the TXFIFO can store up to three data frames. If the
TXFIFO empty or full appears below and
there is no special explanation, the meaning is the
same as that described here.
(2) For SPI1, the meaning of RXFIFO empty is divided into the following two conditions: If
BYTEN bit in SPI_CTL1 is set, the RXFIFO empty means the RXFIFO level is less than
quarter of its capacity. At this time, when the data frame format is not more than 8 bits, the
RXFIFO can store up to 4 data frames. If BYTEN is cleared, the RXFIFO empty means the