This (www.keil.com/.../group__spi__interface__gr.html) spi interface is so confusing to me.
I can easily clock out my bytes. but I can not read them in? For example
SPIdrv->Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE); // SS line = ACTIVE = LOW SPIdrv->Send(testdata_out, size); // Wait for completion evt = osSignalWait(0x01, 100); if (evt.status == osEventTimeout) __breakpoint(0); // Timeout error: Call debugger SPIdrv->Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE); // SS line = INACTIVE = HIGH
.
this will send what is in my out data perfectly and I see the replies per byte. but the drivers wants me to now do this to read?
. SPIdrv->Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE); SPIdrv->Receive(testdata_in, 8); evt = osSignalWait(0x01, 100); if (evt.status == osEventTimeout) {__breakpoint(0); SPIdrv->Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE);
. and it clocks out 0's for each byte. Well, what good is that? I need to get the data after each byte clocked out? I'm obviously must be misusing this but it is a match to the example.
Really?
It's right there on the page you linked - immediately after ARM_SPI_Send and ARM_SPI_Receive in the list of functions