Created
April 21, 2019 20:05
-
-
Save benwaffle/7605d7d57faf63b7e142b85d73b316ab to your computer and use it in GitHub Desktop.
OrangePI rk3399 pin calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from sys import argv, exit | |
if len(argv) != 2: | |
print('Usage: ./orangepi-pinout.py <GPIO1_B3>') | |
exit() | |
gpio = argv[1] | |
assert(gpio[:4] == 'GPIO') | |
n = gpio[4] | |
l = gpio[6] | |
x = gpio[7] | |
print(1000 + int(n) * 32 + (ord(l) - ord('A')) * 8 + int(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment