/* Initializes SPI peripheral registers to their default reset values(Reset SPI FIFO when this function is called).  */
void SPI_DeviceInit(SPI_Type *SPIx)
/* Initializes SPI peripheral registers to their default reset values(Reset SPI FIFO when this function is called).  */
void SPI_DeviceInit(SPI_Type *SPIx)
{
  __IO uint32_t dummy_data = 0UL;
  assert_parameters(IS_SPI_ALL_INSTANCE(SPIx));
  SPIx->CTRL = 0;
  SPIx->CTRL |= SPI_CTRL_RST;
  SPIx->CTRL &= ~SPI_CTRL_RST;
  dummy_data = SPIx->RXDAT;
  dummy_data += 1;
  SPIx->TXSTS = SPI_TXSTS_TXIF|SPI_TXSTS_DMATXDONE;
  SPIx->RXSTS = SPI_RXSTS_RXIF;
  SPIx->MISC = SPI_MISC_RSTValue;
}