/* Returns the transmit or the receive CRC register value for the specified SPI.  */
uint16_t SPI_GetCRC(SPI_TypeDef *SPIx, uint8_t SPI_CRC)
/* Returns the transmit or the receive CRC register value for the specified SPI.  */
uint16_t SPI_GetCRC(SPI_TypeDef *SPIx, uint8_t SPI_CRC)
{
    uint16_t crcreg = 0;
    assert_param(IS_SPI_ALL_PERIPH(SPIx));
    assert_param(IS_SPI_CRC(SPI_CRC));
    if (SPI_CRC != SPI_CRC_Rx)
    {
        crcreg = SPIx->TXCRCR;
    }
    else
    {
        crcreg = SPIx->RXCRCR;
    }
    return crcreg;
}