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

From WikiTI
Jump to: navigation, search
 
m
Line 30: Line 30:
 
jp  c,Error
 
jp  c,Error
 
ld  b,descEndpoint
 
ld  b,descEndpoint
call FindDescriptor      ;Search for endpoint descriptor within config descriptor
+
call FindDescriptor      ;Search for endpoint descriptor within config descriptor</nowiki>
</nowiki>
+
  
 
== See Also ==
 
== See Also ==
 
* [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device
 
* [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device

Revision as of 22:06, 15 July 2006

Synopsis

Name: FindDescriptor

Minimum usb8x version: 0.05

Find the first instance of a descriptor entry in the config descriptor listing

Inputs

  • B: Descriptor type
  • HL: Address of descriptor list

Outputs

  • DE: Points byte after entire descriptor listing
  • HL: Points to requested descriptor
  • NC: Success

Destroys

  • AF, BC

Notes

This routine only finds the first instance of a descriptor. There is an internal routine to find additional instances, but it does not currently have an entry point. This will be fixed in future versions.

Example

ld   hl,DescriptorBuf    ;Temporary buffer to hold config descriptor
ld   b,descConfig
push hl
call ReadDescriptor      ;Read config descriptor from device
pop  hl
jp   c,Error
ld   b,descEndpoint
call FindDescriptor      ;Search for endpoint descriptor within config descriptor

See Also

  • [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device