Merge pull request #46 from bobmcwhirter/adc_common_more_families

Adc common more families
This commit is contained in:
Dario Nieuwenhuis 2021-06-14 19:28:35 +02:00 committed by GitHub
commit 83b10acc02
3 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,4 @@
peripherals:
VREFINTCAL:
address: 0x1FFF75AA
block: vrefintcal_v1/VREFINTCAL

View File

@ -0,0 +1,4 @@
peripherals:
VREFINTCAL:
address: 0x1FFF75AA
block: vrefintcal_v1/VREFINTCAL

View File

@ -410,8 +410,9 @@ def parse_chips():
if pname in FAKE_PERIPHERALS:
continue
if pname.startswith('ADC'):
if not pname + '_COMMON' in peris:
peris[pname + '_COMMON'] = ip['@Name'] + '_COMMON:'+removesuffix(ip['@Version'], '_Cube')
if not 'ADC_COMMON' in peris:
print(f'adding ADC_COMMON')
peris['ADC_COMMON'] = 'ADC_COMMON:'+removesuffix(ip['@Version'], '_Cube')
peris[pname] = pkind
pins[pname] = []
@ -462,6 +463,13 @@ def parse_chips():
peris = {}
for pname, pkind in chip['peripherals'].items():
addr = h['defines'].get(pname)
if addr is None:
if pname == 'ADC_COMMON':
addr = h['defines'].get('ADC1_COMMON')
if addr is None:
addr = h['defines'].get('ADC12_COMMON')
if addr is None:
addr = h['defines'].get('ADC123_COMMON')
if addr is None:
continue