1 diff -Nur xilprg-0.5/makefile xilprg-new/makefile
2 --- xilprg-0.5/makefile 2006-08-23 07:41:20.000000000 +0200
3 +++ xilprg-new/makefile 2007-04-07 17:09:16.000000000 +0200
5 $(SRC_DIR)/prgfile.cpp \
\r
6 $(SRC_DIR)/chip.cpp \
\r
7 $(SRC_DIR)/parport.cpp \
\r
8 + $(SRC_DIR)/onbusb.cpp \
\r
9 $(SRC_DIR)/cable.cpp \
\r
10 $(SRC_DIR)/digilent.cpp \
\r
11 $(SRC_DIR)/xilinx.cpp
\r
12 diff -Nur xilprg-0.5/src/cable.cpp xilprg-new/src/cable.cpp
13 --- xilprg-0.5/src/cable.cpp 2006-08-23 07:38:34.000000000 +0200
14 +++ xilprg-new/src/cable.cpp 2007-04-07 17:20:55.000000000 +0200
17 #include "cmdline.h"
\r
18 #include "digilent.h"
\r
19 +#include "onbusb.h"
\r
20 #include "parport.h"
\r
24 if (stricmp(argv[0], "dusb") == 0)
\r
27 + if (stricmp(argv[0], "ousb") ==0)
\r
31 msgf(STR_INVALID_CABLE_DEF);
\r
33 diff -Nur xilprg-0.5/src/onbusb.cpp xilprg-new/src/onbusb.cpp
34 --- xilprg-0.5/src/onbusb.cpp 1970-01-01 01:00:00.000000000 +0100
35 +++ xilprg-new/src/onbusb.cpp 2007-04-07 17:15:34.000000000 +0200
40 + * author: till & frank zirkelbach
\r
44 +#include "xilprg.h"
\r
46 +#include "onbusb.h"
\r
60 + struct usb_bus *bus;
\r
63 + usb_find_busses();
\r
64 + usb_find_devices();
\r
66 + bus=usb_get_busses();
\r
70 + if(dev->descriptor.idVendor==USB_VENDOR_ID &&
\r
71 + dev->descriptor.idProduct==USB_PRODUCT_ID)
\r
72 + /* found the device */
\r
81 + handle=usb_open(dev);
\r
85 + if(usb_set_configuration(handle,1)<0)
\r
88 + if(usb_claim_interface(handle,0)<0)
\r
91 + if(usb_set_altinterface(handle,1)<0)
\r
96 + reset_tap_state();
\r
108 +int onbusb::close()
\r
111 + usb_close(handle);
\r
116 +int onbusb::get_description(string& desc)
\r
119 + sprintf(s, "onboard usb bitbanging");
\r
124 +void onbusb::set_tdi(int bit)
\r
126 + if (bit) data |= 0x04; else data &= ~0x04;
\r
128 + usb_bulk_write(handle,0x01,&data,1,0);
\r
131 +void onbusb::set_tck(int bit)
\r
133 + if (bit) data |= 0x10; else data &= ~0x10;
\r
135 + usb_bulk_write(handle,0x01,&data,1,0);
\r
138 +void onbusb::set_tms(int bit)
\r
140 + if (bit) data |= 0x08; else data &= ~0x08;
\r
142 + usb_bulk_write(handle,0x01,&data,1,0);
\r
145 +int onbusb::get_tdo()
\r
147 + usb_bulk_read(handle,0x81,&data,1,0);
\r
148 + return data & 0x01 ? 1 : 0;
\r
150 diff -Nur xilprg-0.5/src/onbusb.h xilprg-new/src/onbusb.h
151 --- xilprg-0.5/src/onbusb.h 1970-01-01 01:00:00.000000000 +0100
152 +++ xilprg-new/src/onbusb.h 2007-04-07 17:14:07.000000000 +0200
157 + * author: till & frank zirkelbach
\r
161 +#ifndef _ONBUSB_H_INCLUDED_
\r
162 +#define _ONBUSB_H_INCLUDED_
\r
164 +#include "cable.h"
\r
168 +class onbusb : public cable
\r
172 + virtual ~onbusb();
\r
176 + USB_VENDOR_ID = 0x04b4,
\r
177 + USB_PRODUCT_ID = 0x8613
\r
180 + virtual int open();
\r
181 + virtual int close();
\r
183 + virtual int get_description(string&);
\r
185 + virtual void set_tdi(int);
\r
186 + virtual void set_tck(int);
\r
187 + virtual void set_tms(int);
\r
188 + virtual int get_tdo();
\r
192 + struct usb_device *dev;
\r
193 + usb_dev_handle *handle;
\r
197 diff -Nur xilprg-0.5/src/strtable.cpp xilprg-new/src/strtable.cpp
198 --- xilprg-0.5/src/strtable.cpp 2006-08-23 07:38:34.000000000 +0200
199 +++ xilprg-new/src/strtable.cpp 2007-04-07 16:56:25.000000000 +0200
203 "Sets programmer cable\0"
\r
204 - "cable {xil3 [ioaddr]|dusb}\0",
\r
205 + "cable {xil3 [ioaddr]|dusb|ousb}\0",
\r
208 "Prints supported devices\0"
\r