/* Enables or disables the CRC value calculation of the transferred bytes.  */
void SPI_CalculateCRC(SPI_TypeDef *SPIx, FunctionalState NewState)
/* Enables or disables the CRC value calculation of the transferred bytes.  */
void SPI_CalculateCRC(SPI_TypeDef *SPIx, FunctionalState NewState)
{
    assert_param(IS_SPI_ALL_PERIPH(SPIx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        SPIx->CR1 |= SPI_CR1_CRCEN;
    }
    else
    {
        SPIx->CR1 &= (uint16_t)~((uint16_t)SPI_CR1_CRCEN);
    }
}