83Plus:Software:usb8x/Asm Interface/FindDescriptor

From WikiTI
Jump to: navigation, search

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
U_CALL ReadDescriptor      ;Read config descriptor from device
pop    hl
jp     c,Error
ld     b,descEndpoint
U_CALL FindDescriptor      ;Search for endpoint descriptor within config descriptor

See Also

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