83Plus:Software:usb8x/Asm Interface

From WikiTI
Revision as of 08:07, 27 August 2006 by Dan Englender (Talk | contribs)

Jump to: navigation, search

Many usb8x functions can be used by other programs/applications through usb8x's assembly language U_CALL interface. Macros are provded in usb8x.inc to simplify the process. The macros require a 32-byte RAM buffer defined as USBDriverCall. The U_CALL system must be initialized by the application as follows:

U_CALL_INIT CallBackRoutine

Where CallBackRoutine is a subroutine that will be called when data arrives on the USB port. If you are using an internal driver, the driver may override the callback address; you must still provide a CallBackRoutine address, but the contents of the routine are irrelevant. If U_CALL_INIT returns carry, usb8x is not loaded on the calculator.


After the U_CALL system has been initialized with U_CALL_INIT, use the U_CALL macro to call usb8x entry points. The first entry point you should call is DriverInit as most other entry points require the driver be initialized before use. Be sure to call HostKill and DriverKill before quitting your program.

Internal Drivers

Several drivers are provided by usb8x to control specific devices. If you are interested in using usb8x in a game or program (as opposed to writing a driver for a new device), the pages below document the entry points you are most likely interested in.

Mass Storage Communicate with flash drives, hard drives, and other devices conforming to the USB MSD standard.
Mouse Communicate with mice and other pointing devices conforming to the USB HID mouse standard.
Keyboard Communicate with keyboards comforming to the USB HID keyboard standard.
SilverLink Use the TI-Graphlink SilverLink to communicate with another calculator.

High Level Entry Points

The following entry points may be useful for any program using usb8x, whether it be using an internal driver or low level entry points to create a new driver.

DriverInit Initialize the USB driver
DriverKill Uninitialize the USB driver
HostKill Uninitialize a USB device
IsDeviceConnected Tests if a device is connected to the USB port
WaitTimerB Precise delay


Low Level Entry Points

These are the entry points you're most likely interested in using if you want to create a device driver for a new device.

AutoSetup Automatically sets up USB device
ConfigureDevice Chooses a device configuration
DriverInit Initialize the USB driver
DriverKill Uninitialize the USB driver
FindDescriptor Finds a specific descriptor in a list
FindPipe Finds a pipe matching characteristics
GetClass Returns the class and subclass for the current device
GetIDs Returns product and vender IDs for current device
GetVersion Returns the current driver version
HostInit Initialize a USB device
HostKill Uninitialize a USB device
IsDeviceConnected Tests if a device is connected to the USB port
LogCustom Adds an entry to current log file
PipeInfo Gets direction, type, and packet size for a pipe
ReadDescriptor Reads a descriptor from the device
ReqData Request data from an incoming pipe
SendControlData Sends data to the control pipe
SendData Send data to the device
SetupInPipe Sets up an incoming pipe
SetupLog Starts logger
SetupOutPipe Sets up an outgoing pipe
StopLog Stops logger
WaitTimerB Precise delay