Merge pull request #60 from embassy-rs/usart1-F0
F0: Manually add usart1 clock
This commit is contained in:
commit
37e44246da
9
parse.py
9
parse.py
@ -397,9 +397,11 @@ def match_rng_clock(rcc):
|
|||||||
return clock
|
return clock
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
all_mcu_files = {}
|
all_mcu_files = {}
|
||||||
per_mcu_files = {}
|
per_mcu_files = {}
|
||||||
|
|
||||||
|
|
||||||
def parse_documentations():
|
def parse_documentations():
|
||||||
print("linking files and documents")
|
print("linking files and documents")
|
||||||
with open('sources/mcufinder/files.json', 'r') as j:
|
with open('sources/mcufinder/files.json', 'r') as j:
|
||||||
@ -415,7 +417,7 @@ def parse_documentations():
|
|||||||
})
|
})
|
||||||
|
|
||||||
with open('sources/mcufinder/mcus.json', 'r') as j:
|
with open('sources/mcufinder/mcus.json', 'r') as j:
|
||||||
mcus = json.load(j);
|
mcus = json.load(j)
|
||||||
for mcu in mcus['MCUs']:
|
for mcu in mcus['MCUs']:
|
||||||
rpn = mcu['RPN']
|
rpn = mcu['RPN']
|
||||||
if rpn not in per_mcu_files:
|
if rpn not in per_mcu_files:
|
||||||
@ -423,6 +425,7 @@ def parse_documentations():
|
|||||||
for file in mcu['files']:
|
for file in mcu['files']:
|
||||||
per_mcu_files[rpn].append(file['file_id'])
|
per_mcu_files[rpn].append(file['file_id'])
|
||||||
|
|
||||||
|
|
||||||
def documents_for(chip_name, type):
|
def documents_for(chip_name, type):
|
||||||
docs = []
|
docs = []
|
||||||
for id in per_mcu_files[chip_name]:
|
for id in per_mcu_files[chip_name]:
|
||||||
@ -437,6 +440,7 @@ def documents_for(chip_name, type):
|
|||||||
|
|
||||||
return docs
|
return docs
|
||||||
|
|
||||||
|
|
||||||
def parse_headers():
|
def parse_headers():
|
||||||
os.makedirs('sources/headers_parsed', exist_ok=True)
|
os.makedirs('sources/headers_parsed', exist_ok=True)
|
||||||
print('loading headers...')
|
print('loading headers...')
|
||||||
@ -511,7 +515,6 @@ def parse_chips():
|
|||||||
rcc = removesuffix(rcc, '-rcc_v1_0')
|
rcc = removesuffix(rcc, '-rcc_v1_0')
|
||||||
rcc = removesuffix(rcc, '_rcc_v1_0')
|
rcc = removesuffix(rcc, '_rcc_v1_0')
|
||||||
|
|
||||||
|
|
||||||
core = r['Core']
|
core = r['Core']
|
||||||
family = r['@Family']
|
family = r['@Family']
|
||||||
|
|
||||||
@ -673,6 +676,8 @@ def parse_chips():
|
|||||||
p['clock'] = "APB4"
|
p['clock'] = "APB4"
|
||||||
elif chip['family'] == 'STM32H7' and pname.startswith('I2C'):
|
elif chip['family'] == 'STM32H7' and pname.startswith('I2C'):
|
||||||
p['clock'] = "APB1"
|
p['clock'] = "APB1"
|
||||||
|
elif chip['family'] == 'STM32F0' and pname == 'USART1':
|
||||||
|
p['clock'] = "APB2"
|
||||||
|
|
||||||
if block := match_peri(chip_name+':'+pname+':'+pkind):
|
if block := match_peri(chip_name+':'+pname+':'+pkind):
|
||||||
p['block'] = block
|
p['block'] = block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user