diff options
author | Karl Palsson <karlp@tweak.net.au> | 2022-05-04 00:41:45 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-07-27 23:03:11 +0200 |
commit | b5cd432df8f336c90d530b5d55fda7f2c25472c2 (patch) | |
tree | 8f1cbda9f677e6e97676649de7c6e9e00e201ab7 /adc/SConscript | |
parent | c40eb0b2d6966760899d1d0c2743770ea130ff09 (diff) |
adc: convert to new style
Converted the old STM32 headers to new style and copied offsets to
platform data.
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Diffstat (limited to 'adc/SConscript')
-rw-r--r-- | adc/SConscript | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/adc/SConscript b/adc/SConscript new file mode 100644 index 0000000..ae2fd2b --- /dev/null +++ b/adc/SConscript @@ -0,0 +1,30 @@ +Import('env') + +headers = [] +instances = [] +sources = [] +aliases = {} +type_aliases = {} + +periph = env['PLATFORM_SPEC'].get('periph', {}) + +if 'stm32_adc' in periph: + headers.append('stm32_adc.h') + for name, data in periph['stm32_adc'].items(): + if name.find("COMMON") > 0: + instances.append({ + 'type': 'STM32_ADC_COMMON_t<STM32_ADC_COMMON_reg_%s_t>' % data['type'], + 'name': name, + 'args': [data['offset']], + }) + else: + instances.append({ + 'type': 'STM32_ADC_t<STM32_ADC_reg_%s_t>' % data['type'], + 'name': name, + 'args': [data['offset']], + }) + + +env.Jinja2('adc.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases, type_aliases = type_aliases) + +Return('sources') |