summaryrefslogtreecommitdiff
path: root/adc/SConscript
blob: e008d25313a26a98da3027c80d5ab1ddde7d32b4 (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():
        instances.append({
            'type': 'STM32_ADC_t<STM32_ADC_reg_%s_t>' % data['type'],
            'name': name,
            'args': [data['offset']],
        })

if 'stm32_adc_common' in periph:
    for name, data in periph['stm32_adc_common'].items():
        instances.append({
            'type': 'STM32_ADC_COMMON_t<STM32_ADC_COMMON_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')