/* Configures the data size for the selected SPI.  */
void SPI_DataSizeConfig(SPI_TypeDef *SPIx, uint16_t SPI_DataSize)
/* Configures the data size for the selected SPI.  */
void SPI_DataSizeConfig(SPI_TypeDef *SPIx, uint16_t SPI_DataSize)
{
  uint16_t tmpreg = 0;
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_DATA_SIZE(SPI_DataSize));
  tmpreg = SPIx->CR2;
  tmpreg &= (uint16_t)~SPI_CR2_DS;
  tmpreg |= SPI_DataSize;
  SPIx->CR2 = tmpreg;
}