#include "type.h"
#include "usbdebug.h"
#include "usbstruct.h"
#include "usbapi.h"
Include dependency graph for usbcontrol.c:
Defines | |
#define | MAX_CONTROL_SIZE 128 |
#define | MAX_REQ_HANDLERS 4 |
Functions | |
void | USBHandleControlTransfer (U8 bEP, U8 bEPStat) |
void | USBRegisterRequestHandler (int iType, TFnHandleRequest *pfnHandler, U8 *pbDataStore) |
In case of a control-write (host-to-device), this module collects the full control message in a local buffer, then sends it off to an installed request handler.
In case of a control-read (device-to-host), an installed request handler is asked to handle the request and provide return data. The handler can either put the data in the control data buffer through the supplied pointer, or it can supply a new data pointer. In both cases, the handler is required to update the data length in *piLen;
Currently, control transfers are handled in a very simple way, keeping almost no state about the control transfer progress (setup stage, data stage, status stage). We simply follow the host: if it sends data, we store it in the control data buffer and if it asks for data, we just send the next block.
|
maximum total size of control transfer data |
|
standard, class, vendor, reserved |
|
Handles IN/OUT transfers on EP0
|
|
Registers a callback for handling requests
|