summaryrefslogtreecommitdiffstats
path: root/pysystemmgr/obmc/system/__init__.py
blob: 9a2a50a29645fba4785a6d91138b31375710a27b (plain)
1
2
3
4
5
6
7
8
9
10
GPIO_BASE = 320

def convertGpio(name):
    offset = int(filter(str.isdigit, name))
    port = filter(str.isalpha, name.upper())
    a = ord(port[-1]) - ord('A')
    if len(port) > 1:
        a += 26
    base = a * 8 + GPIO_BASE
    return base + offset
OpenPOWER on IntegriCloud