blob: 9a2a50a29645fba4785a6d91138b31375710a27b [file] [log] [blame]
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