Module to control GPIOs using the sysfs interface original docs sysfs docs
- error return codes have been removed, catch Exceptions with try/except instead
- replaced Constants with Enum members, all methods now accept and return those (or raise a
ValueError
) - pointless makefile removed
- the export of the sysfs interface now takes place when the class is initialised instead of when a method is called
- the sysfs interface has to be unexported to prevent errors
- the unexport of the sysfs interface now takes place when the
release
method is called instead of when a method finishes- has to be called once and is automatically called when using the class as a context manager (
with OnionGpio(i) as gpio:
)
- has to be called once and is automatically called when using the class as a context manager (
- added the
supportsDirection
andsupportsEdge
methods to check if these settings can be changed - added the
getEdge
,setEdge
andwaitForEdge
methodsgetEdge
returns the edge setting of the GPIOsetEdge(edge)
is setting the edge setting of the GPIOwaitForEdge(timeout=None)
waits for a edge to occur or thetimeout
to run out if not None (raising aTimeoutError
)
- added the
ignore_busy
paramter, which ignores the OSError raised when the interface is already exported (default = False) - exposed the
setDirection(direction)
method which is setting the direction setting of the GPIO todirection
- exposed the
setActiveLow(active_low)
method which is setting the active_low setting of the GPIO toactive_low
- removed original
setActiveLow
andsetActiveHigh
- removed multiple input checks, use the Enums of this module to interact with the methods
Value
contains supported GPIO valuesDirection
contains supported GPIO directionsActiveLow
contains supported active_low settingsEdge
contains supported GPIO edges
- removed at least one occasion of Error hiding
- removed the verbose argument, logging should be done by the application itself
Module compatible with Python >= 3.5
Run as root: python3 setup.py install
or use the .whl file