예제 #1
0
 def __init__(self, chip, channelCount):
     SPI.__init__(self, toint(chip), 0, 8, 10000000, "MCP492%d" % channelCount)
     DAC.__init__(self, channelCount, 12, 3.3)
     self.buffered=False
     self.gain=False
     self.shutdown=False
     self.values = [0 for i in range(channelCount)]
예제 #2
0
 def __init__(self, chip, channelCount):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, channelCount, 12, 3.3)
     self.buffered = False
     self.gain = False
     self.shutdown = False
     self.values = [0 for i in range(channelCount)]
예제 #3
0
 def __init__(self, chip, channelCount, vref):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, channelCount, 12, float(vref))
     self.buffered=False
     self.gain=False
     self.shutdown=False
     self.values = [0 for i in range(channelCount)]
예제 #4
0
 def __init__(self, chip, channelCount, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, channelCount, resolution, 2.048)
     self.name = name
     self.buffered=False
     self.gain=False
     self.shutdown=True
     self.values = [0 for i in range(channelCount)]
예제 #5
0
파일: mcp48XX.py 프로젝트: hereshem/WebIOPi
 def __init__(self, chip, channelCount, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, channelCount, resolution, 2.048)
     self.name = name
     self.buffered = False
     self.gain = False
     self.shutdown = True
     self.values = [0 for i in range(channelCount)]
예제 #6
0
 def __init__(self, chip, slave, channelCount, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     MCP23XXX.__init__(self, channelCount)
     self.slave = self.SLAVE
     iocon_value = 0x08  # Hardware Address Enable
     iocon_addr = self.getAddress(self.IOCON)
     self.writeRegister(iocon_addr, iocon_value)
     self.slave = toint(slave)
     self.name = name
예제 #7
0
파일: mcp23XXX.py 프로젝트: bill0/webiopi
 def __init__(self, chip, slave, channelCount, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     MCP23XXX.__init__(self, channelCount)
     self.slave = self.SLAVE
     iocon_value = 0x08  # Hardware Address Enable
     iocon_addr = self.getAddress(self.IOCON)
     self.writeRegister(iocon_addr, iocon_value)
     self.slave = toint(slave)
     self.name = name
예제 #8
0
 def __init__(self, chip, slave, channelCount, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000, name)
     MCP23XXX.__init__(self, channelCount)
     self.slave = self.SLAVE
     slave = toint(slave)
     addr   = self.getAddress(self.IOCON)
     iocon  = self.readRegister(addr)
     iocon |= 0x08 # Hardware Address Enable
     self.writeRegister(addr, iocon)
     self.slave = slave
예제 #9
0
 def __init__(self, chip, channelCount, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000)
     ADC.__init__(self, channelCount, resolution, 3.3)
     self.name = name
     self.MSB_MASK = 2**(resolution-8) - 1
예제 #10
0
 def __init__(self, chip, vref, channelCount, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, toint(channelCount), toint(resolution), float(vref))
     self.name = name
     self.values = [0 for i in range(toint(channelCount))]
예제 #11
0
 def __init__(self, chip, channelCount, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000)
     ADC.__init__(self, channelCount, resolution, 3.3)
     self.name = name
     self.MSB_MASK = 2**(resolution - 8) - 1
예제 #12
0
 def __init__(self, chip, vref, resolution, name):
     SPI.__init__(self, toint(chip), 0, 8, 10000000)
     DAC.__init__(self, 1, resolution, float(vref))
     self.name = name
     self.value = 0