summaryrefslogtreecommitdiff
path: root/rcc/SConscript
blob: f72d4be99a5c1298458c4c2755539b738015bec7 (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
29
30
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_methods.h')
    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')