Skip to content

Commit 20480f3

Browse files
bors[bot]MathiasKochrichardeoin
authored
Merge #680
680: STM32L4xx: Add GPIOx ASCR & BRR registers r=richardeoin a=MathiasKoch Also corrects naming on L4x5 ADC `Mult` to `Dual` field, as per the reference manual, and adds prescaler field under ADC_CRR. Fixes #342 Co-authored-by: Mathias <mk@blackbird.online> Co-authored-by: Richard Meadows <richardeoin@gmail.com>
2 parents 5833bc3 + 2251515 commit 20480f3

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"GPIO*":
2+
_add:
3+
ASCR:
4+
description: GPIO port analog switch control register
5+
addressOffset: 0x2C
6+
fields:
7+
ASC:
8+
description: These bits are written by software to configure the analog connection of the IOs.
9+
access: read-write
10+
bitOffset: 0
11+
bitWidth: 16
12+
ASCR:
13+
_split: [ASC]
14+
ASC*:
15+
_write:
16+
NoAction: [0, "Disconnect analog switch to the ADC input"]
17+
Reset: [1, " Connect analog switch to the ADC input"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"GPIO*":
2+
_add:
3+
BRR:
4+
description: GPIO port bit reset register
5+
addressOffset: 0x28
6+
fields:
7+
BR:
8+
description: These bits are write-only. A read to these bits returns the value 0x0000
9+
access: write-only
10+
bitOffset: 0
11+
bitWidth: 16
12+
BRR:
13+
_split: [BR]
14+
BR*:
15+
_write:
16+
NoAction: [0, "No action on the corresponding ODx bit"]
17+
Reset: [1, "Reset the corresponding ODx bit"]

devices/stm32l4x1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ _include:
130130
- ./common_patches/l4_adc_smpr.yaml
131131
- ./common_patches/l4_adc_sqr1.yaml
132132
- ./common_patches/l4_spi.yaml
133+
- ./common_patches/l4_gpio_brr.yaml
133134
- ../peripherals/spi/spi_l4.yaml

devices/stm32l4x2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ MPU:
99
_include:
1010
- ./common_patches/stm32l4x2_l412.yaml
1111
- common_patches/rtc/rtc_bkpr.yaml
12+
- ./common_patches/l4_gpio_brr.yaml
1213
- ../peripherals/fw/fw_l0_l4.yaml

devices/stm32l4x3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,6 @@ _include:
161161
- ./common_patches/l4_adc_smpr.yaml
162162
- ./common_patches/l4_adc_sqr1.yaml
163163
- ./common_patches/l4_spi.yaml
164+
- ./common_patches/l4_gpio_brr.yaml
164165
- ../peripherals/spi/spi_l4.yaml
165166
- ./common_patches/l4_lcd_segment.yaml

devices/stm32l4x5.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ _modify:
99
ADC_Common:
1010
CCR:
1111
_modify:
12+
MULT:
13+
name: DUAL
14+
description: Dual ADC mode selection
1215
TSEN:
1316
name: CH18SEL
1417
description: CH18 selection (Vbat)
1518
VBATEN:
1619
name: CH17SEL
1720
description: CH17 selection (temperature)
21+
_add:
22+
PRESC:
23+
description: ADC prescaler
24+
bitOffset: 18
25+
bitWidth: 4
26+
access: read-write
1827

1928
# Merge the thousands of individal bit fields into a single field for each
2029
# CAN filter register. This is not only much easier to use but also saves
@@ -179,5 +188,7 @@ _include:
179188
- ./common_patches/l4_adc_smpr.yaml
180189
- ./common_patches/l4_adc_sqr1.yaml
181190
- ./common_patches/l4_spi.yaml
191+
- ./common_patches/l4_gpio_ascr.yaml
192+
- ./common_patches/l4_gpio_brr.yaml
182193
- ./common_patches/l4_dbg_apb_fzr_rename.yaml
183194
- ../peripherals/spi/spi_l4.yaml

0 commit comments

Comments
 (0)