/* SPI MSP De-Initialization This function frees the hardware resources used in this example:  */
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
/* SPI MSP De-Initialization This function frees the hardware resources used in this example:  */
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
{
  static DMA_HandleTypeDef hdma_tx;
  static DMA_HandleTypeDef hdma_rx;
  SPIx_FORCE_RESET();
  SPIx_RELEASE_RESET();
  HAL_GPIO_DeInit(SPIx_SCK_GPIO_PORT, SPIx_SCK_PIN);
  HAL_GPIO_DeInit(SPIx_MISO_GPIO_PORT, SPIx_MISO_PIN);
  HAL_GPIO_DeInit(SPIx_MOSI_GPIO_PORT, SPIx_MOSI_PIN);
  HAL_DMA_DeInit(&hdma_tx);
  HAL_DMA_DeInit(&hdma_rx);
  HAL_NVIC_DisableIRQ(SPIx_DMA_TX_IRQn);
  HAL_NVIC_DisableIRQ(SPIx_DMA_RX_IRQn);
  HAL_NVIC_DisableIRQ(SPIx_IRQn);
}