Difference between revisions of "83Plus:Software:usb8x/Asm Interface"
m (U_CALL_INIT carry) |
m (Link target was wrong) |
||
(20 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
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: | 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 | U_CALL_INIT CallBackRoutine | ||
− | Where CallBackRoutine is a subroutine that will be called when data arrives on the USB port. If U_CALL_INIT returns carry, usb8x is not loaded on the calculator. | + | Where CallBackRoutine is a subroutine that will be called when data arrives on the USB port. Some internal drivers override the user supplied callback address, but you must still provide one. 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. | + | 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 [[83Plus:Software:usb8x/Asm_Interface/DriverInit|DriverInit]] as most other entry points require the driver be initialized before use. '''Be sure to call [[83Plus:Software:usb8x/Asm_Interface/HostKill|HostKill]] and [[83Plus:Software:usb8x/Asm_Interface/DriverKill|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. | ||
− | |||
{| border="1" cellpadding="2" cellspacing="0" | {| border="1" cellpadding="2" cellspacing="0" | ||
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/MSD|Mass Storage]] || Communicate with flash drives, hard drives, and other devices conforming to the USB MSD standard. |
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/Mouse|Mouse]] || Communicate with mice and other pointing devices conforming to the USB HID mouse standard. | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/KBD|Keyboard]] || Communicate with keyboards comforming to the USB HID keyboard standard. | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/Silver|SilverLink]] || Use the TI-Graphlink SilverLink to communicate with another calculator. | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/Pad|GamePad]] || Communicate with compatible gamepad controllers. | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/Vernier|Vernier]] || Communicate with [http://www.vernier.com/easy/easytemp.html EasyTemp] or other Vernier devices. | ||
+ | |} | ||
+ | |||
+ | ==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. | ||
+ | {| border="1" cellpadding="2" cellspacing="0" | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/DriverInit|DriverInit]] || Initialize the USB driver | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/DriverKill|DriverKill]] || Uninitialize the USB driver | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/GetErrorCode|GetErrorCode]] || Returns the current error and sub-error codes | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/GetVersion|GetVersion]] || Returns the current driver version | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/HostKill|HostKill]] || Uninitialize a USB device | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/IsDeviceConnected|IsDeviceConnected]] || Tests if a device is connected to the USB port | ||
+ | |- | ||
+ | |[[83Plus:Software:usb8x/Asm_Interface/WaitTimerB|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. | ||
+ | {| border="1" cellpadding="2" cellspacing="0" | ||
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/AutoSetup|AutoSetup]] || Automatically sets up USB device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/ConfigureDevice|ConfigureDevice]] || Chooses a device configuration |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/FindDescriptor|FindDescriptor]] || Finds a specific descriptor in a list |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/FindPipe|FindPipe]] || Finds a pipe matching characteristics |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/GetClass|GetClass]] || Returns the class and subclass for the current device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/GetIDs|GetIDs]] || Returns product and vender IDs for current device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/HostInit|HostInit]] || Initialize a USB device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/InternalInfo|InternalInfo]] || Returns current internal usb8x settings |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/LogCustom|LogCustom]] || Adds an entry to current log file |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/PipeInfo|PipeInfo]] || Gets direction, type, and packet size for a pipe |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/Pump|Pump]] || Should be called periodically when pump mode is on to poll USB port |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/PumpOff|PumpOff]] || Turns off pump mode |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/PumpOn|PumpOn]] || Turns on pump mode so that usb8x can be used with TIOS interrupt disabled |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/ReadDescriptor|ReadDescriptor]] || Reads a descriptor from the device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/ReqData|ReqData]] || Request data from an incoming pipe |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/SendControlData|SendControlData]] || Sends data to the control pipe |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/SendControlDataOut|SendControlDataOut]] || Sends data to the control pipe with an out data stage |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/SendData|SendData]] || Send data to the device |
|- | |- | ||
− | |[[/ | + | |[[83Plus:Software:usb8x/Asm_Interface/SetCallBack|SetCallBack]] || Sets the current callback routine |
|- | |- | ||
− | |[[/SetupInPipe|SetupInPipe]] || Sets up an incoming pipe | + | |[[83Plus:Software:usb8x/Asm_Interface/SetupInPipe|SetupInPipe]] || Sets up an incoming pipe |
|- | |- | ||
− | |[[/SetupLog|SetupLog]] || Starts logger | + | |[[83Plus:Software:usb8x/Asm_Interface/SetupLog|SetupLog]] || Starts logger |
|- | |- | ||
− | |[[/SetupOutPipe|SetupOutPipe]] || Sets up an outgoing pipe | + | |[[83Plus:Software:usb8x/Asm_Interface/SetupOutPipe|SetupOutPipe]] || Sets up an outgoing pipe |
|- | |- | ||
− | |[[/StopLog|StopLog]] || Stops logger | + | |[[83Plus:Software:usb8x/Asm_Interface/StopLog|StopLog]] || Stops logger |
|- | |- | ||
− | |[[/WaitTimerB|WaitTimerB]] || Precise delay | + | |[[83Plus:Software:usb8x/Asm_Interface/WaitTimerB|WaitTimerB]] || Precise delay |
|} | |} |
Latest revision as of 10:49, 17 January 2010
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. Some internal drivers override the user supplied callback address, but you must still provide one. 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. |
GamePad | Communicate with compatible gamepad controllers. |
Vernier | Communicate with EasyTemp or other Vernier devices. |
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 |
GetErrorCode | Returns the current error and sub-error codes |
GetVersion | Returns the current driver version |
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 |
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 |
HostInit | Initialize a USB device |
InternalInfo | Returns current internal usb8x settings |
LogCustom | Adds an entry to current log file |
PipeInfo | Gets direction, type, and packet size for a pipe |
Pump | Should be called periodically when pump mode is on to poll USB port |
PumpOff | Turns off pump mode |
PumpOn | Turns on pump mode so that usb8x can be used with TIOS interrupt disabled |
ReadDescriptor | Reads a descriptor from the device |
ReqData | Request data from an incoming pipe |
SendControlData | Sends data to the control pipe |
SendControlDataOut | Sends data to the control pipe with an out data stage |
SendData | Send data to the device |
SetCallBack | Sets the current callback routine |
SetupInPipe | Sets up an incoming pipe |
SetupLog | Starts logger |
SetupOutPipe | Sets up an outgoing pipe |
StopLog | Stops logger |
WaitTimerB | Precise delay |