1GPIO_BASE = 320 2 3def convertGpio(name): 4 name = name.upper() 5 c = name[0:1] 6 offset = int(name[1:]) 7 a = ord(c)-65 8 base = a*8+GPIO_BASE 9 return base+offset 10