📄 ctlsetup.h
字号:
/*++
Copyright (c) 2001 Sunplus Technology Co., Ltd.
Module Name:
ctlsetup.h
Abstract:
Header file related to setup packet of control pipe
Environment:
Keil C51 Compiler
Revision History:
08/28/2001 Chi-Yeh Tsai created
--*/
//------------------------------------------------------------------------------
//Constant
//------------------------------------------------------------------------------
//Standard Request Code
#define K_STDREQCODE_GET_STATUS 0x00
#define K_STDREQCODE_CLEAR_FEATURE 0x01
#define K_STDREQCODE_SET_FEATURE 0x03
#define K_STDREQCODE_SET_ADDRESS 0x05
#define K_STDREQCODE_GET_DESCRIPTOR 0x06
#define K_STDREQCODE_SET_DESCRIPTOR 0x07
#define K_STDREQCODE_GET_CONFIGURATION 0x08
#define K_STDREQCODE_SET_CONFIGURATION 0x09
#define K_STDREQCODE_GET_INTERFACE 0x0A
#define K_STDREQCODE_SET_INTERFACE 0x0B
#define K_STDREQCODE_SYNCH_FRAME 0x0C
//Descriptor Type
#define K_DEVICE_DESCRIPTOR 0x0100
#define K_CONFIGURATION_DESCRIPTOR 0x0200
#define K_STRING_DESCRIPTOR 0x0300
#define K_INTERFACE_DESCRIPTOR 0x0400
#define K_ENDPOINT_DESCRIPTOR 0x0500
//Phase of Transfer
#define K_CommandPhase 0x00
#define K_OutDataPhase 0x01
#define K_OutDataPhaseWrite 0x02
#define K_OutResponsePhase 0x03
#define K_InDataPhase 0x81
#define K_InDataPhaseRead 0x82
#define K_InResponsePhase 0x83
#define K_InCompletionPhase 0x84
#define K_XferDirMask 0x80
//richie@si0418
#define K_InDataGetObjInfo_SIDC 0xA1
#define K_InDataGetThumb_SIDC 0xA2
//richie@pa0429
#define K_InDataGetPartial_SIDC 0xA3
//------------------------------------------------------------------------------
//Type Definition
//------------------------------------------------------------------------------
#define K_CTRL_COMMAND_SIZE 0x08
typedef struct _CTRL_COMMAND
{
UCHAR bmRequestType;
UCHAR bRequest;
USHORT wValue;
USHORT wIndex;
USHORT wLength;
} CTRL_COMMAND, *PCTRL_COMMAND;
//------------------------------------------------------------------------------
//External Link
//------------------------------------------------------------------------------
extern PCTRL_COMMAND G_pCtrlCommand;
extern idata USHORT G_usCtrlDataLength;
extern idata USHORT G_usCtrlDataIndex;
extern idata UCHAR G_ucCtrlPacketIndex;
extern xdata UCHAR G_ucCtrlPhase;
//extern idata UCHAR G_UsbConnectStatus;
extern code UCHAR DeviceDescriptor[];
extern code UCHAR ConfigurationDescriptor[];
//------------------------------------------------------------------------------
//Function Prototype
//------------------------------------------------------------------------------
void CTLSETUP_Packet(void);
void CTLSETUP_StandardRequest(void);
void CTLSETUP_ClassRequest(void);
void CTLSETUP_VendorRequest(void);
void CTLSETUP_ReservedRequest(void);
void CTLSETUP_GetSetupPacket(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -