/* Returns the most recent received data by the SPIx peripheral.  */
uint32_t SPI_ReceiveData(SPI_TypeDef *SPIx)
/* Returns the most recent received data by the SPIx peripheral.  */
uint32_t SPI_ReceiveData(SPI_TypeDef *SPIx)
{
    uint32_t temp = 0;
    assert_param(IS_SPI_ALL_PERIPH(SPIx));
    temp = temp;
    temp |= (uint32_t)SPIx->RXREG;
    if(SPIx->EXTCTL > 8 || SPIx->EXTCTL == 0)    temp |= (uint32_t) (SPIx->RXREG) << 8;
    if(SPIx->EXTCTL > 16 || SPIx->EXTCTL == 0)  	temp |= (uint32_t)( SPIx->RXREG) << 16;
    if(SPIx->EXTCTL > 24 || SPIx->EXTCTL == 0)	temp |= (uint32_t)( SPIx->RXREG) << 24;
    return temp;
}