Skip to content

Commit e834817

Browse files
committed
stm32wb: ADC -> ADC1 and add ADC_COMMON
As is commonly done, use "ADC1" even when there's only one ADC. This makes it not only more self consistent, (interrupt names were for ADC1) but also more consistent with sibling targets like STM32L4. Also, like the L4, the WB svd is missing the ADC_Common registers. Add them back in, but note that there's less bits in the common registers. Signed-off-by: Karl Palsson <karlp@etactica.com>
1 parent 9b853df commit e834817

File tree

2 files changed

+99
-1
lines changed

2 files changed

+99
-1
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Not quite the same as L4 ADC_Common, as there's no slave ADC on WB.
2+
_add:
3+
# This SVD is missing the ADC_Common peripheral that most other parts with
4+
# this ADC contain; consequently it's missing the CSR and CCR regs
5+
# from RM0434.
6+
ADC_Common:
7+
description: ADC common registers
8+
groupName: ADC
9+
baseAddress: 0x50040300
10+
addressBlock:
11+
offset: 0
12+
size: 0xc
13+
usage: registers
14+
registers:
15+
CSR:
16+
description: ADC common status register
17+
addressOffset: 0x0
18+
access: read-only
19+
resetValue: 0x00000000
20+
fields:
21+
JQOVF_MST:
22+
description: Injected Context Queue Overflow flag of the master ADC
23+
bitOffset: 10
24+
bitWidth: 1
25+
AWD3_MST:
26+
description: Analog watchdog 3 flag of the master ADC
27+
bitOffset: 9
28+
bitWidth: 1
29+
AWD2_MST:
30+
description: Analog watchdog 2 flag of the master ADC
31+
bitOffset: 8
32+
bitWidth: 1
33+
AWD1_MST:
34+
description: Analog watchdog 1 flag of the master ADC
35+
bitOffset: 7
36+
bitWidth: 1
37+
JEOS_MST:
38+
description: End of injected sequence flag of the master ADC
39+
bitOffset: 6
40+
bitWidth: 1
41+
JEOC_MST:
42+
description: End of injected conversion flag of the master ADC
43+
bitOffset: 5
44+
bitWidth: 1
45+
OVR_MST:
46+
description: Overrun flag of the master ADC
47+
bitOffset: 4
48+
bitWidth: 1
49+
EOS_MST:
50+
description: End of regular sequence flag of the master ADC
51+
bitOffset: 3
52+
bitWidth: 1
53+
EOC_MST:
54+
description: End of regular conversion flag of the master ADC
55+
bitOffset: 2
56+
bitWidth: 1
57+
EOSMP_MST:
58+
description: End of Sampling phase flag of the master ADC
59+
bitOffset: 1
60+
bitWidth: 1
61+
ADRDY_MST:
62+
description: master ADC ready
63+
bitOffset: 0
64+
bitWidth: 1
65+
66+
CCR:
67+
description: ADC common control register
68+
addressOffset: 0x08
69+
access: read-write
70+
resetValue: 0x00000000
71+
fields:
72+
CH18SEL:
73+
description: CH18 selection (Vbat)
74+
bitOffset: 24
75+
bitWidth: 1
76+
CH17SEL:
77+
description: CH17 selection (temperature)
78+
bitOffset: 23
79+
bitWidth: 1
80+
VREFEN:
81+
description: Vrefint enable
82+
bitOffset: 22
83+
bitWidth: 1
84+
PRESC:
85+
description: ADC prescaler
86+
bitOffset: 18
87+
bitWidth: 4
88+
CKMODE:
89+
description: ADC clock mode
90+
bitOffset: 16
91+
bitWidth: 2

devices/stm32wb55.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ PWR:
1515
802EWKUP:
1616
name: _802EWKUP
1717

18+
# Rename to ADC1 for consistency
19+
_modify:
20+
# The SVD calls ADC1 ADC.
21+
ADC:
22+
name: ADC1
23+
1824
# Rename the L3 field to L to match RM0434
19-
ADC:
25+
ADC1:
2026
SQR1:
2127
_modify:
2228
L3:
@@ -203,3 +209,4 @@ _include:
203209
- ./common_patches/sai/sai_v1.yaml
204210
- ./common_patches/rtc/rtc_cr.yaml
205211
- ../peripherals/tim/v2/ccm_common.yaml
212+
- ./common_patches/wb_adc_common.yaml

0 commit comments

Comments
 (0)