Table 13: COMP Outputs blanking sources
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()