2014-08-26 05:14 AM
2014-08-26 05:37 AM
What does the documentation for the ''HAL_SPI_Transmit_IT()'' function say?
2014-08-26 06:36 AM
Nothing! you can download the library from this link:
http://www.st.com/web/en/catalog/tools/PF2606122014-08-26 08:56 AM
Should add call-back code in your main.c
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi);2014-08-26 09:48 AM
Hey Clive, Thanks
but that's not clear to me still. where/how can I add my code to the callback? in the stm32f0xx_hal_spi.c file and in the void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi); function has written: ''NOTE : This function Should not be modified, when the callback is needed, the HAL_SPI_TxCpltCallback could be implenetd in the user file'' I want to set the NSS pin after transmission and now sound like I have to use the callback. please clear me. the callback function just has an argument that it is a structure.2014-08-26 10:32 AM
From: fairchild.brian
Posted: Tuesday, August 26, 2014 6:48 PMSubject: How can we know that the all datas have been sent!?Hey Clive, Thanks
but that's not clear to me still. where/how can I add my code to the callback? in the stm32f0xx_hal_spi.c file and in the void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi); function has written: ''NOTE : This function Should not be modified, when the callback is needed, the HAL_SPI_TxCpltCallback could be implenetd in the user file'' I want to set the NSS pin after transmission and now sound like I have to use the callback. please clear me. the callback function just has an argument that it is a structure.2014-08-26 10:51 AM
It's weakly defined, you're supposed to supply your own version that does whatever it needs to do at completion. It passes you a structure, you could expand/overload that structure to carry around your own context sensitive data if required.
Do whatever clean up you need, and return. In YOUR main.c, ******.c, or whatever/**
* @brief Tx Transfer completed callbacks
* @param hspi: SPI handle
* @retval None
*/
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{
// Do your stuff here, and return
}