diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2021-01-25 14:23:11 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2021-01-26 00:08:06 +0100 |
commit | c993afa6df80e96bd1fcf96f3ea45f9721a13334 (patch) | |
tree | 5aa20f242ec46331e8cfa3b3f44b06d118e46bae /rcc/SConscript | |
parent | dd742dc80981be5cc5ff218485cbfa408ecb0596 (diff) |
rcc: Generate enables from platform spec.
Diffstat (limited to 'rcc/SConscript')
-rw-r--r-- | rcc/SConscript | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rcc/SConscript b/rcc/SConscript new file mode 100644 index 0000000..c7c384b --- /dev/null +++ b/rcc/SConscript @@ -0,0 +1,29 @@ +Import('env') + +headers = [] +instances = [] +sources = [] +aliases = {} + +periph = env['PLATFORM_SPEC'].get('periph', {}) + +if 'rcc' in periph: + buses = env['PLATFORM_SPEC']['periph']['rcc']['RCC']['bus'] + env.Jinja2('rcc_enums.h', 'rcc_enums.h.j2', buses = buses) + + headers.append('rcc_reg.h') + for name, data in periph['rcc'].items(): + instances.append({ + 'type': 'RCC_t<RCC_reg_%s_t>' % data['type'], + 'name': name, + 'args': [data['offset']], + }) + + sources.extend([ + File('rcc.cpp'), + File('flash.cpp'), + ]) + +env.Jinja2('rcc.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases) + +Return('sources') |