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

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

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

if 'stm32_i2c' in periph:
    headers.append('stm32_i2c.h')
    for name, data in periph['stm32_i2c'].items():
        instances.append({
            'type': 'STM32_I2C_t<STM32_I2C_reg_%s_t>' % data['type'],
            'name': name,
            'args': [data['offset']],
        })

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

Return('sources')