Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-libusb Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:47:33 2022 GMT+0.
Next: Systems, Previous: The cl-libusb Reference Manual, Up: The cl-libusb Reference Manual [Contents][Index]
cl-libusb provides an easy interface to libusb-0.1. There are two systems/packages: libusb-ffi, which provides a (somewhat lispified) ffi to libusb-0.1, and cl-libusb, which provides an easier interface. Buffers are dealt with using unsigned byte static vectors. Converting existing software to use static vectors instead of foreign arrays should be straight-forward: 1. In your project, make sure to use static-vectors instead of antik and grid, 2. If you call USB-BULK-WRITE or USB-INTERRUPT-WRITE, make sure the buffer is a static vector instead of a foreign array: Instead of (GRID:MAKE-FOREIGN-ARRAY '(UNSIGNED-BYTE 8) :DIMENSIONS LENGTH) to make the array, use (STATIC-VECTORS:MAKE-STATIC-VECTOR LENGTH) and fill the array as if it is a normal common lisp array. After the call to -WRITE functions, make sure to use STATIC-VECTORS:FREE-STATIC-VECTOR to ensure the memory will be freed. 3. If you call USB-BULK-READ or USB-INTERRUPT-READ, be aware that the buffer is a static vector instead of a foreign array: The returned array can be simply be used as if it is a normal common lisp array for reading / parsing the output of the -READ functions. Make sure to use STATIC-VECTORS:FREE-STATIC-VECTOR to ensure that the associated memory will be freed. libusb-ffi (and thus cl-libusb) is not complete, but should be usable. Tested and found to work on: linux amd64 (sbcl) linux raspberry pi (sbcl-1.3.1-debian)
Next: Files, Previous: Introduction, Up: The cl-libusb Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Next: libusb-ffi, Previous: Systems, Up: Systems [Contents][Index]
Lispified bindings to libusb-0.1.
Sumant Oemrawsingh
Common Lisp FFI bindings to libusb-0.1.
Sumant Oemrawsingh
Next: Packages, Previous: Systems, Up: The cl-libusb Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: libusb-ffi/libusb-ffi.asd, Previous: Lisp, Up: Lisp [Contents][Index]
cl-libusb (system).
Next: cl-libusb/package.lisp, Previous: cl-libusb/cl-libusb.asd, Up: Lisp [Contents][Index]
libusb-ffi (system).
Next: cl-libusb/cl-libusb.lisp, Previous: libusb-ffi/libusb-ffi.asd, Up: Lisp [Contents][Index]
cl-libusb (system).
Next: libusb-ffi/package.lisp, Previous: cl-libusb/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
cl-libusb (system).
Next: libusb-ffi/libusb-grovel.lisp, Previous: cl-libusb/cl-libusb.lisp, Up: Lisp [Contents][Index]
libusb-ffi (system).
Next: libusb-ffi/libusb-ffi.lisp, Previous: libusb-ffi/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
libusb-ffi (system).
Previous: libusb-ffi/libusb-grovel.lisp, Up: Lisp [Contents][Index]
libusb-grovel.lisp (file).
libusb-ffi (system).
Next: Definitions, Previous: Files, Up: The cl-libusb Reference Manual [Contents][Index]
Packages are listed by definition order.
Previous: libusb-ffi, Up: Packages [Contents][Index]
common-lisp.
Next: Indexes, Previous: Packages, Up: The cl-libusb Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Classes, Previous: Public Interface, Up: Public Interface [Contents][Index]
Check if an endpoint is an in endpoint (and thus can be read from).
Check if an endpoint is and out endpoint (and thus can be written to).
Perform a bulk read request to the endpoint, which can be specified by its address or pointer to the endpoint. Returns the buffer of bytes read, which is a static vector with element type ’(unsigned-byte 8).
Read the given amount of bytes in a bulk transfer and return the buffer (a static vector).
Perform a bulk write request to the endpoint, which can alternatively be specified by its address. Buffer should be a static vector with element type ’(unsigned-byte 8). Returns number of bytes written.
Write data in the given buffer (a static vector) in a bulk transfer and return the amount of bytes actually written.
Claim the given interface for the handle. The interface can be specified by its setting, or its (integer) number.
Claim the given interface for the handle. The interface can be specified by its setting, or its (integer) number.
Clear the halt status on the specified endpoint. The endpoint can also be specified by its address.
Clear the halt flag on the given endpoint of the device.
Close a usb device by the pointer to its handle.
Close a usb device. If a device is already closed, do nothing.
Returns all the interfaces from the given configuration.
Returns the configuration value of the given configuration.
Returns the device descriptor for the given device.
Returns the endpoint’s address.
Return a list of busses.
Returns a configuration which has the given configuration value.
Returns a list of usb configurations for the given device.
Returns a list of all usb devices. Optionally, a bus or list of busses can also be specified, to confine the results to devices on those busses.
Returns a list of all devices with the given vendor id and product
id. If any of the arguments is NIL, then the device id can match any
value. Thus (usb-get-devices-by-ids nil nil) is equivalent
to (usb-get-devices).
Return a list of devices that match the given vendor id and product id. If either is NIL, that parameter is not used as a filter. Thus if both are NIL, a list containing all devices is returned.
Returns the name of the driver currently assigned to this device.
Returns the product id of the device.
Return the product id of the device.
Returns the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. If language id is nil (the default), returns the string descriptor specified by index in the first language for the descriptor and converts it into C style ASCII. Returns the number of bytes returned.
Return the string associated with the given index or symbol. If no language id is given, a simple ascii string is returned, else the string with the given language id is returned. The allowed symbols are :manufacturer, :product or :serial-number. If the device was not open, it is opened to obtain the string and then closed again.
Returns the string index associated with the given symbol. This symbol can be :MANUFACTURER, :PRODUCT or :SERIAL-NUMBER.
Returns the vendor id of the device.
Return the vendor id of the device.
Returns all the possible settings from a given interface.
Return the alternate interface setting value for the given setting.
Return a list of endpoints for the given interface setting.
Return the interface number for the given interface setting.
Perform an interrupt read request to the endpoint, which can be specified by its address or pointer to the endpoint. Returns the buffer of bytes read, which is a static vector with element type ’(unsigned-byte 8).
Read the given amount of bytes in an interrupt transfer and return the buffer (a static vector).
Perform an interrupt write request to the endpoint, which can alternatively be specified by its address. Buffer should be a static vector with element type ’(unsigned-byte 8). Returns number of bytes written.
Write data in the given buffer (a static vector) in an interrupt transfer and return the amount of bytes actually written.
Open a usb device and return a pointer to the handle to be used for communications.
Open a usb device. If the device is already open, do nothing.
Predicate to see if a device has been opened.
Release the given interface for the handle. The interface can be specified by its setting, or its (integer) number.
Release the given interface for the handle. The interface can be specified by its setting, or its (integer) number.
Resets the specified device by sending a RESET down the port it is connected to. Note that this causes re-enumeration: After calling usb-reset, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call usb-reset will no longer work.
Set the alternate interface setting to that of the given setting. The alternate interface setting can be specified by setting, or by its (integer) value.
Set the given configuration for the handle. The configuration can be specified also by its (integer) value.
Set the given configuration for the handle. The configuration can be specified also by its (integer) value.
Set up the device by using the first found configuration, interface and settings.
Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
Boolean indicating if libusb has been initialized.
Next: Generic functions, Previous: Special variables, Up: Internals [Contents][Index]
Make sure the libusb library is initialised and all busses and devices are found.
Returns the endpoint’s type. This can be :control, :isosynchronous, :bulk or :interrupt.
Find all of the busses on the system. Returns the number of changes, which specifies the total of new busses and busses removed since previous call to this function.
Find all of the devices on each bus. This should be called after usb-find-busses. Returns the number of changes, which specifies the total of new devices and devices removed since the previous call to this function.
Returns the current configuration value, or -1 if no configuration is set.
Returns a list of all devices in the given bus.
Initialize the libusb library. It’s not necessary to call this directly, since other (Lisp) functions will do so if required.
Rebuild the finalization list for the given USB device.
Set the alternate interface setting to that of the given setting. The alternate interface setting can be specified by setting, or by its (integer) value.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
automatically generated reader method
automatically generated reader method
Previous: Definitions, Up: The cl-libusb Reference Manual [Contents][Index]
Jump to: | E F G M R U |
---|
Jump to: | E F G M R U |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
C D H S T |
---|
Jump to: | *
C D H S T |
---|
Jump to: | C F L P S U |
---|
Jump to: | C F L P S U |
---|