2020-02-12 01:57 AM
Hi I am trying stm32f429zi discovery board for testing SPI communication
I've successed transmitting and receiving data on ADC chip
But I want know "How do these datas going so well?"
So I checked __HAL_SPI_TRANSMIT function
So I found that
hspi->instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
So that says DR is going to be a value about pTxBuffPtr right? so I pushed a value about pData which is incomming value __HAL_SPI_TRANSMIT name as pTxBuffPtr.
But I dont understand why this processing make spi data transmitting where i can found that informations?
Thanks
2020-02-13 06:29 AM
Spi "DR" is Dataregister, if you write to it, it will transmit out the data written. If you read from it, you will get received data.
And as always Reference manual of your mcu should tell you all you need to know about SPI periephal or any other periephal.