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-09-04 21:39:30.000000000 +0200
40 + * author: till, hunz, koppi, hackbard
\r
44 +#include "xilprg.h"
\r
46 +#include "onbusb.h"
\r
48 +#define GET_TDO 0x20
\r
62 + struct usb_bus *bus;
\r
65 + usb_find_busses();
\r
66 + usb_find_devices();
\r
68 + bus=usb_get_busses();
\r
72 + if(dev->descriptor.idVendor==USB_VENDOR_ID &&
\r
73 + dev->descriptor.idProduct==USB_PRODUCT_ID) {
\r
75 + /* found the device */
\r
76 + handle=usb_open(dev);
\r
80 + if(usb_set_configuration(handle,1)<0)
\r
83 + if(usb_claim_interface(handle,0)<0)
\r
86 + if(usb_set_altinterface(handle,1)<0)
\r
91 + reset_tap_state();
\r
106 + printf("usb init failed!\n");
\r
112 +int onbusb::close()
\r
115 + usb_close(handle);
\r
120 +int onbusb::get_description(string& desc)
\r
123 + sprintf(s, "onboard usb bitbanging (till, hunz, koppi, hackbard)");
\r
128 +void onbusb::set_tdi(int bit)
\r
130 + if (bit) data |= 0x04; else data &= ~0x04;
\r
131 + usb_bulk_write(handle,0x01,&data,1,0);
\r
134 +void onbusb::set_tck(int bit)
\r
136 + if (bit) data |= 0x10; else data &= ~0x10;
\r
137 + usb_bulk_write(handle,0x01,&data,1,0);
\r
140 +void onbusb::set_tms(int bit)
\r
142 + if (bit) data |= 0x08; else data &= ~0x08;
\r
143 + usb_bulk_write(handle,0x01,&data,1,0);
\r
146 +int onbusb::get_tdo()
\r
148 + /* send get tdo command */
\r
150 + usb_bulk_write(handle,0x01,&data,1,0);
\r
152 + /* receive tdo */
\r
153 + usb_bulk_read(handle,0x81,&data,1,0);
\r
154 + return data & 0x01 ? 1 : 0;
\r
156 diff -Nur xilprg-0.5/src/onbusb.h xilprg-new/src/onbusb.h
157 --- xilprg-0.5/src/onbusb.h 1970-01-01 01:00:00.000000000 +0100
158 +++ xilprg-new/src/onbusb.h 2007-09-04 21:17:18.000000000 +0200
163 + * author: till, hunz, koppi, hackbard
\r
167 +#ifndef _ONBUSB_H_INCLUDED_
\r
168 +#define _ONBUSB_H_INCLUDED_
\r
170 +#include "cable.h"
\r
174 +class onbusb : public cable
\r
178 + virtual ~onbusb();
\r
182 + USB_VENDOR_ID = 0x04b4,
\r
183 + USB_PRODUCT_ID = 0x8613
\r
186 + virtual int open();
\r
187 + virtual int close();
\r
189 + virtual int get_description(string&);
\r
191 + virtual void set_tdi(int);
\r
192 + virtual void set_tck(int);
\r
193 + virtual void set_tms(int);
\r
194 + virtual int get_tdo();
\r
198 + struct usb_device *dev;
\r
199 + usb_dev_handle *handle;
\r
203 diff -Nur xilprg-0.5/src/strtable.cpp xilprg-new/src/strtable.cpp
204 --- xilprg-0.5/src/strtable.cpp 2006-08-23 07:38:34.000000000 +0200
205 +++ xilprg-new/src/strtable.cpp 2007-04-07 16:56:25.000000000 +0200
209 "Sets programmer cable\0"
\r
210 - "cable {xil3 [ioaddr]|dusb}\0",
\r
211 + "cable {xil3 [ioaddr]|dusb|ousb}\0",
\r
214 "Prints supported devices\0"
\r