EasyManua.ls Logo

ST STM32F31xx

ST STM32F31xx
584 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Comparators (COMP)
UM1581
140/584
DocID023800 Rev 1
Table 13: COMP Outputs blanking sources
COMP1
COMP2
COMP3
COMP4
COMP5
COMP6
COMP7
TIM1 OC5
TIM1 OC5
TIM1 OC5
TIM3 OC4
TIM3 OC3
TIM2 OC4
TIM1 OC5
TIM3 OC3
TIM3 OC3
TIM2 OC4
TIM15 OC1
TIM8 BKIN
TIM15 OC2
TIM15 OC2
TIM2 OC3
TIM2 OC3
--------
TIM8 OC5
TIM8 OC5
TIM8 OC5
TIM8 OC5
5.2.2 How to use this driver
This driver provides functions to configure and program the Comparators of all
STM32F30x devices. To use the comparator, perform the following steps:
1. Enable the SYSCFG APB clock to get write access to comparator register using
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
2. Configure the comparator input in analog mode using GPIO_Init()
3. Configure the comparator output in alternate function mode using GPIO_Init() and
use GPIO_PinAFConfig() function to map the comparator output to the GPIO pin
4. Configure the comparator using COMP_Init() function:
Select the inverting input
Select the non-inverting input
Select the output polarity
Select the output redirection
Select the hysteresis level
Select the power mode
5. Enable the comparator using COMP_Cmd() function
6. If required enable the COMP interrupt by configuring and enabling EXTI line in
Interrupt mode and selecting the desired sensitivity level using EXTI_Init() function.
After that enable the comparator interrupt vector using NVIC_Init() function.
5.2.3 Initialization and Configuration functions
COMP_DeInit()
COMP_Init()
COMP_StructInit()
COMP_Cmd()
COMP_SwitchCmd()
COMP_GetOutputLevel()
5.2.4 Window mode control function
COMP_WindowCmd()

Table of Contents

Related product manuals