122 EP0Data.
pData += cnt;
123 EP0Data.
Count -= cnt;
137 EP0Data.
pData += cnt;
138 EP0Data.
Count -= cnt;
187 m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
230 m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
244 if (CSW.dSignature == MSC_CSW_Signature) {
304 if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->
bLength != 0) {
305 pD += ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
308 if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->
bLength == 0) {
312 len = ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
317 if (((USB_STRING_DESCRIPTOR *)pD)->
bLength != 0) {
318 pD += ((USB_STRING_DESCRIPTOR *)pD)->bLength;
321 if (((USB_STRING_DESCRIPTOR *)pD)->
bLength == 0) {
325 len = ((USB_STRING_DESCRIPTOR *)EP0Data.
pData)->bLength;
334 case HID_HID_DESCRIPTOR_TYPE:
341 case HID_REPORT_DESCRIPTOR_TYPE:
346 len = HID_ReportDescSize;
348 case HID_PHYSICAL_DESCRIPTOR_TYPE:
359 if (EP0Data.
Count > len) {
419 USB_COMMON_DESCRIPTOR *pD;
428 while (pD->bLength) {
429 switch (pD->bDescriptorType) {
431 if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bConfigurationValue ==
SetupPacket.wValue.WB.L) {
437 for (n = 1; n < 16; n++) {
460 alt = ((USB_INTERFACE_DESCRIPTOR *)pD)->bAlternateSetting;
464 n = ((USB_ENDPOINT_DESCRIPTOR *)pD)->bEndpointAddress & 0x8F;
465 m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
478 for (n = 1; n < 16; n++) {
533 USB_COMMON_DESCRIPTOR *pD;
534 uint32_t ifn = 0, alt = 0, old = 0, msk = 0;
543 while (pD->bLength) {
544 switch (pD->bDescriptorType) {
546 if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bConfigurationValue !=
USB_Configuration) {
552 ifn = ((USB_INTERFACE_DESCRIPTOR *)pD)->bInterfaceNumber;
553 alt = ((USB_INTERFACE_DESCRIPTOR *)pD)->bAlternateSetting;
563 n = ((USB_ENDPOINT_DESCRIPTOR *)pD)->bEndpointAddress & 0x8F;
564 m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
573 else if ((alt == old) && ((msk & m) == 0)) {
621 #if USB_FEATURE_EVENT
631 #if USB_FEATURE_EVENT
667 #if USB_CONFIGURE_EVENT
684 #if USB_INTERFACE_EVENT
705 case HID_REQUEST_GET_REPORT:
706 if (HID_GetReport()) {
712 case HID_REQUEST_SET_REPORT:
715 case HID_REQUEST_GET_IDLE:
722 case HID_REQUEST_SET_IDLE:
728 case HID_REQUEST_GET_PROTOCOL:
729 if (HID_GetProtocol()) {
735 case HID_REQUEST_SET_PROTOCOL:
736 if (HID_SetProtocol()) {
747 case MSC_REQUEST_RESET:
756 case MSC_REQUEST_GET_MAX_LUN:
759 if (MSC_GetMaxLUN()) {
774 case AUDIO_REQUEST_GET_CUR:
775 case AUDIO_REQUEST_GET_MIN:
776 case AUDIO_REQUEST_GET_MAX:
777 case AUDIO_REQUEST_GET_RES:
778 if (ADC_IF_GetRequest()) {
784 case AUDIO_REQUEST_SET_CUR:
854 case AUDIO_REQUEST_GET_CUR:
855 case AUDIO_REQUEST_GET_MIN:
856 case AUDIO_REQUEST_GET_MAX:
857 case AUDIO_REQUEST_GET_RES:
858 if (ADC_EP_GetRequest()) {
864 case AUDIO_REQUEST_SET_CUR:
887 if (!USB_ReqVendorDev(
TRUE)) {
893 if (!USB_ReqVendorIF(
TRUE)) {
899 if (!USB_ReqVendorEP(
TRUE)) {
930 if (EP0Data.
Count == 0) {
946 case HID_REQUEST_SET_REPORT:
947 if (HID_SetReport()) {
960 case AUDIO_REQUEST_SET_CUR:
964 if (ADC_IF_SetRequest()) {
1003 case AUDIO_REQUEST_SET_CUR:
1007 if (ADC_EP_SetRequest()) {
1029 if (!USB_ReqVendorDev(
FALSE)) {
1035 if (!USB_ReqVendorIF(
FALSE)) {
1041 if (!USB_ReqVendorEP(
FALSE)) {
uint32_t CDC_SendBreak(unsigned short wDurationOfBreak)
void USB_Feature_Event(void)
#define USB_FEATURE_ENDPOINT_STALL
#define USB_REQUEST_SET_FEATURE
uint16_t USB_DeviceStatus
const uint8_t USB_DeviceDescriptor[]
void USB_DisableEP(uint32_t EPNum)
void USB_Configure_Event(void)
#define REQUEST_DEVICE_TO_HOST
__inline uint32_t USB_ReqSetInterface(void)
#define USB_STRING_DESCRIPTOR_TYPE
__inline void UsbAddPtr(void **vpptr, uint32_t n)
#define USB_ENDPOINT_DESCRIPTOR_TYPE
#define REQUEST_TO_INTERFACE
uint32_t USB_ReadEP(uint32_t EPNum, uint8_t *pData)
#define USB_REQUEST_SET_CONFIGURATION
#define USB_REQUEST_GET_DESCRIPTOR
#define CDC_SET_LINE_CODING
uint32_t USB_EndPointMask
void USB_DataInStage(void)
void USB_SetAddress(uint32_t adr)
void USB_ResetEP(uint32_t EPNum)
__inline uint32_t USB_ReqSetAddress(void)
#define USB_EVT_OUT_STALL
uint32_t CDC_SetControlLineState(unsigned short wControlSignalBitmap)
#define USB_REQUEST_SET_DESCRIPTOR
uint8_t EP0Buf[USB_MAX_PACKET0]
uint32_t USB_EndPointHalt
#define USB_FEATURE_REMOTE_WAKEUP
void USB_EndPoint0(uint32_t event)
uint32_t CDC_GetCommFeature(unsigned short wFeatureSelector)
#define USB_REQUEST_SET_INTERFACE
void USB_Interface_Event(void)
#define CDC_SET_COMM_FEATURE
void USB_DataOutStage(void)
#define CDC_GET_LINE_CODING
#define USB_INTERFACE_DESCRIPTOR_TYPE
__inline uint32_t USB_ReqSetClrFeature(uint32_t sc)
#define REQUEST_TO_DEVICE
uint32_t CDC_GetEncapsulatedResponse(void)
uint32_t USB_EndPointStall
__inline uint32_t USB_ReqGetConfiguration(void)
#define USB_DEVICE_DESCRIPTOR_TYPE
void USB_StatusInStage(void)
#define USB_REQUEST_SET_ADDRESS
uint32_t CDC_SetLineCoding(void)
#define REQUEST_TO_ENDPOINT
uint32_t CDC_GetLineCoding(void)
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
uint8_t USB_NumInterfaces
#define CDC_CLEAR_COMM_FEATURE
uint32_t CDC_SetCommFeature(unsigned short wFeatureSelector)
#define CDC_GET_COMM_FEATURE
void USB_StatusOutStage(void)
uint8_t USB_Configuration
#define USB_REQUEST_GET_STATUS
const uint8_t USB_StringDescriptor[]
void USB_WakeUpCfg(uint32_t cfg)
uint8_t USB_DeviceAddress
#define CDC_SEND_ENCAPSULATED_COMMAND
const uint8_t USB_ConfigDescriptor[]
unsigned short int uint16_t
USB_SETUP_PACKET SetupPacket
__inline uint32_t USB_ReqGetStatus(void)
uint32_t USB_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
void USB_ConfigEP(USB_ENDPOINT_DESCRIPTOR *pEPD)
#define CDC_SET_CONTROL_LINE_STATE
__inline uint32_t USB_ReqSetConfiguration(void)
void USB_ClrStallEP(uint32_t EPNum)
void USB_SetupStage(void)
#define USB_REQUEST_GET_CONFIGURATION
void USB_Configure(uint32_t cfg)
void USB_DirCtrlEP(uint32_t dir)
uint8_t USB_AltSetting[USB_IF_NUM]
void USB_SetStallEP(uint32_t EPNum)
#define USB_CONFIG_POWERED_MASK
__inline uint32_t USB_ReqGetInterface(void)
uint32_t CDC_SendEncapsulatedCommand(void)
#define USB_REQUEST_GET_INTERFACE
#define USB_GETSTATUS_SELF_POWERED
#define REQUEST_HOST_TO_DEVICE
uint32_t CDC_ClearCommFeature(unsigned short wFeatureSelector)
void USB_EnableEP(uint32_t EPNum)
#define USB_DEVICE_DESC_SIZE
#define USB_REQUEST_CLEAR_FEATURE
__inline uint32_t USB_ReqGetDescriptor(void)
#define USB_GETSTATUS_REMOTE_WAKEUP
#define CDC_GET_ENCAPSULATED_RESPONSE