/* Deinitializes the SPIx peripheral registers to their default reset values.  */
void SPI_DeInit(SPI_TypeDef *SPIx)
/* Deinitializes the SPIx peripheral registers to their default reset values.  */
void SPI_DeInit(SPI_TypeDef *SPIx)
{
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  if (SPIx == SPI1)
  {
    RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, ENABLE);
    RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, DISABLE);
  }
  else
  {
    if (SPIx == SPI2)
    {
      RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, ENABLE);
      RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, DISABLE);
    }
  }
}