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

From WikiTI
Jump to: navigation, search
(Available Functions: reorder and add kbd)
Line 12: Line 12:
 
== Available Functions ==
 
== Available Functions ==
 
{| border="1" cellpadding="2"  cellspacing="0"  
 
{| border="1" cellpadding="2"  cellspacing="0"  
 +
|-
 +
|[[/ExportVariable|ExportVariable]] || Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file
 
|-
 
|-
 
|[[/GetClass|GetClass]] || Gets class, subclass, and protocol information from device
 
|[[/GetClass|GetClass]] || Gets class, subclass, and protocol information from device
 
|-
 
|-
 
|[[/GetIDs|GetIDs]] || Gets product and vendor IDs from device
 
|[[/GetIDs|GetIDs]] || Gets product and vendor IDs from device
 +
|-
 +
|[[/ImportVariable|ImportVariable]] || Import 8x* file in specified directory from connected USB flash drive as calculator variable in RAM/Flash
 
|-
 
|-
 
|[[/IsDeviceConnected|IsDeviceConnected]] || Checks if a device is connected
 
|[[/IsDeviceConnected|IsDeviceConnected]] || Checks if a device is connected
 +
|-
 +
|[[/KBDGetKey|KBDGetKey]] || Get a key press from the keyboard
 +
|-
 +
|[[/KBDInit|KBDInit]] || Initialize the keyboard driver
 
|-
 
|-
 
|[[/KillUSB|KillUSB]] || Uninitializes both USB device and usb8x driver
 
|[[/KillUSB|KillUSB]] || Uninitializes both USB device and usb8x driver
Line 24: Line 32:
 
|-
 
|-
 
|[[/MouseInit|MouseInit]] || Initializes mouse driver
 
|[[/MouseInit|MouseInit]] || Initializes mouse driver
|-
 
|[[/Version|Version]] || Gets usb8x version information
 
 
|-
 
|-
 
|[[/MSDInit|MSDInit]] || Initialize USB mass storage driver
 
|[[/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
+
|[[/Version|Version]] || Gets usb8x version information
|-
+
|[[/ExportVariable|ExportVariable]] || Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file
+
 
|}
 
|}

Revision as of 12:07, 27 August 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.

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

ExportVariable Export calculator variable in RAM/Flash to connected USB flash drive in specified directory as 8x* file
GetClass Gets class, subclass, and protocol information from device
GetIDs Gets product and vendor IDs from device
ImportVariable Import 8x* file in specified directory from connected USB flash drive as calculator variable in RAM/Flash
IsDeviceConnected Checks if a device is connected
KBDGetKey Get a key press from the keyboard
KBDInit Initialize the keyboard driver
KillUSB Uninitializes both USB device and usb8x driver
MouseDo Get mouse movement/button information
MouseInit Initializes mouse driver
MSDInit Initialize USB mass storage driver
Version Gets usb8x version information