GD32W51x User Manual
673
Figure 20-2. SPI 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
FF16=0
MOSI
MISO
NSS
D0
D1
D2
D3
D4
D5
D6
D7
D0
D1
D2
D3
D4
D5
D6
D7
sample
Figure 20-3. SPI timing diagram in Quad-SPI mode (CKPL=1, CKPH=1, LF=0)
D[5]
D[4]
D[6]
D[7]
D[0]
D[1]
D[2]
D[3]
D[5]
D[4]
D[6]
D[7]
D[0]
D[1]
D[2]
D[3]
SCK
MOSI
MISO
IO2
IO3
NSS
sample
In 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. The data frame length is fixed to 8 bits in
Quad-SPI mode.
Data order is configured by the LF bit in SPI_CTL0 register, and SPI will first send the LSB
first if LF=1, or the MSB first if LF=0. The data order is fixed to MSB first in TI mode.
20.5.2.
NSS function
Slave mode
When slave mode is configured (MSTMOD=0), SPI gets NSS level from NSS pin in hardware