I am in the function with the maximum delay waiting for the master to send me data in order to send him the data stored in sendbufer in response. But while I was waiting, I decided to change the data in sendbufer. The question is what data will go to the master new or previous.
Task1
t.length=128*8;
t.tx_buffer=sendbuf;
t.rx_buffer=recvbuf;
ret=spi_slave_transmit(RCV_HOST, &t, portMAX_DELAY);
Task2
sendbuf[0] = 0xA5;
...
SPI Slave transmit function
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: SPI Slave transmit function
It's undefined, as in, we don't guarantee anything about the state the data is in. In practice, it may be that the first few words still are 'old' data as they're already hoovered up by the DMA subsystem and waiting in a FIFO somewhere, but whatever behaviour you see, better not depend on it as there's no guarantee it won't change in future HW/SW versions.
Re: SPI Slave transmit function
Do you have any ideas how you can implement such an algorithm over the SPI bus.since the master needs to have up-to-date latest data at the time of their receipt.
Who is online
Users browsing this forum: Bing [Bot] and 108 guests