/* Selects the data transfer direction in bi-directional mode for the specified SPI.  */
void SPI_ConfigBidirectionalMode(SPI_Module *SPIx, uint16_t DataDirection)
/* Selects the data transfer direction in bi-directional mode for the specified SPI.  */
void SPI_ConfigBidirectionalMode(SPI_Module *SPIx, uint16_t DataDirection)
{
    assert_param(IS_SPI_PERIPH(SPIx));
    assert_param(IS_SPI_BIDIRECTION(DataDirection));
    if (DataDirection == SPI_BIDIRECTION_TX)
    {
        SPIx->CTRL1 |= SPI_BIDIRECTION_TX;
    }
    else
    {
        SPIx->CTRL1 &= SPI_BIDIRECTION_RX;
    }
}