What does the documentation for the ''HAL_SPI_Transmit_IT()'' function say?
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
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.
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.
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
}
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..