I have to read data from a serial Nor flash, connected to my RT1051 through LPSPI2.
I have to send one command byte and then I have to read 10KB data.
It would be nice to do this with two transfers:
- a 1-byte transfer in tx for command, with the rx buffer NULL
- another transfer with 10KB rx buffer, and NULL tx buffer
obviously the chip-select must be asserted at the first transfer and de-asserted at the end of the second transfer, between the two transfers the chip-select must remain asserted (I think the CONTC bit of TCR is to be used)
- Is it possible to do this with the SDK 2.5.0 APIs?
a single call to LPSPI_MasterTransferBlocking() would force me to allocate both rxData and txData buffers with two vectors of more than 10KB, in which the tx buffer is completely useless. Is exactly what I would like to avoid.