Beim SPI ist es normalerweise so, das den Eingang und Ausgang von das Schieberegister parallel arbeiten : Den Master schickt Daten nach den Slave, an Ausgang von den Slave komt dan auch eine Daten Satz raus. Diese kann (aber muss nicht) zuruck nach den Master gehen. Wen das Schieberegister ein Byte gross ist, und den Master schickt ein Byte, sind die Bytes van Master und Slave ausgetauscht.*)The data byte is parallel-loaded into the Tx buffer during a write cycle.
Beide laufen sowieso parallel.*)The transmit sequence begins when the slave device receives the clock signal and the most
significant bit of the data on its MOSI pin.
Da sind verschiedene Beispiele von SPI in die Standard Lib von STM32F10* :
'@par Example Description
This example provides a description of how to set a communication between two
SPIs in simplex mode and performs a data buffer transfer from SPI_MASTER to
SPI_SLAVE using TxE interrupt for master and RxNE interrupt for slave.
SPI_MASTER and SPI_SLAVE can be SPI1 and SPI2 or SPI3 and SPI2, depending on the
STMicroelectronics EVAL board you are using.
"
Lesezeichen