X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=frprog.py;h=293ed4dd449c834a96db2b42ae0e84d3f2fe2ef7;hb=0ccc9709cad2069ca6e4193e1924aed1691729d1;hp=6cdff798ab22bf300f910fe84231b6880740cb77;hpb=392101288e548518f5cc449e014c11b1df93b8a9;p=pyfrprog.git diff --git a/frprog.py b/frprog.py index 6cdff79..293ed4d 100755 --- 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 = []