summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@etactica.com>2021-09-17 12:07:48 +0200
committerKarl Palsson <karlp@etactica.com>2021-09-17 12:07:48 +0200
commit8a73b0bb09eb96068ff02696eb1055a36349b6bf (patch)
tree01e3f3c0c8889973236d1c5174a4c4b2f6445d25
parentd5fbedc24fdd41e7c30b2f9239f666f33893e065 (diff)
gpio: stm32: default to v2
v2 is for everyone except f1, so avoid the yaml spam. Signed-off-by: Karl Palsson <karlp@etactica.com>
-rw-r--r--gpio/SConscript8
-rw-r--r--platforms/stm32/f0.yaml6
-rw-r--r--platforms/stm32/f3.yaml6
-rw-r--r--platforms/stm32/f4.yaml9
-rw-r--r--platforms/stm32/l0.yaml5
-rw-r--r--platforms/stm32/wb.yaml5
6 files changed, 5 insertions, 34 deletions
diff --git a/gpio/SConscript b/gpio/SConscript
index ea352cc..cf33ad4 100644
--- a/gpio/SConscript
+++ b/gpio/SConscript
@@ -11,14 +11,16 @@ periph = env['PLATFORM_SPEC'].get('periph', {})
if 'stm32_gpio' in periph:
headers.append('stm32_gpio.h')
for name, data in periph['stm32_gpio'].items():
+ # Default to v2, ie, everyone but f1
+ real_type = data.get('type', 'v2')
instances.append({
- 'type': 'STM32_GPIO_%s_t' % data['type'],
+ 'type': 'STM32_GPIO_%s_t' % real_type,
'name': name,
'args': [data['offset']],
})
- type_aliases['Pin'] = 'STM32_GPIO_%s_t::Pin' % data['type']
- type_aliases['PinArray'] = 'STM32_GPIO_%s_t::PinArray' % data['type']
+ type_aliases['Pin'] = 'STM32_GPIO_%s_t::Pin' % real_type
+ type_aliases['PinArray'] = 'STM32_GPIO_%s_t::PinArray' % real_type
env.Jinja2('gpio.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases, type_aliases = type_aliases)
diff --git a/platforms/stm32/f0.yaml b/platforms/stm32/f0.yaml
index 6e8899a..58c90b5 100644
--- a/platforms/stm32/f0.yaml
+++ b/platforms/stm32/f0.yaml
@@ -3,19 +3,13 @@
stm32_gpio:
GPIOA:
offset: 0x48000000
- type: v2
GPIOB:
offset: 0x48000400
- type: v2
GPIOC:
offset: 0x48000800
- type: v2
GPIOD:
offset: 0x48000c00
- type: v2
GPIOE:
offset: 0x48001000
- type: v2
GPIOF:
offset: 0x48001400
- type: v2
diff --git a/platforms/stm32/f3.yaml b/platforms/stm32/f3.yaml
index 4cbb3b8..732daf2 100644
--- a/platforms/stm32/f3.yaml
+++ b/platforms/stm32/f3.yaml
@@ -3,22 +3,16 @@
stm32_gpio:
GPIOA:
offset: 0x48000000
- type: v2
GPIOB:
offset: 0x48000400
- type: v2
GPIOC:
offset: 0x48000800
- type: v2
GPIOD:
offset: 0x48000c00
- type: v2
GPIOE:
offset: 0x48001000
- type: v2
GPIOF:
offset: 0x48001400
- type: v2
stm32_timer:
TIM1:
offset: 0x40012c00
diff --git a/platforms/stm32/f4.yaml b/platforms/stm32/f4.yaml
index 429e31b..5f222c7 100644
--- a/platforms/stm32/f4.yaml
+++ b/platforms/stm32/f4.yaml
@@ -32,31 +32,22 @@
stm32_gpio:
GPIOA:
offset: 0x40020000
- type: v2
GPIOB:
offset: 0x40020400
- type: v2
GPIOC:
offset: 0x40020800
- type: v2
GPIOD:
offset: 0x40020c00
- type: v2
GPIOE:
offset: 0x40021000
- type: v2
GPIOF:
offset: 0x40021400
- type: v2
GPIOG:
offset: 0x40021800
- type: v2
GPIOH:
offset: 0x40021c00
- type: v2
GPIOI:
offset: 0x40022000
- type: v2
stm32_timer:
TIM1:
diff --git a/platforms/stm32/l0.yaml b/platforms/stm32/l0.yaml
index 75c4330..f8e8414 100644
--- a/platforms/stm32/l0.yaml
+++ b/platforms/stm32/l0.yaml
@@ -3,16 +3,11 @@
stm32_gpio:
GPIOA:
offset: 0x50000000
- type: v2
GPIOB:
offset: 0x50000400
- type: v2
GPIOC:
offset: 0x50000800
- type: v2
GPIOD:
offset: 0x50000c00
- type: v2
GPIOH:
offset: 0x50001c00
- type: v2
diff --git a/platforms/stm32/wb.yaml b/platforms/stm32/wb.yaml
index 152ea28..cb1d5fb 100644
--- a/platforms/stm32/wb.yaml
+++ b/platforms/stm32/wb.yaml
@@ -31,19 +31,14 @@
stm32_gpio:
GPIOA:
offset: 0x48000000
- type: v2
GPIOB:
offset: 0x48000400
- type: v2
GPIOC:
offset: 0x48000800
- type: v2
GPIOD:
offset: 0x48000c00
- type: v2
GPIOE:
offset: 0x48001000
- type: v2
stm32_timer:
TIM1: