diff options
Diffstat (limited to 'pysystemmgr/obmc')
-rw-r--r-- | pysystemmgr/obmc/system/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pysystemmgr/obmc/system/__init__.py b/pysystemmgr/obmc/system/__init__.py index ff6c537..03dc235 100644 --- a/pysystemmgr/obmc/system/__init__.py +++ b/pysystemmgr/obmc/system/__init__.py @@ -1,6 +1,7 @@ from os.path import join from glob import glob + def find_gpio_base(path="/sys/class/gpio/"): pattern = "gpiochip*" for gc in glob(join(path, pattern)): @@ -12,8 +13,10 @@ def find_gpio_base(path="/sys/class/gpio/"): # trigger a file not found exception open(join(path, "gpiochip")) + GPIO_BASE = find_gpio_base() + def convertGpio(name): offset = int(filter(str.isdigit, name)) port = filter(str.isalpha, name.upper()) |