/**
  @page TIM_TimeBase TIM Time Base Description
  
  @verbatim
  ******************** (C) COPYRIGHT 2015 STMicroelectronics *******************
  * @file    TIM/TIM_TimeBase/readme.txt 
  * @author  MCD Application Team
  * @version V1.1.3
  * @date    15-December-2021
  * @brief   TIM Time Base Example Description.
  ******************************************************************************
  *
  * Copyright (c) 2015 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
   @endverbatim

@par Example Description 

This example shows how to configure the TIM peripheral in Output Compare Timing 
mode with the corresponding Interrupt requests for each channel in order to generate
4 different time bases.

The TIM3CLK frequency is set to SystemCoreClock (Hz), to get TIM3 counter 
clock at 72 MHz so the Prescaler is computed as following:
   - Prescaler = (TIM3CLK / TIM3 counter clock) - 1

SystemCoreClock is set to 72MHz.

The TIM3 CC1 register value is equal to 40961, 
CC1 update rate = TIM3 counter clock / CCR1_Val = 1757.77 Hz,
so the TIM3 Channel 1 generates an interrupt each 6.8ms

The TIM3 CC2 register is equal to 27309, 
CC2 update rate = TIM3 counter clock / CCR2_Val = 2636.49 Hz
so the TIM3 Channel 2 generates an interrupt each 4.55ms

The TIM3 CC3 register is equal to 13654, 
CC3 update rate = TIM3 counter clock / CCR3_Val = 5273.18 Hz
so the TIM3 Channel 3 generates an interrupt each 2.27ms

The TIM3 CC4 register is equal to 6826, 
CC4 update rate = TIM3 counter clock / CCR4_Val =  10547.9 Hz
so the TIM3 Channel 4 generates an interrupt each 1.13ms.

When the counter value reaches the Output compare registers values, the Output 
Compare interrupts are generated and, in the handler routine, 4 leds (LED1, LED2, 
LED3 and LED4) are toggled with the following frequencies: 

- LED1: 878.88 Hz (CC1)
- LED2: 1318.24 Hz (CC2)
- LED3: 2636.59 Hz (CC3) 
- LED4: 5273.95 Hz (CC4)
 
@par Directory contents 

  - TIM/TIM_TimeBase/stm32f30x_conf.h    Library Configuration file
  - TIM/TIM_TimeBase/stm32f30x_it.c      Interrupt handlers
  - TIM/TIM_TimeBase/stm32f30x_it.h      Interrupt handlers header file
  - TIM/TIM_TimeBase/main.c              Main program
  - TIM/TIM_TimeBase/system_stm32f30x.c  STM32F30x system source file
  
@note The "system_stm32f30x.c" is generated by an automatic clock configuration 
      system and can be easily customized to your own configuration. 
      To select different clock setup, use the "STM32F30x_Clock_Configuration_V1.0.0.xls" 
      provided with the AN4152 package available on <a href="http://www.st.com/internet/mcu/family/141.jsp">  ST Microcontrollers </a>
 
@par Hardware and Software environment

  - This example runs on STM32F303xC and STM32F303xE Devices.
  
  - This example has been tested with STMicroelectronics STM32303C-EVAL (STM32F30x)
    evaluation board and can be easily tailored to any other supported device 
    and development board.

  - STM32303C-EVAL Set-up
    - Use LED1, LED2, LED3 and LED4 connected respectively to PE.08, PE.09,PE.10 
    and PE.11 pins and connect them on an oscilloscope to show the different 
    Time Base signals.

@par How to use it ? 

In order to make the program work, you must do the following :
 - Copy all source files from this example folder to the template folder under
   Projects\STM32F30x_StdPeriph_Templates
 - Open your preferred toolchain 
 - Add the following files to the project source list
   - Utilities\STM32_EVAL\STM32303C_EVAL\stm32303c_eval.c
 - Rebuild all files and load your image into target memory
 - Run the example
    

 */
