Difference between revisions of "83Plus:Software:usb8x/BASIC Interface"

From WikiTI
Jump to: navigation, search
(No difference)

Revision as of 09:06, 16 July 2006

The OpenLib( and ExecLib commands can be used to access usb8x functions from BASIC programs. Input and output is passed through a list in the Ans variable. On input, the first element of the list holds the function number of the command to execute and the remaining elements hold input values. On output, the first element holds the success/error status (where 0 is success) and the remaining elements may hold output data values. See the information page on individual functions to determine its function number and input/output values.

Example code to quit unless a USB device is connected:

OpenLib(USBDRV8X
{0
ExecLib
If not(Ans(2
Return

Available Functions

GetClass Gets class, subclass, and protocol information from device
GetIDs Gets product and vendor IDs from device
IsDeviceConnected Checks if a device is connected
KillUSB Uninitializes both USB device and usb8x driver
MouseDo Get mouse movement/button information
MouseInit Initializes mouse driver
Version Gets usb8x version information