Q-Code User Manual
Ver. 7.0 2021/11/30
176
4.9.3 SPI_TX(Data, SPIGroup)
Send 8-bit data to SPI Flash via SCK and MOSI pins. This command can be used to send commands
or write data with SPI_WRD command. It can also be used to combine the commands that
Q-Code
does not support.
Data:
Transmit 8-bit data which can be immediate value or specified by variable.
SPIGroup:
Select the corresponding SPI channel.
NY6 does not support SPIGroup parameter.
NY7 supports SPI1 or SPI2; default is SPI1 if omitted.
Note:
1. NY4 / NY5 / NY5+ / NY6A / NY9T / NX1 do not support this command.
2. This command transmits 8-bit data only through the SCK and MISO pins, and does not
affect the status of CS pin. Therefore, users need to control the CS pin level independently.
3. This command needs to be used with SPI_WREN and SPI_WRD commands to write the
data into SPI Flash. Please refer to the description of SPI_WRD command for writing
method.
Ex.
SPI_CS_On, SPI_TX(0xB9), SPI_CS_Off
; Transmit 0xB9 command to SPI Flash via SPI1.
R0=0xB, R1=0xA, SPI_CS_On(SPI2), SPI_TX(R1:R0, SPI2), SPI_CS_Off(SPI2)
; Transmit 0xAB command to SPI Flash via SPI2.
X0=0x06, SPI_CS_On(SPI1), SPI_TX(X0, SPI1), SPI_CS_Off(SPI1)
; Transmit 0x06 command to SPI Flash via SPI1.
4.9.4 SPI_RX(Result, SPIGroup)
Receive 8-bit data from SPI Flash through SCK and MISO pins. This command can be used to read ID
or receive data from SPI Flash with SPI_RDD command. It can also be used to combine the
commands that
Q-Code
does not support.
Result:
Read 8-bit data which can be a combination of Ri / Xi.
SPIGroup:
Select the corresponding SPI channel.
NY6 does not support SPIGroup parameter.
NY7 supports SPI1 or SPI2; default is SPI1 if omitted.
Note:
1. NY4 / NY5 / NY5+ / NY6A / NY9T / NX1 do not support this command.
2. This command only receives 8-bit data through SCK and MISO pins, and does not affect
the status of CS pin. Therefore, users need to control the CS pin level independently.