summaryrefslogtreecommitdiff
path: root/usb/SConscript
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2021-01-16 01:20:58 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-01-16 01:20:58 +0100
commit9921c9db409ad5b00fe4a43a2459e2fd2de6b0cf (patch)
treeb0f3bc73144d87112f746d04b3bc7a69cc3e0953 /usb/SConscript
parentd834303f5e642266874b1c99be04dcb9149fefb1 (diff)
usb: Generate instances from platform spec.
Diffstat (limited to 'usb/SConscript')
-rw-r--r--usb/SConscript19
1 files changed, 19 insertions, 0 deletions
diff --git a/usb/SConscript b/usb/SConscript
new file mode 100644
index 0000000..81d84d4
--- /dev/null
+++ b/usb/SConscript
@@ -0,0 +1,19 @@
+Import('env')
+
+headers = []
+instances = []
+
+periph = env['PLATFORM_SPEC'].get('periph', {})
+
+if 'dwc_otg' in periph:
+ headers.append('dwc_otg.h')
+ for name, data in periph['dwc_otg'].items():
+ instances.append({
+ 'type': 'DWC_OTG_t',
+ 'name': name,
+ 'args': [data['offset']],
+ })
+
+env.Jinja2('usb.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances)
+
+Return()