DocID025202 Rev 7
418/1080
RM0365
Comparator (COMP)
422
17.5.3
COMP4 control and status register (COMP4_CSR)
Address offset: 0x28
Reset value: 0x0000 0000
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
COMP
4LOCK
COMP
4OUT
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res
Res.
COMP4_BLANKING[2:0]
COMP4HYST
[1:0]
(1)
rwo
r
rw
rw
rw
rw
rw
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
COMP
4POL
Res.
COMP4OUTSEL[3:0]
Res.
Res.
COMP4
INPSEL
COMP4INMSEL[2:0]
COMP4MODE
[1:0]
Res.
COMP4
EN
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
1. Only in STM32F302xB/C.
Bit 31
COMP4LOCK
: Comparator 4 lock
This bit is write-once. It is set by software. It can only be cleared by a system reset.
It allows to have COMP4_CSR register as read-only.
0: COMP4_CSR is read-write.
1: COMP4_CSR is read-only.
Bit 30
COMP4OUT
: Comparator 4 output
This read-only bit is a copy of comparator 4 output state.
0: Output is low (non-inverting input below inverting input).
1: Output is high (non-inverting input above inverting input).
Bits 29: Reserved, must be kept at reset value.
Bits 20:18
COMP4_BLANKING
: Comparator 4 blanking source
These bits select which Timer output controls the comparator 4 output blanking.
000: No blanking
001: TIM3 OC4 selected as blanking source
010: Reserved
011: TIM15 OC1 selected as blanking source
Other configurations: reserved, must be kept at reset value
Note: Depending on the product, when a timer is not available, the corresponding combination is
reserved.
Bits 17:16
COMP4HYST[1:0]
: Comparator 4 Hysteresis
On the STM32F302xBC, these bits control the hysteresis level.
00: No hysteresis
01: Low hysteresis
10: Medium hysteresis
11: High hysteresis
Please refer to the electrical characteristics for the hysteresis values.
On the STM32F302x6/8 and STM32F302xD/E, , these bits are reserved and must be kept at reset
value.
Bit 15
COMP4POL
: Comparator 4 output polarity
This bit is used to invert the comparator 4 output.
0: Output is not inverted
1: Output is inverted
Bit 14 Reserved, must be kept at reset value.