a call to the end of the IRAM (0x00033ffc)...
[pyfrprog.git] / frprog.py
index 6cdff798ab22bf300f910fe84231b6880740cb77..293ed4dd449c834a96db2b42ae0e84d3f2fe2ef7 100755 (executable)
--- a/frprog.py
+++ b/frprog.py
@@ -32,7 +32,6 @@ def recvByte():
 
 def recvChecksum():
        global last_checksum
-       # get checksum
        last_checksum = recvByte()
        last_checksum |= (recvByte() << 8)
 
@@ -72,6 +71,32 @@ def cmdWRITE(address, size, data):
        # get checksum
        recvChecksum()
 
+# TODO: test this function!
+def cmdCALL(address):
+       # send CALL command
+       sendByte(0x01)
+       if (recvByte() != 0xF1):
+               raise Exception
+       sendByte(0x04)
+       if (recvByte() != 0x84):
+               raise Exception
+       # tell desired address
+       sendDWord(address)
+       # wait for return parameter - not needed here!
+       #return recvByte()
+
+# TODO: test this function!
+def cmdCHECKSUM():
+       # call CHECKSUM command
+       sendByte(0x01)
+       if (recvByte() != 0xF1):
+               raise Exception
+       sendByte(0x05)
+       if (recvByte() != 0x84):
+               raise Exception
+       # get checksum
+       recvChecksum()
+
 def cmdBAUDRATE(baudrate):
        global last_checksum
 
@@ -117,6 +142,18 @@ print recvByte()
 sys.exit(0)
 """
 
+#cmdCALL(0x00030000)
+cmdCALL(0x00033ffc)
+sys.exit(0)
+
+# read something from the IRAM
+#print cmdREAD(0x00030000, 32)
+
+#data = []
+#for i in range(0, 32):
+#      data.append(i)
+#cmdWRITE(0x00030000, 32, data)
+
 
 # write something to the begin of the IRAM
 data_wr = []