Difference between revisions of "83Plus:Software:usb8x/Asm Interface/FindDescriptor"
From WikiTI
m |
m (call->U_CALL) |
||
Line 23: | Line 23: | ||
== Example == | == Example == | ||
<nowiki> | <nowiki> | ||
− | ld | + | ld hl,DescriptorBuf ;Temporary buffer to hold config descriptor |
− | ld | + | ld b,descConfig |
− | push hl | + | push hl |
− | + | U_CALL ReadDescriptor ;Read config descriptor from device | |
− | pop | + | pop hl |
− | jp | + | jp c,Error |
− | ld | + | ld b,descEndpoint |
− | + | U_CALL FindDescriptor ;Search for endpoint descriptor within config descriptor</nowiki> | |
== See Also == | == See Also == | ||
* [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device | * [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device |
Latest revision as of 23:53, 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 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