#include "type.h"
#include "usbdebug.h"
#include "usbstruct.h"
#include "usbapi.h"
Include dependency graph for usbstdreq.c:
Defines | |
#define | MAX_DESC_HANDLERS 4 |
#define | DESC_bLength 0 |
#define | DESC_bDescriptorType 1 |
#define | CONF_DESC_wTotalLength 2 |
#define | CONF_DESC_bConfigurationValue 5 |
#define | INTF_DESC_bAlternateSetting 3 |
#define | ENDP_DESC_bEndpointAddress 2 |
#define | ENDP_DESC_wMaxPacketSize 4 |
Functions | |
void | USBRegisterDescriptors (const U8 *pabDescriptors) |
BOOL | USBGetDescriptor (U16 wTypeIndex, U16 wLangID, int *piLen, U8 **ppbData) |
BOOL | USBHandleStandardRequest (TSetupPacket *pSetup, int *piLen, U8 **ppbData) |
void | USBRegisterCustomReqHandler (TFnHandleRequest *pfnHandler) |
This modules handles the 'chapter 9' processing, specifically the standard device requests in table 9-3 from the universal serial bus specification revision 2.0
Specific types of devices may specify additional requests (for example HID devices add a GET_DESCRIPTOR request for interfaces), but they will not be part of this module.
GET_INTERFACE, GET_STATUS, SET_INTERFACE, SYNCH_FRAME
this applies to the following if endpoint != 0:
SET_FEATURE, GET_FEATURE
|
configuration value offset |
|
total length offset |
|
descriptor type offset |
|
length offset |
|
endpoint address offset |
|
maximum packet size offset |
|
alternate setting offset |
|
device, interface, endpoint, other |
|
Parses the list of installed USB descriptors and attempts to find the specified USB descriptor.
|
|
Default handler for standard ('chapter 9') requests If a custom request handler was installed, this handler is called first.
|
|
Registers a callback for custom device requests In USBHandleStandardRequest, the custom request handler gets a first chance at handling the request before it is handed over to the 'chapter 9' request handler. This can be used for example in HID devices, where a REQ_GET_DESCRIPTOR request is sent to an interface, which is not covered by the 'chapter 9' specification.
|
|
Registers a pointer to a descriptor block containing all descriptors for the device.
|