74 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 75 #if defined ( __ICCARM__ ) 76 #pragma data_alignment=4 81 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 82 #if defined ( __ICCARM__ ) 83 #pragma data_alignment=4 88 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 89 #if defined ( __ICCARM__ ) 90 #pragma data_alignment=4 198 switch (pdev->dev.device_status)
204 pdev->dev.class_cb->Setup (pdev, req);
242 pdev->dev.class_cb->Setup (pdev, req);
250 switch (pdev->dev.device_status)
253 if ((ep_addr != 0x00) && (ep_addr != 0x80))
262 if ((ep_addr != 0x00) && (ep_addr != 0x80))
268 pdev->dev.class_cb->Setup (pdev, req);
281 switch (pdev->dev.device_status)
284 if ((ep_addr != 0x00) && (ep_addr != 0x80))
293 if ((ep_addr != 0x00) && (ep_addr != 0x80))
296 pdev->dev.class_cb->Setup (pdev, req);
309 switch (pdev->dev.device_status)
312 if ((ep_addr != 0x00) && (ep_addr != 0x80))
321 if ((ep_addr & 0x80)== 0x80)
323 if(pdev->dev.in_ep[ep_addr & 0x7F].is_stall)
325 USBD_ep_status = 0x0001;
329 USBD_ep_status = 0x0000;
332 else if ((ep_addr & 0x80)== 0x00)
334 if(pdev->dev.out_ep[ep_addr].is_stall)
336 USBD_ep_status = 0x0001;
341 USBD_ep_status = 0x0000;
351 (uint8_t *)&USBD_ep_status,
382 #if (USBD_LPM_ENABLED == 1) 384 pbuf = pdev->pDesc->GetBOSDescriptor(pdev->dev_speed, &len);
388 pbuf = pdev->dev.usr_device->GetDeviceDescriptor(pdev->
cfg.
speed, &len);
392 pbuf = (uint8_t *)pdev->dev.class_cb->GetConfigDescriptor(pdev->
cfg.
speed, &len);
393 #ifdef USB_OTG_HS_CORE 397 pbuf = (uint8_t *)pdev->dev.class_cb->GetOtherConfigDescriptor(pdev->
cfg.
speed, &len);
401 pdev->dev.pConfig_descriptor = pbuf;
405 switch ((uint8_t)(req->
wValue))
408 pbuf = pdev->dev.usr_device->GetLangIDStrDescriptor(pdev->
cfg.
speed, &len);
412 pbuf = pdev->dev.usr_device->GetManufacturerStrDescriptor(pdev->
cfg.
speed, &len);
416 pbuf = pdev->dev.usr_device->GetProductStrDescriptor(pdev->
cfg.
speed, &len);
420 pbuf = pdev->dev.usr_device->GetSerialStrDescriptor(pdev->
cfg.
speed, &len);
424 pbuf = pdev->dev.usr_device->GetConfigurationStrDescriptor(pdev->
cfg.
speed, &len);
428 pbuf = pdev->dev.usr_device->GetInterfaceStrDescriptor(pdev->
cfg.
speed, &len);
432 #ifdef USB_SUPPORT_USER_STRING_DESC 433 pbuf = pdev->dev.class_cb->GetUsrStrDescriptor(pdev->
cfg.
speed, (req->
wValue) , &len);
442 #ifdef USB_OTG_HS_CORE 446 pbuf = (uint8_t *)pdev->dev.class_cb->GetConfigDescriptor(pdev->
cfg.
speed, &len);
467 #ifdef USB_OTG_HS_CORE 471 pbuf = (uint8_t *)pdev->dev.class_cb->GetOtherConfigDescriptor(pdev->
cfg.
speed, &len);
489 if((len != 0)&& (req->
wLength != 0))
515 dev_addr = (uint8_t)(req->
wValue) & 0x7F;
523 pdev->dev.device_address = dev_addr;
554 static uint8_t cfgidx;
556 cfgidx = (uint8_t)(req->
wValue);
564 switch (pdev->dev.device_status)
569 pdev->dev.device_config = cfgidx;
584 pdev->dev.device_config = cfgidx;
589 else if (cfgidx != pdev->dev.device_config)
595 pdev->dev.device_config = cfgidx;
629 switch (pdev->dev.device_status )
634 (uint8_t *)&USBD_default_cfg,
641 &pdev->dev.device_config,
664 switch (pdev->dev.device_status)
669 #ifdef USBD_SELF_POWERED 672 USBD_cfg_status = 0x00;
675 if (pdev->dev.DevRemoteWakeup)
681 (uint8_t *)&USBD_cfg_status,
704 uint8_t test_mode = 0;
708 pdev->dev.DevRemoteWakeup = 1;
709 pdev->dev.class_cb->Setup (pdev, req);
714 ((req->
wIndex & 0xFF) == 0))
718 test_mode = req->
wIndex >> 8;
746 pdev->dev.test_mode = 1;
766 switch (pdev->dev.device_status)
772 pdev->dev.DevRemoteWakeup = 0;
773 pdev->dev.class_cb->Setup (pdev, req);
795 req->
bmRequest = *(uint8_t *) (pdev->dev.setup_packet);
796 req->
bRequest = *(uint8_t *) (pdev->dev.setup_packet + 1);
801 pdev->dev.in_ep[0].ctl_data_len = req->
wLength ;
819 USB_OTG_EP0_OutStart(pdev);
838 unicode[idx++] = *len;
841 while (*desc !=
NULL)
843 unicode[idx++] = *desc++;
844 unicode[idx++] = 0x00;
USBD_Status USBD_StdItfReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdItfReq Handle standard usb interface requests.
header file for the usbd_req.c file
#define USB_LEN_DEV_QUALIFIER_DESC
#define USBD_IDX_CONFIG_STR
static void USBD_GetStatus(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetStatus Handle Get Status request.
#define USB_DESC_TYPE_DEVICE_QUALIFIER
#define USB_OTG_EP0_SETUP
#define USB_REQ_SET_ADDRESS
#define USB_REQ_TYPE_CLASS
USBD_Status USBD_CtlSendData(USB_OTG_CORE_HANDLE *pdev, uint8_t *buf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
static uint8_t USBD_GetLen(uint8_t *buf)
USBD_GetLen return the string length.
#define USB_CONFIG_REMOTE_WAKEUP
#define USB_REQ_GET_STATUS
__ALIGN_BEGIN uint32_t USBD_ep_status __ALIGN_END
static void USBD_GetDescriptor(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetDescriptor Handle Get Descriptor requests.
uint8_t USBD_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC]
uint32_t DCD_EP_Stall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Stall an endpoint.
USBD_Status USBD_ClrCfg(USB_OTG_CORE_HANDLE *pdev, uint8_t cfgidx)
USBD_ClrCfg Clear current configuration.
#define USB_FEATURE_EP_HALT
__IO USB_OTG_DCTL_TypeDef SET_TEST_MODE
#define USBD_IDX_PRODUCT_STR
#define USB_REQ_SET_FEATURE
#define USB_REQ_SET_CONFIGURATION
#define USBD_IDX_SERIAL_STR
#define USB_OTG_SPEED_FULL
#define USB_OTG_SPEED_HIGH
#define USBD_IDX_LANGID_STR
uint8_t USBD_StrDesc[USB_MAX_STR_DESC_SIZ]
USBD_Status USBD_SetCfg(USB_OTG_CORE_HANDLE *pdev, uint8_t cfgidx)
USBD_SetCfg Configure device and start the interface.
#define USB_DESC_TYPE_BOS
#define USB_MAX_STR_DESC_SIZ
USBD_Status USBD_CtlSendStatus(USB_OTG_CORE_HANDLE *pdev)
USBD_CtlSendStatus send zero length packet on the ctl pipe.
void USBD_ParseSetupRequest(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_ParseSetupRequest Copy buffer into setup structure.
#define USB_OTG_READ_REG32(reg)
uint32_t DCD_EP_ClrStall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Clear stall condition on endpoints.
static void USBD_SetAddress(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_SetAddress Set device address.
#define USB_REQ_GET_DESCRIPTOR
#define USB_FEATURE_REMOTE_WAKEUP
#define USB_OTG_ADDRESSED
void USBD_CtlError(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_CtlError Handle USB low level Error.
header file for the usbd_ioreq.c file
#define USB_REQ_CLEAR_FEATURE
static void USBD_GetConfig(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetConfig Handle Get device configuration request.
void DCD_EP_SetAddress(USB_OTG_CORE_HANDLE *pdev, uint8_t address)
This Function set USB device address.
#define USB_FEATURE_TEST_MODE
#define USB_REQ_GET_CONFIGURATION
#define USBD_IDX_INTERFACE_STR
static void USBD_ClrFeature(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_ClrFeature Handle clear device feature request.
static void USBD_SetFeature(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_SetFeature Handle Set device feature request.
#define USB_OTG_CONFIGURED
#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION
void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
USBD_GetString Convert Ascii string into unicode one.
#define USB_DESC_TYPE_CONFIGURATION
#define USB_REQ_TYPE_MASK
#define USB_DESC_TYPE_DEVICE
USBD_Status USBD_StdEPReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdEPReq Handle standard usb endpoint requests.
#define USB_DESC_TYPE_STRING
#define USB_CONFIG_SELF_POWERED
USBD_Status USBD_StdDevReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdDevReq Handle standard usb device requests.
header file for the usbd_desc.c file
struct _USB_OTG_DCTL_TypeDef::@74 b
static void USBD_SetConfig(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_SetConfig Handle Set device configuration request.