![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 499](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794499.webp)
GD32E23x User Manual
499
In SPI0 normal mode, the length of data is configured by the FF16 bit in the SPI_CTL0
register. Data length is 16 bits if FF16=1, otherwise is 8 bits.
Data order is configured by LF bit in SPI_CTL0 register, and SPI will send the LSB first if
LF=1, or the MSB if LF=0. The data order is fixed to MSB first in TI mode.
Figure 18-3. SPI1 timing diagram in normal mode
SCK (CKPH=0 CKPL=0)
SCK (CKPH=0 CKPL=1)
SCK (CKPH=1 CKPL=0)
SCK (CKPH=1 CKPL=1)
LF=1
DZ[3:0]=7
MOSI
MISO
NSS
D[0]
D[1]
D[2]
D[3]
D[4]
D[5]
D[6]
D[7]
sample
D[0]
D[1]
D[2]
D[3]
D[4]
D[5]
D[6]
D[7]
Figure 18-4. SPI timing diagram in Quad-SPI mode (CKPL=1, CKPH=1, LF=0)
MOSI
MISO
NSS
D0[4]
D0[0]
D1[4]
D1[0]
D0[5]
D0[1]
D1[5]
D1[1]
sample
IO2
IO3
D0[6]
D0[2]
D1[6]
D1[2]
D0[7]
D0[3]
D1[7]
D1[3]
SCK
In SPI1 normal mode, the length of data is configured by the DZ[3:0] bits in the SPI_CTL1
register. It can be set from 4-bit up to 16-bit length and the setting applies for both
transmission and reception, and the read access to the FIFO must be aligned with the
BYTEN bit in the SPI_CTL1 register. The data frame length is fixed to 8 bits in Quad-SPI
mode.
Data order is configured by LF bit in SPI_CTL0 register, and SPI will send the LSB first if
LF=1, or the MSB if LF=0. The data order is fixed to MSB first in TI mode.
When the SPI_DATA register is accessed, data frames are always right-aligned into either a
byte (If the data length is less than or equal to one byte) or a half-word. During
communication, only bits within the data frame will be output with the clock.