Skip to content

Instantly share code, notes, and snippets.

@benwaffle
Created April 21, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwaffle/7605d7d57faf63b7e142b85d73b316ab to your computer and use it in GitHub Desktop.
Save benwaffle/7605d7d57faf63b7e142b85d73b316ab to your computer and use it in GitHub Desktop.
OrangePI rk3399 pin calculator
#!/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