Open showier-drastic opened 1 month ago
In f4xx-hal
it is done using advanced BIDI
generic marker. See https://github.com/stm32-rs/stm32f4xx-hal/blob/910163d4d0e2b64091e15a72667fb1273e49a1c2/src/spi.rs#L172
You could improve API making similar PR.
When interfacing with single wire half-duplex SPI devices such as the TLE5012 magnetic sensor, we should enable bidirection mode as shown in "25.3.4 Configuring the SPI for half-duplex communication" of STM32F1 reference manual. Mainly, BIDIMODE bit of CR1 should be set high, and BIDIOE bit should be set according to transfer direction. Is it possible for the HAL to support this?