|
25 | 25 | daclist = [] # ['PIN','name','DACSignal']
|
26 | 26 | i2cscl_list = [] # ['PIN','name','I2CSCLSignal', ['af']]
|
27 | 27 | i2csda_list = [] # ['PIN','name','I2CSDASignal', ['af']
|
| 28 | +i3cscl_list = [] # ['PIN','name','I3CSCLSignal', ['af']] |
| 29 | +i3csda_list = [] # ['PIN','name','I3CSDASignal', ['af'] |
28 | 30 | tim_list = [] # ['PIN','name','TIMSignal', ['af']]
|
29 | 31 | uarttx_list = [] # ['PIN','name','UARTtx', ['af']]
|
30 | 32 | uartrx_list = [] # ['PIN','name','UARTrx', ['af']]
|
@@ -447,6 +449,15 @@ def store_i2c(pin, name, signal):
|
447 | 449 | i2csda_list.append([pin, name, signal])
|
448 | 450 |
|
449 | 451 |
|
| 452 | +# Store I3C list |
| 453 | +def store_i3c(pin, name, signal): |
| 454 | + # is it SDA or SCL ? |
| 455 | + if "_SCL" in signal: |
| 456 | + i3cscl_list.append([pin, name, signal]) |
| 457 | + if "_SDA" in signal: |
| 458 | + i3csda_list.append([pin, name, signal]) |
| 459 | + |
| 460 | + |
450 | 461 | # Store timers
|
451 | 462 | def store_tim(pin, name, signal):
|
452 | 463 | if "_CH" in signal:
|
@@ -664,6 +675,41 @@ def i2c_pinmap(lst):
|
664 | 675 | )
|
665 | 676 |
|
666 | 677 |
|
| 678 | +def i3c_pinmap(lst): |
| 679 | + i3c_pins_list = [] |
| 680 | + winst = [] |
| 681 | + wpin = [] |
| 682 | + mode = "STM_MODE_AF_OD" |
| 683 | + if lst == i3csda_list: |
| 684 | + aname = "I3C_SDA" |
| 685 | + else: |
| 686 | + aname = "I3C_SCL" |
| 687 | + for p in lst: |
| 688 | + # 2nd element is the I3C XXX signal |
| 689 | + b = p[2].split("_")[0] |
| 690 | + inst = b[: len(b) - 1] + b[len(b) - 1] |
| 691 | + winst.append(len(inst)) |
| 692 | + wpin.append(len(p[0])) |
| 693 | + i3c_pins_list.append( |
| 694 | + { |
| 695 | + "pin": p[0], |
| 696 | + "inst": inst, |
| 697 | + "mode": mode, |
| 698 | + "pull": "GPIO_NOPULL", |
| 699 | + "af": p[3], |
| 700 | + } |
| 701 | + ) |
| 702 | + return dict( |
| 703 | + name="I3C", |
| 704 | + hal="I3C", |
| 705 | + aname=aname, |
| 706 | + data="", |
| 707 | + wpin=max(wpin) + 1, |
| 708 | + winst=max(winst) + 1, |
| 709 | + list=i3c_pins_list, |
| 710 | + ) |
| 711 | + |
| 712 | + |
667 | 713 | def tim_pinmap():
|
668 | 714 | tim_pins_list = []
|
669 | 715 | winst = []
|
@@ -1056,6 +1102,7 @@ def print_peripheral():
|
1056 | 1102 | [adc_pinmap()],
|
1057 | 1103 | [dac_pinmap()],
|
1058 | 1104 | (i2c_pinmap(i2csda_list), i2c_pinmap(i2cscl_list)),
|
| 1105 | + (i3c_pinmap(i3csda_list), i3c_pinmap(i3cscl_list)), |
1059 | 1106 | [tim_pinmap()],
|
1060 | 1107 | (
|
1061 | 1108 | uart_pinmap(uarttx_list),
|
@@ -1588,6 +1635,8 @@ def sort_my_lists():
|
1588 | 1635 | daclist.sort(key=natural_sortkey)
|
1589 | 1636 | i2cscl_list.sort(key=natural_sortkey)
|
1590 | 1637 | i2csda_list.sort(key=natural_sortkey)
|
| 1638 | + i3cscl_list.sort(key=natural_sortkey) |
| 1639 | + i3csda_list.sort(key=natural_sortkey) |
1591 | 1640 | tim_list.sort(key=natural_sortkey2)
|
1592 | 1641 | tim_list.sort(key=natural_sortkey)
|
1593 | 1642 | uarttx_list.sort(key=natural_sortkey)
|
@@ -1631,6 +1680,8 @@ def clean_all_lists():
|
1631 | 1680 | del daclist[:]
|
1632 | 1681 | del i2cscl_list[:]
|
1633 | 1682 | del i2csda_list[:]
|
| 1683 | + del i3cscl_list[:] |
| 1684 | + del i3csda_list[:] |
1634 | 1685 | del tim_list[:]
|
1635 | 1686 | del uarttx_list[:]
|
1636 | 1687 | del uartrx_list[:]
|
@@ -1663,7 +1714,8 @@ def clean_all_lists():
|
1663 | 1714 | def manage_af_and_alternate():
|
1664 | 1715 | add_af(i2cscl_list)
|
1665 | 1716 | add_af(i2csda_list)
|
1666 |
| - |
| 1717 | + add_af(i3cscl_list) |
| 1718 | + add_af(i3csda_list) |
1667 | 1719 | add_af(tim_list)
|
1668 | 1720 | add_af(uarttx_list)
|
1669 | 1721 | add_af(uarttx_list)
|
@@ -1698,6 +1750,8 @@ def manage_af_and_alternate():
|
1698 | 1750 | update_alternate(daclist)
|
1699 | 1751 | update_alternate(i2cscl_list)
|
1700 | 1752 | update_alternate(i2csda_list)
|
| 1753 | + update_alternate(i3cscl_list) |
| 1754 | + update_alternate(i3csda_list) |
1701 | 1755 | update_alternate(tim_list)
|
1702 | 1756 | update_alternate(uarttx_list)
|
1703 | 1757 | update_alternate(uartrx_list)
|
@@ -1815,6 +1869,8 @@ def parse_pins():
|
1815 | 1869 | store_dac(pin, name, sig)
|
1816 | 1870 | elif re.match("^I2C", sig) is not None: # ignore FMPI2C
|
1817 | 1871 | store_i2c(pin, name, sig)
|
| 1872 | + elif re.match("^I3C", sig) is not None: |
| 1873 | + store_i3c(pin, name, sig) |
1818 | 1874 | elif re.match("^TIM", sig) is not None: # ignore HRTIM
|
1819 | 1875 | store_tim(pin, name, sig)
|
1820 | 1876 | elif re.match("^(LPU|US|U)ART", sig) is not None:
|
|
0 commit comments