summaryrefslogtreecommitdiffstats
path: root/libtoprammer/main.py
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-04-12 18:41:10 +0200
committerMichael Buesch <m@bues.ch>2012-04-12 18:41:10 +0200
commit820fe749edc052c2411f84aee8da51d1a52754be (patch)
treeafae05cb9874ee2362e89389fe66d40cc8923884 /libtoprammer/main.py
parent616754959714e099f24d507e3977762fd45d2fb7 (diff)
downloadtoprammer-820fe749edc052c2411f84aee8da51d1a52754be.tar.xz
toprammer-820fe749edc052c2411f84aee8da51d1a52754be.zip
Always add the "address OK" bit
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/main.py')
-rw-r--r--libtoprammer/main.py10
1 files changed, 8 insertions, 2 deletions
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))
bues.ch cgit interface