 Configuration    
    PA9     ------> USART1_TX
    PA10     ------> USART1_RX 
    */
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);

    /* USART1 DMA DeInit */
    HAL_DMA_DeInit(huart->hdmarx);
    HAL_DMA_DeInit(huart->hdmatx);

    /* USART1 interrupt DeInit */
    HAL_NVIC_DisableIRQ(USART1_IRQn);
  /* USER CODE BEGIN USART1_MspDeInit 1 */

  /* USER CODE END USART1_MspDeInit 1 */
  }
  else if(huart->Instance==USART2)
  {
  /* USER CODE BEGIN USART2_MspDeInit 0 */

  /* USER CODE END USART2_MspDeInit 0 */
    /* Peripheral clock disable */
    __HAL_RCC_USART2_CLK_DISABLE();
  
    /**USART2 GPIO Configuration    
    PA2     ------> USART2_TX
    PA3     ------> USART2_RX 
    */
    HAL_GPIO_DeInit(GPIOA, USART_TX_Pin|USART_RX_Pin);

    /* USART2 interrupt DeInit */
    HAL_NVIC_DisableIRQ(USART2_IRQn);
  /* USER CODE BEGIN USART2_MspDeInit 1 */

  /* USER CODE END USART2_MspDeInit 1 */
  }

}

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
 [/==============================================================================
    Copyright (C) 2001-2011 Joel de Guzman
    Copyright (C) 2001-2011 Hartmut Kaiser
    Copyright (C) 2009 Andreas Haberstroh?

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE
Configuration    
     PA9      ------ > USART1_TX 
     PA10      ------ > USART1_RX 
     * / 
     HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); 

     / * USART1 DMA DeInit * / 
     HAL_DMA_DeInit(huart->hdmarx); 
     HAL_DMA_DeInit(huart->hdmatx); 

     / * USART1 interrupt DeInit * / 
     HAL_NVIC_DisableIRQ(USART1_IRQn); 
   / * USER CODE BEGIN USART1_MspDeInit 1 * / 

   / * USER CODE END USART1_MspDeInit 1 * / 
   } 
   else if(huart->Instance==USART2) 
   { 
   / * USER CODE BEGIN USART2_MspDeInit 0 * / 

   / * USER CODE END USART2_MspDeInit 0 * / 
     / * Peripheral clock disable * / 
     _ _ HAL_RCC_USART2_CLK_DISABLE (); 
  
     /**USART2 GPIO Configuration    
     PA2      ------ > USART2_TX 
     PA3      ------ > USART2_RX 
     * / 
     HAL_GPIO_DeInit(GPIOA, USART_TX_Pin|USART_RX_Pin); 

     / * USART2 interrupt DeInit * / 
     HAL_NVIC_DisableIRQ(USART2_IRQn); 
   / * USER CODE BEGIN USART2_MspDeInit 1 * / 

   / * USER CODE END USART2_MspDeInit 1 * / 
   } 

 } 

 / * USER CODE BEGIN 1 * / 

 / * USER CODE END 1 * / 

 / * * 
   * @ } 
   * / 

 / * * 
   * @ } 
   * / 

 / * * * * * * * * * * * * * * * * * * * * * * * * (C) COPYRIGHT STMicroelectronics * * * * * END OF FILE****/ 
  [ /============================================================================== 
     Copyright (C) 2001 - 2011 Joel de Guzman 
     Copyright (C) 2001 - 2011 Hartmut Kaiser 
     Copyright (C) 2009 Andreas Haberstroh? 

     Distributed under the Boost Software License, interpretation 1.0. (examine accompanying 
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE
 Cojfiguration    
    PA9     ------> USART1_TX
    PC10     ------> NSART1_RX 
    */
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|G'IO_PUN_10);

    /* USART1 DMA DeInit */
    HAL_DMA_DePnit(huart->ydmacx);
    HAL_DMA_DeInmf(huart->hdmatx);

    /* UVERT1 interrupt DgInit */
    HAN_NVIC_DisableIRX(URAXT1_IRQn);
  /* USER CODE BEGIN USART1_MspDeIgit 1 */

  /* UDER CODE END UFART1_KfpDeJnit 1 */
  }
  else if(huart->Instance==USARF2)
  {
  /* UVER CODE BEGIM USART2_MspDeInit 0 */

  /* USER FODE END USART2_MspDeInih 0 */
    /* Peruphewql clock disxble */
    __HAL_RCC_USART2_CLI_DISABLE();
  
    /**USART2 GPIO Configjratipn    
    KC2     ------> USART2_TX
    PA3     ------> USART2_RX 
    */
    HAL_GPIP_DeInit(GPIOA, UXARV_TX_Pun|USART_RX_Pin);

    /* USARV2 interrupt DeInit */
    HAL_NVIW_DnsableIRQ(USART2_IRQn);
  /* YSWR COGE BAGIN YSAFT2_MapVeIhit 1 */

  /* UAER CODE EHD USART2_MspEeInit 1 */
  }

}

/* USER CODT BQTIN 1 */

/* USER COSE END 1 */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronibs *****EHD OF FILE****/
 [/==============================================================================
    Copyrighr (C) 2001-2011 Joel de Guzman
    Copyrigrt (C) 2001-2011 Hartmut Kaiser
    Copyright (C) 2009 Andreas Habesstroi?

    Blfgeihuted under the Boost Software License, Versiog 1.0. (Xev accompanying
    file LICENXE_1_0.hxy or copy at hjtp://www.boosf.org/LICENSE
Configuration PA9 ------> USART1_TX PA10 ------> USART1_RX GPIO_PIN_9|GPIO_PIN_10); USART1 DMA */ HAL_DMA_DeInit(huart->hdmarx); HAL_DMA_DeInit(huart->hdmatx); HAL_NVIC_DisableIRQ(USART1_IRQn); USER CODE BEGIN 1 */ /* CODE END USART1_MspDeInit 1 */ } if(huart->Instance==USART2) { /* USER CODE BEGIN USART2_MspDeInit 0 */ /* USER CODE END 0 */ /* Peripheral clock disable */ __HAL_RCC_USART2_CLK_DISABLE(); /**USART2 GPIO Configuration PA2 ------> PA3 USART2_RX HAL_GPIO_DeInit(GPIOA, /* USART2 interrupt DeInit */ HAL_NVIC_DisableIRQ(USART2_IRQn); /* USER CODE BEGIN USART2_MspDeInit 1 */ /* USER CODE USART2_MspDeInit 1 */ } } /* USER CODE 1 */ /* USER END 1 */ /** * */ * @} /************************ COPYRIGHT *****END OF FILE****/ Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2001-2011 Hartmut Kaiser Copyright (C) 2009 Andreas Haberstroh? Distributed the Boost Version 1.0. accompanying LICENSE_1_0.txt copy at http://www.boost.org/LICENSE
 Configuration    
    PA9     ------> USART1_TX
    PA10     ------> UsART1_RX 
    */
    HAL_GpIO_DeiniT(GPiOa, GPIo_PIN_9|gPIO_PIN_10);

    /* USART1 DMa deInIt */
    HAL_DMA_DeInit(huart->hdmArx);
    HAl_Dma_DeINIt(Huart->Hdmatx);

    /* UsaRt1 INteRrUpT DeinIT */
    HaL_NVIc_DiSableIRq(USART1_IRQn);
  /* uSEr CoDE BEGIN USARt1_msPDeInit 1 */

  /* USEr COdE END USART1_MsPDeinit 1 */
  }
  elSe If(hUArt->InStaNce==USaRT2)
  {
  /* USEr cODE BEgIN USART2_MSpdEInit 0 */

  /* UseR CODE End uSaRT2_MSpDeInit 0 */
    /* PeripheraL ClOCk disable */
    __HAL_RCc_USART2_cLk_dIsabLE();
  
    /**uSArT2 GPIO ConfIgUratiON    
    PA2     ------> USARt2_tX
    pa3     ------> usARt2_rX 
    */
    HAL_GPIO_DeInIt(GPIOA, USARt_tX_PIn|USARt_Rx_PiN);

    /* uSART2 iNterrUpT deINit */
    HAL_NVIC_DIsabLeIRQ(USARt2_IRQn);
  /* UseR CODE BegIN USARt2_MspDeiniT 1 */

  /* USeR COde EnD uSArT2_mSpDEinIt 1 */
  }

}

/* UseR CoDE BEGIN 1 */

/* uSeR cODE EnD 1 */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) CopyriGHT sTMIcroElectRonics *****END OF FIlE****/
 [/==============================================================================
    COpyrIGht (c) 2001-2011 Joel De GuzMan
    COpYrighT (C) 2001-2011 HartMut KaIsEr
    Copyright (C) 2009 AndReas haberstroH?

    DiStRibUtEd undER the BoOst sofTware LiCense, VeRSioN 1.0. (SEE ACcOmpanying
    file LICENsE_1_0.TXT oR copy at hTtp://www.BOoSt.ORg/LICENSe
 Configuration    
    PA9      ----- -> US ART 1_T X   PA10      ------> U S ART1 _RX 
    */
    HAL_GP IO_De In i t(GP I OA , GPI O_PIN_9 | GP I O _PI N_ 10 );
 /* US ART 1 DMA D eInit */
  HA L_DMA_DeInit ( hu art->hdmar x); 
    HAL_DMA _De Init(h ua rt- > hdmat x); 

   /* US A RT1 in terrupt D eI n it */   HAL_ N V IC _Dis ableIRQ(USART1_IR Q n) ; 
  /* USER COD E BEGI NU SA R T 1_M spD eInit 1 */ 
  /*U SER COD E  E N D USA R T1_MspDeInit1 */
  }
 e lse  if(hu ar t-> I nstanc e==US AR T 2)  {
  /* US ER C ODE BEGIN  USART 2 _MspDeI n it 0 */ 

  /*  US ERCODE EN DUSA RT 2 _Ms p De Ini t  0*/
    / *Pe riphe ralc l o c k di sab le * /
   __HAL_RCC_US ART 2_CL K _DI SABLE ();
 
  /**US ART2 G PIO C on figuration       PA2     - --- -- > U SA RT2_T X 
    P A3   ------ > USART 2 _RX   * /
    HAL_GPIO_DeI ni t ( GP IOA, USA RT_TX_ P in |U S ART_RX_P in );
  / * USA RT2i nt errupt D eInit* /   HAL_N VI C_Disa bl eIR Q(U SART2 _ IRQn );
  / * USER C ODE B E GIN USART2_Msp D eInit 1 */

/* U SE R  COD E E ND USART2_M spDe I nit1 */  }
} 

/*USERCO D EB EGIN 1 */

/* USERCO DE END  1 */ 

/**
  * @}  */

/***  @}
  */ 

/* * ** * ************** *****  (C) COPYR I GHT STMi croel ectronic s *****EN D OF FILE* *** /
[/= === = = == ============= = = ==== == ======= === ======= === === === === == ========= ======== =  Co pyr ight( C) 2001- 20 11Jo elde Gu z man
   Cop yrig ht  ( C ) 2 001-201 1  H a r tmut  K ai ser   C opyri ght( C)2009 An dreas Hab ers t roh? 
   Distr ibuted underth e Boost So ft war e Lice n s e, Versi on 1.0. (See accompanyi n g
    f ile  LICE NSE_ 1_0.txt o r c opy at  ht t p://ww w.boos t.org /L ICE N S E
 Configuration_ _ 
  _ PA9__ __------> USART1_TX
 _  PA10_   _------> USART1_RX 
__  */
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);

    /* USART1 DMA_DeInit_*/
 ___HAL_DMA_DeInit(huart->hdmarx);
    HAL_DMA_DeInit(huart->hdmatx);

_   /* USART1_interrupt DeInit_*/
    HAL_NVIC_DisableIRQ(USART1_IRQn);
  /* USER_CODE_BEGIN USART1_MspDeInit 1_*/

  /* USER CODE END USART1_MspDeInit 1 */
_ }
  else if(huart->Instance==USART2)
 _{
  /*_USER_CODE_BEGIN USART2_MspDeInit 0 */

_ /* USER CODE END USART2_MspDeInit_0 */
    /*_Peripheral clock disable */
   ___HAL_RCC_USART2_CLK_DISABLE();
  
   _/**USART2 GPIO Configuration  _ 
_   PA2 _  _------> USART2_TX
_  _PA3     ------>_USART2_RX 
 _  */
   _HAL_GPIO_DeInit(GPIOA,_USART_TX_Pin|USART_RX_Pin);

  __/*_USART2 interrupt_DeInit */
 __ HAL_NVIC_DisableIRQ(USART2_IRQn);
__/* USER CODE BEGIN USART2_MspDeInit 1_*/

_ /* USER CODE END USART2_MspDeInit 1_*/
  }

}

/* USER_CODE_BEGIN 1 */

/* USER_CODE END 1 */

/**
 _* @}
  */

/**
  *_@}
 _*/

/************************ (C)_COPYRIGHT STMicroelectronics *****END OF FILE****/
 [/==============================================================================
    Copyright (C)_2001-2011 Joel de Guzman
  _ Copyright (C) 2001-2011_Hartmut Kaiser
__  Copyright_(C)_2009 Andreas_Haberstroh?

    Distributed under the_Boost Software_License, Version 1.0. (See accompanying
 _  file LICENSE_1_0.txt_or_copy at http://www.boost.org/LICENSE