83Plus:Software:usb8x/Asm Interface/AutoSetup

From WikiTI
Revision as of 22:47, 15 July 2006 by Dan Englender (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Synopsis

Name: AutoSetup

Minimum usb8x version: 0.05

Sets up the attached USB device.

Inputs

  • DE: Address of callback routine
  • HL: Address of temporary buffer for descriptors

Outputs

  • NC: Success

Destroys

  • AF, BC, DE, HL

Notes

AutoSetup completes the following tasks:

  • Checks for an attached device
  • Calls HostInit
  • Sets configuration
  • Sets up pipes

AutoSetup may fail some circumstances, including devices with multiple configurations and/or interfaces.

Example

       ld     hl,DriverBuf
       call   DriverInit
       ld     de,CallBackRoutine
       ld     hl,DescriptorBuf
       call   AutoSetup
       jp     c,Error
;Device is now ready to use
;Use GetClass or GetIDs to make sure you have the right device