summaryrefslogtreecommitdiff
path: root/timer/SConscript
blob: 149057567dc2bf538ff2cb157776dae4a611d220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Import('env')

headers = []
instances = []
sources = []
aliases = {}

periph = env['PLATFORM_SPEC'].get('periph', {})

if 'stm32_timer' in periph:
    headers.append('stm32_timer.h')
    for name, data in periph['stm32_timer'].items():
        # ~everyone so far has v1 timers, don't require it until we need it
        real_type = data.get('type', 'v1')
        instances.append({
            'type': 'STM32_TIMER_t<STM32_TIMER_reg_%s_t>' % real_type,
            'name': name,
            'args': [data['offset']],
        })

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

Return('sources')