summaryrefslogtreecommitdiff
path: root/dma/SConscript
blob: b559fe0416efc5ed215dac9155afd2e1bdaf4bf3 (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
40
41
42
43
44
45
46
47
48
Import('env')

headers = set()
instances = []
sources = []
aliases = {}

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

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

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

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

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

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

Return('sources')