📄 obj_usbdesc.h
字号:
char type, /* Descriptor type */
char index, /* Descriptor index */
short feature, /* Feature */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*GetConfiguration)(
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*GetDescriptor) (
char type, /* Descriptor type */
char index, /* Descriptor index */
short langID, /* Language ID */
short length, /* Desriptor length */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*GetInterface) (
short interface, /* Interface index */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*GetStatus) (
char recipient, /* device, interface, endpoint */
short index, /* interface or endpoint index */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SetAddress) (
char address, /* device, interface, endpoint */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SetConfiguration) (
short cfgValue, /* Configuration value */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SetDescriptor) (
char type, /* Descriptor type */
char index, /* Descriptor index */
short langID, /* Language ID */
short length, /* Desriptor length */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SetFeature) (
char recipient, /* device, interface, endpoint */
short index, /* interface or endpoint index */
short feature, /* Feature selector */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SetInterface) (
short interface, /* Interface index */
short setting, /* Alternative setting */
void *pPrvtStdDt); /* Pointer to private Standard data */
void (*SynchFrame) (
short endpoint, /* Endpoint index */
void *pPrvtStdDt); /* Pointer to private Standard data */
/* ======================================================================= */
/* Following pointers are used by dispatchClassRequest() */
/* and dispatchVendorRequest() */
/* ======================================================================= */
void *pPrivateStandardData;
void *pPrivateClassData;
void *pPrivateVendorData;
/* Control Endpoint definition */
AT91PS_UDP pUdp;
char epId;
} AT91S_UsbDesc, *AT91PS_UsbDesc;
typedef AT91PS_UsbDesc (*AT91PF_OpenUsbDesc) (AT91PS_UsbDesc, AT91PS_UDP, char);
typedef void (*AT91PF_DispatchRequest) (AT91PS_UsbDesc, AT91PS_UsbSetup);
typedef void (*AT91PF_DispatchClassRequest) (AT91PS_UsbSetup, void *);
typedef void (*AT91PF_DispatchVendorRequest) (AT91PS_UsbSetup, void *);
typedef void (*AT91PF_ClearFeature) (char, char, short, void *);
typedef void (*AT91PF_GetConfiguration) (void *);
typedef void (*AT91PF_GetDescriptor) (char, char, short, short, void *);
typedef void (*AT91PF_GetInterface) (short, void *);
typedef void (*AT91PF_GetStatus) (char, short, void *);
typedef void (*AT91PF_SetAddress) (char, void *);
typedef void (*AT91PF_SetConfiguration) (short, void *);
typedef void (*AT91PF_SetDescriptor) (char, char, short, short, void *);
typedef void (*AT91PF_SetFeature) (char, short, short, void *);
typedef void (*AT91PF_SetInterface) (short, short, void *);
typedef void (*AT91PF_SynchFrame) (short, void *);
/* *********************************************************************** */
/* Following functions are define in obj_usbdesc.c. They handle standard */
/* request in order to match with USB spec. Rev. 1.1. Once the request has */
/* been checked according to the USB status, the request is transmitted to */
/* the application calling the application request handler. */
/* *********************************************************************** */
/* ======================================================================= */
/* Following functions are used when a Setup packet has been sent to the */
/* device. According to the request, they call the corresponding functions */
/* ======================================================================= */
extern AT91PS_UsbDesc AT91F_OpenUsbDesc(
AT91PS_UsbDesc pUsbDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UDP pUdp, /* Uregister structure */
char epId); /* endpoint number */
/* usbDescDispatchRequest handle standart request or call */
/* USBDesc->dispatchVendorRequest() or */
/* USBDesc->dispatchClassRequest() */
extern void AT91F_UsbDescDispatchRequest(
AT91PS_UsbDesc const pDesc, /* pointer to application request handlers */
AT91PS_UsbSetup pSetup); /* Descriptor type */
/* ======================================================================= */
/* Following functions handle standard request they are called by the */
/* application through usbDescDispatchRequest (). */
/* If this is a valid request, they transmit the request to the application*/
/* layer */
/* ======================================================================= */
extern void AT91F_UsbDescClearFeature(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescGetConfiguration(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescGetDescriptor(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescGetInterface(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescGetStatus(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSetAddress(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSetConfiguration(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSetDescriptor(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSetFeature(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSetInterface(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
extern void AT91F_UsbDescSynchFrame(
AT91PS_UsbDesc const pDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbSetup pSetup); /* Descriptor type */
// Small utility function to configure the UDP endpoint
// according to the endpoint descriptor
extern void AT91F_UdpConfigure(
AT91PS_UsbDesc const pUsbDesc, /* pointer to a AT91S_UsbDesc structure */
AT91PS_UsbEndpoint const pEp);
/* ************************************ */
/* usbSendStatus */
/* */
/* Arguments: */
/* pPipe: pointer to default pipe */
/* handler */
/* Return: */
/* Nothing */
/* Description: */
/* Acknowledge a control write tx. */
/* Send a sero length packet */
/* ************************************ */
//__inline void AT91F_UsbDescSendStatus(AT91PS_Pipe pPipe)
//{
// /* Send a zero length packet */
// pPipe->Write(pPipe, 0, 0);
//}
#endif /* obj_usbdesc_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -