summaryrefslogtreecommitdiff
path: root/rcc/SConscript
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2021-01-25 14:23:11 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-01-26 00:08:06 +0100
commitc993afa6df80e96bd1fcf96f3ea45f9721a13334 (patch)
tree5aa20f242ec46331e8cfa3b3f44b06d118e46bae /rcc/SConscript
parentdd742dc80981be5cc5ff218485cbfa408ecb0596 (diff)
rcc: Generate enables from platform spec.
Diffstat (limited to 'rcc/SConscript')
-rw-r--r--rcc/SConscript29
1 files changed, 29 insertions, 0 deletions
diff --git a/rcc/SConscript b/rcc/SConscript
new file mode 100644
index 0000000..c7c384b
--- /dev/null
+++ b/rcc/SConscript
@@ -0,0 +1,29 @@
+Import('env')
+
+headers = []
+instances = []
+sources = []
+aliases = {}
+
+periph = env['PLATFORM_SPEC'].get('periph', {})
+
+if 'rcc' in periph:
+ buses = env['PLATFORM_SPEC']['periph']['rcc']['RCC']['bus']
+ env.Jinja2('rcc_enums.h', 'rcc_enums.h.j2', buses = buses)
+
+ headers.append('rcc_reg.h')
+ for name, data in periph['rcc'].items():
+ instances.append({
+ 'type': 'RCC_t<RCC_reg_%s_t>' % data['type'],
+ 'name': name,
+ 'args': [data['offset']],
+ })
+
+ sources.extend([
+ File('rcc.cpp'),
+ File('flash.cpp'),
+ ])
+
+env.Jinja2('rcc.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases)
+
+Return('sources')