ï‚· If the selected comparator is locked, initialization can't be
performed. To unlock the configuration, perform a system
reset.
ï‚· By default, PA1 is selected as COMP1 non inverting input. To
use PA4 as COMP1 non inverting input call
COMP_SwitchCmd() after COMP_Init()
5.2.5.3 COMP_StructInit
void COMP_StructInit ( COMP_InitTypeDef *
COMP_InitStruct)
Fills each COMP_InitStruct member with its default value.
ï‚· COMP_InitStruct : pointer to an COMP_InitTypeDef
structure which will be initialized.
5.2.5.4 COMP_Cmd
void COMP_Cmd ( uint32_t COMP_Selection, FunctionalState
NewState)
Enable or disable the COMP peripheral.
ï‚· COMP_Selection : the selected comparator. This parameter
can be COMP_Selection_COMPx where x can be 1 to 7 to
select the COMP peripheral.
ï‚· NewState : new state of the COMP peripheral. This
parameter can be: ENABLE or DISABLE. When enabled, the
comparator compares the non inverting input with the
inverting input and the comparison result is available on
comparator output. When disabled, the comparator doesn't
perform comparison and the output level is low.
ï‚· If the selected comparator is locked, enable/disable can't be