usb8x 0.12 - USB host driver on the TI-84 Plus January 7th, 2007 Homepage - http://usb8x.sourceforge.net Documentation - http://usb8x.denglend.net 0) BETA 1) Intro 2) Documentation 3) Credits 4) Version History 5) License 0) BETA -------------------------------------------------- This is a beta release of this software. There may be bugs and it may crash your calculator. We (the usb8x developers) take no responsibilty for anything bad that happens from use of this software. 1) INTRO -------------------------------------------------- usb8x is a free, open source application for the TI-84 Plus calculators. It combines a low level driver to support the calculator's USB port with a limited selection of device drivers. It is designed with two goals in mind: First, to allow programmers to create external applications/programs that use USB devices without any knowledge of the low-level workings of those devices or the USB port itself. Second, to allow programmers to create additional drivers for other USB hardware not currently supported natively in usb8x. 2) DOCUMENTATION -------------------------------------------------- Up to date documentation on usb8x is available at: http://usb8x.denglend.net 3) CREDITS -------------------------------------------------- usb8x v0.12 Portions (c) Dan Englender, Brandon Wilson, Michael Vincent Released: January 7th, 2007 Thanks: Olivier Armand - His collaboration was vital to figuring out some secrets of the USB port Google - Their Summer of Code grant allowed me to spend my summer working on such a fun project Andree Chea - Making the website not suck 4) VERSION HISTORY -------------------------------------------------- ;Version 0.12 - January 7th, 2007 ; Fixed bug in ReadDescriptor which crashed on errors when reading string descriptors ; Fixed bug in DOS_fileWrite which incorrectly resized some files when writing ; Fixed bug in DOS_renameFileEntry involving off-by-one LBA problem ; Interrupt now signals to SendControlData (and anything else that waits on port 82) that port 82 reported ; success. This fixes a bug with control requests that timed out if the device did not respond immediately. ; Added driver to control Vernier Easy and Go! products, in particular Go/EasyTemp ; DOS_fileWrite should be faster ; Improved MSD driver support ; Added pump entry points to allow use of usb8x without interrupts ; Added caching code ; Experimental FAT12/FAT32 MSD code added and is conditional ; Individual drivers can be compiled out via settings ; Hub code now works. AutoSetup will pass through to the first non-hub device it finds on the bus. ;Entry Points Added: ; Asm - VernierVersion - Get version and RAM requirements of vernier driver ; Asm - EasyTempInit - Initialize driver and Go/EasyTemp device ; Asm - VernierSendCmd - Send a command block to a vernier device ; Asm - VernierQuickCmd - Send a simple command to a vernier device ; Asm - VernierGetMeas - Get the latest measurement returned by vernier device ; Asm - VernierToDegree - Convert voltage to degree ; Asm - DOS_updateAttributes - update "last modified" date/time and other attributes ; Asm - PumpOn - Turns on pump (disables usb hook stuff) ; Asm - PumpOff - Turns off pump (enables usb hook stuff) ; Asm - Pump - Pump (emulates interrupt. call in your main loop) ; Asm - CacheOn - Turn on MSD caching ; Asm - CacheOff - Turn off MSD caching ; Asm - msdDetect - Mass storage version of ionDetect to search for and load 83P/8XP levels from specified directory ; BASIC - USBInit - initializes and supplies power to USB port (useful for power-only devices like USB lights) 0.11 - September 10th, 2006 - INPUTS TO MOUSE DRIVER CHANGED - Logging support is disabled by default - Removed USBInfo and demos - Callback is now driver-wide instead of a per-pipe . This means SetupInPipe no longer takes callback as input - Converted remaining routines to restore interrupts to original state instead of di/ei - Added keyboard, silverlink, and gamepad drivers - Removed lots of old code that wasn't being used anymore - Mouse (and kbd) driver can now passthrough callbacks to user program - DISAVE/EIRESTORE now compile time option because it was (maybe?) causing trouble - MSD callback saves/restores ix - Restructured interrupt to allow for logging - Added compile time option to turn on/off logging for individual log entry types - Added assertion macros/compile-time option - Added compile time option for assertion-checking IM2 interrupt - Entry points can now have IX inputs - DriverInit checks base code version for 2.30+ - Driver routines now kill host device if driver init fails -Entry Points Added: - Asm - KBDInit - Initialize keyboard driver - Asm - KBDGetKey - Get keypress from keyboard - Asm - KBDGetMods - Get modifier/lock key status - Asm - KBDCheckDirect - Check current keyboard matrix status - Asm - SilverInit - Initialize silverlink - Asm - SilverSend - Send data on silverlink - Asm - SetCallBack - Sets the callback address - Asm - PadInit - Initialize gamepad driver - Asm - PadSetup - Get a key mapping - Asm - PadStart - Start passing pad information to the callback function - Asm - GetErrorCode - Get the current error code - Asm - SendControlDataOut - Send a control command that includes outbound data stage - BASIC - KBDInit - BASIC - KBDGetKey -Known bugs: - Interrupts may be getting disabled at some point. Use ei in mousegetkey and kbdgetkey loops. - AutoSetup may leave device in various states of initialization on error instead of killing it. - Some drivers don't seem to work as well (at all?) on boot code 1.00 -To Do: - Add Silver BASIC entry points - Add option to KBDInit to set up something (cursor hook?) to implement key repeat 0.10 - unreleased - Input list to BASIC library no longer required to be 7 elements long - KillUSB BASIC entry point now disables driver as well killing the device - ExecLib now returns error via list rather than system error on non-existant entry point -Other: - BASIC entry points now require 42 bytes of free RAM to execute -Entry Points Added: - BASIC - GetIDs - BASIC - GetClass - BASIC - Version - BASIC - MSDInit - Initializes mass storage driver - BASIC - MSD_ImportVariable - Imports *.8x* file from specified directory and stores as variable in RAM/Flash - BASIC - MSD_ExportVariable - Exports variable in RAM/Flash to specified directory as *.8x* file - Asm - KBDVersion - Returns version/memory needed for kbd driver - MSD - MSDVersion - Returns major/minor version and memory requirements of mass storage driver - MSD - MSD_Initialize - Initializes mass storage device - MSD - UFI_Initialize - Initializes mass storage device for sector read/write operations - MSD - UFI_Read - Reads one sector of LBA address into sector buffer - MSD - UFI_Write - Writes one sector of data from sector buffer to LBA address - MSD - FAT_Initialize - Initializes mass storage device for FAT16 file system operations - MSD - FAT_lookupPath - Sees if a file in specified folder exists - MSD - DOS_openFile - Open file in specified folder for reading/writing by populating file handle (memory buffer) - MSD - DOS_fileSeek - Adjusts seek pointer in specified file handle - MSD - DOS_fileRead - Reads bytes from a file at current seek pointer - MSD - DOS_fileWrite - Writes bytes to a file at current seek pointer, increasing file size if necessary - MSD - DOS_createFile - Creates new, empty file in specified directory - MSD - DOS_createDirectory - Creates new, empty directory in specified directory - MSD - DOS_deleteFileEntry - Deletes file or folder, recursing through files/folders inside as necessary - MSD - DOS_countFilesInDir - Returns number of file/folder entries in specified directory - MSD - DOS_getNextFile - Gets next file in list from a specified directory - MSD - FAT_getStartingCluster - Gets starting cluster of specified directory (necessary input for some routines) - MSD - MSD_ImportVariable - Imports *.8x* file from specified directory and stores as variable in RAM/Flash - MSD - MSD_ExportVariable - Exports variable in RAM/Flash to specified directory as *.8x* file - MSD - DOS_getFileSize - Gets file size from specified directory entry - MSD - DOS_getDirEntry - Gets directory entry for specified file/directory 0.09 - July 2nd, 2006 - Changed descriptor equates and added more for other descriptor types - Added logging and log viewer - Added code to load HID report descriptor - Added SendDataPart entry point. Hopefuly temporarily - Added hub related stuff: - SetAddress now sets next available address instead of constant address - Added SetHubFeature and ClearHubFeature calls - Added SetHubPortFeature and ClearHubPortFeature calls - Added GetHubStatus and GetHubPortStatus calls - Added appropriate desc and log equates - Added prelim hub demo code (doesn't work) - Added prelim calc-calc code (doesn't work) - Sporadic crashes on exit from app. Cause? - GetPipeInfo can now return both pipeIn and pipeOut - MSD demo now autodetects correct output pipe - Added FindPipe entry point to return the address of a pipe based on characterisitics - DriverInit now returns error if OS version isn't high enough -Bugs fixed: - Fixed bug with logging (otir replacement crashed on odd sizes) - Devices with I and O endpoints at same addr should work - Minor fix to U_CALL system (allows multipage apps) - Added a LogCustom entry point to allow apps to make entries in the log file -Other: - Added errDemo and errFindPipe - Added pipeBitIn and pipeBitOut equates - Renamed usbInt and usbBulk to pipeInt and pipeBulk - Created usb8xtsm.inc include file in TASM compatible syntax -Known bugs: - Interrupts are getting disabled at some point. Requires ei in mousegetkey loop. - USBInfo interface has some bugs. 0.08 - July 18, 2005 -Graphlink code now checks to make sure a graphlink is connected -Fixed a bug in GetIDs -Any call using ReadDescriptor (e.g. GetIDs and GetClass) will now work after AutoSetup however, don't use any of these calls inside of an interrupt. -Added preliminary mouse driver -Added di/ei to SendControlData as well (so don't use in int) -Reworked menu scheme because there's flash test code now. -SendControlData now takes argument for how much data to recieve in response -Callback routine can now be passed cbStall or cbNak -Fixed stupid bug in SendData -Exposed WaitTimerB entry point -Added GetPipeInfo entry point and test code to info section -Lowered mouse movement threshold to fifteen ticks/pixel 0.07 - July 15, 2005 -Changed appname to "USB8X" from "USBDRV8X" because of TIOS bugs -Added BASIC interface through OpenLib and ExecLib -Prettied the graphlink demo a little bit -Fixed crashing problem on port 82 and 91 errors -Created KillDriver call, and took that functionality out of HostKill -Fixed some random bugs -Added about screen 0.06 - July 13, 2005 -Should now work with calculators with Port 3A = 0F. I think this means calculators with boot code 1.00. -Application on-calc name changed to USB8X -Added entry point for ReqData -Added sample keyboard application -Minimum OS version 2.30 0.05 - July 13, 2005 -Initial public release 5) License Copyright (c) 2006 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.