From 820fe749edc052c2411f84aee8da51d1a52754be Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Thu, 12 Apr 2012 18:41:10 +0200 Subject: Always add the "address OK" bit Signed-off-by: Michael Buesch --- libtoprammer/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libtoprammer/main.py') diff --git a/libtoprammer/main.py b/libtoprammer/main.py index 0a0cc3d..d1a4f76 100644 --- a/libtoprammer/main.py +++ b/libtoprammer/main.py @@ -553,16 +553,22 @@ class TOP: cmd += b"\x00" * (64 - len(cmd)) # padding self.queueCommand(cmd) + def __makeFPGAAddr(self, address): + # Set the "address OK" bit + return address | 0x10 + def cmdFPGARead(self, address): """Read a byte from the FPGA at address into the buffer register.""" - if address == 0x10: # Fast tracked + address = self.__makeFPGAAddr(address) + if address == self.__makeFPGAAddr(0): # Fast tracked self.queueCommand(int2byte(0x01)) return self.queueCommand(int2byte(0x0B) + int2byte(address)) def cmdFPGAWrite(self, address, byte): """Write a byte to an FPGA address.""" - if address == 0x10: # Fast tracked + address = self.__makeFPGAAddr(address) + if address == self.__makeFPGAAddr(0): # Fast tracked self.queueCommand(int2byte(0x10) + int2byte(byte)) return self.queueCommand(int2byte(0x0A) + int2byte(address) + int2byte(byte)) -- cgit v1.2.3