Fix STM32 SPI async API for STM32H7 (SPI_IP_VERSION_V2)
By default, HAL functions (HAL_SPI_TransmitReceive_IT/HAL_SPI_Transmit_IT/HAL_SPI_Receive_IT) assume that SPI is disabled between function invocation.
It's needed to set transfer size (CR2 register), that can be modified only if SPI disabled. But `stm32_spi_api.c` keeps SPI enabled after initialization.

This commit adds helper code for STM32H7 (SPI_IP_VERSION_V2) that disables SPI before HAL_SPI_TransmitReceive_IT/HAL_SPI_Transmit_IT/HAL_SPI_Receive_IT
and after end of transaction for HAL API compatibility.
ls
1 parent 756f6f5 commit 0c9d5b060521d241c678e2da15a2d9844555248b
@Konstantin Kochin Konstantin Kochin authored on 11 Jan 2022
Showing 1 changed file
View
targets/TARGET_STM/stm_spi_api.c