I have a few questions:
My understanding of SPI as it stands, is that the master is responsible for bringing chip select low, pulsing the clock, and transmitting data for a certain period. In a full duplex scenario, it receives data in the same period and receives exactly as many bits as it transmits. In a half duplex scenario, it continues to pulse the clock after it has transmitted, first for a pause for the slave to compute its response, and then for a period of time for the slave to transmit a number of bits. Is this correct?
I'm trying to use half duplex communication, does this mean that the master is responsible for knowing how long the slave will take to compute its response, and how many bits the slave will transmit back to it? If this is not so, how is the master supposed to deal with the slave communicating this information to it?
When the master talls
Code: Select all
spi_device_transmitCode: Select all
rxlengthCode: Select all
rxlengthIn the SPI Slave API it doesn't appear that there's any way to simply wait for the master to send something, and receive. Am I right in thinking that in order to receive you must "transmit" a transaction that happens to have a 0 byte transmission, but has a receive buffer? For an API that's meant to be implementing a protocol that's entirely driven by the master, it seems very odd that the slave API isn't something along the lines of a function to yeild the CPU until a data received interrupt comes in, and then have a callback called when a request comes in.
I've set up a very basic experiment (code attached), in which the slave tries to respond to all messages with "My Tallest", and the master sends out requests containing command 0x1, and address 0xdead. When I do this, the master only appears to receive "llest". I honestly, have no idea why that would be. Can anyone clarify what's going on here?
