summaryrefslogtreecommitdiff
path: root/adc/SConscript
blob: 8bcc25d722595554773f08916c33356ccd4f7747 (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
31
32
33
34
35
36
37
38
39
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']],
        })

if 'stm32_opamp' in periph:
    headers.append('stm32_opamp.h')
    for name, data in periph['stm32_opamp'].items():
        instances.append({
            'type': 'STM32_OPAMP_t',
            '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')