2024-11-01 09:18 PM
We are trying to develop a device that uses SPI communication (Receive Only Master).
Are there any sample programs for SPI communication (Receive Only Master)?
Which should be executed first: "Receive Only Master HAL_SPI_Receive" or "Transmit Only Slave"?
I think it is "Receive Only Master HAL_SPI_Receive", is that correct?
2024-11-01 11:10 PM
Slave must be ready to respond to master, so slave must be started first.
SPI protocol is designed in such a way that slave implementation in a microcontroller may not be easy. Normally, the slave is a logic circuit, always ready for communication with master and able to initialize the session immediately after detecting -SS going low. This is impossible with an MCU.
2024-11-01 11:18 PM
”slave must be started first.”
I see. That's how it was.
Does this mean that "Transmit Only Slave" cannot be achieved with a MUC program?
Is there any way to achieve this by combining the following APIs?
・HAL_SPI_TransmitReceive
・HAL_SPI_Transmit
・HAL_SPI_Receive
・HAL_SPI_TransmitReceive_IT
・HAL_SPI_Transmit_IT
・HAL_SPI_Receive_IT
・HAL_SPI_TransmitReceive_DMA
・HAL_SPI_Transmit_DMA
・HAL_SPI_Receive_DMA
・HAL_SPI_TxCpltCallback
2024-11-03 03:24 AM
Hi,
Unfortunately, you are looking for a "crisp" black-white answer. But there is not one for the description you have given. There are many subtle differences between the different modes that may or may not suit your application.
You really need to read the Reference Manual for your device to assist with good choices...
Kind regards
Pedro