summaryrefslogtreecommitdiff
path: root/rcc/SConscript
diff options
context:
space:
mode:
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')