diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-07-28 23:13:15 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-07-28 23:13:15 +0200 |
commit | 104c965101dfa6b9122184209cc00d0f18e7dbbe (patch) | |
tree | 3ec4fe7e03cae75649fdb38aa0df4c93eb1bfb2f | |
parent | a3a82c502e045c4e6de37f7ead1f3b9fcecd37b9 (diff) |
stm32_adc: Rename common blocks to ADC12 and ADC345 respectively.
-rw-r--r-- | adc/SConscript | 24 | ||||
-rw-r--r-- | adc/stm32_adc.h | 1 | ||||
-rw-r--r-- | platforms/stm32/f3.yaml | 6 | ||||
-rw-r--r-- | platforms/stm32/g4.yaml | 6 | ||||
-rw-r--r-- | platforms/stm32/wb.yaml | 4 |
5 files changed, 24 insertions, 17 deletions
diff --git a/adc/SConscript b/adc/SConscript index ae2fd2b..e008d25 100644 --- a/adc/SConscript +++ b/adc/SConscript @@ -11,19 +11,19 @@ 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']], - }) + instances.append({ + 'type': 'STM32_ADC_t<STM32_ADC_reg_%s_t>' % data['type'], + 'name': name, + 'args': [data['offset']], + }) +if 'stm32_adc_common' in periph: + for name, data in periph['stm32_adc_common'].items(): + instances.append({ + 'type': 'STM32_ADC_COMMON_t<STM32_ADC_COMMON_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) diff --git a/adc/stm32_adc.h b/adc/stm32_adc.h index 6216581..d907956 100644 --- a/adc/stm32_adc.h +++ b/adc/stm32_adc.h @@ -68,6 +68,7 @@ struct STM32_ADC_COMMON_reg_v2_t { volatile uint32_t CSR; uint32_t _reserved1; volatile uint32_t CCR; + volatile uint32_t CDR; }; template <typename T> diff --git a/platforms/stm32/f3.yaml b/platforms/stm32/f3.yaml index 03f2498..4d0c02f 100644 --- a/platforms/stm32/f3.yaml +++ b/platforms/stm32/f3.yaml @@ -80,10 +80,12 @@ ADC4: type: v2 offset: 0x50000500 - ADC_COMMON1: + + stm32_adc_common: + ADC12: type: v2 offset: 0x50000300 - ADC_COMMON3: + ADC345: type: v2 offset: 0x50000700 diff --git a/platforms/stm32/g4.yaml b/platforms/stm32/g4.yaml index 417e3b4..acd333c 100644 --- a/platforms/stm32/g4.yaml +++ b/platforms/stm32/g4.yaml @@ -48,10 +48,12 @@ ADC5: type: v2 offset: 0x50000600 - ADC_COMMON1: + + stm32_adc_common: + ADC12: type: v2 offset: 0x50000300 - ADC_COMMON3: + ADC345: type: v2 offset: 0x50000700 diff --git a/platforms/stm32/wb.yaml b/platforms/stm32/wb.yaml index 241c467..f2572a8 100644 --- a/platforms/stm32/wb.yaml +++ b/platforms/stm32/wb.yaml @@ -32,7 +32,9 @@ ADC1: type: v2 offset: 0x50040000 - ADC_COMMON1: + + stm32_adc_common: + ADC12: type: v2 offset: 0x50040300 |