Hi! Am Montag, den 15.06.2009, 09:44 +0200 schrieb fpcl...@silvermono.co.za: > Hi guys, > > I'm interested in exploring the USB interface from within Linux using FPC. > I have looked at libusb and am aware of the functionality which it exposes. > > I would appreciate it if someone with USB programming experience could help > by > pointing me to a website or documentation that reveals a bit more than just > iterating through connected devices on a USB bus. A code snippet or two would > be most helpful. > > While I am aware that specific device drivers are required in order to access > specific USB devices, code samples demonstrating reading and writing to and > from a file system on USB stick would be most welcome.
As Henry already pointed out, file system (and block device) access of USB mass storage devices is already there in the Linux kernel. For other kinds of devices, especially where the Linux kernel has no built in drivers, you can use libusb. Some time ago I did header translations for it. I'll attach it (libusb.pas) plus some utilities and a class wrapper (usbutil.pas), firmware download to Cypress EZ-USB AN2131 (and related) chips (ezusb.pas), intel hex file reader (intelhex.pas), and some generic utilities (utils.pas) used by the other units. As an example of a device driver for a simple device I built, I'll attach accudraindev.pas. Unfortunately it's rather uncommented, sorry. @FPC team: Are you interested in including the libusb header translations (and possibly the other stuff) to FPC rtl? Bye Hansi
usb.tar.gz
Description: application/compressed-tar
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal