GD32W51x User Manual
727
FIFO and flag control
A FIFO with a size of 8-bit by 16 is implemented to transfer data. In indirect write mode, 32-
bit AHB write access add 4-bytes to FIFO, 16-bit add 2-bytes, and 8-bit add 1-byte.
FIFO threshold is defined by FTL, in indirect read mode, when the amount of bytes in the
FIFO is equal or above the defined threshold, FIFO threshold flag FT is set. FT is also set
after data phase is complete if FIFO is not empty. In indirect write mode, when the amount of
the empty bytes in the FIFO is above the threshold, FT is set.
An interrupt is generated if both FTIE and FT is set. If DMA is enabled, a DMA request is
generated by FT, until this flag is cleared.
In indirect read mode, when the FIFO becomes full, the QSPI temporarily stop SCK clock to
avoid overrun. The reading sequence is not resumed until more than 4 byte are available in
FIFO.
22.4.2.
Status polling mode
In status polling mode, the QSPI periodically starts a read command with up-to 4-bytes data.
The received data can be bit-wise masked and compared with a defined data content, if a
match happens, then an interrupt is generated when SMIE is set.
Status polling access starts the same as indirect read sequence. BUSY stays high even
between periodic intervals.
Polling match mode SPMOD controls the comparison match mode, if SPMOD = 1, the AND
mode is selected. In this mode, status match flag SM is set only when there is a match on all
the unmasked bits. While if SPMOD = 0, the OR mode is selected. In this mode, SM is set if
there is a match on any of the unmasked bit.
If status-polling-mode-stop SPS is set, status polling sequence stop when a match is detected,
and the BUSY flag is cleared at the end of data phase. Otherwise, the periodic sequence
continues until abort is issued or the QSPI is disabled.
In status polling mode, FIFO is bypassed, the read status bytes are stored in DATA, and the
stored status bytes are not affected by the MASK control field. DATA contents is renewed at
the beginning of data phase if there is any.
FT is set at the end of data phase, where the external flash memory status bytes are
considered read, and it is cleared when DATA is read.
22.4.3.
Memory map mode
In memory-mapped mode, the external flash memory is considered as internal memory, no
more than 256MB can be address even if the external memory is larger. The Memory map
mode also don’t allow an an address outside what defined by FMSZ but still within 256MB
range. The memory map mode supports TrustZone architecture by stopping the transfer