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