Import('env')

headers = []
instances = []

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

if 'stm32_ltdc' in periph:
    headers.append('stm32_ltdc.h')
    for name, data in periph['stm32_ltdc'].items():
        instances.append({
            'type': 'STM32_LTDC_t',
            'name': name,
            'args': [data['offset']],
        })

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

Return()