Difference between revisions of "83Plus:Software:usb8x/BASIC Interface"
m (→Available Functions: Sorted the functions by command number instead of by name.) |
(links work!) |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
{| border="1" cellpadding="2" cellspacing="0" | {| border="1" cellpadding="2" cellspacing="0" | ||
|- | |- | ||
− | |[[/IsDeviceConnected|IsDeviceConnected]] || Checks if a device is connected | + | |0 || [[83Plus:Software:usb8x/BASIC_Interface/IsDeviceConnected|IsDeviceConnected]] || Checks if a device is connected |
|- | |- | ||
− | |[[/KillUSB|KillUSB]] || Uninitializes both USB device and usb8x driver | + | |1 || [[83Plus:Software:usb8x/BASIC_Interface/KillUSB|KillUSB]] || Uninitializes both USB device and usb8x driver |
|- | |- | ||
− | |[[/MouseInit|MouseInit]] || Initializes mouse driver | + | |2 || [[83Plus:Software:usb8x/BASIC_Interface/MouseInit|MouseInit]] || Initializes mouse driver |
|- | |- | ||
− | |[[/MouseDo|MouseDo]] || Get mouse movement/button information | + | |3 || [[83Plus:Software:usb8x/BASIC_Interface/MouseDo|MouseDo]] || Get mouse movement/button information |
|- | |- | ||
− | |[[/GetClass|GetClass]] || Gets class, subclass, and protocol information from device | + | |4 || [[83Plus:Software:usb8x/BASIC_Interface/GetClass|GetClass]] || Gets class, subclass, and protocol information from device |
|- | |- | ||
− | |[[/GetIDs|GetIDs]] || Gets product and vendor IDs from device | + | |5 || [[83Plus:Software:usb8x/BASIC_Interface/GetIDs|GetIDs]] || Gets product and vendor IDs from device |
|- | |- | ||
− | |[[/Version|Version]] || Gets usb8x version information | + | |6 || [[83Plus:Software:usb8x/BASIC_Interface/Version|Version]] || Gets usb8x version information |
|- | |- | ||
− | |[[/MSDInit|MSDInit]] || Initialize USB mass storage driver | + | |7 || [[83Plus:Software:usb8x/BASIC_Interface/MSDInit|MSDInit]] || Initialize USB mass storage driver |
|- | |- | ||
− | |[[/ImportVariable|ImportVariable]] || Import 8x* file in specified directory from connected USB flash drive as calculator variable in RAM/Flash | + | |8 || [[83Plus:Software:usb8x/BASIC_Interface/ImportVariable|ImportVariable]] || Import 8x* file in specified directory from connected USB flash drive as calculator variable in RAM/Flash |
|- | |- | ||
− | |[[/ExportVariable|ExportVariable]] || Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file | + | |9 || [[83Plus:Software:usb8x/BASIC_Interface/ExportVariable|ExportVariable]] || Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file |
|- | |- | ||
− | |[[/KBDInit|KBDInit]] || Initialize the keyboard driver | + | |10 || [[83Plus:Software:usb8x/BASIC_Interface/KBDInit|KBDInit]] || Initialize the keyboard driver |
|- | |- | ||
− | |[[/KBDGetKey|KBDGetKey]] || Get a key press from the keyboard | + | |11 || [[83Plus:Software:usb8x/BASIC_Interface/KBDGetKey|KBDGetKey]] || Get a key press from the keyboard |
|- | |- | ||
− | |[[/HostInit|HostInit]] || Initialize USB device only (for power-only devices) | + | |12 || [[83Plus:Software:usb8x/BASIC_Interface/HostInit|HostInit]] || Initialize USB device only (for power-only devices) |
|} | |} |
Latest revision as of 10:52, 9 November 2009
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.
Note: Versions of usb8x prior to 0.10 require that the input list be seven elements long. Elements that are not part of the defined input are ignored.
Example code to quit unless a USB device is connected:
OpenLib(USBDRV8X {0 ExecLib If not(Ans(2 Return
Available Functions
0 | IsDeviceConnected | Checks if a device is connected |
1 | KillUSB | Uninitializes both USB device and usb8x driver |
2 | MouseInit | Initializes mouse driver |
3 | MouseDo | Get mouse movement/button information |
4 | GetClass | Gets class, subclass, and protocol information from device |
5 | GetIDs | Gets product and vendor IDs from device |
6 | Version | Gets usb8x version information |
7 | MSDInit | Initialize USB mass storage driver |
8 | ImportVariable | Import 8x* file in specified directory from connected USB flash drive as calculator variable in RAM/Flash |
9 | ExportVariable | Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file |
10 | KBDInit | Initialize the keyboard driver |
11 | KBDGetKey | Get a key press from the keyboard |
12 | HostInit | Initialize USB device only (for power-only devices) |