summaryrefslogtreecommitdiff
path: root/usb/SConscript
blob: d000a82877a0a2a1505004c21b4276d091cb3f7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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']],
        })

if 'stm32_usb' in periph:
    headers.append('stm32_usb.h')
    for name, data in periph['stm32_usb'].items():
        instances.append({
            'type': 'STM32_USB_t<STM32_USB_reg_%s_t>' % data['type'],
            'name': name,
            'args': [data['offset'], data['buf_offset']],
        })

env.Jinja2('usb.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances)

Return()