├── .gitignore ├── README.md ├── doc ├── 001-57294_AN57294_USB_101_An_Introduction_to_Universal_Serial_Bus_2.0.pdf ├── 01233a.pdf ├── 1333179451-USB_Complete_3rdEdition.pdf ├── 2011-06-08-usb.pdf ├── AN73609 EZUSB FX2LP_FX3 Developing Bulk-Loop Example on Linux.pdf ├── HID1_11.pdf ├── How to find all serial devices (ttyS, ttyUSB, ..pdf ├── Introduction To Using LibUSB-1.0 - C++ Tutorials _ Dream.In.pdf ├── JHWP.pdf ├── Jan Axelson - USB Complete (2nd Edition).PDF ├── LibUSB_-_Create_a_Solution_Without_the_Class_Struggle.pdf ├── Libusb_Developers_Guide_vers0_1.pdf ├── Linux Disable USB Devices (Disable loading of USB Storage Driver) - nixCraft.pdf ├── Overview-Universal-Serial-Bus-2.0-1331844599.pdf ├── PL-2305 Installation Guide.pdf ├── PL2305 Windows 8 Installation Guide.pdf ├── PL2305H_EOL_Notice.pdf ├── PL2305I_ECN.pdf ├── SAF1508.pdf ├── ULPI │ ├── 00001783C.pdf │ ├── 00001792E.pdf │ ├── 001-15775_CY7C68003_MOBL-USB_TX2UL_USB_2.0_ULPI_TRANSCEIVER.pdf │ ├── 3300db.pdf │ ├── 3318-320906.pdf │ ├── FUSB2805-84258.pdf │ ├── FUSB2805-D.pdf │ ├── ULPI_v1_1.pdf │ ├── USB3300-USB-HS-Board-Schematic.pdf │ ├── USB3300-USB-HS-Board-size.png │ ├── an702.pdf │ ├── en562704.pdf │ └── utmiplus_whitepaper.pdf ├── USB Complete Dev_Guide.pdf ├── USB_Debugging_and_Profiling_Techniques.pdf ├── USB_Parallel │ ├── API for USB2LPT.pdf │ ├── DLO_DeluxeUSB │ │ ├── DLO_DeluxeUSB.dll │ │ ├── DLO_DeluxeUSB.zip │ │ ├── DeluxeUSB │ │ │ ├── firmware │ │ │ │ ├── DeluxeUSB.c │ │ │ │ ├── DeluxeUSB.hex │ │ │ │ ├── Makefile │ │ │ │ ├── usbconfig.h │ │ │ │ └── usbdrv │ │ │ │ │ ├── asmcommon.inc │ │ │ │ │ ├── oddebug.h │ │ │ │ │ ├── usbdrv.c │ │ │ │ │ ├── usbdrv.h │ │ │ │ │ ├── usbdrvasm.S │ │ │ │ │ ├── usbdrvasm165.inc │ │ │ │ │ └── usbportability.h │ │ │ ├── readme.txt │ │ │ └── schematic │ │ │ │ ├── dl-10.brd │ │ │ │ ├── dl-10.png │ │ │ │ ├── dl-10.sch │ │ │ │ ├── dl-10.wmf │ │ │ │ └── dl.lbr │ │ ├── DeluxeUSBmux │ │ │ ├── firmware │ │ │ │ └── coming soon │ │ │ ├── readme.txt │ │ │ └── schematic │ │ │ │ ├── dl-11.brd │ │ │ │ ├── dl-11.png │ │ │ │ ├── dl-11.sch │ │ │ │ └── dl-11.wmf │ │ ├── DeluxeUSBmux2 │ │ │ ├── firmware │ │ │ │ ├── DeluxeUSBmux2.c │ │ │ │ ├── DeluxeUSBmux2.hex │ │ │ │ ├── Makefile │ │ │ │ ├── usbconfig.h │ │ │ │ └── usbdrv │ │ │ │ │ ├── asmcommon.inc │ │ │ │ │ ├── oddebug.h │ │ │ │ │ ├── usbdrv.c │ │ │ │ │ ├── usbdrv.h │ │ │ │ │ ├── usbdrvasm.S │ │ │ │ │ ├── usbdrvasm12.inc │ │ │ │ │ └── usbportability.h │ │ │ ├── readme.txt │ │ │ ├── running.jpg │ │ │ └── schematic │ │ │ │ ├── dl-12.brd │ │ │ │ ├── dl-12.png │ │ │ │ ├── dl-12.sch │ │ │ │ ├── dl-12.wmf │ │ │ │ ├── dl-12b.wmf │ │ │ │ └── dl-12t.wmf │ │ ├── plugin-src │ │ │ ├── DLO_DeluxeUSB.c │ │ │ ├── DLO_DeluxeUSB.dsp │ │ │ └── DLO_DeluxeUSB.rc │ │ └── readme.txt │ ├── DLO_Parallel │ │ ├── DLO_Parallel 0x378.dll │ │ ├── DLO_Parallel.zip │ │ ├── inpout32.dll │ │ ├── readme.txt │ │ └── src │ │ │ ├── DLO_Parallel.c │ │ │ ├── DLO_Parallel.dsp │ │ │ └── DLO_Parallel.rc │ ├── DLO_UsbPrn │ │ ├── DLO_UsbPrn.dll │ │ ├── DLO_UsbPrn.png │ │ ├── DLO_UsbPrn.zip │ │ ├── DLO_UsbPrnCen.png │ │ ├── readme.txt │ │ └── src │ │ │ ├── DLO_UsbPrn.c │ │ │ ├── DLO_UsbPrn.dsp │ │ │ ├── DLO_UsbPrn.rc │ │ │ ├── DLO_UsbPrn.sch │ │ │ ├── DLO_UsbPrn.wmf │ │ │ ├── DLO_UsbPrnCen.sch │ │ │ └── DLO_UsbPrnCen.wmf │ ├── HIDKeys.2012-12-08.tar.gz │ ├── Has anyone tried to connect a usb parallel port_ - Hacking WD MyBook World Ed.pdf │ ├── PL2303_Prolific_DriverInstaller_v1210 │ │ ├── PL2303_Prolific_DriverInstaller_v1210.exe │ │ ├── PL2303_Prolific_DriverInstaller_v1210.zip │ │ └── releasenote.txt │ ├── PL2305I_ECN.pdf │ ├── USB2CV_1.5.4.1_Installer_-_x64_Release.exe │ ├── USB3CV_2.1.7.1_Installer_-_x64_Release.exe │ ├── Using Linux USB.pdf │ ├── ds_pl2305I_v1.0.pdf │ ├── hid_listen │ │ ├── Makefile │ │ ├── binaries │ │ │ ├── blinky-teensy1++.elf │ │ │ ├── blinky-teensy1++.hex │ │ │ ├── blinky-teensy1.elf │ │ │ ├── blinky-teensy1.hex │ │ │ ├── blinky-teensy2++.elf │ │ │ ├── blinky-teensy2++.hex │ │ │ ├── blinky-teensy2.elf │ │ │ ├── blinky-teensy2.hex │ │ │ ├── hid_listen │ │ │ ├── hid_listen.exe │ │ │ └── hid_listen.mac │ │ ├── gpl3.txt │ │ ├── hid_listen.c │ │ ├── hid_listen_1.01.zip │ │ ├── rawhid.c │ │ └── rawhid.h │ ├── parapin-1.5.1-beta1 │ │ ├── .cvsignore │ │ ├── INSTALL │ │ ├── Kbuild │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── Makefile-2.4 │ │ ├── Makefile-2.6 │ │ ├── README │ │ ├── contrib │ │ │ ├── README │ │ │ └── qtparapin.tar.gz │ │ ├── doc │ │ │ ├── .cvsignore │ │ │ ├── Makefile │ │ │ ├── html.sty │ │ │ ├── parapin.html │ │ │ ├── parapin.ps │ │ │ ├── parapin.tex │ │ │ └── parapin.txt │ │ ├── examples │ │ │ ├── .cvsignore │ │ │ ├── adc0831.c │ │ │ ├── inputtest.c │ │ │ ├── outputtest.c │ │ │ ├── ppdrv-test.c │ │ │ └── setlp0pin.c │ │ ├── kparapin │ │ │ ├── Makefile │ │ │ ├── kparapin.c │ │ │ ├── parapin-linux.h │ │ │ └── parapin.h │ │ ├── parapin-1.5.1-beta1.tgz │ │ ├── parapin-linux.h │ │ ├── parapin.c │ │ ├── parapin.h │ │ ├── parapin_java │ │ │ ├── .classpath │ │ │ ├── .cvsignore │ │ │ ├── .project │ │ │ ├── Makefile │ │ │ ├── build.xml │ │ │ ├── doc │ │ │ │ ├── LICENSE │ │ │ │ ├── index.xhtml │ │ │ │ └── package-list │ │ │ ├── etc │ │ │ │ └── MANIFEST.MF │ │ │ ├── example │ │ │ │ └── src │ │ │ │ │ ├── BaseConsoleTest.java │ │ │ │ │ ├── BlinkTest.java │ │ │ │ │ ├── DriveRateTest.java │ │ │ │ │ ├── InputTest.java │ │ │ │ │ ├── OpenAndCloseTest.java │ │ │ │ │ ├── PortUI.java │ │ │ │ │ └── ReadRateTest.java │ │ │ ├── src │ │ │ │ ├── net │ │ │ │ │ └── sf │ │ │ │ │ │ ├── CVS │ │ │ │ │ │ ├── Entries │ │ │ │ │ │ ├── Repository │ │ │ │ │ │ └── Root │ │ │ │ │ │ └── parapin │ │ │ │ │ │ ├── CVS │ │ │ │ │ │ ├── Entries │ │ │ │ │ │ ├── Repository │ │ │ │ │ │ └── Root │ │ │ │ │ │ ├── ParallelPort.java │ │ │ │ │ │ ├── Parapin.java │ │ │ │ │ │ └── Parapin.properties │ │ │ │ ├── net_sf_parapin_ParallelPort.c │ │ │ │ └── net_sf_parapin_ParallelPort.h │ │ │ └── version │ │ ├── parapin_py │ │ │ ├── Makefile │ │ │ ├── outputtest.py │ │ │ ├── parapin_py.c │ │ │ ├── parapin_py.h │ │ │ ├── setup.py │ │ │ └── test_parapin.py │ │ ├── parapin_rb │ │ │ ├── GNUmakefile │ │ │ ├── README │ │ │ ├── extconf.rb │ │ │ ├── parallel-port.rb │ │ │ ├── parapin.c │ │ │ └── tests.rb │ │ ├── parapindriver.c │ │ ├── parapindriver.h │ │ ├── parapindriver │ │ │ ├── Makefile │ │ │ ├── parapin.h │ │ │ ├── parapindriver.c │ │ │ └── parapindriver.h │ │ ├── ppdrv_load.sh │ │ ├── setup-2.4.sh │ │ └── setup-2.6.sh │ ├── parashell │ │ ├── ChangeLog │ │ ├── Copying │ │ ├── INSTALL │ │ ├── Makefile │ │ ├── README │ │ ├── bin │ │ │ ├── Linux │ │ │ │ ├── parashell │ │ │ │ └── pin │ │ │ └── Win32 │ │ │ │ ├── inpout32.dll │ │ │ │ └── parashell.exe │ │ ├── docs │ │ │ ├── LED.txt │ │ │ ├── parallel_port_pinout.txt │ │ │ └── stepper_motors.txt │ │ ├── examples │ │ │ ├── 7seg_led.sh │ │ │ ├── count.sh │ │ │ ├── right_knider.sh │ │ │ └── stepper_motor.pl │ │ ├── parashell-2.2.zip │ │ └── src │ │ │ ├── Linux │ │ │ ├── parashell.c │ │ │ └── pin.c │ │ │ └── Win32 │ │ │ ├── parashell.perlapp │ │ │ └── parashell.pl │ ├── sch_pl2305_v2.3.zip │ ├── sch_pl2305_v2.3 │ │ ├── SCH_PL2305_V2.3-ORCAD7.2.DSN │ │ ├── SCH_PL2305_V2.3.BOM │ │ ├── SCH_PL2305_V2.3.pdf │ │ └── sch_pl2305_v2.3.zip │ └── usb2lpt5.c ├── Universal Serial Bus System Architecture.pdf ├── Usb.Complete.The.Developers.Guide.5th.Edition.pdf ├── bit-bang-usb.pdf ├── develop_usb_device_access_once_using_libusb_-_use_any_where_nagendra_simhadri_-_v4.0.pdf ├── ds_pl2305I_v1.0.pdf ├── ds_pl2305_v1.3.pdf ├── example.c ├── libusb.pdf ├── mlug-usb-talk.pdf ├── prolific_2305_brochure.pdf ├── stulpi01a.pdf ├── usb-in-a-nutshell.pdf ├── usb_complete_chapter1.pdf ├── usbdoc-1.32.pdf ├── usbprint11.pdf ├── walac-pyusb-7a1ce1e │ ├── .gitignore │ ├── ACKNOWLEDGEMENTS │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.rst │ ├── deploy.sh │ ├── docs │ │ ├── faq.rst │ │ └── tutorial.rst │ ├── etc │ │ └── pyusb.rules │ ├── gencl.sh │ ├── setup.cfg │ ├── setup.py │ ├── tests │ │ ├── devinfo.py │ │ ├── test_backend.py │ │ ├── test_control.py │ │ ├── test_find.py │ │ ├── test_integration.py │ │ ├── test_legacy.py │ │ ├── test_util.py │ │ ├── testall.py │ │ └── utils.py │ ├── tools │ │ ├── decode-request-type │ │ ├── setup_testenv.sh │ │ └── vcp_terminal.py │ ├── tox.ini │ ├── usb │ │ ├── __init__.py │ │ ├── _debug.py │ │ ├── _interop.py │ │ ├── _lookup.py │ │ ├── _objfinalizer.py │ │ ├── backend │ │ │ ├── __init__.py │ │ │ ├── libusb0.py │ │ │ ├── libusb1.py │ │ │ └── openusb.py │ │ ├── control.py │ │ ├── core.py │ │ ├── legacy.py │ │ ├── libloader.py │ │ └── util.py │ └── walac-pyusb-v1.0.2-2-g7a1ce1e.tar.gz └── zena-0.4.3.c ├── hid-test └── hid-test.factor ├── linux └── hid │ └── hid.factor ├── usb-test ├── .gitignore └── usb-test.factor └── windows └── hid └── hid.factor /.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | USB 2 | ========= 3 | 4 | Playing around with the USB interface using Factor 5 | 6 | (HID) Human Interface Device would be a good place to start with. -------------------------------------------------------------------------------- /doc/001-57294_AN57294_USB_101_An_Introduction_to_Universal_Serial_Bus_2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/001-57294_AN57294_USB_101_An_Introduction_to_Universal_Serial_Bus_2.0.pdf -------------------------------------------------------------------------------- /doc/01233a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/01233a.pdf -------------------------------------------------------------------------------- /doc/1333179451-USB_Complete_3rdEdition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/1333179451-USB_Complete_3rdEdition.pdf -------------------------------------------------------------------------------- /doc/2011-06-08-usb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/2011-06-08-usb.pdf -------------------------------------------------------------------------------- /doc/AN73609 EZUSB FX2LP_FX3 Developing Bulk-Loop Example on Linux.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/AN73609 EZUSB FX2LP_FX3 Developing Bulk-Loop Example on Linux.pdf -------------------------------------------------------------------------------- /doc/HID1_11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/HID1_11.pdf -------------------------------------------------------------------------------- /doc/How to find all serial devices (ttyS, ttyUSB, ..pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/How to find all serial devices (ttyS, ttyUSB, ..pdf -------------------------------------------------------------------------------- /doc/Introduction To Using LibUSB-1.0 - C++ Tutorials _ Dream.In.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Introduction To Using LibUSB-1.0 - C++ Tutorials _ Dream.In.pdf -------------------------------------------------------------------------------- /doc/JHWP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/JHWP.pdf -------------------------------------------------------------------------------- /doc/Jan Axelson - USB Complete (2nd Edition).PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Jan Axelson - USB Complete (2nd Edition).PDF -------------------------------------------------------------------------------- /doc/LibUSB_-_Create_a_Solution_Without_the_Class_Struggle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/LibUSB_-_Create_a_Solution_Without_the_Class_Struggle.pdf -------------------------------------------------------------------------------- /doc/Libusb_Developers_Guide_vers0_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Libusb_Developers_Guide_vers0_1.pdf -------------------------------------------------------------------------------- /doc/Linux Disable USB Devices (Disable loading of USB Storage Driver) - nixCraft.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Linux Disable USB Devices (Disable loading of USB Storage Driver) - nixCraft.pdf -------------------------------------------------------------------------------- /doc/Overview-Universal-Serial-Bus-2.0-1331844599.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Overview-Universal-Serial-Bus-2.0-1331844599.pdf -------------------------------------------------------------------------------- /doc/PL-2305 Installation Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/PL-2305 Installation Guide.pdf -------------------------------------------------------------------------------- /doc/PL2305 Windows 8 Installation Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/PL2305 Windows 8 Installation Guide.pdf -------------------------------------------------------------------------------- /doc/PL2305H_EOL_Notice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/PL2305H_EOL_Notice.pdf -------------------------------------------------------------------------------- /doc/PL2305I_ECN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/PL2305I_ECN.pdf -------------------------------------------------------------------------------- /doc/SAF1508.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/SAF1508.pdf -------------------------------------------------------------------------------- /doc/ULPI/00001783C.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/00001783C.pdf -------------------------------------------------------------------------------- /doc/ULPI/00001792E.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/00001792E.pdf -------------------------------------------------------------------------------- /doc/ULPI/001-15775_CY7C68003_MOBL-USB_TX2UL_USB_2.0_ULPI_TRANSCEIVER.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/001-15775_CY7C68003_MOBL-USB_TX2UL_USB_2.0_ULPI_TRANSCEIVER.pdf -------------------------------------------------------------------------------- /doc/ULPI/3300db.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/3300db.pdf -------------------------------------------------------------------------------- /doc/ULPI/3318-320906.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/3318-320906.pdf -------------------------------------------------------------------------------- /doc/ULPI/FUSB2805-84258.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/FUSB2805-84258.pdf -------------------------------------------------------------------------------- /doc/ULPI/FUSB2805-D.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/FUSB2805-D.pdf -------------------------------------------------------------------------------- /doc/ULPI/ULPI_v1_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/ULPI_v1_1.pdf -------------------------------------------------------------------------------- /doc/ULPI/USB3300-USB-HS-Board-Schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/USB3300-USB-HS-Board-Schematic.pdf -------------------------------------------------------------------------------- /doc/ULPI/USB3300-USB-HS-Board-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/USB3300-USB-HS-Board-size.png -------------------------------------------------------------------------------- /doc/ULPI/an702.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/an702.pdf -------------------------------------------------------------------------------- /doc/ULPI/en562704.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/en562704.pdf -------------------------------------------------------------------------------- /doc/ULPI/utmiplus_whitepaper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ULPI/utmiplus_whitepaper.pdf -------------------------------------------------------------------------------- /doc/USB Complete Dev_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB Complete Dev_Guide.pdf -------------------------------------------------------------------------------- /doc/USB_Debugging_and_Profiling_Techniques.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Debugging_and_Profiling_Techniques.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/API for USB2LPT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/API for USB2LPT.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DLO_DeluxeUSB.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_DeluxeUSB/DLO_DeluxeUSB.dll -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DLO_DeluxeUSB.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_DeluxeUSB/DLO_DeluxeUSB.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DeluxeUSB/firmware/DeluxeUSB.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_DeluxeUSB/DeluxeUSB/firmware/DeluxeUSB.c -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DeluxeUSB/firmware/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT = DeluxeUSB 2 | DEVICE = attiny25 3 | F_CPU = 16500000 # in Hz 4 | AVRDUDE = avrdude -c pony-stk200 -P lpt1 -p $(DEVICE) 5 | 6 | CFLAGS = -Iusbdrv -I. 7 | OBJECTS = $(PROJECT).o usbdrv/usbdrvasm.o 8 | #usbdrv/usbdrv.o 9 | 10 | COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE) 11 | 12 | ############################## ATTiny25/45/85 ############################### 13 | # ATtiny*5 FUSE_L (Fuse low byte): 14 | # 0xC1 = 1 1 0 0 0 0 0 1 15 | # ^ ^ \+/ \--+--/ 16 | # | | | +------- CKSEL 3..0 (clock selection -> HF PLL @ 16.5 MHz) 17 | # | | +--------------- SUT 1..0 (BOD enabled, fast rising power) 18 | # | +------------------ CKOUT (clock output on CKOUT pin -> disabled) 19 | # +-------------------- CKDIV8 (divide clock by 8 -> don't divide) 20 | # ATtiny*5 FUSE_H (Fuse high byte): 21 | # 0xD5 = 1 1 0 1 0 1 0 1 22 | # ^ ^ ^ ^ ^ \-+-/ 23 | # | | | | | +------ BODLEVEL 2..0 (brownout trigger level -> 2.7V) 24 | # | | | | +---------- EESAVE (preserve EEPROM on Chip Erase -> preserve) 25 | # | | | +-------------- WDTON (watchdog timer always on -> no) 26 | # | | +---------------- SPIEN (enable serial programming -> enabled) 27 | # | +------------------ DWEN (debug wire enable) 28 | # +-------------------- RSTDISBL (disable external reset -> enabled) 29 | # 30 | LFUSE = 0xC1 31 | HFUSE = 0xD5 32 | 33 | all: $(PROJECT).hex 34 | 35 | help: 36 | @echo "make all ....... to build DeluxeUSB.hex out of source files" 37 | @echo "make prog ...... to flash fuses and firmware (for ATtiny25)" 38 | @echo "make tn45 ...... to flash fuses and firmware for ATtiny45" 39 | @echo "make tn85 ...... to flash fuses and firmware for ATtiny85" 40 | @echo "make fuse ...... to flash the fuses" 41 | @echo "make flash ..... to flash the firmware" 42 | @echo "make clean ..... to delete objects and hex file" 43 | @echo "make disasm .... create DeluxeUSB.dis" 44 | 45 | # rule for programming fuse bits only: 46 | fuse: 47 | $(AVRDUDE) -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m 48 | 49 | # rule for uploading firmware, compile if necessary: 50 | flash: $(PROJECT).hex 51 | $(AVRDUDE) -U flash:w:$<:i 52 | 53 | # program a fresh chip without compiling, only one invocation of avrdude 54 | prog: 55 | $(AVRDUDE) -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m -U flash:w:$(PROJECT).hex:i 56 | 57 | # program an ATtiny45 chip without compiling 58 | tn45: 59 | $(AVRDUDE) -p attiny45 -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m -U flash:w:$(PROJECT).hex:i 60 | 61 | # program an ATtiny85 chip without compiling 62 | tn85: 63 | $(AVRDUDE) -p attiny85 -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m -U flash:w:$(PROJECT).hex:i 64 | 65 | # rule for deleting dependent files (those which can be built by Make): 66 | clean: 67 | rm -f $(PROJECT).hex $(PROJECT).lst $(PROJECT).elf *.o usbdrv/*.o 68 | 69 | # Generic rule for compiling C files: 70 | .c.o: 71 | $(COMPILE) -c $< -o $@ 72 | 73 | # Generic rule for assembling Assembler source files: 74 | .S.o: 75 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 76 | 77 | # file targets: 78 | 79 | $(PROJECT).elf: $(OBJECTS) 80 | $(COMPILE) -o $@ $(OBJECTS) 81 | 82 | $(PROJECT).hex: $(PROJECT).elf 83 | rm -f $@ 84 | avr-objcopy -j .text -j .data -O ihex $< $@ 85 | avr-size $@ 86 | 87 | disasm: $(PROJECT).elf 88 | avr-objdump -d $< > $(PROJECT).lst 89 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DeluxeUSB/firmware/usbdrv/oddebug.h: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.h 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #ifndef __oddebug_h_included__ 12 | #define __oddebug_h_included__ 13 | 14 | /* 15 | General Description: 16 | This module implements a function for debug logs on the serial line of the 17 | AVR microcontroller. Debugging can be configured with the define 18 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging 19 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is 20 | 2, DBG1 and DBG2 logs will be printed. 21 | 22 | A debug log consists of a label ('prefix') to indicate which debug log created 23 | the output and a memory block to dump in hex ('data' and 'len'). 24 | */ 25 | 26 | 27 | #ifndef F_CPU 28 | # define F_CPU 12000000 /* 12 MHz */ 29 | #endif 30 | 31 | /* make sure we have the UART defines: */ 32 | #include "usbportability.h" 33 | 34 | #ifndef uchar 35 | # define uchar unsigned char 36 | #endif 37 | 38 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */ 39 | # warning "Debugging disabled because device has no UART" 40 | # undef DEBUG_LEVEL 41 | #endif 42 | 43 | #ifndef DEBUG_LEVEL 44 | # define DEBUG_LEVEL 0 45 | #endif 46 | 47 | /* ------------------------------------------------------------------------- */ 48 | 49 | #if DEBUG_LEVEL > 0 50 | # define DBG1(prefix, data, len) odDebug(prefix, data, len) 51 | #else 52 | # define DBG1(prefix, data, len) 53 | #endif 54 | 55 | #if DEBUG_LEVEL > 1 56 | # define DBG2(prefix, data, len) odDebug(prefix, data, len) 57 | #else 58 | # define DBG2(prefix, data, len) 59 | #endif 60 | 61 | /* ------------------------------------------------------------------------- */ 62 | 63 | #if DEBUG_LEVEL > 0 64 | extern void odDebug(uchar prefix, uchar *data, uchar len); 65 | 66 | /* Try to find our control registers; ATMEL likes to rename these */ 67 | 68 | #if defined UBRR 69 | # define ODDBG_UBRR UBRR 70 | #elif defined UBRRL 71 | # define ODDBG_UBRR UBRRL 72 | #elif defined UBRR0 73 | # define ODDBG_UBRR UBRR0 74 | #elif defined UBRR0L 75 | # define ODDBG_UBRR UBRR0L 76 | #endif 77 | 78 | #if defined UCR 79 | # define ODDBG_UCR UCR 80 | #elif defined UCSRB 81 | # define ODDBG_UCR UCSRB 82 | #elif defined UCSR0B 83 | # define ODDBG_UCR UCSR0B 84 | #endif 85 | 86 | #if defined TXEN 87 | # define ODDBG_TXEN TXEN 88 | #else 89 | # define ODDBG_TXEN TXEN0 90 | #endif 91 | 92 | #if defined USR 93 | # define ODDBG_USR USR 94 | #elif defined UCSRA 95 | # define ODDBG_USR UCSRA 96 | #elif defined UCSR0A 97 | # define ODDBG_USR UCSR0A 98 | #endif 99 | 100 | #if defined UDRE 101 | # define ODDBG_UDRE UDRE 102 | #else 103 | # define ODDBG_UDRE UDRE0 104 | #endif 105 | 106 | #if defined UDR 107 | # define ODDBG_UDR UDR 108 | #elif defined UDR0 109 | # define ODDBG_UDR UDR0 110 | #endif 111 | 112 | static inline void odDebugInit(void) 113 | { 114 | ODDBG_UCR |= (1< crystal) 17 | # | | +--------------- SUT 1..0 (fastest startup possible) 18 | # | +------------------ CKOUT (clock output on CKOUT pin -> disabled) 19 | # +-------------------- CKDIV8 (divide clock by 8 -> don't divide) 20 | # ATtiny2313 FUSE_H (Fuse high byte): 21 | # 0xDB = 1 1 0 1 1 0 1 1 22 | # ^ ^ ^ ^ \-+-/ ^ 23 | # | | | | | +---- RSTDISBL (disable external reset -> enabled) 24 | # | | | | +-------- BODLEVEL 2..0 (brownout trigger level -> 2.7V) 25 | # | | | +-------------- WDTON (watchdog timer always on -> no) 26 | # | | +---------------- SPIEN (enable serial programming -> enabled) 27 | # | +------------------ EESAVE (preserve EEPROM on Chip Erase -> preserve) 28 | # +-------------------- DWEN (debug wire enable) 29 | # 30 | LFUSE = 0xEE 31 | HFUSE = 0xDB 32 | EFUSE = 0xFF 33 | 34 | all: $(PROJECT).hex 35 | 36 | help: 37 | @echo "make all ....... to build DeluxeUSBmux2.hex out of source files" 38 | @echo "make prog ...... to flash fuses and firmware" 39 | @echo "make fuse ...... to flash the fuses" 40 | @echo "make flash ..... to flash the firmware" 41 | @echo "make clean ..... to delete objects and hex file" 42 | @echo "make disasm .... create DeluxeUSBmux2.dis" 43 | 44 | # rule for programming fuse bits only: 45 | fuse: 46 | $(AVRDUDE) -U efuse:w:$(EFUSE):m -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m 47 | 48 | # rule for uploading firmware, compile if necessary: 49 | flash: $(PROJECT).hex 50 | $(AVRDUDE) -U flash:w:$<:i 51 | 52 | # program a fresh chip without compiling, only one invocation of avrdude 53 | prog: 54 | $(AVRDUDE) -U efuse:w:$(EFUSE):m -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m -U flash:w:$(PROJECT).hex:i 55 | 56 | # rule for deleting dependent files (those which can be built by Make): 57 | clean: 58 | rm -f $(PROJECT).hex $(PROJECT).lst $(PROJECT).elf *.o usbdrv/*.o 59 | 60 | # Generic rule for compiling C files: 61 | .c.o: 62 | $(COMPILE) -c $< -o $@ 63 | 64 | # Generic rule for assembling Assembler source files: 65 | .S.o: 66 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 67 | 68 | # file targets: 69 | 70 | $(PROJECT).elf: $(OBJECTS) 71 | $(COMPILE) -o $@ $(OBJECTS) 72 | 73 | $(PROJECT).hex: $(PROJECT).elf 74 | rm -f $@ 75 | avr-objcopy -j .text -j .data -O ihex $< $@ 76 | avr-size $@ 77 | 78 | disasm: $(PROJECT).elf 79 | avr-objdump -d $< > $(PROJECT).lst 80 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/DeluxeUSBmux2/firmware/usbdrv/oddebug.h: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.h 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #ifndef __oddebug_h_included__ 12 | #define __oddebug_h_included__ 13 | 14 | /* 15 | General Description: 16 | This module implements a function for debug logs on the serial line of the 17 | AVR microcontroller. Debugging can be configured with the define 18 | 'DEBUG_LEVEL'. If this macro is not defined or defined to 0, all debugging 19 | calls are no-ops. If it is 1, DBG1 logs will appear, but not DBG2. If it is 20 | 2, DBG1 and DBG2 logs will be printed. 21 | 22 | A debug log consists of a label ('prefix') to indicate which debug log created 23 | the output and a memory block to dump in hex ('data' and 'len'). 24 | */ 25 | 26 | 27 | #ifndef F_CPU 28 | # define F_CPU 12000000 /* 12 MHz */ 29 | #endif 30 | 31 | /* make sure we have the UART defines: */ 32 | #include "usbportability.h" 33 | 34 | #ifndef uchar 35 | # define uchar unsigned char 36 | #endif 37 | 38 | #if DEBUG_LEVEL > 0 && !(defined TXEN || defined TXEN0) /* no UART in device */ 39 | # warning "Debugging disabled because device has no UART" 40 | # undef DEBUG_LEVEL 41 | #endif 42 | 43 | #ifndef DEBUG_LEVEL 44 | # define DEBUG_LEVEL 0 45 | #endif 46 | 47 | /* ------------------------------------------------------------------------- */ 48 | 49 | #if DEBUG_LEVEL > 0 50 | # define DBG1(prefix, data, len) odDebug(prefix, data, len) 51 | #else 52 | # define DBG1(prefix, data, len) 53 | #endif 54 | 55 | #if DEBUG_LEVEL > 1 56 | # define DBG2(prefix, data, len) odDebug(prefix, data, len) 57 | #else 58 | # define DBG2(prefix, data, len) 59 | #endif 60 | 61 | /* ------------------------------------------------------------------------- */ 62 | 63 | #if DEBUG_LEVEL > 0 64 | extern void odDebug(uchar prefix, uchar *data, uchar len); 65 | 66 | /* Try to find our control registers; ATMEL likes to rename these */ 67 | 68 | #if defined UBRR 69 | # define ODDBG_UBRR UBRR 70 | #elif defined UBRRL 71 | # define ODDBG_UBRR UBRRL 72 | #elif defined UBRR0 73 | # define ODDBG_UBRR UBRR0 74 | #elif defined UBRR0L 75 | # define ODDBG_UBRR UBRR0L 76 | #endif 77 | 78 | #if defined UCR 79 | # define ODDBG_UCR UCR 80 | #elif defined UCSRB 81 | # define ODDBG_UCR UCSRB 82 | #elif defined UCSR0B 83 | # define ODDBG_UCR UCSR0B 84 | #endif 85 | 86 | #if defined TXEN 87 | # define ODDBG_TXEN TXEN 88 | #else 89 | # define ODDBG_TXEN TXEN0 90 | #endif 91 | 92 | #if defined USR 93 | # define ODDBG_USR USR 94 | #elif defined UCSRA 95 | # define ODDBG_USR UCSRA 96 | #elif defined UCSR0A 97 | # define ODDBG_USR UCSR0A 98 | #endif 99 | 100 | #if defined UDRE 101 | # define ODDBG_UDRE UDRE 102 | #else 103 | # define ODDBG_UDRE UDRE0 104 | #endif 105 | 106 | #if defined UDR 107 | # define ODDBG_UDR UDR 108 | #elif defined UDR0 109 | # define ODDBG_UDR UDR0 110 | #endif 111 | 112 | static inline void odDebugInit(void) 113 | { 114 | ODDBG_UCR |= (1< 2 | #pragma code_page(1252) 3 | 4 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 5 | 6 | 100 DIALOG DISCARDABLE 0, 0, 216, 89 7 | STYLE DS_MODALFRAME|DS_NOIDLEMSG|DS_NOFAILCREATE|WS_POPUP|WS_CAPTION|WS_SYSMENU|DS_CENTER 8 | CAPTION "Configuration of DeluxeUSB plugin" 9 | FONT 8, "MS Sans Serif" 10 | { 11 | CTEXT "This plugin is for controlling up to 32 lights via USB device containing ATtiny25 and up to four 74HC595.\nFreeware, open-source, Henrik Haftmann, Chemnitz, 100407",-1,4,3,208,31,SS_NOPREFIX 12 | DEFPUSHBUTTON "OK",IDOK,84,36,50,14 13 | CONTROL "Handle to DeluxeUSB device available",11,"Button",BS_AUTORADIOBUTTON|WS_DISABLED,32,58,148,10 14 | PUSHBUTTON "re-open DeluxeUSB device",10,60,70,96,14 15 | } 16 | 17 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 18 | 19 | 1 VERSIONINFO 20 | FILEVERSION 1,0,2010,407 21 | PRODUCTVERSION 1,0,2010,407 22 | FILEFLAGSMASK 0x3fL 23 | #ifdef _DEBUG 24 | FILEFLAGS 0x1L 25 | #else 26 | FILEFLAGS 0x0L 27 | #endif 28 | FILEOS 0x40004L 29 | FILETYPE 0x2L 30 | FILESUBTYPE 0x0L 31 | { 32 | BLOCK "StringFileInfo" 33 | { 34 | BLOCK "040904b0" 35 | { 36 | VALUE "CompanyName", "haftmann#software\0" 37 | VALUE "FileDescription", "Discolitez Plugin for DeluxeUSB device\0" 38 | VALUE "FileVersion", "1.0 (4/10)\0" 39 | VALUE "InternalName", "DLO_DeluxeUSB\0" 40 | VALUE "OriginalFilename", "DLO_DeluxeUSB.dll\0" 41 | VALUE "ProductName", "www.tu-chemnitz.de/~heha\0" 42 | VALUE "ProductVersion", "1.0 (4/10)\0" 43 | } 44 | } 45 | BLOCK "VarFileInfo" 46 | { 47 | VALUE "Translation", 0x409, 1200 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_DeluxeUSB/readme.txt: -------------------------------------------------------------------------------- 1 | DiscoLitez plugin, for controlling 32 LEDs or lamps via DeluxeUSB 2 | or DeluxeUSBmux circuitry or compatible HID-USB devices. 3 | See schematics and firmware in this .ZIP archive. 4 | 5 | This plugin overcomes the absence of parallel ports, 6 | especially on laptops. 7 | 8 | All schematics and associated firmware (while very different 9 | in construction) present the same USB-HID interface, 10 | so the plugin needed is always the same. 11 | 12 | Install this plugin by copying the file DLO_DeluxeUSB.dll 13 | to the \Plugins\DiscoLitez\DLOPs\ folder. 14 | No other files are necessary. 15 | If you do not find this folder, you probably should 16 | install DiscoLitez first. 17 | 18 | This plugin generally uses the first DeluxeUSB device found. 19 | 20 | If you rename or copy the DLL to "DLO_DeluxeUSB 1.dll", 21 | you can access a second DeluxeUSB device, and so forth. 22 | Please note the size of the .DLL! Why bloating it? 23 | (Hint to Delphi users: Don't use sysutils and VCL!) 24 | 25 | This software is open-source freeware (public domain). 26 | You can do with it what you want, 27 | even including it into closed-source commercial programs. 28 | 29 | Henrik Haftmann, Chemnitz, 2010/5/25 30 | 31 | Change log: 32 | +100407 First (preferred) schematic with ATtiny25 and four 74HC595, 32 single LEDs 33 | +100408 First working sample 34 | +100413 Second schematic with ATmega8, 48 or 88 35 | *100419 Some updates (for beauty) on first schematic 36 | *100424 Updated source file comments 37 | +100523 Third schematic with ATtiny2313 and dot-matrix (7x5) LED display 38 | -100613 DeluxeUSBmux2 schematic fixed 39 | 40 | Todo: 41 | Firmware for DeluxeUSBmux 42 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/DLO_Parallel 0x378.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_Parallel/DLO_Parallel 0x378.dll -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/DLO_Parallel.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_Parallel/DLO_Parallel.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/inpout32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_Parallel/inpout32.dll -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/readme.txt: -------------------------------------------------------------------------------- 1 | Another DiscoLitez plugin, replacing huge DLO_NTParallelXxx.dll plugins. 2 | 3 | Install this plugin by copying the file DLO_Parallel 0x378.dll 4 | to the \Plugins\DiscoLitez\DLOPs\ folder. 5 | No other files are necessary. 6 | If you do not find this folder, you probably should 7 | install DiscoLitez first. 8 | 9 | The port address that is used is part of the DLL file name. 10 | To change the port address, simply rename the DLL accordingly. 11 | No recompilation is necessary. 12 | 13 | A user can change the port address in configuration dialog, 14 | this will rename the DLL too. 15 | 16 | This DLL requires inpout32.dll beside or in PATH. 17 | Note that this inpout32.dll is much smaller but has the same function 18 | as the original one that floats (or bloats) in the Internet. 19 | You can find its (slightly modified) source at 20 | http://www-user.tu-chemnitz.de/~heha/hs_freeware/inpout32_source_and_bins_changed.zip 21 | 22 | Change log: 23 | -080820 Wrong output fixed, sections .text and .rdata combined 24 | *091112 This new (and unfortunately larger) inpout32.dll runs on X64 platforms too; 25 | it contains two signed kernel-mode drivers and loads the appropriate 26 | Note that you don't need inpout64.dll for this plugin because this plugin 27 | is fixed to be 32 bit, because DiscoLitez is 32 bit, because WinAmp is 32 bit. 28 | IF (and only if) DiscoLitez comes out as 64 bit, please contact me for 29 | compiling 64 bit output plugins. 30 | 31 | Henrik Haftmann, 090424 32 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/src/DLO_Parallel.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="DLO_Parallel" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | 4 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 5 | 6 | CFG=DLO_Parallel - Win32 Debug 7 | !MESSAGE "DLO_Parallel - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") 8 | !MESSAGE "DLO_Parallel - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") 9 | 10 | # Begin Project 11 | # PROP AllowPerConfigDependencies 0 12 | # PROP Scc_ProjName "" 13 | # PROP Scc_LocalPath "" 14 | CPP=cl.exe 15 | MTL=midl.exe 16 | RSC=rc.exe 17 | 18 | !IF "$(CFG)" == "DLO_Parallel - Win32 Release" 19 | 20 | # PROP Use_MFC 0 21 | # PROP Use_Debug_Libraries 0 22 | # PROP Output_Dir "Release" 23 | # PROP Intermediate_Dir "Release" 24 | # PROP Ignore_Export_Lib 1 25 | # PROP Target_Dir "" 26 | # ADD CPP /nologo /Gr /MT /W3 /O1 /I "c:\Programme\msvc\Platform SDK XP SP2\Include" /I "c:\Programme\msvc\ddk\inc\ddk\wdm\wxp" /D "WIN32" /FD /GF /c 27 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 28 | # ADD RSC /l 0x409 29 | BSC32=bscmake.exe 30 | # ADD BSC32 /nologo 31 | LINK32=link.exe 32 | # ADD LINK32 kernel32.lib user32.lib winmm.lib shlwapi.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib /libpath:"c:\Programme\msvc\Platform SDK XP SP2\Lib" /opt:nowin98 /release /largeaddressaware /merge:.rdata=.text 33 | 34 | !ELSEIF "$(CFG)" == "DLO_Parallel - Win32 Debug" 35 | 36 | # PROP Use_MFC 0 37 | # PROP Use_Debug_Libraries 1 38 | # PROP Output_Dir "c:\Programme\Winamp5\Plugins\DiscoLitez\DLOPs" 39 | # PROP Intermediate_Dir "Debug" 40 | # PROP Ignore_Export_Lib 1 41 | # PROP Target_Dir "" 42 | # ADD CPP /nologo /Gr /MTd /W3 /Gm /ZI /Od /I "c:\Programme\msvc\Platform SDK XP SP2\Include" /I "c:\Programme\msvc\ddk\inc\ddk\wdm\wxp" /D "WIN32" /D "_DEBUG" /FR /FD /GF /c 43 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 44 | # ADD RSC /l 0x409 /d "_DEBUG" 45 | BSC32=bscmake.exe 46 | # ADD BSC32 /nologo 47 | LINK32=link.exe 48 | # ADD LINK32 kernel32.lib user32.lib winmm.lib shlwapi.lib /nologo /dll /debug /machine:I386 /nodefaultlib /out:"c:\Programme\Winamp5\Plugins\DiscoLitez\DLOPs/DLO_Parallel 0x378.dll" /pdbtype:sept /libpath:"c:\Programme\msvc\Platform SDK XP SP2\Lib" /opt:nowin98 49 | # SUBTRACT LINK32 /pdb:none 50 | 51 | !ENDIF 52 | 53 | # Begin Target 54 | 55 | # Name "DLO_Parallel - Win32 Release" 56 | # Name "DLO_Parallel - Win32 Debug" 57 | # Begin Group "Quellcodedateien" 58 | 59 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 60 | # Begin Source File 61 | 62 | SOURCE=.\DLO_Parallel.c 63 | # End Source File 64 | # End Group 65 | # Begin Group "Header-Dateien" 66 | 67 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 68 | # End Group 69 | # Begin Group "Ressourcendateien" 70 | 71 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 72 | # Begin Source File 73 | 74 | SOURCE=.\DLO_Parallel.rc 75 | # End Source File 76 | # End Group 77 | # End Target 78 | # End Project 79 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_Parallel/src/DLO_Parallel.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma code_page(1252) 3 | 4 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 5 | 6 | 100 DIALOG DISCARDABLE 0, 0, 216, 89 7 | STYLE DS_MODALFRAME|DS_NOIDLEMSG|DS_NOFAILCREATE|WS_POPUP|WS_CAPTION|WS_SYSMENU|DS_CENTER 8 | CAPTION "Configuration of parallel port plugin" 9 | FONT 8, "MS Sans Serif" 10 | { 11 | CTEXT "This plugin is for controlling eight digital light channels via an old-style parallel port.\nFreeware, open-source, Henrik Haftmann, Chemnitz, 080817",-1,4,3,208,31,SS_NOPREFIX 12 | LTEXT "Port address (hex):",-1,22,38,68,10 13 | COMBOBOX 10,90,36,86,96,CBS_DROPDOWN|CBS_AUTOHSCROLL|WS_TABSTOP|WS_GROUP 14 | DEFPUSHBUTTON "OK",IDOK,84,68,50,14,WS_GROUP 15 | PUSHBUTTON "Cancel",IDCANCEL,150,68,50,14 16 | } 17 | 18 | STRINGTABLE 19 | { 20 | 1 "Wrong hexadecimal number" 21 | } 22 | 23 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 24 | 25 | 1 VERSIONINFO 26 | FILEVERSION 1,0,2008,817 27 | PRODUCTVERSION 1,0,2008,817 28 | FILEFLAGSMASK 0x3fL 29 | #ifdef _DEBUG 30 | FILEFLAGS 0x1L 31 | #else 32 | FILEFLAGS 0x0L 33 | #endif 34 | FILEOS 0x40004L 35 | FILETYPE 0x2L 36 | FILESUBTYPE 0x0L 37 | { 38 | BLOCK "StringFileInfo" 39 | { 40 | BLOCK "040904b0" 41 | { 42 | VALUE "CompanyName", "haftmann#software\0" 43 | VALUE "FileDescription", "Discolitez Plugin for a Parallel port converter\0" 44 | VALUE "FileVersion", "1.0 (08/08)\0" 45 | VALUE "InternalName", "DLO_Parallel\0" 46 | VALUE "OriginalFilename", "DLO_Parallel.dll\0" 47 | VALUE "ProductName", "www.tu-chemnitz.de/~heha\0" 48 | VALUE "ProductVersion", "1.0 (08/08)\0" 49 | } 50 | } 51 | BLOCK "VarFileInfo" 52 | { 53 | VALUE "Translation", 0x409, 1200 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.dll -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.png -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrn.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrnCen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/DLO_UsbPrnCen.png -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/readme.txt: -------------------------------------------------------------------------------- 1 | DiscoLitez plugin, for controlling eight channels via 2 | a regular USB->Printer adapter 3 | 4 | This plugin overcomes the absence of parallel ports, 5 | especially on laptops. 6 | 7 | Requires following connections, besides such an adapter: 8 | - Connection of /STB (1) and /ACK (10) for handshake 9 | - Connection of BSY (11) with GND (22) 10 | - Maybe a connection of PE (12) with GND (23) 11 | - Maybe a connection of /ERR (15) with /INI (16) supplying HIGH level 12 | - Catching data with a 8-channel flip-flop (e.g. 74HC574), 13 | CLOCK = STB (1), Ucc = /INI (16), GND = /OE = GND (21) 14 | Some light controllers may have these connections built-in, 15 | for emulating a regular printer. 16 | 17 | See schematics. 18 | 19 | Install this plugin by copying the file DLO_UsbPrn.dll 20 | to the \Plugins\DiscoLitez\DLOPs\ folder. 21 | No other files are necessary. 22 | If you do not find this folder, you probably should 23 | install DiscoLitez first. 24 | 25 | This plugin uses the first USB->Printer adapter found by default. 26 | Copy this DLL to "DLO_UsbPrn#1.dll" etc. to get a driver 27 | for the second, third etc. USB->Printer adapter. 28 | 29 | Please note the size of the .DLL! Why bloating it? 30 | 31 | This software is open-source freeware (public domain). 32 | You can do with it what you want, 33 | even including it into closed-source commercial programs. 34 | 35 | Henrik Haftmann, Chemnitz, 2009/2/12 36 | 37 | Change log: 38 | *080817 Added /GF compiler switch reduces DLL size by 512 bytes 39 | -080820 Wrong output lights, timer procedure 40 | +110403 User-selectable number or USB->Printer adapter 41 | -110404 Asynchronous operation for reliability when adapter is unplugged 42 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="DLO_UsbPrn" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | 4 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 5 | 6 | CFG=DLO_UsbPrn - Win32 Debug 7 | !MESSAGE "DLO_UsbPrn - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") 8 | !MESSAGE "DLO_UsbPrn - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") 9 | 10 | # Begin Project 11 | # PROP AllowPerConfigDependencies 0 12 | # PROP Scc_ProjName "" 13 | # PROP Scc_LocalPath "" 14 | CPP=cl.exe 15 | MTL=midl.exe 16 | RSC=rc.exe 17 | 18 | !IF "$(CFG)" == "DLO_UsbPrn - Win32 Release" 19 | 20 | # PROP Use_MFC 0 21 | # PROP Use_Debug_Libraries 0 22 | # PROP Output_Dir "Release" 23 | # PROP Intermediate_Dir "Release" 24 | # PROP Ignore_Export_Lib 1 25 | # PROP Target_Dir "" 26 | # ADD CPP /nologo /Gr /MT /W3 /O1 /I "c:\Programme\msvc\Platform SDK XP SP2\Include" /I "c:\Programme\msvc\ddk\inc\ddk\wdm\wxp" /D "WIN32" /FD /GF /c 27 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 28 | # ADD RSC /l 0x409 29 | BSC32=bscmake.exe 30 | # ADD BSC32 /nologo 31 | LINK32=link.exe 32 | # ADD LINK32 kernel32.lib user32.lib shlwapi.lib setupapi.lib winmm.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib /libpath:"c:\Programme\msvc\Platform SDK XP SP2\Lib" /opt:nowin98 /release /largeaddressaware /merge:.rdata=.text 33 | 34 | !ELSEIF "$(CFG)" == "DLO_UsbPrn - Win32 Debug" 35 | 36 | # PROP Use_MFC 0 37 | # PROP Use_Debug_Libraries 1 38 | # PROP Output_Dir "Debug" 39 | # PROP Intermediate_Dir "Debug" 40 | # PROP Ignore_Export_Lib 1 41 | # PROP Target_Dir "" 42 | # ADD CPP /nologo /Gr /MTd /W3 /Gm /ZI /Od /I "c:\Programme\msvc\Platform SDK XP SP2\Include" /I "c:\Programme\msvc\ddk\inc\ddk\wdm\wxp" /D "WIN32" /D "_DEBUG" /FR /FD /GF /c 43 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 44 | # ADD RSC /l 0x409 /d "_DEBUG" 45 | BSC32=bscmake.exe 46 | # ADD BSC32 /nologo 47 | LINK32=link.exe 48 | # ADD LINK32 kernel32.lib user32.lib shlwapi.lib setupapi.lib winmm.lib /nologo /dll /debug /machine:I386 /nodefaultlib /out:"c:\Programme\Winamp5\Plugins\DiscoLitez\DLOPs/DLO_UsbPrn.dll" /pdbtype:sept /libpath:"c:\Programme\msvc\Platform SDK XP SP2\Lib" /opt:nowin98 49 | # SUBTRACT LINK32 /pdb:none 50 | 51 | !ENDIF 52 | 53 | # Begin Target 54 | 55 | # Name "DLO_UsbPrn - Win32 Release" 56 | # Name "DLO_UsbPrn - Win32 Debug" 57 | # Begin Group "Quellcodedateien" 58 | 59 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 60 | # Begin Source File 61 | 62 | SOURCE=.\DLO_UsbPrn.c 63 | # End Source File 64 | # End Group 65 | # Begin Group "Header-Dateien" 66 | 67 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 68 | # End Group 69 | # Begin Group "Ressourcendateien" 70 | 71 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 72 | # Begin Source File 73 | 74 | SOURCE=.\DLO_UsbPrn.rc 75 | # End Source File 76 | # End Group 77 | # End Target 78 | # End Project 79 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.rc: -------------------------------------------------------------------------------- 1 | #include "windows.h" 2 | 3 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | 6 | 1 VERSIONINFO 7 | FILEVERSION 1,1,2011,403 8 | PRODUCTVERSION 1,1,2011,403 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS 0x1L 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS 0x40004L 16 | FILETYPE 0x2L 17 | FILESUBTYPE 0x0L 18 | { 19 | BLOCK "StringFileInfo" 20 | { 21 | BLOCK "040904b0" 22 | { 23 | VALUE "CompanyName", "haftmann#software\0" 24 | VALUE "FileDescription", "Discolitez Plugin for a USB->Printer converter\0" 25 | VALUE "FileVersion", "1.01 (04/11)\0" 26 | VALUE "InternalName", "DLO_UsbPrn\0" 27 | VALUE "OriginalFilename", "DLO_UsbPrn.dll\0" 28 | VALUE "ProductName", "www.tu-chemnitz.de/~heha\0" 29 | VALUE "ProductVersion", "1.01 (04/11)\0" 30 | } 31 | } 32 | BLOCK "VarFileInfo" 33 | { 34 | VALUE "Translation", 0x409, 1200 35 | } 36 | } 37 | 38 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 39 | #pragma code_page(1252) 40 | 41 | 100 DIALOG DISCARDABLE 0, 0, 216, 89 42 | STYLE DS_MODALFRAME|DS_NOIDLEMSG|DS_NOFAILCREATE|DS_CENTER|WS_POPUP|WS_CAPTION|WS_SYSMENU 43 | CAPTION "Configuration of USB->Printer plugin" 44 | FONT 8, "MS Sans Serif" 45 | { 46 | CTEXT "This plugin is for controlling eight digital light channels via a regular and cheap USB->Printer converter using simple glue logic.\nFreeware, open-source, Henrik Haftmann, Chemnitz, 110403",-1,4,3,208,31,SS_NOPREFIX 47 | DEFPUSHBUTTON "OK",IDOK,84,36,50,14 48 | CONTROL "Handle to USB->Printer currently available",11,"Button",BS_AUTORADIOBUTTON|WS_DISABLED,32,58,148,10 49 | RTEXT "&Number (0-based):",-1,8,73,66,8 50 | EDITTEXT 12,78,70,24,14,ES_CENTER|ES_AUTOHSCROLL|ES_NUMBER 51 | PUSHBUTTON "&re-open USB->Printer device",10,110,70,96,14 52 | } 53 | 54 | -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.sch -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.wmf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrn.wmf -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrnCen.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrnCen.sch -------------------------------------------------------------------------------- /doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrnCen.wmf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/DLO_UsbPrn/src/DLO_UsbPrnCen.wmf -------------------------------------------------------------------------------- /doc/USB_Parallel/HIDKeys.2012-12-08.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/HIDKeys.2012-12-08.tar.gz -------------------------------------------------------------------------------- /doc/USB_Parallel/Has anyone tried to connect a usb parallel port_ - Hacking WD MyBook World Ed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/Has anyone tried to connect a usb parallel port_ - Hacking WD MyBook World Ed.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/PL2303_Prolific_DriverInstaller_v1210/PL2303_Prolific_DriverInstaller_v1210.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/PL2303_Prolific_DriverInstaller_v1210/PL2303_Prolific_DriverInstaller_v1210.exe -------------------------------------------------------------------------------- /doc/USB_Parallel/PL2303_Prolific_DriverInstaller_v1210/PL2303_Prolific_DriverInstaller_v1210.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/PL2303_Prolific_DriverInstaller_v1210/PL2303_Prolific_DriverInstaller_v1210.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/PL2303_Prolific_DriverInstaller_v1210/releasenote.txt: -------------------------------------------------------------------------------- 1 | PL-2303 Driver Setup Installer, Prolific Edition 2 | Setup Installer Revision Note History 3 | ================================================= 4 | 5 | System Requirement: 6 | . Supports the following Windows OSes: 7 | - Windows 98SE 8 | - Windows ME 9 | - Windows 2000 SP4 10 | - Windows XP SP2 and above (32 & 64 bit) 11 | - Windows Server 2003 (32 & 64 bit) 12 | - Windows Server 2008 / 2008 R2 (32 & 64 bit) 13 | - Windows Vista (32 & 64 bit) 14 | - Windows 7 (32 & 64 bit) 15 | NOTE: For Windows 7, please use RC build 7100 or above. 16 | . USB host controller 17 | . Device using PL-2303H/HX/X version chip 18 | 19 | 20 | Supported device ID and product strings: 21 | . VID_067B&PID_2303 for "Prolific USB-to-Serial Comm Port" 22 | 23 | 24 | Driver Versions: 25 | ------------------- 26 | - Windows 98/ME Driver: v2.0.0.19 27 | - Windows 2000/XP/Server2003 (32 & 64-bit) WDM WHQL Driver: v2.0.13.130 28 | - Windows Vista/7/Server2008 (32 & 64-bit) WDF WHQL Driver: v3.3.11.152 29 | 30 | 31 | Release Notes: 32 | --------------- 33 | PL2303 Driver Installer v1.2.10 34 | Changes from Installer v1.1.0: 35 | Driver Changes - 36 | - Windows Vista/7/Server2008 (32 & 64-bit) WDF WHQL Driver: v3.3.11.152 37 | - Fixed BSOD issue when unplug device while data transfer 38 | 39 | Installer Changes - 40 | - Add "Modify/Repair/Remove" Menu when doing uninstall/update. 41 | 42 | Installer & Build date: 1.2.10 (2010-4-08) 43 | 44 | Language Support: 45 | - English (default) 46 | - Chinese (Traditional) 47 | - Chinese (Simplified) 48 | - Japanese 49 | 50 | 51 | ======================================== 52 | Prolific Technology Inc. 53 | http://www.prolific.com.tw 54 | -------------------------------------------------------------------------------- /doc/USB_Parallel/PL2305I_ECN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/PL2305I_ECN.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/USB2CV_1.5.4.1_Installer_-_x64_Release.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/USB2CV_1.5.4.1_Installer_-_x64_Release.exe -------------------------------------------------------------------------------- /doc/USB_Parallel/USB3CV_2.1.7.1_Installer_-_x64_Release.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/USB3CV_2.1.7.1_Installer_-_x64_Release.exe -------------------------------------------------------------------------------- /doc/USB_Parallel/Using Linux USB.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/Using Linux USB.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/ds_pl2305I_v1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/ds_pl2305I_v1.0.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/Makefile: -------------------------------------------------------------------------------- 1 | PROG = hid_listen 2 | 3 | OS = LINUX 4 | #OS = DARWIN 5 | #OS = WINDOWS 6 | 7 | 8 | ifeq ($(OS), LINUX) 9 | TARGET = $(PROG) 10 | CC = gcc 11 | STRIP = strip 12 | CFLAGS = -O2 -Wall -D$(OS) 13 | LIBS = 14 | else ifeq ($(OS), DARWIN) 15 | TARGET = $(PROG) 16 | CC = gcc 17 | STRIP = strip 18 | SDK = /Developer/SDKs/MacOSX10.5.sdk 19 | CFLAGS = -O2 -Wall -isysroot $(SDK) -D$(OS) -arch ppc -arch i386 20 | LIBS = -Xlinker -syslibroot -Xlinker $(SDK) -framework IOKit -framework CoreFoundation 21 | else ifeq ($(OS), WINDOWS) 22 | TARGET = $(PROG).exe 23 | CC = i586-mingw32msvc-gcc 24 | STRIP = i586-mingw32msvc-strip 25 | WINDRES = i586-mingw32msvc-windres 26 | CFLAGS = -O2 -Wall -D$(OS) 27 | LIBS = -lhid -lsetupapi 28 | KEY_SPC = ~/bin/cert/mykey.spc 29 | KEY_PVK = ~/bin/cert/mykey.pvk 30 | KEY_TS = http://timestamp.comodoca.com/authenticode 31 | endif 32 | 33 | 34 | MAKEFLAGS = --jobs=2 35 | OBJS = hid_listen.o rawhid.o 36 | 37 | all: $(TARGET) 38 | 39 | $(PROG): $(OBJS) 40 | gcc -o $(PROG) $(OBJS) $(LIBS) 41 | $(STRIP) $(PROG) 42 | 43 | $(PROG).app: $(PROG) Info.plist 44 | mkdir -p $(PROG).app/Contents/MacOS 45 | mkdir -p $(PROG).app/Contents/Resources/English.lproj 46 | cp Info.plist $(PROG).app/Contents/ 47 | echo -n 'APPL????' > $(PROG).app/Contents/PkgInfo 48 | cp $(PROG) $(PROG).app/Contents/MacOS/$(PROG) 49 | cp icons/$(PROG).icns $(PROG).app/Contents/Resources/$(PROG).icns 50 | touch $(PROG).app 51 | 52 | $(PROG).dmg: $(PROG).app 53 | hdiutil create -ov -srcfolder $(PROG).app $(PROG).dmg 54 | 55 | $(PROG).exe: $(OBJS) 56 | $(CC) $(OBJS) -o $(PROG).exe $(LIBS) 57 | $(STRIP) $(PROG).exe 58 | -signcode -spc $(KEY_SPC) -v $(KEY_PVK) -t $(KEY_TS) $(PROG).exe 59 | 60 | resource.o: resource.rs icons/$(PROG).ico 61 | $(WINDRES) -o resource.o resource.rs 62 | 63 | 64 | 65 | clean: 66 | rm -f *.o $(PROG) $(PROG).exe $(PROG).exe.bak $(PROG).dmg 67 | rm -rf $(PROG).app 68 | 69 | -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/blinky-teensy1++.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/blinky-teensy1++.elf -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/blinky-teensy1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/blinky-teensy1.elf -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/blinky-teensy2++.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/blinky-teensy2++.elf -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/blinky-teensy2.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/blinky-teensy2.elf -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/hid_listen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/hid_listen -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/hid_listen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/hid_listen.exe -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/binaries/hid_listen.mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/binaries/hid_listen.mac -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/hid_listen.c: -------------------------------------------------------------------------------- 1 | /* HID Listen, http://www.pjrc.com/teensy/hid_listen.html 2 | * Listens (and prints) all communication received from a USB HID device, 3 | * which is useful for view debug messages from the Teensy USB Board. 4 | * Copyright 2008, PJRC.COM, LLC 5 | * 6 | * You may redistribute this program and/or modify it under the terms 7 | * of the GNU General Public License as published by the Free Software 8 | * Foundation, either version 3 of the License, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see http://www.gnu.org/licenses/ 18 | */ 19 | 20 | 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | #include "rawhid.h" 27 | 28 | 29 | static void delay_ms(unsigned int msec); 30 | 31 | 32 | int main(void) 33 | { 34 | char buf[64], *in, *out; 35 | rawhid_t *hid; 36 | int num, count; 37 | 38 | printf("Waiting for device:"); 39 | fflush(stdout); 40 | while (1) { 41 | hid = rawhid_open_only1(0, 0, 0xFF31, 0x0074); 42 | if (hid == NULL) { 43 | printf("."); 44 | fflush(stdout); 45 | delay_ms(1000); 46 | continue; 47 | } 48 | printf("\nListening:\n"); 49 | while (1) { 50 | num = rawhid_read(hid, buf, sizeof(buf), 200); 51 | if (num < 0) break; 52 | if (num == 0) continue; 53 | in = out = buf; 54 | for (count=0; count 80 | static void delay_ms(unsigned int msec) 81 | { 82 | Sleep(msec); 83 | } 84 | #else 85 | #include 86 | static void delay_ms(unsigned int msec) 87 | { 88 | usleep(msec * 1000); 89 | } 90 | #endif 91 | -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/hid_listen_1.01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/hid_listen/hid_listen_1.01.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/hid_listen/rawhid.h: -------------------------------------------------------------------------------- 1 | #ifndef rawhid_included_h__ 2 | #define rawhid_included_h__ 3 | 4 | // Raw HID, Basic API 5 | typedef void rawhid_t; 6 | rawhid_t * rawhid_open_only1(int vid, int pid, int usage_page, int usage); 7 | int rawhid_status(rawhid_t *hid); 8 | int rawhid_read(rawhid_t *h, void *buf, int bufsize, int timeout_ms); 9 | int rawhid_write(rawhid_t *hid, const void *buf, int len, int timeout_ms); 10 | void rawhid_close(rawhid_t *h); 11 | 12 | 13 | // Raw HID, Multiple Device API 14 | typedef void rawhid_list_t; 15 | rawhid_list_t * rawhid_list_open(int vid, int pid, int usage_page, int usage); 16 | int rawhid_list_count(rawhid_list_t *list); 17 | void rawhid_list_close(rawhid_list_t *list); 18 | int rawhid_list_indexof(rawhid_list_t *list, rawhid_t *hid); 19 | void rawhid_list_remove(rawhid_list_t *list, rawhid_t *hid); 20 | rawhid_t * rawhid_open(rawhid_list_t *list, int index); 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/.cvsignore: -------------------------------------------------------------------------------- 1 | kparapin.o 2 | libparapin.a 3 | parapindriver.o 4 | parapin.o -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/INSTALL: -------------------------------------------------------------------------------- 1 | 2 | Build and Install instructions for the parapin system 3 | 4 | Version 1.0 5 | 6 | Al Hooton (ahooton@users.sourceforge.net) 7 | 8 | 9 | 10 | ------------------------------------------------------------------ 11 | 12 | NOTE: Support for 2.4.x kernels in parapin is now deprecated, 13 | and will be removed in the next production release after 1.5. If you 14 | build for a 2.4.x kernel you will receive a deprecation warning, but 15 | the build should still succeed. If for some reason you can not 16 | upgrade to 2.6 kernels, please plan to use an archived version of 17 | parapin in the future. 18 | 19 | ------------------------------------------------------------------ 20 | 21 | 22 | Building and installing parapin is fairly simple, but there 23 | are a few things you must do prior to typing "make". These steps are 24 | necessary to deal with differences in parapin to support running on 25 | both 2.4 kernels and 2.6 kernels. 26 | 27 | The parapin system can be built for kernel trees other than 28 | the one that is currently booted on your machine. However, this 29 | *requires* editing the main Makefile as described below. 30 | 31 | Note that you do *not* have be root to build parapin, but you 32 | will most likely need to be root in order to install the libraries and 33 | modules in their standard system locations. 34 | 35 | Version-specific setup scripts 36 | ------------------------------ 37 | The instructions below are slightly different if you are 38 | running 2.4 kernels or 2.6 kernels: 39 | 40 | 2.6 kernels: run "setup-2.6.sh" 41 | # ./setup-2.6.sh 42 | 43 | 2.4 kernels: run "setup-2.4.sh" 44 | # ./setup-2.4.sh 45 | 46 | The "setup-*" scripts copy "Makefile-" to 47 | "Makefile". If you run a setup script a second time, it will ask 48 | before trying overwrite "Makefile". There should not be any reason to 49 | run one of these scripts a second time, but if you find a need to do 50 | so be careful -- any edits you have made to Makefile so parapin will 51 | build on your system will be lost. 52 | 53 | 54 | Common build/install instructions 55 | --------------------------------- 56 | - Edit Makefile to change the LINUX_SRC and LINUX_MODULES values, if 57 | necessary. If you are building for the kernel you are running, on a 58 | distribution that puts the kernel sources and libs in the normal 59 | places (/usr/src and /lib), the default values should work for you. 60 | That should cover most situations, however if you are building 61 | parapin for a kernel tree in a different location, set these values 62 | appropriately. 63 | 64 | - If you only need to use the userspace library, you can build it now, 65 | and optionally install it (the install requires you to be root): 66 | # make 67 | # su 68 | # make install 69 | 70 | - If you want to use the kparapin kernel module, and optionally the 71 | parapindriver device-driver wrapper, you can build and install 72 | everything at one time: 73 | # make all 74 | # su 75 | # make allinstall 76 | 77 | - If you want to build (and optionally) install a language binding 78 | you can use the -build and -install 79 | Makefile targets. Note that you will need all the appropriate 80 | development environment packages required for the language in 81 | question already installed prior to doing the build. There are 82 | currently bindings for python and java, here is an example for 83 | the python binding: 84 | # make parapin_py-build 85 | # su 86 | # make parapin_py-install 87 | 88 | - Note that several example programs are built in the "examples" 89 | subdirectory. 90 | 91 | 92 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/Kbuild: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin top-level Kbuild file, to drive subdir kbuild processing for modules 26 | # 27 | # Currently maintained by Al Hooton (al@hootons.org) 28 | # 29 | # $Id $ 30 | # 31 | 32 | # This top-level kbuild makefile allows kbuild to start in the main 33 | # directory, instead of us launching it at the subdirs directly. By 34 | # doing this, kbuild knows about external symbols from all our modules and 35 | # can determine that parapindriver is dependent on symbols from kparapin, 36 | # thereby avoiding warnings at build time about undefined symbols. 37 | 38 | obj-y := kparapin/ parapindriver/ 39 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin Makefile-2.6 -- build parapin for 2.6 kernels 26 | # 27 | # original author Jeremy Elson, First released 30 March 2000 28 | # 29 | # Currently maintained by Al Hooton (al@hootons.org) 30 | # 31 | # $Id: Makefile-2.6,v 1.9 2007/06/23 22:58:27 ahooton Exp $ 32 | # 33 | 34 | # Set this to be the location of your Linux kernel header files (and 35 | # modules, if you're using the kernel modules). If you are building 36 | # for the kernel you are running, the lines below with "uname" in the 37 | # paths will usually work. If you're installing the libs or kernel modules, 38 | # you will have to run make as root. If you are building for a 39 | # different kernel than you are running, you will need to edit these 40 | # paths to explicitly point to the target kernel source and lib trees. 41 | # You may also need to edit these if you're running an SMP 42 | # kernel on some distros. 43 | LINUX_SRC = /usr/src/linux-`uname -r`/ 44 | LINUX_MODULES := /lib/modules/`uname -r`/kernel/ 45 | 46 | LIBPARAPIN_OBJS := parapin.o 47 | 48 | EXAMPLE_DIR := examples 49 | EXAMPLE_PROGRAMS := \ 50 | $(EXAMPLE_DIR)/inputtest\ 51 | $(EXAMPLE_DIR)/outputtest\ 52 | $(EXAMPLE_DIR)/adc0831\ 53 | $(EXAMPLE_DIR)/ppdrv-test 54 | 55 | ### Determine if we have a linux/config.h file or not 56 | findCmd=find $(LINUX_SRC)include/linux -maxdepth 1 -name config.h 57 | 58 | ifeq ($(strip $(shell $(findCmd))), ) 59 | CONFIG_H= 60 | unexport CONFIG_H 61 | else 62 | CONFIG_H=-DCONFIG_H 63 | export CONFIG_H 64 | endif 65 | 66 | CFLAGS += -O2 -g -Wall $(CONFIG_H) 67 | 68 | 69 | ########################################################################### 70 | 71 | default: libparapin.a $(EXAMPLE_PROGRAMS) 72 | 73 | install: libparapin.a 74 | /usr/bin/install -o bin -g bin -m 644 libparapin.a /usr/local/lib/ 75 | /usr/bin/install -o bin -g bin -m 444 parapin.h /usr/local/include/ 76 | 77 | modules: 78 | make -C $(LINUX_SRC) M=`pwd` modules 79 | 80 | modulesinstall: modules 81 | /usr/bin/install -o root -g root -m 644 kparapin/kparapin.ko $(LINUX_MODULES) 82 | /usr/bin/install -o root -g root -m 644 parapindriver/parapindriver.ko $(LINUX_MODULES) 83 | /usr/bin/install -o root -g root -m 644 parapindriver.h /usr/local/include/ 84 | /usr/bin/install -o root -g root -m 744 ppdrv_load.sh /usr/local/bin/ 85 | depmod -q 86 | 87 | all: libparapin.a modules $(EXAMPLE_PROGRAMS) 88 | 89 | allinstall: all install modulesinstall 90 | 91 | ##### libraries 92 | 93 | libparapin.a: $(LIBPARAPIN_OBJS) 94 | ar -cr libparapin.a $(LIBPARAPIN_OBJS) 95 | 96 | parapin.o: parapin.c parapin.h parapin-linux.h 97 | $(CC) $(CFLAGS) -c parapin.c; 98 | 99 | # Example programs and the test suite 100 | $(EXAMPLE_DIR)/%: $(EXAMPLE_DIR)/%.c libparapin.a parapin.h parapin-linux.h 101 | $(CC) $(CFLAGS) -I. -L. $< -o $@ -lparapin 102 | 103 | 104 | # Clean target 105 | clean: 106 | rm -f *.[oa] *.ko $(EXAMPLE_PROGRAMS) 107 | make -C $(LINUX_SRC) M=`pwd` clean 108 | 109 | 110 | ##################################### 111 | 112 | # Language binding targets, must be invoked explicitly as 113 | # "make parapin_-". Note that all 114 | # the clean targets are also invoked from the main clean target 115 | # above 116 | 117 | parapin_%-build: libparapin.a 118 | make -C $(subst -build,,$@) build 119 | 120 | parapin_%-install: libparapin.a 121 | make -C $(subst -install,,$@) install 122 | 123 | parapin_%-clean: 124 | make -C $(subst -clean,,$@) clean 125 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/Makefile-2.4: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin Makefile-2.4 -- build parapin for 2.4 kernels 26 | # 27 | # original author Jeremy Elson, First released 30 March 2000 28 | # 29 | # Currently maintained by Al Hooton (al@hootons.org) 30 | # 31 | # $Id: Makefile-2.4,v 1.9 2007/06/23 22:58:27 ahooton Exp $ 32 | # 33 | 34 | # Set this to be the location of your Linux kernel header files (and 35 | # modules, if you're using the kernel modules). If you are building 36 | # for the kernel you are running, the lines below with "uname" in the 37 | # paths will usually work. If you're installing the libs or kernel modules, 38 | # you will have to run make as root. If you are building for a 39 | # different kernel than you are running, you will need to edit these 40 | # paths to explicitly point to the target kernel source and lib trees. 41 | # You will also need to edit these manually if you're running an SMP 42 | # kernel. 43 | LINUX_HEADERS := /usr/src/linux-`uname -r`/include/ 44 | LINUX_MODULES := /lib/modules/`uname -r`/kernel/ 45 | 46 | CC := gcc 47 | CFLAGS := -O2 -g -Wall 48 | 49 | LIBPARAPIN_OBJS := parapin.o 50 | 51 | EXAMPLE_DIR := examples 52 | EXAMPLE_PROGRAMS := \ 53 | $(EXAMPLE_DIR)/inputtest \ 54 | $(EXAMPLE_DIR)/outputtest\ 55 | $(EXAMPLE_DIR)/adc0831 \ 56 | $(EXAMPLE_DIR)/ppdrv-test 57 | 58 | 59 | ########################################################################### 60 | 61 | default: libparapin.a $(EXAMPLE_PROGRAMS) 62 | 63 | all: libparapin.a kparapin.o parapindriver.o $(EXAMPLE_PROGRAMS) 64 | 65 | install: libparapin.a 66 | /usr/bin/install -o bin -g bin -m 644 libparapin.a /usr/local/lib/ 67 | /usr/bin/install -o bin -g bin -m 444 parapin.h /usr/local/include/ 68 | 69 | 70 | modules: kparapin.o parapindriver.o 71 | 72 | modulesinstall: kparapin.o parapindriver.o 73 | /usr/bin/install -o root -g root -m 644 kparapin.o $(LINUX_MODULES) 74 | /usr/bin/install -o root -g root -m 644 parapindriver.o $(LINUX_MODULES) 75 | /usr/bin/install -o root -g root -m 644 parapindriver.h /usr/local/include/ 76 | 77 | /usr/bin/install -o root -g root -m 744 ppdrv_load.sh /usr/local/bin/ 78 | depmod -q 79 | 80 | allinstall: install modulesinstall $(BINDINGS)-install 81 | 82 | ##### libraries 83 | 84 | libparapin.a: $(LIBPARAPIN_OBJS) 85 | ar -cr libparapin.a $(LIBPARAPIN_OBJS) 86 | 87 | parapin.o: parapin.c parapin.h parapin-linux.h 88 | $(CC) $(CFLAGS) -c parapin.c 89 | 90 | kparapin.o: parapin.c parapin.h 91 | $(CC) $(CFLAGS) -I$(LINUX_HEADERS) -D__KERNEL__ -DMODULE -o kparapin.o -c parapin.c 92 | 93 | parapindriver.o: parapindriver.c parapindriver.h parapin.h parapin-linux.h 94 | $(CC) $(CFLAGS) -I$(LINUX_HEADERS) -D__KERNEL__ -DMODULE -o parapindriver.o -c parapindriver.c 95 | 96 | 97 | # Example programs and the test suite 98 | $(EXAMPLE_DIR)/%: $(EXAMPLE_DIR)/%.c libparapin.a parapin.h parapin-linux.h 99 | $(CC) $(CFLAGS) -I. -L. $< -o $@ -lparapin 100 | 101 | 102 | # NOTE: Must explicitly add bindings clean targets as dependencies here 103 | clean: parapin_py-clean parapin_java-clean 104 | rm -f *.[oa] *.ko $(EXAMPLE_PROGRAMS) 105 | 106 | 107 | ##################################### 108 | 109 | # Language binding targets, must be invoked explicitly as 110 | # "make parapin_-". Note that all 111 | # the clean targets are also invoked from the main clean target 112 | # above 113 | 114 | parapin_%-build: libparapin.a 115 | make -C $(subst -build,,$@) build 116 | 117 | parapin_%-install: libparapin.a 118 | make -C $(subst -install,,$@) install 119 | 120 | parapin_%-clean: 121 | make -C $(subst -clean,,$@) clean 122 | 123 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/Makefile-2.6: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin Makefile-2.6 -- build parapin for 2.6 kernels 26 | # 27 | # original author Jeremy Elson, First released 30 March 2000 28 | # 29 | # Currently maintained by Al Hooton (al@hootons.org) 30 | # 31 | # $Id: Makefile-2.6,v 1.10 2007/12/16 17:38:17 ahooton Exp $ 32 | # 33 | 34 | # Set this to be the location of your Linux kernel header files (and 35 | # modules, if you're using the kernel modules). If you are building 36 | # for the kernel you are running, the lines below with "uname" in the 37 | # paths will usually work. If you're installing the libs or kernel modules, 38 | # you will have to run make as root. If you are building for a 39 | # different kernel than you are running, you will need to edit these 40 | # paths to explicitly point to the target kernel source and lib trees. 41 | # You may also need to edit these if you're running an SMP 42 | # kernel on some distros. 43 | LINUX_SRC = /usr/src/linux-`uname -r`/ 44 | LINUX_MODULES := /lib/modules/`uname -r`/kernel/ 45 | 46 | LIBPARAPIN_OBJS := parapin.o 47 | 48 | EXAMPLE_DIR := examples 49 | EXAMPLE_PROGRAMS := \ 50 | $(EXAMPLE_DIR)/inputtest\ 51 | $(EXAMPLE_DIR)/outputtest\ 52 | $(EXAMPLE_DIR)/adc0831\ 53 | $(EXAMPLE_DIR)/ppdrv-test 54 | 55 | ### Determine if we have a linux/config.h file or not 56 | findCmd=find $(LINUX_SRC)include/linux -maxdepth 1 -name config.h 57 | 58 | ifeq ($(strip $(shell $(findCmd))), ) 59 | CONFIG_H= 60 | unexport CONFIG_H 61 | else 62 | CONFIG_H=-DCONFIG_H 63 | export CONFIG_H 64 | endif 65 | 66 | CFLAGS += -O2 -g -Wall $(CONFIG_H) 67 | 68 | 69 | ########################################################################### 70 | 71 | default: libparapin.a $(EXAMPLE_PROGRAMS) 72 | 73 | install: libparapin.a 74 | /usr/bin/install -o bin -g bin -m 644 libparapin.a /usr/local/lib/ 75 | /usr/bin/install -o bin -g bin -m 444 parapin.h /usr/local/include/ 76 | 77 | modules: 78 | make -C $(LINUX_SRC) M=`pwd` modules 79 | 80 | modulesinstall: modules 81 | /usr/bin/install -o root -g root -m 644 kparapin/kparapin.ko $(LINUX_MODULES) 82 | /usr/bin/install -o root -g root -m 644 parapindriver/parapindriver.ko $(LINUX_MODULES) 83 | /usr/bin/install -o root -g root -m 644 parapindriver.h /usr/local/include/ 84 | /usr/bin/install -o root -g root -m 744 ppdrv_load.sh /usr/local/bin/ 85 | depmod -q 86 | 87 | all: libparapin.a modules $(EXAMPLE_PROGRAMS) 88 | 89 | allinstall: all install modulesinstall 90 | 91 | ##### libraries 92 | 93 | libparapin.a: $(LIBPARAPIN_OBJS) 94 | ar -cr libparapin.a $(LIBPARAPIN_OBJS) 95 | 96 | parapin.o: parapin.c parapin.h parapin-linux.h 97 | $(CC) $(CFLAGS) -c parapin.c; 98 | 99 | # Example programs and the test suite 100 | $(EXAMPLE_DIR)/%: $(EXAMPLE_DIR)/%.c libparapin.a parapin.h parapin-linux.h 101 | $(CC) $(CFLAGS) -I. -L. $< -o $@ -lparapin 102 | 103 | 104 | # Clean target 105 | clean: 106 | rm -f *.[oa] *.ko $(EXAMPLE_PROGRAMS) 107 | make -C $(LINUX_SRC) M=`pwd` clean 108 | 109 | 110 | ##################################### 111 | 112 | # Language binding targets, must be invoked explicitly as 113 | # "make parapin_-". Note that all 114 | # the clean targets are also invoked from the main clean target 115 | # above 116 | 117 | parapin_%-build: libparapin.a 118 | make -C $(subst -build,,$@) build 119 | 120 | parapin_%-install: libparapin.a 121 | make -C $(subst -install,,$@) install 122 | 123 | parapin_%-clean: 124 | make -C $(subst -clean,,$@) clean 125 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/contrib/README: -------------------------------------------------------------------------------- 1 | This directory holds examples, tips, and other useful information provided by parapin users and developers. It is not reviewed as a normal course of parapin development, so the parapin team may not be familiar with the state of things in here. If you have questions regarding any of this contributed work, please post to the parapin-users email list. 2 | 3 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/contrib/qtparapin.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parapin-1.5.1-beta1/contrib/qtparapin.tar.gz -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/doc/.cvsignore: -------------------------------------------------------------------------------- 1 | parapin.log 2 | parapin.aux 3 | texput.log 4 | parapin.dvi 5 | parapin 6 | parapin.toc 7 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/doc/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapindriver; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # http://parapin.sourceforge.net/ 21 | # 22 | default: parapin.ps parapin.txt html 23 | 24 | parapin.ps: parapin.tex 25 | latex parapin.tex 26 | latex parapin.tex 27 | dvips -o parapin.ps parapin.dvi 28 | 29 | parapin.txt: parapin.tex 30 | rm -rf /tmp/parapintemp 31 | mkdir /tmp/parapintemp 32 | latex2html -split 0 -ascii_mode -noauto_link -rootdir /tmp/parapintemp parapin 33 | lynx -dump --nolist /tmp/parapintemp/parapin.html > parapin.txt 34 | cp /tmp/parapintemp/parapin.html . 35 | rm -rf /tmp/parapintemp 36 | 37 | html: 38 | latex2html -split 4 -local_icons parapin 39 | 40 | clean: 41 | rm -f parapin.ps parapin.txt parapin.html -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/doc/parapin.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parapin-1.5.1-beta1/doc/parapin.txt -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/.cvsignore: -------------------------------------------------------------------------------- 1 | inputtest 2 | outputtest 3 | adc0831 4 | ppdrv-test -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/adc0831.c: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "parapin.h" 32 | 33 | 34 | #define VCC LP_PIN02 35 | #define CS LP_PIN03 36 | #define CLK LP_PIN04 37 | #define DBG LP_PIN05 38 | 39 | #define D0 LP_PIN10 40 | 41 | 42 | #define TPD0 2500 43 | #define TSETUP 250 44 | 45 | #define NUM_SAMPLES 200 46 | 47 | 48 | void inline clock() 49 | { 50 | set_pin(CLK); 51 | clear_pin(CLK); 52 | } 53 | 54 | 55 | 56 | void terminate(int signo) 57 | { 58 | puts("Shutting down..."); 59 | clear_pin(VCC | CS | CLK | DBG); 60 | exit(0); 61 | } 62 | 63 | 64 | int acquire() 65 | { 66 | int sample, i, total, iterations, wait; 67 | 68 | iterations = NUM_SAMPLES; 69 | total = 0; 70 | 71 | while (iterations--) { 72 | 73 | clear_pin(CS); /* pull CS low */ 74 | wait = TSETUP; 75 | while (wait--); /* set-up time */ 76 | clock(); /* tell chip to acquire */ 77 | 78 | sample = 0; 79 | for (i = 0; i < 8; i++) { 80 | clock(); 81 | wait = TPD0; 82 | while (wait--); /* wait for output to stabilize */ 83 | sample <<= 1; 84 | sample |= (pin_is_set(D0) == D0); 85 | } 86 | 87 | set_pin(CS); 88 | 89 | total += sample; 90 | /* delay before next sample */ 91 | wait = 7000; 92 | while (wait--); 93 | } 94 | 95 | return total/NUM_SAMPLES; 96 | } 97 | 98 | 99 | int main(int argc, char *argv[]) 100 | { 101 | signal(SIGINT, terminate); 102 | signal(SIGTERM, terminate); 103 | signal(SIGHUP, terminate); 104 | 105 | pin_init_user(LPT1); 106 | 107 | set_pin(VCC | CS); 108 | 109 | sleep(1); 110 | 111 | if (argc != 1) { 112 | for (;;) { 113 | set_pin(DBG); 114 | acquire(); 115 | clear_pin(DBG); 116 | acquire(); 117 | } 118 | } else { 119 | for (;;) { 120 | printf("Got sample: %d\n", acquire()); 121 | sleep(1); 122 | } 123 | } 124 | 125 | return 0; 126 | } 127 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/inputtest.c: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "parapin.h" 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | int i; 34 | 35 | if (pin_init_user(LPT1) < 0) 36 | exit(0); 37 | 38 | pin_input_mode(LP_DATA_PINS); 39 | pin_input_mode(LP_SWITCHABLE_PINS); 40 | 41 | printf("\nstarting\n"); 42 | for (i = 1; i <= 17; i++) 43 | printf("Pin %d: %s\n", i, pin_is_set(LP_PIN[i]) ? "HIGH":"LOW"); 44 | printf("\n\n"); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/outputtest.c: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include "parapin.h" 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | int pin_sequence[] = { 1, 2, 3, 4, 5, 6, 7, 8, 17, 14, 16, 9, -1}; 35 | int i; 36 | int prev = 0; 37 | char buf[240]; 38 | 39 | if (pin_init_user(LPT1) < 0) 40 | exit(0); 41 | 42 | pin_output_mode(LP_DATA_PINS | LP_SWITCHABLE_PINS); 43 | 44 | i = -1; 45 | while (1) { 46 | if (pin_sequence[++i] == -1) 47 | i = 0; 48 | printf("setting pin %d\n", pin_sequence[i]); 49 | set_pin(LP_PIN[pin_sequence[i]] | prev); 50 | printf("Hit return...\n"); 51 | fgets(buf, 5, stdin); 52 | printf("clearing pin %d\n", pin_sequence[i]); 53 | clear_pin(LP_PIN[pin_sequence[i]] | prev); 54 | /* prev = LP_PIN[pin_sequence[i]]; */ 55 | } while (0); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/ppdrv-test.c: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | /* ppdrv_test.c -- example of how to use the parapindriver kernel driver module 26 | that wraps around kparapin. Not useful functionally, since it assumes custom 27 | hardware, but this shows how to use the parapindriver device interface 28 | via ioctl's. */ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | #define CLK LP_PIN01 39 | #define DATA LP_PIN11 40 | #define NCS LP_PIN02 41 | 42 | 43 | int main(int argc, char *argv[]) 44 | { 45 | int i, value; 46 | int device; 47 | float temp; 48 | 49 | /* Get things set up */ 50 | device = open("/dev/ppdrv_device", 0); 51 | 52 | if (device < 0) { 53 | fprintf(stderr, "device open failed, we're outta here\n"); 54 | exit(-1); 55 | } 56 | 57 | ioctl(device, PPDRV_IOC_PINMODE_OUT, CLK | NCS); 58 | ioctl(device, PPDRV_IOC_PINMODE_IN, DATA); 59 | 60 | /* make sure we're in the idle state */ 61 | ioctl(device, PPDRV_IOC_PINSET, NCS); 62 | ioctl(device, PPDRV_IOC_PINCLEAR, CLK); 63 | 64 | /* start a conversion by dropping NCS */ 65 | ioctl(device, PPDRV_IOC_PINCLEAR, NCS); 66 | 67 | /* wait for data to go high, signalling the end of conversion */ 68 | while (!ioctl(device, PPDRV_IOC_PINGET, DATA)) 69 | /* null */; 70 | 71 | /* clock out 12 bits of data */ 72 | value = 0; 73 | for (i=0; i<12; i++) { 74 | value <<= 1; 75 | ioctl(device, PPDRV_IOC_PINSET, CLK); 76 | ioctl(device, PPDRV_IOC_PINCLEAR, CLK); 77 | value |= (ioctl(device, PPDRV_IOC_PINGET, DATA) ? 1 : 0); 78 | } 79 | 80 | /* go back to idle */ 81 | ioctl(device, PPDRV_IOC_PINCLEAR, CLK); 82 | ioctl(device, PPDRV_IOC_PINSET, NCS); 83 | 84 | /* print out the values */ 85 | temp = ((float)value / (float)0x0FFF) * 1250; 86 | printf("value(hex)=%x; degC=%.0f; degF=%.0f\n", value, temp, (temp*(9.0/5.0))+32); 87 | 88 | 89 | /* close the device */ 90 | close(device); 91 | 92 | return 0; 93 | } 94 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/examples/setlp0pin.c: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include "parapin.h" 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | int pin; 35 | if(argc < 2) 36 | { 37 | printf("USAGE: setlp0pin pin#\n"); 38 | exit(1); 39 | } 40 | pin = atoi(argv[1]); 41 | if (pin_init_user(LPT1) < 0) 42 | exit(0); 43 | pin_output_mode(LP_DATA_PINS | LP_SWITCHABLE_PINS); 44 | 45 | if(pin < 0) // clear requested 46 | { 47 | pin = pin * -1; 48 | clear_pin(LP_PIN[pin]); 49 | printf("pin# %d cleared\n", pin); 50 | } 51 | else 52 | { 53 | 54 | set_pin(LP_PIN[pin]); 55 | printf("pin# %d set. Run \"setlp0pin -%d\" to clear pin# %d\n", pin, pin, pin); 56 | } 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/kparapin/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin Makefile-2.6 -- build parapin for 2.6 kernels 26 | # 27 | # original author Jeremy Elson, First released 30 March 2000 28 | # 29 | # Currently maintained by Al Hooton (al@hootons.org) 30 | # 31 | # $Id: Makefile,v 1.2 2007/06/23 22:58:27 ahooton Exp $ 32 | # 33 | 34 | obj-m := kparapin.o 35 | 36 | clean-dirs := .tmp_versions/ 37 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/kparapin/kparapin.c: -------------------------------------------------------------------------------- 1 | ../parapin.c -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/kparapin/parapin-linux.h: -------------------------------------------------------------------------------- 1 | ../parapin-linux.h -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/kparapin/parapin.h: -------------------------------------------------------------------------------- 1 | ../parapin.h -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin-1.5.1-beta1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parapin-1.5.1-beta1/parapin-1.5.1-beta1.tgz -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/.cvsignore: -------------------------------------------------------------------------------- 1 | .generated-by-eclipse 2 | generated 3 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | parapin 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/Makefile: -------------------------------------------------------------------------------- 1 | # make file for parapin Java bindings, $Revision: 1.5 $ 2 | 3 | PROJECT = net_sf_parapin_ParallelPort 4 | VERSION = `./version` 5 | ANT=`which ant2` 6 | PKGNAME = parapin-$(VERSION) 7 | RELDIR = generated/$(PKGNAME) 8 | CFLAGS = -Wall $(DEBUG) 9 | INCLUDES = -I/usr/java/jdk/include -I/usr/java/jdk/include/linux -I.. 10 | PARTS = src/$(PROJECT).c 11 | 12 | .SILENT: 13 | 14 | # Targets... 15 | 16 | build: $(PROJECT) 17 | ant build-examples mkrel 18 | 19 | $(PROJECT): $(PARTS) 20 | [ -d $(RELDIR)/lib ] || mkdir -p $(RELDIR)/lib 21 | $(CC) $(CFLAGS) $(INCLUDES) -shared -o $(RELDIR)/lib/lib$(PROJECT).so $(PARTS) 22 | 23 | install: all 24 | install -D $(RELDIR)/lib/$(PKGNAME).jar /usr/share/java 25 | install -D $(RELDIR)/lib/lib$(PROJECT).so /usr/local/lib 26 | install -D doc/LICENSE /usr/share/doc/$(PKGNAME)-java/copyright 27 | cp --archive $(RELDIR)/doc/* /usr/share/doc/$(PKGNAME)-java 28 | 29 | clean: 30 | ant clean 31 | rm -f *.o $(RELDIR)/lib/lib$(PROJECT).so 32 | rm -Rf /usr/share/doc/$(PKGNAME)-java 33 | rm -f /usr/local/lib/lib$(PROJECT).so 34 | rm -f /usr/share/java/$(PKGNAME).jar 35 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 79 | 80 | 81 | 82 | 85 | 87 | 88 | 89 | 90 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/doc/index.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 66 | Parapin release ${VERSION} 67 | 68 | 69 | 70 | 71 |

Java bindings for Parapin

72 | 73 |

This is what it's like to use it:

74 | 75 |
76 | ParallelPort port = ParallelPort.open(); 77 | Pin pin1 = port.pin( 1 ); 78 | pin1.assumeRole( PinRole.DRIVER ); 79 | pin1.driveTo( LogicLevel.HIGH ); 80 | pin1.assumeRole( PinRole.SENSOR ); 81 | System.out.println( pin1.logicLevel() ); 82 | port.close(); 83 |
84 | 85 |

..and what little of the API that isn't covered above is detailed in the API javadoc.

86 | 87 | 88 |

environment

89 | 90 |

Parapin Java bindings require at least Java SE 5.0 for type-safe enumerated types.

91 | 92 |

After configuring the environment so that the C programs run properly, launch Java with:

93 | 94 |

java -Djava.library.path=PATH_TO_LIB ...

95 | 96 |

..where PATH_TO_LIB is the path to the folder that contains the native library (.so file).

97 | 98 | 99 | 100 | 101 |

102 | Valid XHTML 1.0 Transitional 105 |

106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/doc/package-list: -------------------------------------------------------------------------------- 1 | java.applet 2 | java.awt 3 | java.awt.color 4 | java.awt.datatransfer 5 | java.awt.dnd 6 | java.awt.event 7 | java.awt.font 8 | java.awt.geom 9 | java.awt.im 10 | java.awt.im.spi 11 | java.awt.image 12 | java.awt.image.renderable 13 | java.awt.print 14 | java.beans 15 | java.beans.beancontext 16 | java.io 17 | java.lang 18 | java.lang.annotation 19 | java.lang.instrument 20 | java.lang.management 21 | java.lang.ref 22 | java.lang.reflect 23 | java.math 24 | java.net 25 | java.nio 26 | java.nio.channels 27 | java.nio.channels.spi 28 | java.nio.charset 29 | java.nio.charset.spi 30 | java.rmi 31 | java.rmi.activation 32 | java.rmi.dgc 33 | java.rmi.registry 34 | java.rmi.server 35 | java.security 36 | java.security.acl 37 | java.security.cert 38 | java.security.interfaces 39 | java.security.spec 40 | java.sql 41 | java.text 42 | java.util 43 | java.util.concurrent 44 | java.util.concurrent.atomic 45 | java.util.concurrent.locks 46 | java.util.jar 47 | java.util.logging 48 | java.util.prefs 49 | java.util.regex 50 | java.util.zip 51 | javax.accessibility 52 | javax.activity 53 | javax.crypto 54 | javax.crypto.interfaces 55 | javax.crypto.spec 56 | javax.imageio 57 | javax.imageio.event 58 | javax.imageio.metadata 59 | javax.imageio.plugins.bmp 60 | javax.imageio.plugins.jpeg 61 | javax.imageio.spi 62 | javax.imageio.stream 63 | javax.management 64 | javax.management.loading 65 | javax.management.modelmbean 66 | javax.management.monitor 67 | javax.management.openmbean 68 | javax.management.relation 69 | javax.management.remote 70 | javax.management.remote.rmi 71 | javax.management.timer 72 | javax.naming 73 | javax.naming.directory 74 | javax.naming.event 75 | javax.naming.ldap 76 | javax.naming.spi 77 | javax.net 78 | javax.net.ssl 79 | javax.print 80 | javax.print.attribute 81 | javax.print.attribute.standard 82 | javax.print.event 83 | javax.rmi 84 | javax.rmi.CORBA 85 | javax.rmi.ssl 86 | javax.security.auth 87 | javax.security.auth.callback 88 | javax.security.auth.kerberos 89 | javax.security.auth.login 90 | javax.security.auth.spi 91 | javax.security.auth.x500 92 | javax.security.cert 93 | javax.security.sasl 94 | javax.sound.midi 95 | javax.sound.midi.spi 96 | javax.sound.sampled 97 | javax.sound.sampled.spi 98 | javax.sql 99 | javax.sql.rowset 100 | javax.sql.rowset.serial 101 | javax.sql.rowset.spi 102 | javax.swing 103 | javax.swing.border 104 | javax.swing.colorchooser 105 | javax.swing.event 106 | javax.swing.filechooser 107 | javax.swing.plaf 108 | javax.swing.plaf.basic 109 | javax.swing.plaf.metal 110 | javax.swing.plaf.multi 111 | javax.swing.plaf.synth 112 | javax.swing.table 113 | javax.swing.text 114 | javax.swing.text.html 115 | javax.swing.text.html.parser 116 | javax.swing.text.rtf 117 | javax.swing.tree 118 | javax.swing.undo 119 | javax.transaction 120 | javax.transaction.xa 121 | javax.xml 122 | javax.xml.datatype 123 | javax.xml.namespace 124 | javax.xml.parsers 125 | javax.xml.transform 126 | javax.xml.transform.dom 127 | javax.xml.transform.sax 128 | javax.xml.transform.stream 129 | javax.xml.validation 130 | javax.xml.xpath 131 | org.ietf.jgss 132 | org.omg.CORBA 133 | org.omg.CORBA.DynAnyPackage 134 | org.omg.CORBA.ORBPackage 135 | org.omg.CORBA.TypeCodePackage 136 | org.omg.CORBA.portable 137 | org.omg.CORBA_2_3 138 | org.omg.CORBA_2_3.portable 139 | org.omg.CosNaming 140 | org.omg.CosNaming.NamingContextExtPackage 141 | org.omg.CosNaming.NamingContextPackage 142 | org.omg.Dynamic 143 | org.omg.DynamicAny 144 | org.omg.DynamicAny.DynAnyFactoryPackage 145 | org.omg.DynamicAny.DynAnyPackage 146 | org.omg.IOP 147 | org.omg.IOP.CodecFactoryPackage 148 | org.omg.IOP.CodecPackage 149 | org.omg.Messaging 150 | org.omg.PortableInterceptor 151 | org.omg.PortableInterceptor.ORBInitInfoPackage 152 | org.omg.PortableServer 153 | org.omg.PortableServer.CurrentPackage 154 | org.omg.PortableServer.POAManagerPackage 155 | org.omg.PortableServer.POAPackage 156 | org.omg.PortableServer.ServantLocatorPackage 157 | org.omg.PortableServer.portable 158 | org.omg.SendingContext 159 | org.omg.stub.java.rmi 160 | org.w3c.dom 161 | org.w3c.dom.bootstrap 162 | org.w3c.dom.events 163 | org.w3c.dom.ls 164 | org.xml.sax 165 | org.xml.sax.ext 166 | org.xml.sax.helpers 167 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/etc/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: Hand 3 | Main-Class: net.sf.parapin.Parapin 4 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/BaseConsoleTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort; 3 | 4 | 5 | /** 6 | * Provides a little support for console-based tests where the test is 7 | * terminated by a SIGTERM. 8 | */ 9 | public abstract class BaseConsoleTest 10 | { 11 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 12 | public static final String LICENSE = "LGPL"; 13 | public static final String REVISION = "$Revision: 1.1 $"; 14 | 15 | 16 | protected static ParallelPort port; 17 | 18 | 19 | static { 20 | // register a shutdown hook to close the parallel port on exit 21 | Thread shutdownHook = new Thread("Test shutdown") { 22 | @Override 23 | public void run() 24 | { 25 | System.out.println("closing " + port); 26 | if (port != null) { 27 | port.close(); 28 | } 29 | } 30 | }; 31 | Runtime.getRuntime().addShutdownHook( shutdownHook ); 32 | 33 | port = ParallelPort.open(); 34 | } 35 | 36 | 37 | protected static void tryToSleep( long msecs ) 38 | { 39 | try { 40 | Thread.sleep( msecs ); 41 | } 42 | catch ( InterruptedException e ) 43 | { 44 | e.printStackTrace(); 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/BlinkTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort.LogicLevel; 3 | import net.sf.parapin.ParallelPort.Pin; 4 | import net.sf.parapin.ParallelPort.PinRole; 5 | 6 | 7 | /** 8 | * Blinks an LED wired to pin 1. 9 | */ 10 | public final class BlinkTest extends BaseConsoleTest 11 | { 12 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 13 | public static final String LICENSE = "LGPL"; 14 | public static final String REVISION = "$Revision: 1.3 $"; 15 | 16 | 17 | public static void main( String[] args ) 18 | { 19 | Pin pin1 = port.pin( 1 ); 20 | pin1.assumeRole( PinRole.DRIVER ); 21 | 22 | while (true) { 23 | pin1.driveTo( LogicLevel.HIGH ); 24 | tryToSleep( 500 ); 25 | pin1.driveTo( LogicLevel.LOW ); 26 | tryToSleep( 500 ); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/DriveRateTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort.LogicLevel; 3 | import net.sf.parapin.ParallelPort.Pin; 4 | import net.sf.parapin.ParallelPort.PinRole; 5 | 6 | 7 | /** 8 | * Test how fast a pin can be driven. 9 | * 10 | * platform writes/sec 11 | * 2000 MHz Dothan, Java 6.0 386,000 12 | * 400 MHz Mendocino, Java 6.0 305,000 13 | * 600 MHz Samuel 2, Java 6.0 263,000 14 | */ 15 | public final class DriveRateTest extends BaseConsoleTest 16 | { 17 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 18 | public static final String LICENSE = "LGPL"; 19 | public static final String REVISION = "$Revision: 1.2 $"; 20 | 21 | 22 | public static void main( String[] args ) 23 | { 24 | Pin pin = port.pin( 1 ); 25 | pin.assumeRole( PinRole.DRIVER ); 26 | 27 | int timesDriven = 0; 28 | long countingFrom = System.currentTimeMillis(); 29 | while (true) 30 | { 31 | // drive the logic level at the pin 1000 times 32 | for (int i = 0; i < 100; i++) 33 | { 34 | pin.driveTo( LogicLevel.HIGH ); 35 | pin.driveTo( LogicLevel.LOW ); 36 | pin.driveTo( LogicLevel.HIGH ); 37 | pin.driveTo( LogicLevel.LOW ); 38 | pin.driveTo( LogicLevel.HIGH ); 39 | pin.driveTo( LogicLevel.LOW ); 40 | pin.driveTo( LogicLevel.HIGH ); 41 | pin.driveTo( LogicLevel.LOW ); 42 | pin.driveTo( LogicLevel.HIGH ); 43 | pin.driveTo( LogicLevel.LOW ); 44 | } 45 | timesDriven ++; 46 | long now = System.currentTimeMillis(); 47 | 48 | // if at least a second has passed since the status was updated.. 49 | if (countingFrom + 1000 <= now) 50 | { 51 | System.out.print( "\rdriven " ); 52 | System.out.print( timesDriven ); 53 | System.out.print( "000 times, test inaccuracy:" ); 54 | System.out.print( now - (countingFrom + 1000) ); 55 | System.out.print( " " ); 56 | timesDriven = 0; 57 | countingFrom = now; 58 | } 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/InputTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort; 3 | import net.sf.parapin.ParallelPort.Pin; 4 | 5 | 6 | /** 7 | * Continuously prints the logic level of pin 1 to stdout. 8 | */ 9 | public final class InputTest extends BaseConsoleTest 10 | { 11 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 12 | public static final String LICENSE = "LGPL"; 13 | public static final String REVISION = "$Revision: 1.2 $"; 14 | 15 | 16 | public static void main( String[] args ) 17 | { 18 | Pin pin = port.pin( 1 ); 19 | pin.assumeRole( ParallelPort.PinRole.SENSOR ); 20 | 21 | while (true) { 22 | System.out.println( pin.logicLevel() ); 23 | tryToSleep( 1000 ); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/OpenAndCloseTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort; 3 | 4 | 5 | /** 6 | * Opens the parallel port then close it immediately then exits. 7 | */ 8 | public final class OpenAndCloseTest 9 | { 10 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 11 | public static final String LICENSE = "LGPL"; 12 | public static final String REVISION = "$Revision: 1.2 $"; 13 | 14 | 15 | public static void main( String[] args ) 16 | { 17 | ParallelPort port = ParallelPort.open(); 18 | port.close(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/example/src/ReadRateTest.java: -------------------------------------------------------------------------------- 1 | 2 | import net.sf.parapin.ParallelPort.Pin; 3 | import net.sf.parapin.ParallelPort.PinRole; 4 | 5 | 6 | /** 7 | * Test how fast a pin can be read. 8 | * 9 | * platform reads/sec 10 | * 2000 MHz Dothan, Java 6.0 686,000 11 | * 400 MHz Mendocino, Java 6.0 465,000 12 | * 600 MHz Samuel 2, Java 6.0 391,000 13 | */ 14 | public final class ReadRateTest extends BaseConsoleTest 15 | { 16 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 17 | public static final String LICENSE = "LGPL"; 18 | public static final String REVISION = "$Revision: 1.2 $"; 19 | 20 | 21 | public static void main( String[] args ) 22 | { 23 | Pin pin = port.pin( 1 ); 24 | pin.assumeRole( PinRole.SENSOR ); 25 | 26 | int timesRead = 0; 27 | long countingFrom = System.currentTimeMillis(); 28 | while (true) 29 | { 30 | // read the logic level at the pin 1000 times 31 | for (int i = 0; i < 100; i++) 32 | { 33 | pin.logicLevel(); 34 | pin.logicLevel(); 35 | pin.logicLevel(); 36 | pin.logicLevel(); 37 | pin.logicLevel(); 38 | pin.logicLevel(); 39 | pin.logicLevel(); 40 | pin.logicLevel(); 41 | pin.logicLevel(); 42 | pin.logicLevel(); 43 | } 44 | timesRead ++; 45 | long now = System.currentTimeMillis(); 46 | 47 | // if at least a second has passed since the status was updated.. 48 | if (countingFrom + 1000 <= now) 49 | { 50 | System.out.print( "\rread " ); 51 | System.out.print( timesRead ); 52 | System.out.print( "000 times, test inaccuracy:" ); 53 | System.out.print( now - (countingFrom + 1000) ); 54 | System.out.print( " " ); 55 | timesRead = 0; 56 | countingFrom = now; 57 | } 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/CVS/Entries: -------------------------------------------------------------------------------- 1 | D/parapin//// 2 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/CVS/Repository: -------------------------------------------------------------------------------- 1 | parapin/parapin_java/src/net/sf 2 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:ahooton@parapin.cvs.sourceforge.net:/cvsroot/parapin 2 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/parapin/CVS/Entries: -------------------------------------------------------------------------------- 1 | /ParallelPort.java/1.5/Mon Jun 25 10:55:54 2007// 2 | /Parapin.java/1.1/Mon Jun 4 00:44:44 2007// 3 | /Parapin.properties/1.1/Mon Jun 4 00:44:44 2007// 4 | D 5 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/parapin/CVS/Repository: -------------------------------------------------------------------------------- 1 | parapin/parapin_java/src/net/sf/parapin 2 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/parapin/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:ahooton@parapin.cvs.sourceforge.net:/cvsroot/parapin 2 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/parapin/Parapin.java: -------------------------------------------------------------------------------- 1 | 2 | package net.sf.parapin; 3 | 4 | 5 | import java.util.ResourceBundle; 6 | 7 | 8 | /** 9 | * Shows the revision of the library on stdout. 10 | */ 11 | public final class Parapin 12 | { 13 | public static final String COPYRIGHT = "© 2007 Neil Stockbridge"; 14 | public static final String LICENSE = "LGPL"; 15 | public static final String REVISION = "$Revision: 1.1 $"; 16 | 17 | 18 | public static void main( String[] args ) 19 | { 20 | ResourceBundle b = ResourceBundle.getBundle( Parapin.class.getName() ); 21 | String revision = b.getString( "REVISION" ); 22 | System.out.println(""); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net/sf/parapin/Parapin.properties: -------------------------------------------------------------------------------- 1 | REVISION=${VERSION} -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net_sf_parapin_ParallelPort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "net_sf_parapin_ParallelPort.h" 9 | 10 | JNIEXPORT jint JNICALL Java_net_sf_parapin_ParallelPort_open0 11 | (JNIEnv *jnienv, jclass class) 12 | { 13 | return (jint) open( "/dev/parapin", 0 ); 14 | } 15 | 16 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_configurePin0 17 | (JNIEnv *jnienv, jclass class, jint port, jint pin, jbyte direction) 18 | { 19 | ioctl( port, direction ? PPDRV_IOC_PINMODE_OUT : PPDRV_IOC_PINMODE_IN, LP_PIN[pin] ); 20 | } 21 | 22 | JNIEXPORT jbyte JNICALL Java_net_sf_parapin_ParallelPort_logicLevelAtPin0 23 | (JNIEnv *jnienv, jclass class, jint port, jint pin) 24 | { 25 | // the ioctl returns 0 for LOW and 65536 for HIGH 26 | return (jbyte) (ioctl( port, PPDRV_IOC_PINGET, LP_PIN[pin] ) >> 16); 27 | } 28 | 29 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_drivePin0 30 | (JNIEnv *jnienv, jclass class, jint port, jint pin, jbyte logicLevel) 31 | { 32 | ioctl( port, logicLevel ? PPDRV_IOC_PINSET : PPDRV_IOC_PINCLEAR, LP_PIN[pin] ); 33 | } 34 | 35 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_close0 36 | (JNIEnv *jnienv, jclass class, jint port) 37 | { 38 | close( port ); 39 | } 40 | 41 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/src/net_sf_parapin_ParallelPort.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class net_sf_parapin_ParallelPort */ 4 | 5 | #ifndef _Included_net_sf_parapin_ParallelPort 6 | #define _Included_net_sf_parapin_ParallelPort 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: net_sf_parapin_ParallelPort 12 | * Method: open0 13 | * Signature: ()I 14 | */ 15 | JNIEXPORT jint JNICALL Java_net_sf_parapin_ParallelPort_open0 16 | (JNIEnv *, jclass); 17 | 18 | /* 19 | * Class: net_sf_parapin_ParallelPort 20 | * Method: configurePin0 21 | * Signature: (IIB)V 22 | */ 23 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_configurePin0 24 | (JNIEnv *, jclass, jint, jint, jbyte); 25 | 26 | /* 27 | * Class: net_sf_parapin_ParallelPort 28 | * Method: logicLevelAtPin0 29 | * Signature: (II)B 30 | */ 31 | JNIEXPORT jbyte JNICALL Java_net_sf_parapin_ParallelPort_logicLevelAtPin0 32 | (JNIEnv *, jclass, jint, jint); 33 | 34 | /* 35 | * Class: net_sf_parapin_ParallelPort 36 | * Method: drivePin0 37 | * Signature: (IIB)V 38 | */ 39 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_drivePin0 40 | (JNIEnv *, jclass, jint, jint, jbyte); 41 | 42 | /* 43 | * Class: net_sf_parapin_ParallelPort 44 | * Method: close0 45 | * Signature: (I)V 46 | */ 47 | JNIEXPORT void JNICALL Java_net_sf_parapin_ParallelPort_close0 48 | (JNIEnv *, jclass, jint); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_java/version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Prints the version number of any package that is build from this working 4 | # folder. The version of a package is the revision on which this working folder 5 | # is based along with a "-dev" suffix if there are any local changes. 6 | # 7 | # $Revision: 1.1 $ 8 | # $Date: 2007/06/04 00:44:43 $ 9 | # 10 | REVISION=1.5.0 11 | CHANGES=0 12 | if [ "0" -eq "$CHANGES" ]; then 13 | SUFFIX='' 14 | else 15 | SUFFIX='-dev' 16 | fi 17 | echo $REVISION$SUFFIX 18 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_py/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | python setup.py build 4 | 5 | install: 6 | python setup.py install 7 | 8 | clean: 9 | python setup.py clean 10 | rm -rf build -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_py/parapin_py.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the package "parapin". 2 | 3 | The parapin package is free software; you can redistribute it 4 | and/or modify it under the terms of the GNU Library General Public 5 | License (LGPL) as published by the Free Software Foundation. 6 | 7 | The parapin package is distributed in the hope that it will be 8 | useful, but WITHOUT ANY WARRANTY; without even the implied 9 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Library General Public License for more details. 11 | 12 | You should have received a copy of the GNU Library General Public 13 | License along with parapin; if not, write to the Free 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | 02111-1307 USA 16 | 17 | 18 | For futher information on the parapin package, please refer to the 19 | project information hosted on Sourceforge -- 20 | 21 | http://sourceforge.net/projects/parapin/ 22 | 23 | */ 24 | 25 | /* 26 | * parapin_py.h 27 | * 28 | * $Id $ 29 | * 30 | */ 31 | 32 | 33 | /* Pin object interface */ 34 | 35 | PyAPI_DATA(PyTypeObject) PinType; 36 | 37 | 38 | /* Port object interface */ 39 | PyAPI_DATA(PyTypeObject) PortType; 40 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_py/setup.py: -------------------------------------------------------------------------------- 1 | ## This file is part of the package "parapin". 2 | 3 | ## The parapin package is free software; you can redistribute it 4 | ## and/or modify it under the terms of the GNU Library General Public 5 | ## License (LGPL) as published by the Free Software Foundation. 6 | 7 | ## The parapin package is distributed in the hope that it will be 8 | ## useful, but WITHOUT ANY WARRANTY; without even the implied 9 | ## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | ## See the GNU Library General Public License for more details. 11 | 12 | ## You should have received a copy of the GNU Library General Public 13 | ## License along with parapin; if not, write to the Free 14 | ## Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | ## 02111-1307 USA 16 | 17 | 18 | ## For futher information on the parapin package, please refer to the 19 | ## project information hosted on Sourceforge -- 20 | 21 | ## http://sourceforge.net/projects/parapin/ 22 | 23 | 24 | 25 | 26 | 27 | ## setup.py 28 | ## 29 | ## $Id: setup.py,v 1.3 2005/07/23 19:10:16 pwerneck Exp $ 30 | 31 | 32 | 33 | 34 | from distutils.core import setup, Extension 35 | 36 | module1 = Extension('parapin', 37 | sources=['parapin_py.c'], 38 | include_dirs=['../'], 39 | libraries=['parapin'], 40 | library_dirs=['../']) 41 | 42 | setup(name = 'Parapin', 43 | ext_modules = [module1]) 44 | 45 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_rb/GNUmakefile: -------------------------------------------------------------------------------- 1 | # make file for parapin Ruby bindings, $Revision: 1.1 $ 2 | 3 | .SILENT: 4 | 5 | # Targets... 6 | 7 | build: $(PROJECT) 8 | # the following command will generate a file called "Makefile" 9 | ruby extconf.rb 10 | make -f Makefile 11 | 12 | install: build 13 | # TODO 14 | 15 | clean: 16 | rm -f parapin.so parapin.o Makefile 17 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_rb/README: -------------------------------------------------------------------------------- 1 | 2 | ruby extconf.rb 3 | make 4 | ./tests.rb open_and_close 5 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_rb/extconf.rb: -------------------------------------------------------------------------------- 1 | require 'mkmf' 2 | 3 | $CFLAGS = "#{$CFLAGS} -I.." 4 | 5 | dir_config("parapin") 6 | 7 | create_makefile("parapin") 8 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_rb/parapin.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | static VALUE rb_mParapin; 10 | 11 | 12 | static VALUE parapin_open(VALUE module) 13 | { 14 | int port = open( "/dev/parapin", 0 ); 15 | return INT2NUM( port ); 16 | } 17 | 18 | 19 | static VALUE parapin_configure_pin(VALUE module, VALUE rb_port, VALUE rb_pin, VALUE rb_direction) 20 | { 21 | int port = NUM2INT( rb_port ); 22 | int pin = NUM2INT( rb_pin ); 23 | int direction = NUM2INT( rb_direction ); 24 | ioctl( port, direction ? PPDRV_IOC_PINMODE_OUT : PPDRV_IOC_PINMODE_IN, LP_PIN[pin] ); 25 | return Qnil; 26 | } 27 | 28 | 29 | static VALUE parapin_logic_level_at_pin(VALUE module, VALUE rb_port, VALUE rb_pin) 30 | { 31 | int port = NUM2INT( rb_port ); 32 | int pin = NUM2INT( rb_pin ); 33 | // the ioctl returns 0 for LOW and 65536 for HIGH 34 | int level = ioctl( port, PPDRV_IOC_PINGET, LP_PIN[pin] ) >> 16; 35 | return INT2NUM( level ); 36 | } 37 | 38 | 39 | static VALUE parapin_drive_pin(VALUE module, VALUE rb_port, VALUE rb_pin, VALUE rb_logic_level) 40 | { 41 | int port = NUM2INT( rb_port ); 42 | int pin = NUM2INT( rb_pin ); 43 | int logic_level = NUM2INT( rb_logic_level ); 44 | ioctl( port, logic_level ? PPDRV_IOC_PINSET : PPDRV_IOC_PINCLEAR, LP_PIN[pin] ); 45 | return Qnil; 46 | } 47 | 48 | 49 | static VALUE parapin_close(VALUE module, VALUE rb_port) 50 | { 51 | int port = NUM2INT( rb_port ); 52 | close( port ); 53 | return Qnil; 54 | } 55 | 56 | 57 | void Init_parapin() 58 | { 59 | rb_mParapin = rb_define_module("Parapin"); 60 | 61 | rb_define_module_function (rb_mParapin, "open", parapin_open, 0); 62 | rb_define_module_function (rb_mParapin, "configure_pin", parapin_configure_pin, 3); 63 | rb_define_module_function (rb_mParapin, "logic_level_at_pin", parapin_logic_level_at_pin, 2); 64 | rb_define_module_function (rb_mParapin, "drive_pin", parapin_drive_pin, 3); 65 | rb_define_module_function (rb_mParapin, "close", parapin_close, 1); 66 | } 67 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapin_rb/tests.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # $Revision: 1.1 $ 4 | # 5 | 6 | require 'parallel-port' 7 | 8 | 9 | include ParallelPort::LogicLevel 10 | 11 | 12 | def open_and_close 13 | port = ParallelPort.open 14 | puts "opened port #{port}" 15 | port.close 16 | port 17 | end 18 | 19 | 20 | def closed_port 21 | # check that the class may not be instantiated normally 22 | check_fails do ParallelPort.new 3 end 23 | 24 | begin 25 | # open the port 26 | port = ParallelPort.open 27 | # get hold of a Pin object to perform closed test later on 28 | pin = port.pin 1 29 | ensure 30 | # close the port 31 | port.close 32 | end 33 | 34 | # check that methods fails on the port now it's closed 35 | check_fails do port.pin 0 end 36 | check_fails do port.close end 37 | check_fails do pin.assume_role DRIVER end 38 | check_fails do pin.logic_level end 39 | check_fails do pin.drive HIGH end 40 | end 41 | 42 | 43 | def pin_conf 44 | begin 45 | port = ParallelPort.open 46 | 47 | # check that pin#1 can be configured in either direction 48 | port.pin(1).assume_role DRIVER 49 | port.pin(1).assume_role SENSOR 50 | ensure 51 | port.close 52 | end 53 | end 54 | 55 | 56 | def probe 57 | begin 58 | port = ParallelPort.open 59 | probe = port.pin 1 60 | probe.assume_role ParallelPort::Pin::Role::SENSOR 61 | while true do 62 | puts probe.logic_level 63 | sleep 1 64 | end 65 | ensure 66 | puts 'closing parallel port' 67 | port.close 68 | end 69 | end 70 | 71 | 72 | def flash 73 | begin 74 | port = ParallelPort.open 75 | driver = port.pin 2 76 | driver.assume_role ParallelPort::Pin::Role::DRIVER 77 | while true do 78 | driver.drive LOW == driver.logic_level ? HIGH : LOW 79 | sleep 1 80 | end 81 | ensure 82 | puts 'closing parallel port' 83 | port.close 84 | end 85 | end 86 | 87 | 88 | def check_fails &test 89 | begin 90 | test.call 91 | raise 'should have barfed' 92 | rescue 93 | end 94 | end 95 | 96 | 97 | def main 98 | test = ARGV[0] 99 | self.send test 100 | end 101 | 102 | main 103 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapindriver.h: -------------------------------------------------------------------------------- 1 | /* parapindriver.h -- header file for the parapindriver module. 2 | */ 3 | 4 | /* Copyright (c) 2003, Al Hooton 5 | 6 | This file is part of the program "parapindriver". 7 | 8 | Parapindriver is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public 10 | License (LGPL) as published by the Free Software Foundation. 11 | 12 | Parapindriver is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with parapindriver; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | For futher information on the parapin package, please refer to the 22 | project information hosted on Sourceforge -- 23 | 24 | http://parapin.sourceforge.net/ 25 | 26 | */ 27 | 28 | #ifndef _PARAPINDRIVER_H_ 29 | #define _PARAPINDRIVER_H_ 30 | 31 | 32 | /* Bring in parapin.h so users of this driver get the same LP_PINxx 33 | definitions that kparapin is expecting. We just run those 34 | values through parapindriver with no change. */ 35 | #include "parapin.h" 36 | 37 | 38 | /* Define our ioctl commands. We choose the magic number 0x96 */ 39 | #define PPDRV_IOC_MAGIC (0x96) 40 | 41 | #define PPDRV_IOC_PINMODE_OUT _IOW(PPDRV_IOC_MAGIC, 0, int) 42 | #define PPDRV_IOC_PINMODE_IN _IOW(PPDRV_IOC_MAGIC, 1, int) 43 | #define PPDRV_IOC_PINSET _IOW(PPDRV_IOC_MAGIC, 2, int) 44 | #define PPDRV_IOC_PINCLEAR _IOW(PPDRV_IOC_MAGIC, 3, int) 45 | #define PPDRV_IOC_PINGET _IOWR(PPDRV_IOC_MAGIC, 4, int) 46 | 47 | 48 | #endif /* _PARAPINDRIVER_H_ */ 49 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapindriver/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the package "parapin". 2 | # 3 | # The parapin package is free software; you can redistribute it 4 | # and/or modify it under the terms of the GNU Library General Public 5 | # License (LGPL) as published by the Free Software Foundation. 6 | # 7 | # The parapin package is distributed in the hope that it will be 8 | # useful, but WITHOUT ANY WARRANTY; without even the implied 9 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | # See the GNU Library General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Library General Public 13 | # License along with parapin; if not, write to the Free 14 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 15 | # 02111-1307 USA 16 | # 17 | # 18 | # For futher information on the parapin package, please refer to the 19 | # project information hosted on Sourceforge -- 20 | # 21 | # http://sourceforge.net/projects/parapin/ 22 | # 23 | # 24 | # 25 | # Parapin Makefile-2.6 -- build parapin for 2.6 kernels 26 | # 27 | # original author Jeremy Elson, First released 30 March 2000 28 | # 29 | # Currently maintained by Al Hooton (al@hootons.org) 30 | # 31 | # $Id: Makefile,v 1.2 2007/06/23 22:58:27 ahooton Exp $ 32 | # 33 | 34 | obj-m := parapindriver.o 35 | 36 | clean-dirs := .tmp_versions/ 37 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapindriver/parapin.h: -------------------------------------------------------------------------------- 1 | ../parapin.h -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapindriver/parapindriver.c: -------------------------------------------------------------------------------- 1 | ../parapindriver.c -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/parapindriver/parapindriver.h: -------------------------------------------------------------------------------- 1 | ../parapindriver.h -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/ppdrv_load.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Loading script for parapindriver, should be run late in the boot process 4 | # as root. Kicking it off from the end of /etc/rc.local is usually fine. 5 | # You must have parport.o, kparapin.o and parapindriver.o in a location 6 | # that insmod can find them. 7 | 8 | # The device name we want to use. This can be whatever you choose. 9 | DEVNAME="ppdrv_device" 10 | 11 | # Be sure a depmod has been run, so the symbols in kparapin and 12 | # parapindriver can be seen 13 | depmod 14 | 15 | # Make sure the requisite modules are loaded first. Uncomment either 16 | # of these that are not already being loaded in your configuration. 17 | #modprobe parport 18 | modprobe kparapin 19 | 20 | # Load parapindriver, passing in the device name 21 | modprobe parapindriver devname=${DEVNAME} 22 | 23 | # Make our device node, using the dynamic major that was assigned to 24 | # parapin driver when it registered itself. 25 | rm -f /dev/${DEVNAME} 26 | mknod /dev/${DEVNAME} u `grep $DEVNAME /proc/devices | cut -d " " -f 1` 0 27 | 28 | # Change mode and ownership here if necessary 29 | chmod 777 /dev/${DEVNAME} 30 | chown root /dev/${DEVNAME} 31 | chgrp root /dev/${DEVNAME} 32 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/setup-2.4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cp -i Makefile-2.4 Makefile 4 | 5 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parapin-1.5.1-beta1/setup-2.6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cp -i Makefile-2.6 Makefile 4 | 5 | ln -s ../parapin.c kparapin/kparapin.c 6 | ln -s ../parapin.h kparapin/parapin.h 7 | ln -s ../parapin-linux.h kparapin/parapin-linux.h 8 | 9 | ln -s ../parapindriver.c parapindriver/parapindriver.c 10 | ln -s ../parapindriver.h parapindriver/parapindriver.h 11 | ln -s ../parapin.h parapindriver/parapin.h 12 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/ChangeLog: -------------------------------------------------------------------------------- 1 | 2002-7-22 2 | * src/parashell.c - Command line arguments supported 3 | * src/pin.c - Command line arguments supported 4 | 5 | 2006-09-06 6 | * src/parashell.pl - Windows support using inpout32.dll 7 | * bin/Win32/parashell.exe - Updated binary 8 | 9 | 2006-09-07 10 | * src/parashell.pl - Combined input and output into single script 11 | * bin/Win32/parashell.exe - Updated binary 12 | 13 | 2008-12-01 14 | * src/Linux - Created separate source directory for Linux 15 | * src/Win32 - Created separate source directory for Windows 16 | * src/Win32/parashell.pl - rewritten to allow using other parallel port bytes (CONTROL, DATA, and STATUS) 17 | - changed Option argument syntax 18 | * bin/Win32/parashell.exe - Updated binary 19 | * README - Updated to reflect new changes 20 | * INSTALL - Included clarifications to Windows system directory 21 | * docs/parallel_port_pinout.txt - Added pinout documentation for the parallel port -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/INSTALL: -------------------------------------------------------------------------------- 1 | parashell 2 | 3 | Installation on Windows 4 | Copy bin/Win32/inpout32.dll to the windows system directory (usually C:\Windows\system\) 5 | 6 | That's all there is to it! -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/Makefile: -------------------------------------------------------------------------------- 1 | # parashell Makefile 2 | # this will compile the parashell (output) and pin (input) 3 | OWNER=root 4 | GROUP=root 5 | CFLAGS= -O 6 | CC=gcc 7 | BINDIR=/usr/local/bin 8 | 9 | all: parashell 10 | 11 | parashell: 12 | $(CC) $(CFLAGS) src/parashell.c -o bin/parashell 13 | $(CC) $(CFLAGS) src/pin.c -o bin/pin 14 | install: 15 | cp bin/parashell $(BINDIR) 16 | cp bin/pin $(BINDIR) 17 | clean: 18 | -rm -f core 19 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/README: -------------------------------------------------------------------------------- 1 | parashell - Parallel Port Control for Linux 2 | http://parashell.sourceforge.net/ 3 | 4 | Copyright (C) by Brett Carroll 5 | 6 | 7 | Please send comments, questions, submissions to 8 | Brett Carroll 9 | 10 | GENERAL 11 | ------- 12 | 13 | parashell is a Parallel Port interface for Linux and Windows. 14 | 15 | Under Linux parashell allows the control of multiple Parallel Ports through simple command 16 | line arguments. 17 | 18 | Under Windows parashell allows reading and writing of the CONTROL, DATA, and STATUS bytes on the default parallel port (usually 0x378) 19 | 20 | pin is also included for Linux, which reads the status of a parallel port. 21 | (ie., you can use the parallel port as an input device) 22 | 23 | All you need is some scripting knowledge, a parallel port and some misc electronic components. 24 | 25 | COPYING 26 | ------- 27 | This program is free software; you can redistribute it and/or 28 | modify it under the terms of the GNU General Public License 29 | as published by the Free Software Foundation; either version 2 30 | of the License, or (at your option) any later version. 31 | 32 | This program is distributed in the hope that it will be useful, 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 35 | GNU General Public License for more details. 36 | 37 | You should have received a copy of the GNU General Public License 38 | along with this program in a text-formatted file named COPYING; if 39 | not, write to the Free Software Foundation, Inc., 59 Temple Place - 40 | Suite 330, Boston, MA 02111-1307, USA. 41 | 42 | 43 | FEATURES 44 | -------- 45 | - Allows control of multiple parallel ports 46 | - Easily scriptable 47 | - Windows and Linux support 48 | 49 | RELATED LINKS 50 | ------------- 51 | 52 | The parashell homepage: 53 | http://parashell.sourceforge.net 54 | 55 | 56 | MORE INFORMATION 57 | ---------------- 58 | 59 | See the following files for more information: 60 | 61 | COPYING GNU General Public License 62 | README This File 63 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/bin/Linux/parashell: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/bin/Linux/parashell -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/bin/Linux/pin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/bin/Linux/pin -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/bin/Win32/inpout32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/bin/Win32/inpout32.dll -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/bin/Win32/parashell.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/bin/Win32/parashell.exe -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/docs/LED.txt: -------------------------------------------------------------------------------- 1 | ######################################### 2 | # Connecting LEDs to the Parallel Port. # 3 | ######################################### 4 | 5 | Parts: (8) LEDs (L1 through L8) 6 | (8) 470 ohm resistors (R1 through R8) 7 | DB-25 connector (or something else to plug into the Parallel Port) 8 | 9 | This wiring scheme will work with the right_knider.sh script found in the examples directory. 10 | 11 | Parallel Port Wiring: 12 | 13 | Pin # 14 | 15 | 1 UNUSED 16 | + - 17 | 2 ----------L1--------R1------------(connect to GND) 18 | + - 19 | 3 ----------L2--------R2------------(connect to GND) 20 | + - 21 | 4 ----------L3--------R3------------(connect to GND) 22 | + - 23 | 5 ----------L4--------R4------------(connect to GND) 24 | + - 25 | 6 ----------L5--------R5------------(connect to GND) 26 | + - 27 | 7 ----------L6--------R6------------(connect to GND) 28 | + - 29 | 8 ----------L7--------R7------------(connect to GND) 30 | + - 31 | 9 ----------L8--------R8------------(connect to GND) 32 | 33 | 10 UNUSED 34 | 11 UNUSED 35 | 12 UNUSED 36 | 13 UNUSED 37 | 14 UNUSED 38 | 15 UNUSED 39 | 16 UNUSED 40 | 17 UNUSED 41 | 18 GND 42 | 19 GND 43 | 20 GND (Connect pins 18-25 together) 44 | 21 GND 45 | 22 GND 46 | 23 GND 47 | 24 GND 48 | 25 GND -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/docs/parallel_port_pinout.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/docs/parallel_port_pinout.txt -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/docs/stepper_motors.txt: -------------------------------------------------------------------------------- 1 | USING PARASHELL TO CONTROL STEPPER MOTORS 2 | 3 | Controlling 2 stepper motors with parashell. 4 | 5 | First you will need to interface the stepper motors with the parallel port. 6 | This example will use two, 5 five wire stepper motors. 7 | These stepper motors can easily be stripped from an old floppy disk drive. 8 | 9 | 4 wires are used to control the position of the shaft, while the fifth wire is the common ground. 10 | You are on your own to figure out which wire is which. 11 | 12 | QUICK TIP: Hook the ground of a DC power source to one of the wires (look on the motor for the correct voltage, usually 12 v$ 13 | touch the positive lead to each of the motor's wires and note the response of the motor. 14 | The motor should jiggle back and forth, once you have the correct sequence figured out you should be able to 15 | touch the positive lead to each of the motor's wires, one at a time, and the motor will slowly rotate. 16 | A stepper motor moves in steps to complete it's rotation, so to get it to spin 360 degrees you will have to 17 | step through the motor's wires (ie., 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3,4, etc) 18 | Once you have figured out the motor's wiring sequence it is a good idea to wire it to the parallel port 19 | according to that sequence. (it just makes it easier to program) 20 | 21 | We will be using the DATA port for this example. 22 | We will assume that: 23 | Pin2 is connected to motor wire for step1 24 | Pin3 is connected to motor wire for step2 25 | Pin4 is connected to motor wire for step3 26 | Pin5 is connected to motor wire for step4 27 | and the motor's ground is connected to ground. 28 | 29 | In this configuration will can write the following script to make the motor spin continuously. 30 | 31 | #!/bin/sh 32 | # 33 | #parashell Stepper Motor Example 34 | #brettcarroll@movlug.com 35 | #This example will loop, making the stepper motor spin until the script is issued a break signal. 36 | #You can increase the motors speed by lowering the usleep delay value, 37 | #but remember to leave at least one usleep in the script to avoid spiking your CPU. 38 | 39 | while : 40 | do 41 | parashell 0x378 1 #Step 1 42 | usleep 100 #usleep to avoid CPU spikes 43 | parashell 0x378 2 #Step 2 44 | usleep 100 #usleep to avoid CPU spikes 45 | parashell 0x378 4 #Step 3 46 | usleep 100 #usleep to avoid CPU spikes 47 | parashell 0x378 8 #Step 4 48 | usleep 100 #usleep to avoid CPU spikes 49 | done 50 | 51 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/examples/7seg_led.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ##################################################### 3 | # 7seg_led.sh -- brettcarroll@wirefire.com 4 | # 7 segment LED module script 5 | ##################################################### 6 | 7 | send_data="/usr/local/bin/parashell 0x378 " 8 | 9 | REPEAT=10 # Number of times to loop 10 | DELAY=100000 # Set the blink delay in microseconds 11 | 12 | loop=1 13 | 14 | while [ "$loop" -le "$REPEAT" ] 15 | do 16 | for data_out in 1 2 4 8 16 32 64 8 1 3 7 71 103 119 127 119 127 119 17 | do 18 | $send_data $data_out 19 | # echo $data_out # Display current value being sent 20 | usleep $DELAY 21 | done 22 | 23 | loop=$((loop+1)) 24 | done 25 | 26 | echo 27 | 28 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/examples/count.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ##################################################### 3 | # count.sh -- brettcarroll@wirefire.com 4 | # 7 segment LED module script 5 | ##################################################### 6 | 7 | send_data="/usr/local/bin/parashell 0x378 " 8 | send_control="/usr/local/bin/parashell 0x37a " 9 | 10 | REPEAT=100 11 | DELAY=100000 #Delay in microseconds 12 | 13 | loop=1 14 | 15 | while [ "$loop" -le "$REPEAT" ] 16 | do 17 | for data_out in 68 107 110 92 62 31 100 127 124 119 0 0 18 | do 19 | for dot in 4 0 20 | do 21 | /usr/bin/pouta $dot 22 | $send_data $data_out 23 | # echo $data_out # Display current value being sent 24 | usleep $DELAY 25 | $send_control $dot 26 | 27 | done 28 | done 29 | loop=$((loop+1)) 30 | done 31 | 32 | echo 33 | 34 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/examples/right_knider.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################################# 3 | # right_knider.sh -- Brett Carroll -- brettcarroll@movlug.com 4 | # 5 | # Purpose: Chasing effect with LEDs 6 | # 7 | # Refer to docs/LED.txt for wiring diagram 8 | # 9 | ################################################################# 10 | 11 | send_data="/usr/local/bin/parashell 0x378 " 12 | 13 | REPEAT=100 14 | DELAY=100000 # Set the blink delay 15 | 16 | loop=1 17 | 18 | while [ "$loop" -le "$REPEAT" ] 19 | do 20 | for data_out in 0 1 2 4 8 16 32 64 128 0 0 128 64 32 16 8 4 2 1 0 0 21 | do 22 | $send_data $data_out 23 | # echo $data_out # used for Debugging 24 | usleep $DELAY 25 | 26 | done 27 | 28 | loop=$((loop+1)) 29 | 30 | done 31 | 32 | echo 33 | 34 | exit 0 35 | 36 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/examples/stepper_motor.pl: -------------------------------------------------------------------------------- 1 | #use strict; 2 | #use warnings; 3 | 4 | my $parashell = "c:/parashell.exe"; #path to parashell.exe 5 | 6 | my $delay = .1; #default delay parameter in seconds 7 | 8 | #my @bits = (16,32,64,128); #last four bits of the DATA port. Full steps 9 | #my @bits = (1,2,4,8); #first four bits of the DATA port. Full steps 10 | #my @bits = (3,6,12,9); #first four bits of the DATA port. Half steps 11 | my @bits = (48,96,192,144); #last four bits of the DATA port. Half steps 12 | 13 | my $rotation = 25; #number of steps to complete one full rotation 14 | 15 | #this loop will rotate the stepper motor one complete turn forwards then one complete turn backwards and repeat forever... 16 | while (1){ 17 | for ( my $i=0; $i<=$rotation; $i++ ){ 18 | foreach my $bit (@bits) { 19 | `$parashell -w $bit`; 20 | `c:/Docume~1/bcarroll/Desktop/parashell-2.1/parashell-2.1/parashell/bin/Win32/parashell.exe -w $bit`; 21 | #print "$bit\n"; #debugging... 22 | delay(); 23 | } 24 | } 25 | 26 | for ( my $i=0; $i<=$rotation; $i++ ){ 27 | foreach my $bit (reverse @bits) { 28 | `$parashell -w $bit`; 29 | #print "$bit\n"; #debugging... 30 | delay(); 31 | } 32 | } 33 | } 34 | 35 | #turn off all bits so you don't burn up something 36 | `$parashell -w 0`; 37 | 38 | sub delay { 39 | my $d; 40 | if (@_) { $d = @_; } else { $d = $delay; } 41 | select(undef,undef,undef, $d); 42 | } 43 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/parashell-2.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/parashell/parashell-2.2.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/src/Linux/parashell.c: -------------------------------------------------------------------------------- 1 | /* 2 | * parashell -- Brett Carroll @ 2002 3 | * Write data to the parallel port as recieved from the cmdline. 4 | * Usage: parashell [PORT] [DATA] 5 | * DATA can be decimal (0...255) or hexadecimal (0x00...0xff) 6 | * snippets taken from Tomi Engdahl's (tomi.engdahl@hut.fi) 7 | * Simple parallel port output control program for Linux 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | main(int argc, char **argv) 16 | { 17 | int par_data; 18 | int PORT; 19 | 20 | if (argc!=3) 21 | printf("USAGE: parashell [PORT] [DATA]\n ie., parashell 0x378 128\n"), exit(1); 22 | 23 | sscanf(argv[1],"%i",&PORT); // Get PORT value (ie. 0x378) 24 | 25 | if (sscanf(argv[2],"%i",&par_data)!=1) 26 | fprintf(stderr, "ERROR: DATA entered is not a number.\n"), exit(1); 27 | 28 | if ((par_data<0) || (par_data>255)) 29 | fprintf(stderr, "ERROR: DATA must be between 0 and 255\nUSAGE: parashell [PORT] [DATA]\n"), exit(1); 30 | 31 | if (ioperm(PORT,1,1)) 32 | fprintf(stderr, "ERROR: Can't gain access to port %x\n", PORT), exit(1); 33 | 34 | 35 | outb((unsigned char)par_data, PORT); // Output Data to the Parallel Port 36 | // inb(PORT); // Input Parallel Port Data 37 | } 38 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/src/Linux/pin.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pout -- By: Brett Carroll 3 | * Read data from the Parallel Port 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main(int argc, char **argv) 12 | { 13 | int in_data; 14 | int PORT; 15 | 16 | if (argc!=2) 17 | printf("USAGE: pin [PORT]\n ie., pin 0x378\n"), exit(1); 18 | 19 | sscanf(argv[1],"%i",&PORT); // Get PORT value (ie. 0x378, 0x379, 0x37a) 20 | 21 | if (ioperm(PORT,1,1)) 22 | fprintf(stderr, "ERROR: Can't gain access to port %x\n", PORT), exit(1); 23 | 24 | in_data = inb(PORT); 25 | printf("%d\n",in_data); 26 | 27 | return(in_data); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/src/Win32/parashell.perlapp: -------------------------------------------------------------------------------- 1 | #!C:\Program Files\ActiveState Perl Dev Kit 6.0\bin\lib\pai.exe 2 | PAP-Version: 1.0 3 | Packer: C:\Program Files\ActiveState Perl Dev Kit 6.0\bin\perlapp.exe 4 | Script: parashell.pl 5 | Cwd: C:\Documents and Settings\bcarroll\Desktop\parashell-2.2\parashell\src\Win32 6 | Clean: 1 7 | Date: 2008-12-01 09:59:46 8 | Debug: 9 | Dependent: 0 10 | Dyndll: 0 11 | Exe: ..\..\..\..\..\parashell.exe 12 | Force: 1 13 | Gui: 0 14 | Hostname: BCARROL2 15 | No-Compress: 0 16 | No-Logo: 1 17 | Runlib: 18 | Shared: none 19 | Tmpdir: 20 | Verbose: 0 21 | Version-Comments: 22 | Version-CompanyName: 23 | Version-FileDescription: Parallel port programming interface 24 | Version-FileVersion: 2.2 25 | Version-InternalName: parashell 26 | Version-LegalCopyright: 27 | Version-LegalTrademarks: 28 | Version-OriginalFilename: parashell 29 | Version-ProductName: parashell 30 | Version-ProductVersion: 2.2 31 | Xclude: 0 32 | -------------------------------------------------------------------------------- /doc/USB_Parallel/parashell/src/Win32/parashell.pl: -------------------------------------------------------------------------------- 1 | #parashell -- Brett Carroll @ 2008 2 | #Read and Write data to/from the parallel port as recieved from the cmdline. 3 | #Usage: parashell.exe [OPTIONS] 4 | #Simple parallel port input/output control program for Windows 5 | 6 | #use strict; 7 | #use warnings; 8 | use Device::ParallelPort; 9 | use Getopt::Long; 10 | 11 | my $parport = Device::ParallelPort->new('win32'); #load the win32 parallel port driver 12 | 13 | my ($mode, $port, $data, $help); 14 | 15 | #print usage statement if no command line parameters are passed or there is an unknown parameter or help option is passed 16 | GetOptions('mode=s' => \$mode, 'port=s' => \$port, 'data:i' => \$data, 'help|?' => \$help); 17 | 18 | usage if defined $help; 19 | 20 | if ($mode =~ /r/i){ 21 | print pin($port); #read from the specified port 22 | } elsif ($mode =~ /w/i){ 23 | pout ($port, $data); #write to the specified port 24 | } 25 | 26 | sub pin { 27 | my $port = shift; 28 | my $val; 29 | if ($port =~ /c/i){ 30 | $val = $parport->get_byte(1); #read from the CONTROL port 31 | } elsif ($port =~ /d/i){ 32 | $val = $parport->get_byte(0); #read from the DATA port 33 | } elsif ($port =~ /s/i){ 34 | $val = $parport->get_byte(2); #read from the STATUS port 35 | } else { 36 | usage(); 37 | } 38 | return ord($val); 39 | } 40 | 41 | sub pout { 42 | my ($port, $data) = @_; 43 | my $val; 44 | for my $i (0 .. 255){ 45 | if ($i == $data){ 46 | if ($port =~ /c/i){ 47 | $parport->set_byte(1,chr($data)); #write to the CONTROL port 48 | } elsif ($port =~ /d/i){ 49 | $parport->set_byte(0,chr($data)); #write to the DATA port 50 | } elsif ($port =~ /s/i){ 51 | $parport->set_byte(2,chr($data)); #write to the STATUS port 52 | } 53 | return 0; 54 | } 55 | } 56 | } 57 | 58 | sub usage { 59 | #Usage statement 60 | print "Usage: parashell.exe [OPTIONS]\n"; 61 | print "Options:\n"; 62 | print "-mode Set parashell mode (read or write)\n"; 63 | print "\tr Set read mode\n"; 64 | print "\tw Set write mode\n"; 65 | print "-port Set port to use\n"; 66 | print "\tc Use CONTROL port\n"; 67 | print "\td Use DATA port\n"; 68 | print "\ts Use STATUS port\n"; 69 | print "-data Specifies data to be sent to the specified port (-mode must be set to w)\n"; 70 | print " data can be decimal (0-255)\n"; 71 | print "\nExample:\n"; 72 | print "\tc:\\>parashell.exe -mode w -port d -data 255\n"; 73 | print "\tThis example sets all 8 DATA bits high\n"; 74 | } -------------------------------------------------------------------------------- /doc/USB_Parallel/sch_pl2305_v2.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/sch_pl2305_v2.3.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/sch_pl2305_v2.3/SCH_PL2305_V2.3-ORCAD7.2.DSN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/sch_pl2305_v2.3/SCH_PL2305_V2.3-ORCAD7.2.DSN -------------------------------------------------------------------------------- /doc/USB_Parallel/sch_pl2305_v2.3/SCH_PL2305_V2.3.BOM: -------------------------------------------------------------------------------- 1 | Revised: Monday, April 11, 2011 2 | PL-2305 - USB to Parallel Converter Revision: 1.3 3 | 4 | Prolific Technology Inc. 5 | 6 | 7 | 8 | 9 | 10 | Bill Of Materials April 11,2011 10:38:48 Page1 11 | 12 | Item Quantity Reference Part 13 | ______________________________________________ 14 | 15 | 1 3 C1,C8,C10 1u 16 | 2 6 C2,C4,C6,C7,C9,C11 0.1u 17 | 3 2 C3,C5 10u 18 | 4 1 C12 100p 19 | 5 2 C13,C14 10p 20 | 6 2 D1,D2 Schottky DIODE 21 | 7 1 J1 Centronic Connector 22 | 8 2 L1,L2 FB 23 | 9 1 R1 1.5K 24 | 10 2 R2,R3 27 25 | 11 12 R4,R5,R6,R7,R8,R9,R10, 24 26 | R11,R12,R13,R14,R15 27 | 12 4 R16,R17,R18,R20 (4.7K) 28 | 13 2 R19,R26 10K 29 | 14 6 R21,R22,R23,R24,R25,R27 200K 30 | 15 2 R28,R29 4.7K 31 | 16 1 R30 (560K) 32 | 17 1 USB_CON1 USB_CONA 33 | 18 1 U1 PL-2305 34 | 19 1 U2 24C02 35 | 20 1 Y1 12 MHz 36 | -------------------------------------------------------------------------------- /doc/USB_Parallel/sch_pl2305_v2.3/SCH_PL2305_V2.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/sch_pl2305_v2.3/SCH_PL2305_V2.3.pdf -------------------------------------------------------------------------------- /doc/USB_Parallel/sch_pl2305_v2.3/sch_pl2305_v2.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/sch_pl2305_v2.3/sch_pl2305_v2.3.zip -------------------------------------------------------------------------------- /doc/USB_Parallel/usb2lpt5.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/USB_Parallel/usb2lpt5.c -------------------------------------------------------------------------------- /doc/Universal Serial Bus System Architecture.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Universal Serial Bus System Architecture.pdf -------------------------------------------------------------------------------- /doc/Usb.Complete.The.Developers.Guide.5th.Edition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/Usb.Complete.The.Developers.Guide.5th.Edition.pdf -------------------------------------------------------------------------------- /doc/bit-bang-usb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/bit-bang-usb.pdf -------------------------------------------------------------------------------- /doc/develop_usb_device_access_once_using_libusb_-_use_any_where_nagendra_simhadri_-_v4.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/develop_usb_device_access_once_using_libusb_-_use_any_where_nagendra_simhadri_-_v4.0.pdf -------------------------------------------------------------------------------- /doc/ds_pl2305I_v1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ds_pl2305I_v1.0.pdf -------------------------------------------------------------------------------- /doc/ds_pl2305_v1.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/ds_pl2305_v1.3.pdf -------------------------------------------------------------------------------- /doc/libusb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/libusb.pdf -------------------------------------------------------------------------------- /doc/mlug-usb-talk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/mlug-usb-talk.pdf -------------------------------------------------------------------------------- /doc/prolific_2305_brochure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/prolific_2305_brochure.pdf -------------------------------------------------------------------------------- /doc/stulpi01a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/stulpi01a.pdf -------------------------------------------------------------------------------- /doc/usb-in-a-nutshell.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/usb-in-a-nutshell.pdf -------------------------------------------------------------------------------- /doc/usb_complete_chapter1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/usb_complete_chapter1.pdf -------------------------------------------------------------------------------- /doc/usbdoc-1.32.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/usbdoc-1.32.pdf -------------------------------------------------------------------------------- /doc/usbprint11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/usbprint11.pdf -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | build 3 | ChangeLog 4 | MANIFEST 5 | dist 6 | .tox 7 | *.egg-info 8 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/ACKNOWLEDGEMENTS: -------------------------------------------------------------------------------- 1 | Alan Aguiar 2 | jaseg 3 | Johannes Stezenbach 4 | Marijn van Vliet 5 | Stefano Di Martino 6 | Simon Norberg 7 | iThompson 8 | Harry Bock 9 | ponty 10 | Chris Clark 11 | themperek 12 | David Halter 13 | Robert von Burg 14 | James Rowe 15 | Braiden Kindt 16 | Tormod Volden 17 | Chris Clark 18 | Emmanuel Blot 19 | Peter Bigot 20 | Travis Robinson 21 | Xiaofan Chen 22 | Poul-Henning Kamp 23 | Thomas Reitmayr 24 | Carl Ritson 25 | Romain Aviolat 26 | Walker Inman 27 | Prathmesh Prabhu 28 | André Erdmann 29 | Jeffrey Nichols 30 | Deliang Fan 31 | Matthew Chan 32 | Maximilian Köhl 33 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2009-2017 Wander Lairson Costa. All Rights Reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. The name of the author may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 22 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 25 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 26 | OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE ACKNOWLEDGEMENTS ChangeLog README.rst ReleaseNotes.rst 2 | recursive-include docs *.rst 3 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/README.rst: -------------------------------------------------------------------------------- 1 | ======================================= 2 | PyUSB 1.0 - Easy USB access from Python 3 | ======================================= 4 | 5 | PYUSB IS FOR LOOKING FOR A NEW MAINTAINER 6 | 7 | Due for personal reasons, I can no longer maintain PyUSB. If you are 8 | willing to take PyUSB maintainance role, please contact me. 9 | 10 | Introduction 11 | ============ 12 | 13 | The PyUSB module provides for Python easy access to the host 14 | machine's Universal Serial Bus (USB) system. 15 | 16 | Until 0.4 version, PyUSB used to be a thin wrapper over libusb. 17 | With 1.0 version, things changed considerably. Now PyUSB is an 18 | API rich, backend neutral Python USB module easy to use. 19 | 20 | As with most Python modules, PyUSB's documentation is based on Python 21 | doc strings and can therefore be manipulated by tools such as pydoc. 22 | 23 | You can also find a tutorial at: 24 | https://github.com/walac/pyusb/blob/master/docs/tutorial.rst. 25 | 26 | PyUSB is being developed and tested on Linux and Windows, but it should work 27 | fine on any platform running Python >= 2.4, ctypes and at least one of the 28 | builtin backends. 29 | 30 | PyUSB supports libusb 0.1, libusb 1.0 and OpenUSB, but the user does not need 31 | to worry about that, unless in some corner cases. 32 | 33 | If you have any question about PyUSB, you can use the PyUSB mailing list 34 | hosted in the SourceForge. In the PyUSB website (http://walac.github.io/pyusb) 35 | you can find instructions on how to subscribe to the mailing list. 36 | 37 | Installing 38 | ========== 39 | 40 | PyUSB is installed through `pip `: 41 | 42 | pip install pyusb 43 | 44 | Remember that you need libusb (1.0 or 0.1) or OpenUSB running on your 45 | system. For Windows users, libusb 0.1 is provided through 46 | `libusb-win32 `_ 47 | package. Check the libusb website for updates 48 | (http://www.libusb.info). 49 | 50 | Reporting bugs/Submitting patches 51 | ================================= 52 | 53 | Some people have been sending patches and reporting bugs directly 54 | at my email. Please, do it through 55 | `github `_, I had a hardtime tracking 56 | their names to put them in the acknowledgments file. ;-) 57 | 58 | PS: this README file was based on the great Josh Lifton's one... ^_^ 59 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | export LC_ALL=en_US.UTF-8 4 | export LANG=en_US.UTF-8 5 | 6 | if ! which twine; then 7 | echo "Please run 'sudo pip install twine'" 8 | exit 1 9 | fi 10 | 11 | version=$(python -c 'import usb; print (".".join(str(x) for x in usb.version_info))') 12 | 13 | echo "Deploying version $version" 14 | 15 | ./gencl.sh 16 | git tag -s -m "Version $version" v$version 17 | python setup.py sdist 18 | gpg --detach-sign -a dist/pyusb-$version.tar.gz 19 | git push origin master 20 | git push --tags origin 21 | twine upload -s dist/pyusb-$version.tar.gz dist/pyusb-$version.tar.gz.asc 22 | rm -rf build/ dist/ 23 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/docs/faq.rst: -------------------------------------------------------------------------------- 1 | FAQ 2 | === 3 | 4 | How do I fix "No backend available" errors? 5 | ------------------------------------------- 6 | 7 | Generally, there are four possible causes for this problem: 8 | 9 | 1. You didn't install libusb library. 10 | 2. Your libusb library isn't in the standard shared library paths. 11 | 3. Your libusb version is too old. 12 | 4. Your PyUSB version is too old. 13 | 14 | To debug what's wrong, run the following script in your environment:: 15 | 16 | import os 17 | os.environ['PYUSB_DEBUG'] = 'debug' 18 | import usb.core 19 | usb.core.find() 20 | 21 | This will print debug messages to the console. If you still have problems 22 | to figure out what's going on, please ask for help in the mailing list, 23 | providing the debug output. 24 | 25 | How do I install libusb on Windows? 26 | ----------------------------------- 27 | 28 | To install either libusb_ or libusb-win32_ on Windows, please use zadig_. 29 | 30 | .. _zadig: http://zadig.akeo.ie/ 31 | .. _libusb: https://libusb.info 32 | .. _libusb-win32: http://www.libusb.org/wiki/libusb-win32 33 | 34 | How do I enforce a backend? 35 | --------------------------- 36 | 37 | Here is an example for the *libusb1* backend:: 38 | 39 | >>> import usb.core 40 | >>> from usb.backend import libusb1 41 | >>> be = libusb1.get_backend() 42 | >>> dev = usb.core.find(backend=be) 43 | 44 | How can I pass the libusb library path to the backend? 45 | ------------------------------------------------------ 46 | 47 | Check the *Specify libraries by hand* section in the tutorial_. 48 | 49 | .. _tutorial: https://github.com/walac/pyusb/blob/master/docs/tutorial.rst 50 | 51 | How (not) to call set_configuration() on a device already configured with the selected configuration? 52 | ----------------------------------------------------------------------------------------------------- 53 | 54 | Typically ``set_configuration()`` is called during device initialization. The `libusb documentation`_ on ``libusb_set_configuration()`` states: 55 | 56 | .. _libusb documentation: http://libusb.org/static/api-1.0/group__dev.html#ga186593ecae576dad6cd9679f45a2aa43 57 | 58 | If you call this function on a device already configured with the selected configuration, then this function will act as a lightweight device reset: it will issue a SET_CONFIGURATION request using the current configuration, causing most USB-related device state to be reset (altsetting reset to zero, endpoint halts cleared, toggles reset). 59 | 60 | Calling ``write()`` subsequently will therefore result in a timeout error. 61 | 62 | One solution to this behaviour is to consider the currently active configuration, as described in the `configuration selection and handling`_. "If the configuration we want is already active, then we don't have to select any configuration":: 63 | 64 | cfg = dev.get_active_configuration() 65 | if cfg is None or cfg.bConfigurationValue != cfg_desired: 66 | dev.set_configuration(cfg_desired) 67 | 68 | .. _configuration selection and handling: http://libusb.org/static/api-1.0/caveats.html 69 | 70 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/etc/pyusb.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="fa2e", MODE="0666" 2 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/gencl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | changelog_file=ChangeLog 4 | latest_tag=$(git describe --abbrev=0) 5 | 6 | git log --pretty='format:Author: %an%n%w(0,4,4)%B' $latest_tag..HEAD > $changelog_file 7 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.rst 3 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2016 Wander Lairson Costa 4 | # 5 | # The following terms apply to all files associated 6 | # with the software unless explicitly disclaimed in individual files. 7 | # 8 | # The authors hereby grant permission to use, copy, modify, distribute, 9 | # and license this software and its documentation for any purpose, provided 10 | # that existing copyright notices are retained in all copies and that this 11 | # notice is included verbatim in any distributions. No written agreement, 12 | # license, or royalty fee is required for any of the authorized uses. 13 | # Modifications to this software may be copyrighted by their authors 14 | # and need not follow the licensing terms described here, provided that 15 | # the new terms are clearly indicated on the first page of each file where 16 | # they apply. 17 | # 18 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 19 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 20 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 21 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 22 | # POSSIBILITY OF SUCH DAMAGE. 23 | # 24 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 25 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 26 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 27 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 28 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 29 | # MODIFICATIONS. 30 | 31 | from setuptools import setup 32 | 33 | import usb 34 | 35 | 36 | setup( 37 | name='pyusb', 38 | version=usb.__version__, 39 | description='Python USB access module', 40 | author='Wander Lairson Costa', 41 | author_email='wander.lairson@gmail.com', 42 | license = 'BSD', 43 | url='http://walac.github.io/pyusb', 44 | packages=['usb', 'usb.backend'], 45 | long_description = 46 | """ 47 | PyUSB offers easy USB devices communication in Python. 48 | It should work without additional code in any environment with 49 | Python >= 2.4, ctypes and an pre-built usb backend library 50 | (currently, libusb 0.1.x, libusb 1.x, and OpenUSB). 51 | """, 52 | classifiers=[ 53 | 'Development Status :: 5 - Production/Stable', 54 | 'Intended Audience :: Developers', 55 | 'Intended Audience :: Information Technology', 56 | 'Intended Audience :: Manufacturing', # USB automation, or mfg USB devs 57 | 'Intended Audience :: Science/Research', # interface with instruments 58 | 'Intended Audience :: System Administrators', # integrate strange devs 59 | 'Intended Audience :: Telecommunications Industry', # telecomm devs 60 | 'License :: OSI Approved :: BSD License', 61 | 'Natural Language :: English', 62 | # try to union the OSes that can build any of the backend libraries... 63 | 'Operating System :: MacOS :: MacOS X', 64 | 'Operating System :: Microsoft :: Windows :: Windows Vista', 65 | 'Operating System :: Microsoft :: Windows :: Windows 7', 66 | 'Operating System :: POSIX :: BSD :: FreeBSD', 67 | 'Operating System :: POSIX :: BSD :: NetBSD', 68 | 'Operating System :: POSIX :: BSD :: OpenBSD', 69 | 'Operating System :: POSIX :: Linux', 70 | 'Operating System :: POSIX :: SunOS/Solaris', 71 | 'Programming Language :: Python :: 2.4', 72 | 'Programming Language :: Python :: 2.5', 73 | 'Programming Language :: Python :: 2.6', 74 | 'Programming Language :: Python :: 2.7', 75 | 'Programming Language :: Python :: 3', 76 | # source(CPython,Jython,IronPython,PyPy): "The Long Term" section of 77 | # http://ojs.pythonpapers.org/index.php/tpp/article/viewFile/23/23 78 | 'Programming Language :: Python :: Implementation :: CPython', 79 | 'Programming Language :: Python :: Implementation :: IronPython', 80 | 'Programming Language :: Python :: Implementation :: Jython', 81 | 'Programming Language :: Python :: Implementation :: PyPy', 82 | 'Topic :: Scientific/Engineering :' \ 83 | ': Interface Engine/Protocol Translator', 84 | 'Topic :: Software Development :: Libraries', 85 | 'Topic :: Software Development :: Libraries :: Python Modules', 86 | 'Topic :: System :: Hardware :: Hardware Drivers' 87 | ] 88 | ) 89 | 90 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tests/devinfo.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Wander Lairson Costa 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | import usb.util 30 | 31 | ID_VENDOR = 0x04d8 32 | ID_PRODUCT = 0xfa2e 33 | 34 | # transfer interfaces 35 | INTF_BULK = 0 36 | INTF_INTR = 1 37 | INTF_ISO = 2 38 | 39 | # endpoints address 40 | EP_BULK = 1 41 | EP_INTR = 2 42 | EP_ISO = 3 43 | 44 | # test type 45 | TEST_NONE = 0 46 | TEST_PCREAD = 1 47 | TEST_PCWRITE = 2 48 | TEST_LOOP = 3 49 | 50 | # Vendor requests 51 | PICFW_SET_TEST = 0x0e 52 | PICFW_SET_TEST = 0x0f 53 | PICFW_SET_VENDOR_BUFFER = 0x10 54 | PICFW_GET_VENDOR_BUFFER = 0x11 55 | 56 | def set_test_type(t, dev = None): 57 | if dev is None: 58 | dev = usb.core.find(idVendor = ID_VENDOR, idProduct = ID_PRODUCT) 59 | 60 | bmRequestType = usb.util.build_request_type( 61 | usb.util.CTRL_OUT, 62 | usb.util.CTRL_TYPE_VENDOR, 63 | usb.util.CTRL_RECIPIENT_INTERFACE 64 | ) 65 | 66 | dev.ctrl_transfer( 67 | bmRequestType = bmRequestType, 68 | bRequest = PICFW_SET_TEST, 69 | wValue = t, 70 | wIndex = 0 71 | ) 72 | 73 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tests/test_find.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Wander Lairson Costa 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | import utils 30 | import usb.backend 31 | from usb.core import find 32 | from usb._debug import methodtrace 33 | import usb.util 34 | import unittest 35 | import devinfo 36 | 37 | class _DeviceDescriptor(object): 38 | def __init__(self, idVendor, idProduct): 39 | self.bLength = 18 40 | self.bDescriptorType = usb.util.DESC_TYPE_DEVICE 41 | self.bcdUSB = 0x0200 42 | self.idVendor = idVendor 43 | self.idProduct = idProduct 44 | self.bcdDevice = 0x0001 45 | self.iManufacturer = 0 46 | self.iProduct = 0 47 | self.iSerialNumber = 0 48 | self.bNumConfigurations = 0 49 | self.bMaxPacketSize0 = 64 50 | self.bDeviceClass = 0xff 51 | self.bDeviceSubClass = 0xff 52 | self.bDeviceProtocol = 0xff 53 | self.bus = 1 54 | self.address = 1 55 | self.port_number = None 56 | self.port_numbers = None 57 | self.speed = None 58 | 59 | # We are only interested in test usb.find() function, we don't need 60 | # to implement all IBackend stuff 61 | class _MyBackend(usb.backend.IBackend): 62 | def __init__(self): 63 | self.devices = [_DeviceDescriptor(devinfo.ID_VENDOR, p) for p in range(4)] 64 | def enumerate_devices(self): 65 | return range(len(self.devices)) 66 | def get_device_descriptor(self, dev): 67 | return self.devices[dev] 68 | 69 | class FindTest(unittest.TestCase): 70 | @methodtrace(utils.logger) 71 | def test_find(self): 72 | b = _MyBackend() 73 | self.assertEqual(find(backend=b, idVendor=1), None) 74 | self.assertNotEqual(find(backend=b, idProduct=1), None) 75 | self.assertEqual(len(tuple(find(find_all=True, backend=b))), len(b.devices)) 76 | self.assertEqual(len(tuple(find(find_all=True, backend=b, idProduct=1))), 1) 77 | self.assertEqual(len(tuple(find(find_all=True, backend=b, idVendor=1))), 0) 78 | 79 | self.assertEqual( 80 | len(tuple(find( 81 | find_all=True, 82 | backend=b, 83 | custom_match = lambda d: d.idProduct==1))), 84 | 1) 85 | 86 | self.assertEqual( 87 | len(tuple( 88 | find( 89 | find_all=True, 90 | backend=b, 91 | custom_match = lambda d: d.idVendor==devinfo.ID_VENDOR, 92 | idProduct=1))), 93 | 1) 94 | 95 | def get_suite(): 96 | suite = unittest.TestSuite() 97 | suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(FindTest)) 98 | return suite 99 | 100 | if __name__ == '__main__': 101 | utils.run_tests(get_suite()) 102 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tests/testall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2014 Wander Lairson Costa 4 | # 5 | # The following terms apply to all files associated 6 | # with the software unless explicitly disclaimed in individual files. 7 | # 8 | # The authors hereby grant permission to use, copy, modify, distribute, 9 | # and license this software and its documentation for any purpose, provided 10 | # that existing copyright notices are retained in all copies and that this 11 | # notice is included verbatim in any distributions. No written agreement, 12 | # license, or royalty fee is required for any of the authorized uses. 13 | # Modifications to this software may be copyrighted by their authors 14 | # and need not follow the licensing terms described here, provided that 15 | # the new terms are clearly indicated on the first page of each file where 16 | # they apply. 17 | # 18 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 19 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 20 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 21 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 22 | # POSSIBILITY OF SUCH DAMAGE. 23 | # 24 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 25 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 26 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 27 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 28 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 29 | # MODIFICATIONS. 30 | 31 | import utils 32 | import unittest 33 | import glob 34 | import os.path 35 | 36 | if __name__ == '__main__': 37 | suite = unittest.TestSuite() 38 | 39 | for i in glob.glob('*.py'): 40 | m = __import__(os.path.splitext(i)[0]) 41 | if hasattr(m, 'get_suite'): 42 | suite.addTest(m.get_suite()) 43 | 44 | utils.run_tests(suite) 45 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tools/decode-request-type: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | 4 | DIR_MASK = 0b10000000 5 | RECIPIENT_MASK = 0b00011111 6 | TYPE_MASK = 0b01100000 7 | 8 | direction_decode_table = {0x00:'out', 0x80:'in'} 9 | recipient_decode_table = ['device', 'interface', 'endpoint', 'other', 'reserved'] 10 | transfer_type_decode_table = ['standard', 'class', 'vendor', 'reserved'] 11 | 12 | if len(sys.argv) < 2: 13 | print ('Usage: decode-request-type ') 14 | sys.exit(1) 15 | 16 | request_type = int(sys.argv[1], 0) 17 | 18 | direction = request_type & DIR_MASK 19 | recipient = request_type & RECIPIENT_MASK 20 | transfer_type = (request_type & TYPE_MASK) >> 5 21 | 22 | if recipient > len(recipient_decode_table)-1: 23 | recipient = len(recipient_decode_table) - 1 24 | 25 | print ('direction=%s, type=%s, recipient=%s' % \ 26 | (direction_decode_table[direction], 27 | transfer_type_decode_table[transfer_type], 28 | recipient_decode_table[recipient])) 29 | 30 | 31 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tools/setup_testenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CTYPES_VERSION=1.0.2 4 | 5 | curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash 6 | . $HOME/.pythonz/etc/bashrc 7 | 8 | sudo apt-get install -y \ 9 | build-essential \ 10 | zlib1g-dev \ 11 | libbz2-dev \ 12 | libssl-dev \ 13 | libreadline-dev \ 14 | libncurses5-dev \ 15 | libsqlite3-dev \ 16 | libgdbm-dev \ 17 | libdb-dev \ 18 | libexpat-dev \ 19 | libpcap-dev \ 20 | liblzma-dev \ 21 | libpcre3-dev 22 | 23 | pythonz install 2.4.6 2.5.6 2.6.9 2.7.8 3.1.5 3.2.5 3.3.5 3.4.1 24 | 25 | cd /tmp 26 | wget https://dl.dropboxusercontent.com/u/20387324/ctypes-1.0.2.tar.gz 27 | 28 | tar -xzf ctypes-${CTYPES_VERSION}.tar.gz 29 | cd ctypes-${CTYPES_VERSION} 30 | $HOME/.pythonz/pythons/CPython-2.4.6/bin/python setup.py install 31 | cd - 32 | rm -rf ctypes* 33 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/tox.ini: -------------------------------------------------------------------------------- 1 | # Tox is broken with Python 2.4 2 | # setuptools is broken with Python 2.5 3 | # pythonz is broken with Python 3.0 4 | # Pip 1.5.4 (distributed with Ubuntu 14.04) is broken with Python 3.1 5 | [tox] 6 | envlist = py26,py27,py32,py33,py34 7 | 8 | [testenv] 9 | changedir=tests 10 | commands=python testall.py 11 | 12 | [testenv:py24] 13 | basepython = {homedir}/.pythonz/pythons/CPython-2.4.6/bin/python 14 | 15 | [testenv:py25] 16 | basepython = {homedir}/.pythonz/pythons/CPython-2.5.6/bin/python 17 | 18 | [testenv:py26] 19 | basepython = {homedir}/.pythonz/pythons/CPython-2.6.9/bin/python 20 | 21 | [testenv:py27] 22 | basepython = {homedir}/.pythonz/pythons/CPython-2.7.8/bin/python 23 | 24 | [testenv:py30] 25 | basepython = {homedir}/.pythonz/pythons/CPython-3.0.1/bin/python 26 | 27 | [testenv:py31] 28 | basepython = {homedir}/.pythonz/pythons/CPython-3.1.5/bin/python 29 | 30 | [testenv:py32] 31 | basepython = {homedir}/.pythonz/pythons/CPython-3.2.5/bin/python 32 | 33 | [testenv:py33] 34 | basepython = {homedir}/.pythonz/pythons/CPython-3.3.5/bin/python 35 | 36 | [testenv:py34] 37 | basepython = {homedir}/.pythonz/pythons/CPython-3.4.1/bin/python 38 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/usb/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Wander Lairson Costa 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | r"""PyUSB - Easy USB access in Python 30 | 31 | This package exports the following modules and subpackages: 32 | 33 | core - the main USB implementation 34 | legacy - the compatibility layer with 0.x version 35 | backend - the support for backend implementations. 36 | control - USB standard control requests. 37 | libloader - helper module for backend library loading. 38 | 39 | Since version 1.0, main PyUSB implementation lives in the 'usb.core' 40 | module. New applications are encouraged to use it. 41 | """ 42 | 43 | import logging 44 | import os 45 | 46 | __author__ = 'Wander Lairson Costa' 47 | 48 | # Use Semantic Versioning, http://semver.org/ 49 | version_info = (1, 0, 2) 50 | __version__ = '%d.%d.%d' % version_info 51 | 52 | __all__ = ['legacy', 'control', 'core', 'backend', 'util', 'libloader'] 53 | 54 | def _setup_log(): 55 | from usb import _debug 56 | logger = logging.getLogger('usb') 57 | debug_level = os.getenv('PYUSB_DEBUG') 58 | 59 | if debug_level is not None: 60 | _debug.enable_tracing(True) 61 | filename = os.getenv('PYUSB_LOG_FILENAME') 62 | 63 | LEVELS = {'debug': logging.DEBUG, 64 | 'info': logging.INFO, 65 | 'warning': logging.WARNING, 66 | 'error': logging.ERROR, 67 | 'critical': logging.CRITICAL} 68 | 69 | level = LEVELS.get(debug_level, logging.CRITICAL + 10) 70 | logger.setLevel(level = level) 71 | 72 | try: 73 | handler = logging.FileHandler(filename) 74 | except: 75 | handler = logging.StreamHandler() 76 | 77 | fmt = logging.Formatter('%(asctime)s %(levelname)s:%(name)s:%(message)s') 78 | handler.setFormatter(fmt) 79 | logger.addHandler(handler) 80 | else: 81 | class NullHandler(logging.Handler): 82 | def emit(self, record): 83 | pass 84 | 85 | # We set the log level to avoid delegation to the 86 | # parent log handler (if there is one). 87 | # Thanks to Chris Clark to pointing this out. 88 | logger.setLevel(logging.CRITICAL + 10) 89 | 90 | logger.addHandler(NullHandler()) 91 | 92 | 93 | _setup_log() 94 | 95 | # We import all 'legacy' module symbols to provide compatibility 96 | # with applications that use 0.x versions. 97 | from usb.legacy import * 98 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/usb/_debug.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Wander Lairson Costa 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | __author__ = 'Wander Lairson Costa' 30 | 31 | __all__ = ['methodtrace', 'functiontrace'] 32 | 33 | import logging 34 | import usb._interop as _interop 35 | 36 | _enable_tracing = False 37 | 38 | def enable_tracing(enable): 39 | global _enable_tracing 40 | _enable_tracing = enable 41 | 42 | def _trace_function_call(logger, fname, *args, **named_args): 43 | logger.debug( 44 | # TODO: check if 'f' is a method or a free function 45 | fname + '(' + \ 46 | ', '.join((str(val) for val in args)) + \ 47 | ', '.join((name + '=' + str(val) for name, val in named_args.items())) + ')' 48 | ) 49 | 50 | # decorator for methods calls tracing 51 | def methodtrace(logger): 52 | def decorator_logging(f): 53 | if not _enable_tracing: 54 | return f 55 | def do_trace(*args, **named_args): 56 | # this if is just a optimization to avoid unecessary string formatting 57 | if logging.DEBUG >= logger.getEffectiveLevel(): 58 | fn = type(args[0]).__name__ + '.' + f.__name__ 59 | _trace_function_call(logger, fn, *args[1:], **named_args) 60 | return f(*args, **named_args) 61 | _interop._update_wrapper(do_trace, f) 62 | return do_trace 63 | return decorator_logging 64 | 65 | # decorator for methods calls tracing 66 | def functiontrace(logger): 67 | def decorator_logging(f): 68 | if not _enable_tracing: 69 | return f 70 | def do_trace(*args, **named_args): 71 | # this if is just a optimization to avoid unecessary string formatting 72 | if logging.DEBUG >= logger.getEffectiveLevel(): 73 | _trace_function_call(logger, f.__name__, *args, **named_args) 74 | return f(*args, **named_args) 75 | _interop._update_wrapper(do_trace, f) 76 | return do_trace 77 | return decorator_logging 78 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/usb/_interop.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Wander Lairson Costa 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | # All the hacks necessary to assure compatibility across all 30 | # supported versions come here. 31 | # Please, note that there is one version check for each 32 | # hack we need to do, this makes maintenance easier... ^^ 33 | 34 | import sys 35 | import array 36 | 37 | __all__ = ['_reduce', '_set', '_next', '_update_wrapper'] 38 | 39 | # we support Python >= 2.4 40 | assert sys.hexversion >= 0x020400f0 41 | 42 | # On Python 3, reduce became a functools module function 43 | try: 44 | import functools 45 | _reduce = functools.reduce 46 | except (ImportError, AttributeError): 47 | _reduce = reduce 48 | 49 | # all, introduced in Python 2.5 50 | try: 51 | _all = all 52 | except NameError: 53 | _all = lambda iter_ : _reduce( lambda x, y: x and y, iter_, True ) 54 | 55 | # we only have the builtin set type since 2.5 version 56 | try: 57 | _set = set 58 | except NameError: 59 | import sets 60 | _set = sets.Set 61 | 62 | # On Python >= 2.6, we have the builtin next() function 63 | # On Python 2.5 and before, we have to call the iterator method next() 64 | def _next(iter): 65 | try: 66 | return next(iter) 67 | except NameError: 68 | return iter.next() 69 | 70 | # functools appeared in 2.5 71 | try: 72 | import functools 73 | _update_wrapper = functools.update_wrapper 74 | except (ImportError, AttributeError): 75 | def _update_wrapper(wrapper, wrapped): 76 | wrapper.__name__ = wrapped.__name__ 77 | wrapper.__module__ = wrapped.__module__ 78 | wrapper.__doc__ = wrapped.__doc__ 79 | wrapper.__dict__ = wrapped.__dict__ 80 | 81 | # this is used (as of May 2015) twice in core, once in backend/openusb, and in 82 | # some unit test code. It would probably be clearer if written in terms of some 83 | # definite 3.2+ API (bytearrays?) with a fallback provided for 2.4+. 84 | def as_array(data=None): 85 | if data is None: 86 | return array.array('B') 87 | 88 | if isinstance(data, array.array): 89 | return data 90 | 91 | try: 92 | return array.array('B', data) 93 | except TypeError: 94 | # When you pass a unicode string or a character sequence, 95 | # you get a TypeError if the first parameter does not match 96 | a = array.array('B') 97 | a.fromstring(data) # deprecated since 3.2 98 | return a 99 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/usb/_lookup.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2014 Walker Inman 2 | # 3 | # The following terms apply to all files associated 4 | # with the software unless explicitly disclaimed in individual files. 5 | # 6 | # The authors hereby grant permission to use, copy, modify, distribute, 7 | # and license this software and its documentation for any purpose, provided 8 | # that existing copyright notices are retained in all copies and that this 9 | # notice is included verbatim in any distributions. No written agreement, 10 | # license, or royalty fee is required for any of the authorized uses. 11 | # Modifications to this software may be copyrighted by their authors 12 | # and need not follow the licensing terms described here, provided that 13 | # the new terms are clearly indicated on the first page of each file where 14 | # they apply. 15 | # 16 | # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | # ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | # DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | # POSSIBILITY OF SUCH DAMAGE. 21 | # 22 | # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | # IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | # NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | # MODIFICATIONS. 28 | 29 | r"""usb._lookups - Lookup tables for USB 30 | """ 31 | 32 | descriptors = { 33 | 0x1 : "Device", 34 | 0x2 : "Configuration", 35 | 0x3 : "String", 36 | 0x4 : "Interface", 37 | 0x5 : "Endpoint", 38 | 0x6 : "Device qualifier", 39 | 0x7 : "Other speed configuration", 40 | 0x8 : "Interface power", 41 | 0x9 : "OTG", 42 | 0xA : "Debug", 43 | 0xB : "Interface association", 44 | 0xC : "Security", 45 | 0xD : "Key", 46 | 0xE : "Encryption type", 47 | 0xF : "Binary device object store (BOS)", 48 | 0x10 : "Device capability", 49 | 0x11 : "Wireless endpoint companion", 50 | 0x30 : "SuperSpeed endpoint companion", 51 | } 52 | 53 | device_classes = { 54 | 0x0 : "Specified at interface", 55 | 0x2 : "Communications Device", 56 | 0x9 : "Hub", 57 | 0xF : "Personal Healthcare Device", 58 | 0xDC : "Diagnostic Device", 59 | 0xE0 : "Wireless Controller", 60 | 0xEF : "Miscellaneous", 61 | 0xFF : "Vendor-specific", 62 | } 63 | 64 | interface_classes = { 65 | 0x0 : "Reserved", 66 | 0x1 : "Audio", 67 | 0x2 : "CDC Communication", 68 | 0x3 : "Human Interface Device", 69 | 0x5 : "Physical", 70 | 0x6 : "Image", 71 | 0x7 : "Printer", 72 | 0x8 : "Mass Storage", 73 | 0x9 : "Hub", 74 | 0xA : "CDC Data", 75 | 0xB : "Smart Card", 76 | 0xD : "Content Security", 77 | 0xE : "Video", 78 | 0xF : "Personal Healthcare", 79 | 0xDC : "Diagnostic Device", 80 | 0xE0 : "Wireless Controller", 81 | 0xEF : "Miscellaneous", 82 | 0xFE : "Application Specific", 83 | 0xFF : "Vendor Specific", 84 | } 85 | 86 | ep_attributes = { 87 | 0x0 : "Control", 88 | 0x1 : "Isochronous", 89 | 0x2 : "Bulk", 90 | 0x3 : "Interrupt", 91 | } 92 | 93 | MAX_POWER_UNITS_USB2p0 = 2 # mA 94 | MAX_POWER_UNITS_USB_SUPERSPEED = 8 # mA 95 | -------------------------------------------------------------------------------- /doc/walac-pyusb-7a1ce1e/walac-pyusb-v1.0.2-2-g7a1ce1e.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/doc/walac-pyusb-7a1ce1e/walac-pyusb-v1.0.2-2-g7a1ce1e.tar.gz -------------------------------------------------------------------------------- /hid-test/hid-test.factor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forthnutter/USB/fdac726647c904cb9eacc93ab826704b0c6268c4/hid-test/hid-test.factor -------------------------------------------------------------------------------- /linux/hid/hid.factor: -------------------------------------------------------------------------------- 1 | ! Copyright (C) 2011 Joseph Louis Moschini. 2 | ! See http://factorcode.org/license.txt for BSD license. 3 | 4 | USING: kernel alien alien.c-types alien.syntax alien.data alien.strings 5 | namespaces locals literals math math.parser prettyprint 6 | arrays classes.struct memory accessors semantic-versioning 7 | sequences byte-arrays tools.continuations libudev system-info.linux ; 8 | 9 | IN: usb.hid.linux 10 | 11 | TUPLE: hid-device handle blocking reports ; 12 | 13 | ! hidapi info structure 14 | TUPLE: hid_device_info path vendor_id product_id serial_number 15 | release_number manufacturer_string product_string usage_page 16 | usage interface_number *next ; 17 | 18 | ! #define LINUX_VERSION_CODE 200711 19 | ! #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 20 | SYMBOL: kernel_version ; 21 | 22 | 23 | : detect-kernel-version ( -- kv ) 24 | release split-version first 25 | first3 [ 16 shift ] 2dip [ 8 shift ] dip + + ; 26 | 27 | 28 | ! new hid device 29 | : ( -- hid-device ) 30 | hid_device new 31 | f >>handle 32 | t >>blocking 33 | 0 >>reports ; 34 | 35 | 36 | 37 | : hid_init ( -- ) 38 | detect_kernel_version kernel_ersion set 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /usb-test/.gitignore: -------------------------------------------------------------------------------- 1 | /usb-test.factor~ 2 | --------------------------------------------------------------------------------