/* Enables or disables the CRC value calculation of the transfered bytes.  */
void SPI_CalculateCRCCmd(SPI_TypeDef *SPIx, FunctionalState NewState)
/* Enables or disables the CRC value calculation of the transfered bytes.  */
void SPI_CalculateCRCCmd(SPI_TypeDef *SPIx, FunctionalState NewState)
{
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  SPI_Cmd(SPI1, DISABLE);
  if (NewState != DISABLE)
  {
    SPIx->CR2 |= SPI_CR2_CRCEN;
  }
  else
  {
    SPIx->CR2 &= (uint8_t)(~SPI_CR2_CRCEN);
  }
}