/* Selects the data transfer direction in bi-directional mode.  */
void SPI_BiDirectionalLineConfig(SPI_TypeDef *SPIx, SPI_Direction_TypeDef SPI_Direction)
/* Selects the data transfer direction in bi-directional mode.  */
void SPI_BiDirectionalLineConfig(SPI_TypeDef *SPIx, SPI_Direction_TypeDef SPI_Direction)
{
  assert_param(IS_SPI_DIRECTION(SPI_Direction));
  if (SPI_Direction != SPI_Direction_Rx)
  {
    SPIx->CR2 |= SPI_CR2_BDOE;
  }
  else
  {
    SPIx->CR2 &= (uint8_t)(~SPI_CR2_BDOE);
  }
}