예제 #1
0
def iglooReg(bus, rm, slot, address, nbytes):
    t.openRM(rm)
    bus.write(0x00, [0x06])
    bus.write(t.bridgeAddress(slot), [0x11, 0x03, 0, 0, 0])
    bus.write(0x09, [address])
    bus.read(0x09, nbytes)
    return bus.sendBatch()
예제 #2
0
def readIgloo(slot, address, num_bytes):
    b.write(0x00,[0x06])
    b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    b.write(0x09,[address])
    b.read(0x09, num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #3
0
def writeIgloo(rm,slot,address,messageList):
    t.openRM(b,rm)
    b.write(0x00,[0x06])
    b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    b.write(0x09,[address] + messageList)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #4
0
def iglooReg(bus,rm,slot,address,nbytes):
    t.openRM(rm)
    bus.write(0x00,[0x06])
    bus.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    bus.write(0x09,[address])
    bus.read(0x09,nbytes)
    return bus.sendBatch()
예제 #5
0
 def getID(self):
     # Reset entire board by writing 0x6 to 0x0.
     self.bus.write(0x00,[0x06])
     # Note that the i2c_select has register address 0x11
     # Value : 4 = 0x04 selects 0x50
     # Note that the SSN expects 32 bits (4 bytes) for writing (send 0x4, 0, 0, 0)
     self.bus.write(t.bridgeAddress(self.slot),[0x11,0x04,0,0,0])
     # Send 0x0 to 0x50 in order to set pointer for reading ID
     # This removes the permutation problem!
     self.bus.write(0x50,[0x00])
     self.bus.read(0x50,8)
     raw = self.bus.sendBatch()[-1]
     return raw
예제 #6
0
 def getID(self):
     # Reset entire board by writing 0x6 to 0x0.
     self.bus.write(0x00, [0x06])
     # Note that the i2c_select has register address 0x11
     # Value : 4 = 0x04 selects 0x50
     # Note that the SSN expects 32 bits (4 bytes) for writing (send 0x4, 0, 0, 0)
     self.bus.write(t.bridgeAddress(self.slot), [0x11, 0x04, 0, 0, 0])
     # Send 0x0 to 0x50 in order to set pointer for reading ID
     # This removes the permutation problem!
     self.bus.write(0x50, [0x00])
     self.bus.read(0x50, 8)
     raw = self.bus.sendBatch()[-1]
     return raw
예제 #7
0
def readTempHumi(slot, num_bytes, key, hold, verbosity=0):
    bus.write(0x00,[0x06])
    bus.write(t.bridgeAddress(slot),[0x11,0x05,0,0,0])
    bus.write(0x40,[triggerDict[key][hold]])
    bus.read(0x40, num_bytes + 1) # also read checksum byte
    message = bus.sendBatch()[-1]

    check = Checksum(message,1)
    crc = check.result

    value = getValue(message)

    if verbosity > 1:
        print 'message: ', message
        print 'checksum: ', crc
        print 'value: ', value
    return [crc,function[key](value)]
예제 #8
0
def openIgloo(rm,slot):
    t.openRM(b,rm)
    #the igloo is value "3" in I2C_SELECT table
    b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    b.sendBatch()
예제 #9
0
def writeBridge(rm, slot, address, messageList):
    t.openRM(b, rm)
    b.write(t.bridgeAddress(slot), [address] + messageList)
    return b.sendBatch()
예제 #10
0
def readBridge(slot, address, num_bytes):
    b.write(t.bridgeAddress(slot), [address])
    b.read(t.bridgeAddress(slot), num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #11
0
def writeBridge(rm,slot,address,messageList):
    t.openRM(b,rm)
    b.write(t.bridgeAddress(slot),[address] + messageList)
    return b.sendBatch()
예제 #12
0
def readBridge(slot, address, num_bytes):
    b.write(t.bridgeAddress(slot),[address])
    b.read(t.bridgeAddress(slot), num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)