/**
  @page COMP_OutputBlanking COMP output blanking example
  
  @verbatim
  ******************** (C) COPYRIGHT 2015 STMicroelectronics *******************
  * @file    COMP/COMP_OutputBlanking/readme.txt 
  * @author  MCD Application Team
  * @version V1.1.3
  * @date    15-December-2021
  * @brief   Description of the COMP output blanking Example
  ******************************************************************************
  *
  * 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 use the output blanking feature of COMP peripheral.
The purpose of the output blanking feature in motor control is to prevent the
current regulation to trip upon short current spikes at the beginning of the PWM
period.
In this example COMP1 and TIM1 are used:
COMP1 is configured as following:
   - Non Inverting input is connected to PA1
   - Inverting input is connected to VREFINT (1.22V)
   - Output is available on PA0
   - Output is redirected to TIM1 BKIN to generate break event when
     non-inverting input is at higher voltage than inverting input (VREFINT)
   - TIM1 OC5 is used as blanking source

TIM1 is configured as following:
   - TIM1 period is APB2 clock / period = 72000000 / 50000 = 1440 Hz
   - TIM1 CH2 (PA9) configured in PWM mode with a frequency equal to 1440 Hz
     and duty cycle pulse/period = 100 * (37500 / 50000) =  75%
   - TIM1 OC5 (internal channel: not available on GPIO) configured in PWM mode
     with a frequency equal to 1440 Hz and high level equal to pulse / period = 
     2000 / 72000000 = 27.7 micro second
   - Break event is generated at high polarity (when non-inverting input is at
     higher voltage than inverting input)

At the beginning of TIM1 CH2 PWM, COMP1 output is blanked while TIM1 OC5 is at
high level (27.7 micro second): if non-inverting input is at higher voltage
than inverting input (VREFINT), the break event is not generated while TIM1 OC5
is at high level.
When OC5 is at low level, COMP1 output is no more blanked and if non-inverting
input is at higher voltage than inverting input (VREFINT) a break event is
generated and TIM1 CH2 (PA9) is held in safe state (low level).

In order to test this example, follow these steps:
- Connect TIM1 CH2 (PA9) to a scope and to the input trigger of a wave generator
- Connect the wave generator output to COMP1 Non Inverting input (PA1)
- Configure the wave generator to output a pulse at rising edge event with 
  high level greater than VREFINT (1.22V) and pulse duration lower 27.7 micro second
  (as an example you can use 10 micro second). 
  You can change the pulse delay and note that the break event is generated
  only when the pulse is triggered after 27.7 micro second

@par Directory contents 

  - COMP/COMP_OutputBlanking/stm32f30x_conf.h    Library Configuration file
  - COMP/COMP_OutputBlanking/stm32f30x_it.c      Interrupt handlers
  - COMP/COMP_OutputBlanking/stm32f30x_it.h      Interrupt handlers header file
  - COMP/COMP_OutputBlanking/main.c              Main program
  - COMP/COMP_OutputBlanking/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.

@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 
 - Rebuild all files and load your image into target memory
 - Run the example
    

 */
