/* Enables or disables the CRC value calculation of the transferred bytes.  */
void SPI_EnableCalculateCrc(SPI_Module *SPIx, FunctionalState Cmd)
/* Enables or disables the CRC value calculation of the transferred bytes.  */
void SPI_EnableCalculateCrc(SPI_Module *SPIx, FunctionalState Cmd)
{
    assert_param(IS_SPI_PERIPH(SPIx));
    assert_param(IS_FUNCTIONAL_STATE(Cmd));
    if (Cmd != DISABLE)
    {
        SPIx->CTRL1 |= CTRL1_CRCEN_ENABLE;
    }
    else
    {
        SPIx->CTRL1 &= CTRL1_CRCEN_DISABLE;
    }
}