HAL_SPI_Receive_IT Also Transmits
I am using STM32F105xx family, working with HAL_SPI API. I have discovered that the call to HAL_SPI_Receive_IT causes whatever data is in the provided buffer to be clocked out on MOSI. This issue is also discussed to some extent in this thread, but that thread is more focused on fixing the system behavior than discussing whether it's actually a bug in HAL.
So...am I crazy or is this a bug? If I call a "Receive" method that only takes a receive buffer, I shouldn't expect it to transmit that data, should I?
I'm working with TI's ADS1258 ADC which has a "direct read" mode meaning no command needs to be sent to read the next conversion result (technically, it watches the first three bits of MOSI; if they are all 1s or all 0s, it ignores the rest of MOSI and continues clocking out data on MISO for 32 bits). If there is stale data in the buffer provided to HAL_SPI_Receive_IT, and that data happens to have a first byte that the ADS1258 recognizes as a command, then my attempt to "direct read" turns into an unexpected reconfiguring of the ADC.
Why does HAL_SPI_Receive_IT clock out any data at all? Seems to me MOSI should be left alone.
I can observe the MOSI signal with a logic analyzer and see that it's clocking out the bits that were in the receive buffer, and I can fix my ADC issue by clearing the buffer before providing it to HAL_SPI_Receive_IT. But...I shouldn't have to do that, right?
Is there some use case I'm not imagining where one would want the "receive" API method to transmit data? HAL_SPI_TransmitReceive_* are the methods meant to enable full-duplex operation...
As an aside, I haven't bothered trying to find out whether HAL_SPI_Transmit_* also puts received data into the buffer it was given...but I have definitely noticed that the HAL API is not const-correct so it certainly could.
