blob: a176ec56a603ea31e7b339d868422243bff670f6 [file] [log] [blame]
#! /usr/bin/python
import sys
if (len(sys.argv) <2):
print "Usage: gpio2num [gpio1] [gpio2] ... [gpion]"
print "\tExample: gpio2num A2 B4"
exit(0)
sys.argv.pop(0)
for name in sys.argv:
c = name[0:1]
num = name[1:]
a = ord(c)-65
base = 480 - (int(a/4) * 32)
offset = a%4*8 + int(num)
gpio_num = base+offset
print name+" = " + str(gpio_num)