summaryrefslogtreecommitdiff
path: root/adc/SConscript
blob: ae2fd2b37135321b9e8f8d9d808e4a942c678178 (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 = {}
type_aliases = {}

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

if 'stm32_adc' in periph:
    headers.append('stm32_adc.h')
    for name, data in periph['stm32_adc'].items():
        if name.find("COMMON") > 0:
            instances.append({
                'type': 'STM32_ADC_COMMON_t<STM32_ADC_COMMON_reg_%s_t>' % data['type'],
                'name': name,
                'args': [data['offset']],
            })
        else:
            instances.append({
                'type': 'STM32_ADC_t<STM32_ADC_reg_%s_t>' % data['type'],
                'name': name,
                'args': [data['offset']],
            })


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

Return('sources')