예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #5
0
 def getIrqMode(self):
     """ get irq mode
     """
     try:
         return wrapper.getIrqMode(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
예제 #6
0
 def getIrqMode(self):
     """ get irq mode
     """
     try:
         return wrapper.getIrqMode(self.__device)
     except Exception, e:
         raise AsGpioError(str(e))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #20
0
 def __del__(self):
     try:
         wrapper.gpio_close(self.__device)
     except Exception, e:
         pass
예제 #21
0
 def __del__(self):
     try:
         wrapper.gpio_close(self.__device)
     except Exception, e:
         pass
예제 #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))