Beispiel #1
0
 def setPinValue(self, aValue):
     """ Set pin value
         \param aValue value to write
     """
     try:
         wrapper.setPinValue(self.__device, aValue)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #2
0
 def setPinDirection(self, aDirection):
     """ Set period in us
         \param aDirection pin direction "in":input "out":output
     """
     try:
         wrapper.setPinDirection(self.__device, aDirection)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #3
0
 def setPinValue(self, aValue):
     """ Set pin value
         \param aValue value to write
     """
     try:
         wrapper.setPinValue(self.__device, aValue)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #4
0
 def setPinDirection(self, aDirection):
     """ Set period in us
         \param aDirection pin direction "in":input "out":output
     """
     try:
         wrapper.setPinDirection(self.__device, aDirection)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #5
0
 def getIrqMode(self):
     """ get irq mode
     """
     try:
         return wrapper.getIrqMode(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #6
0
 def getIrqMode(self):
     """ get irq mode
     """
     try:
         return wrapper.getIrqMode(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #7
0
 def getPinDirection(self):
     """ Set period in us
         \param aDirection pin direction 0:input 1:output
     """
     try:
         return wrapper.getPinDirection(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #8
0
 def getPinNumber(self):
     """ Get pin number
         \param return pin number
     """
     try:
         return wrapper.getPinNumber(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #9
0
 def setIrqMode(self, aMode):
     """ Set irq Mode
         \param aMode.  "none" "rising" "falling" "both"
     """
     try:
         return wrapper.setIrqMode(self.__device, aMode)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #10
0
 def blockingGetPinValue(self, aDelay_ms):
     """ Get pin value (blocking mode)
         \param return pin value
     """
     try:
         return wrapper.blockingGetPinValue(self.__device, aDelay_ms)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #11
0
 def getPinValue(self):
     """ Get pin value
         \param return pin value
     """
     try:
         return wrapper.getPinValue(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #12
0
 def getPinValue(self):
     """ Get pin value
         \param return pin value
     """
     try:
         return wrapper.getPinValue(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #13
0
 def getPinDirection(self):
     """ Set period in us
         \param aDirection pin direction 0:input 1:output
     """
     try:
         return wrapper.getPinDirection(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #14
0
 def getPinNumber(self):
     """ Get pin number
         \param return pin number
     """
     try:
         return wrapper.getPinNumber(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #15
0
 def setIrqMode(self, aMode):
     """ Set irq Mode
         \param aMode.  "none" "rising" "falling" "both"
     """
     try:
         return wrapper.setIrqMode(self.__device, aMode)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #16
0
 def blockingGetPinValue(self, aDelay_ms):
     """ Get pin value (blocking mode)
         \param return pin value
     """
     try:
         return wrapper.blockingGetPinValue(self.__device,
                                            aDelay_ms);
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #17
0
 def setIrqMode(self, aMode):
     """ Set irq Mode
         \param aMode.
             1:MODE_NOINT
             2:MODE_RISING
             3:MODE_FALLING
             4:MODE_BOTH
     """
     try:
         return wrapper.setIrqMode(self.__device, aMode)
     except Exception, e:
         raise AsGpioError(str(e))
Beispiel #18
0
 def __init__(self, aPortLetter, aPinNum):
     try:
         self.__device = wrapper.gpio_open(aPortLetter, aPinNum)
     except Exception, e:
         raise AsGpioError("Can't open GPIO port "+str(aPortLetter)+\
                             " pin "+str(aPinNum)+": "+str(e))
Beispiel #19
0
 def __init__(self, aGpioNum):
     try:
         self.__device = wrapper.gpio_open(aGpioNum)
     except Exception, e:
         raise AsGpioError("Can't open GPIO number " + str(aGpioNum) +
                           ": " + str(e))
Beispiel #20
0
 def __del__(self):
     try:
         wrapper.gpio_close(self.__device)
     except Exception, e:
         pass
Beispiel #21
0
 def __del__(self):
     try:
         wrapper.gpio_close(self.__device)
     except Exception, e:
         pass
Beispiel #22
0
 def __init__(self, aGpioNum):
     try:
         self.__device = wrapper.gpio_open(aGpioNum)
     except Exception, e:
         raise AsGpioError("Can't open GPIO number "+str(aGpioNum)+": "+str(e))