text: 
  /**
    ********************************************************************************
    * @file    stm8s_tim2_DeInit.c
    * @author  MCD Application Team
    * @version V2.2.0
    * @date    30-September-2014
    * @brief   This file contains all the functions for the UART1 peripheral.
     ******************************************************************************
    * @attention
    *
    * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
    *
    * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
    * You may not use this file except in compliance with the License.
    * You may obtain a copy of the License at:
    *
    *        http://www.st.com/software_license_agreement_liberty_v2
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    *
    ******************************************************************************
    */
  
  /* Includes ------------------------------------------------------------------*/
  #include "stm8s_tim2.h"
  #include "private/stm8s_tim2_private.h"
  
  /** @addtogroup STM8S_StdPeriph_Driver
    * @{
    */
  
  /** @}
    * @addtogroup TIM2_Public_Functions
    * @{
    */
  
  /**
    * @brief  Deinitializes the TIM2 peripheral registers to their default reset values.
    * @param  None
    * @retval None
    */
  void TIM2_DeInit(void)
  {
    TIM2->CR1 = (uint8_t)TIM2_CR1_RESET_VALUE;
    TIM2->IER = (uint8_t)TIM2_IER_RESET_VALUE;
    TIM2->SR2 = (uint8_t)TIM2_SR2_RESET_VALUE;
    
    /* Disable channels */
    TIM2->CCER1 = (uint8_t)TIM2_CCER1_RESET_VALUE;
    TIM2->CCER2 = (uint8_t)TIM2_CCER2_RESET_VALUE;
    
    
    /* Then reset channel registers: it also works if lock level is equal to 2 or 3 */
    TIM2->CCER1 = (uint8_t)TIM2_CCER1_RESET_VALUE;
    TIM2->CCER2 = (uint8_t)TIM2_CCER2_RESET_VALUE;
    TIM2->CCMR1 = (uint8_t)TIM2_CCMR1_RESET_VALUE;
    TIM2->CCMR2 = (uint8_t)TIM2_CCMR2_RESET_VALUE;
    TIM2->CCMR3 = (uint8_t)TIM2_CCMR3_RESET_VALUE;
    TIM2->CNTRH = (uint8_t)TIM2_CNTRH_RESET_VALUE;
    TIM2->CNTRL = (uint8_t)TIM2_CNTRL_RESET_VALUE;
    TIM2->PSCR = (uint8_t)TIM2_PSCR_RESET_VALUE;
    TIM2->ARRH  = (uint8_t)TIM2_ARRH_RESET_VALUE;
    TIM2->ARRL  = (uint8_t)TIM2_ARRL_RESET_VALUE;
    TIM2->CCR1H = (uint8_t)TIM2_CCR1H_RESET_VALUE;
    TIM2->CCR1L = (uint8_t)TIM2_CCR1L_RESET_VALUE;
    TIM2->CCR2H = (uint8_t)TIM2_CCR2H_RESET_VALUE;
    TIM2->CCR2L = (uint8_t)TIM2_CCR2L_RESET_VALUE;
    TIM2->CCR3H = (uint8_t)TIM2_CCR3H_RESET_VALUE;
    TIM2->CCR3L = (uint8_t)TIM2_CCR3L_RESET_VALUE;
    TIM2->SR1 = (uint8_t)TIM2_SR1_RESET_VALUE;
  }
  
  /**
    * @}
    */
  
  /**
    * @}
    */
  
  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  