Example #1
0
	def getGpio(self, card, channel):
		for gpio in card['gpios']:
			if(gpio['name'] == channel):
				return gpio
		raise GPIO.InvalidChannelException("Gpio %s does not exists on card %s" % (channel, card['name']))
Example #2
0
 def checkDigitalChannelExported(self, channel):
     if not channel in self.export:
         raise GPIO.InvalidChannelException("Channel %d is not allowed" %
                                            channel)
Example #3
0
	def findCard(self, cardname):
		for card in self.cards:
			if card['name'] == cardname:
				return card
		#TODO Create a new exception for this case
		raise GPIO.InvalidChannelException("Card %s does not exists" % cardname)