From 9921c9db409ad5b00fe4a43a2459e2fd2de6b0cf Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 16 Jan 2021 01:20:58 +0100 Subject: usb: Generate instances from platform spec. --- usb/SConscript | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 usb/SConscript (limited to 'usb/SConscript') 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() -- cgit v1.2.3