OpenCores
URL https://opencores.org/ocsvn/usb_dongle_fpga/usb_dongle_fpga/trunk

Subversion Repositories usb_dongle_fpga

[/] [usb_dongle_fpga/] [tags/] [version_1_5/] [sw/] [dongle.py] - Diff between revs 9 and 12

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 12
Line 44... Line 44...
from struct import *
from struct import *
from Uspp.uspp import *
from Uspp.uspp import *
 
 
#### global funcs ####
#### global funcs ####
def usage(s):
def usage(s):
    print "Artec USB Dongle programming utility"
    print "Artec USB Dongle programming utility ver. 1.1"
    print "Usage: ",s," -c comport [-fvdq] filename address"
    print "Usage: ",s," -c comport [-fvdq] filename address"
    print "       ",s," [-fvdqr] offset length filename"
    print "       ",s," [-fvdqr] offset length filename"
    print ""
    print ""
    print "Options:"
    print "Options:"
    print " -c        COM port"
    print " -c        COM port"
Line 377... Line 377...
 
 
 
 
if mode.q == 1:   # perform a query from dongle
if mode.q == 1:   # perform a query from dongle
 
 
    buf=don.read_data(4,0x0)  # word count and word address
    buf=don.read_data(4,0x0)  # word count and word address
    print 'Data: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x '%(ord(buf[1]),ord(buf[0]),ord(buf[3]),ord(buf[2]),ord(buf[5]),ord(buf[4]),ord(buf[7]),ord(buf[6]) )
 
 
 
 
 
    don.write_command(0x0050) # 0x0098
    don.write_command(0x0050) # 0x0098
    don.write_command(0x0098) # 0x0098
    don.write_command(0x0098) # 0x0098
    buf=don.read_data(3,0x000010)  # word count and word address
    buf=don.read_data(3,0x000010)  # word count and word address
    if ord(buf[0])==0x51 and  ord(buf[2])==0x52 and  ord(buf[4])==0x59:
    if ord(buf[0])==0x51 and  ord(buf[2])==0x52 and  ord(buf[4])==0x59:
        buf=don.read_data(2,0x000000)  # word count and word address
        buf=don.read_data(2,0x000000)  # word count and word address

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.