summaryrefslogtreecommitdiff
path: root/syscfg/SConscript
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2022-01-20 13:18:33 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2022-01-26 23:40:29 +0100
commit267c99850a0795b1563725c33674f2c62f6942a8 (patch)
treed446995cf2c7b0098b4c261eb358712c3683c2ee /syscfg/SConscript
parented1731d14aa7036376c7a68a6689f76ff61c0985 (diff)
stm32_syscfg: convert to modern.
Includes the f4, l0 and wb. f4 renames MEMRM to MEMRMP to be both consistent with other parts and consistent with ref man. Retested on the WB, but l0 and f4 code was simply moved. For yaml files, given how varied syscfg is, we default to using the family name as the type, but still allow overriding via explicit type in the yaml file if desired. Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Diffstat (limited to 'syscfg/SConscript')
-rw-r--r--syscfg/SConscript23
1 files changed, 23 insertions, 0 deletions
diff --git a/syscfg/SConscript b/syscfg/SConscript
new file mode 100644
index 0000000..190bacb
--- /dev/null
+++ b/syscfg/SConscript
@@ -0,0 +1,23 @@
+Import('env')
+
+headers = []
+instances = []
+sources = []
+aliases = {}
+
+periph = env['PLATFORM_SPEC'].get('periph', {})
+
+if 'stm32_syscfg' in periph:
+ headers.append('stm32_syscfg.h')
+ for name, data in periph['stm32_syscfg'].items():
+ # allow overrides, but default to family for syscfg, it's a little special
+ ptype = data.get('type', env['PLATFORM_SPEC']['meta']['family'])
+ instances.append({
+ 'type': 'STM32_SYSCFG_t<STM32_SYSCFG_reg_%s_t>' % ptype,
+ 'name': name,
+ 'args': [data['offset']],
+ })
+
+env.Jinja2('syscfg.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases)
+
+Return('sources')