/* Selects the data transfer direction in bidirectional mode for the specified SPI.  */
void SPI_BiDirectionalLineConfig(SPI_TypeDef *SPIx, uint16_t SPI_Direction)
/* Selects the data transfer direction in bidirectional mode for the specified SPI.  */
void SPI_BiDirectionalLineConfig(SPI_TypeDef *SPIx, uint16_t SPI_Direction)
{
    assert_param(IS_SPI_ALL_PERIPH(SPIx));
    assert_param(IS_SPI_DIRECTION(SPI_Direction));
    if (SPI_Direction == SPI_Direction_Tx)
    {
        SPIx->CR1 |= SPI_Direction_Tx;
    }
    else
    {
        SPIx->CR1 &= SPI_Direction_Rx;
    }
}