blob: c37f4aa75ea7e29695a9244dccf104a4a24b4434 (
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 = {}
periph = env['PLATFORM_SPEC'].get('periph', {})
if 'stm32_uart' in periph:
headers.append('stm32_uart.h')
for name, data in periph['stm32_uart'].items():
instances.append({
'type': 'STM32_UART_t<STM32_UART_reg_%s_t>' % data['type'],
'name': name,
'args': [data['offset']],
})
if 'litex_uart' in periph:
headers.append('litex_uart.h')
for name, data in periph['litex_uart'].items():
instances.append({
'type': 'LiteX_UART_t',
'name': name,
'args': [data['offset']],
})
env.Jinja2('uart.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases)
Return('sources')
|