2015-08-29 4:49 PM
I'm at my wit's end, I cant seem to make SPI receive work properly.
This is a cut from the S003 reference manual:uint8_t SPI_TransferData(uint8_t Data)
{
SPI_SendData(Data);; 
/* Write in the DR register the data to be sent*/
while
(((SPI->SR & (uint8_t)SPI_FLAG_TXE) != (uint8_t)RESET)){} 
SPI_SendData(0x00);
while
(((SPI->SR & (uint8_t)SPI_FLAG_RXNE) != (uint8_t)RESET)){}
return
((uint8_t)SPI->DR);
}while
(((SPI->SR & (uint8_t)SPI_FLAG_RXNE) != (uint8_t)RESET)){}