Added spi and fixed FSMC alternate setup
This commit is contained in:
parent
4bb8aeb6f5
commit
e0e7b4270b
|
@ -240,6 +240,11 @@ def read_project(gpio, filename):
|
|||
elif 'GPIO_Input' == prop_value:
|
||||
pads[pad_port][pad_num]["MODER"] = PIN_MODE_INPUT
|
||||
else:
|
||||
# workaround for different names in project and gpio defs
|
||||
if "FSMC" in prop_value:
|
||||
prop_value = re.sub(r"FSMC_D([0-9]+)_DA[0-9]+",
|
||||
r"FSMC_D\1", prop_value)
|
||||
|
||||
pads[pad_port][pad_num]["SIGNAL"] = prop_value
|
||||
pads[pad_port][pad_num]["MODER"] = PIN_MODE_ALTERNATE
|
||||
pads[pad_port][pad_num]["OSPEEDR"] = PIN_OSPEED_MEDIUM
|
||||
|
@ -316,6 +321,11 @@ def gen_defines(project):
|
|||
defines['I2C_' + label] = match.group(1)
|
||||
continue
|
||||
|
||||
match = re.search(r"SPI(\d)_(MOSI|MISO|SCK|NSS)", signal)
|
||||
if match:
|
||||
defines['SPI_' + label] = match.group(1)
|
||||
continue
|
||||
|
||||
match = re.search(r"CAN(\d*)_[RT]X", signal)
|
||||
if match:
|
||||
can = match.group(1)
|
||||
|
|
Loading…
Reference in New Issue