#include "type.h"
#include "debug.h"
#include "usbstruct.h"
#include "usbapi.h"
Go to the source code of this file.
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) |
Control transfer handler.
This module handles control transfers and is normally installed on the endpoint 0 callback.
Control transfers can be of the following type: 0 Standard; 1 Class; 2 Vendor; 3 Reserved.
A callback can be installed for each of these control transfers using USBRegisterRequestHandler. When an OUT request arrives, data is collected in the data store provided with the USBRegisterRequestHandler call. When the transfer is done, the callback is called. When an IN request arrives, the callback is called immediately to either put the control transfer data in the data store, or to get a pointer to control transfer data. The data is then packetised and sent to the host.
Definition in file usbcontrol.c.
#define MAX_CONTROL_SIZE 128 |
maximum total size of control transfer data
Definition at line 59 of file usbcontrol.c.
#define MAX_REQ_HANDLERS 4 |
standard, class, vendor, reserved
Definition at line 60 of file usbcontrol.c.
Handles IN/OUT transfers on EP0
[in] | bEP | Endpoint address |
[in] | bEPStat | Endpoint status |
Definition at line 145 of file usbcontrol.c.
void USBRegisterRequestHandler | ( | int | iType, | |
TFnHandleRequest * | pfnHandler, | |||
U8 * | pbDataStore | |||
) |
Registers a callback for handling requests
[in] | iType | Type of request, e.g. REQTYPE_TYPE_STANDARD |
[in] | *pfnHandler | Callback function pointer |
[in] | *pbDataStore | Data storage area for this type of request |
Definition at line 224 of file usbcontrol.c.