Software writes byte sequences that are needed for the specific flash device. Refer to the Quad-SPI device vendor's specification. The controller has four write-only 32-bit TXD registers for software to issue a stream of commands to get status and read/write data from the flash memory. Quad-SPI TXD register write formats are described in the following table. Each access to the TXD0, TXD1, TXD2, or TXD3 register results into a corresponding write to the TxFIFO.
The user must empty the TxFIFO between consecutive accesses from:
- TXD0 to TXD1/TXD2/TXD3
- TXD1 to TXD0/TXD1/TXD2/TXD3
- TXD2 to TXD0/TXD1/TXD2/TXD3
- TXD3 to TXD0/TXD1/TXD2/TXD3
You need not empty the FIFO for TxD0 to TXD0 accesses.
| Register | Write Data Format | Example Usage | |||
|---|---|---|---|---|---|
| 31:24 | 23:16 | 15:8 | 7:0 | ||
| TXD 1 | Reserved | Reserved | Reserved | Data or command | Set write enable |
| TXD 2 | Reserved | Reserved | Data 0 | Data or command | Write status with data |
| TXD 3 | Reserved | Data 1 | Data 0 | Data or command | Read status with two dummy bytes |
| TXD 0 | Data 3 | Data 2 | Data 1 | Data or command | Write data to transmit or dummy data for reads |
Note: The dummy data bytes, which are required in some of the
instructions for the selected memory, should be part of the instruction sequence
along with the number of bytes intended to be read from memory. The dummy data bytes
ensure enough bus turnaround time for switching I/O from output to input. If the
number of dummy data bytes is insufficient for an instruction, the memory reads the
wrong data. For more information on the number of dummy data bytes needed for a
particular instruction, consult the data sheet for the targeted memory.