usbd_req.c
Go to the documentation of this file.
1 
28 /* Includes ------------------------------------------------------------------*/
29 #include "usbd_req.h"
30 #include "usbd_ioreq.h"
31 #include "usbd_desc.h"
32 
33 
73 
74 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
75  #if defined ( __ICCARM__ )
76  #pragma data_alignment=4
77  #endif
78 #endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
79 __ALIGN_BEGIN uint32_t USBD_ep_status __ALIGN_END = 0;
80 
81 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
82  #if defined ( __ICCARM__ )
83  #pragma data_alignment=4
84  #endif
85 #endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
86 __ALIGN_BEGIN uint32_t USBD_default_cfg __ALIGN_END = 0;
87 
88 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
89  #if defined ( __ICCARM__ )
90  #pragma data_alignment=4
91  #endif
92 #endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
93 __ALIGN_BEGIN uint32_t USBD_cfg_status __ALIGN_END = 0;
94 
104 static void USBD_GetDescriptor(USB_OTG_CORE_HANDLE *pdev,
105  USB_SETUP_REQ *req);
106 
107 static void USBD_SetAddress(USB_OTG_CORE_HANDLE *pdev,
108  USB_SETUP_REQ *req);
109 
110 static void USBD_SetConfig(USB_OTG_CORE_HANDLE *pdev,
111  USB_SETUP_REQ *req);
112 
113 static void USBD_GetConfig(USB_OTG_CORE_HANDLE *pdev,
114  USB_SETUP_REQ *req);
115 
116 static void USBD_GetStatus(USB_OTG_CORE_HANDLE *pdev,
117  USB_SETUP_REQ *req);
118 
119 static void USBD_SetFeature(USB_OTG_CORE_HANDLE *pdev,
120  USB_SETUP_REQ *req);
121 
122 static void USBD_ClrFeature(USB_OTG_CORE_HANDLE *pdev,
123  USB_SETUP_REQ *req);
124 
125 static uint8_t USBD_GetLen(uint8_t *buf);
144 {
145  USBD_Status ret = USBD_OK;
146 
147  switch (req->bRequest)
148  {
150 
151  USBD_GetDescriptor (pdev, req) ;
152  break;
153 
154  case USB_REQ_SET_ADDRESS:
155  USBD_SetAddress(pdev, req);
156  break;
157 
159  USBD_SetConfig (pdev , req);
160  break;
161 
163  USBD_GetConfig (pdev , req);
164  break;
165 
166  case USB_REQ_GET_STATUS:
167  USBD_GetStatus (pdev , req);
168  break;
169 
170 
171  case USB_REQ_SET_FEATURE:
172  USBD_SetFeature (pdev , req);
173  break;
174 
175  case USB_REQ_CLEAR_FEATURE:
176  USBD_ClrFeature (pdev , req);
177  break;
178 
179  default:
180  USBD_CtlError(pdev , req);
181  break;
182  }
183 
184  return ret;
185 }
186 
195 {
196  USBD_Status ret = USBD_OK;
197 
198  switch (pdev->dev.device_status)
199  {
200  case USB_OTG_CONFIGURED:
201 
202  if (LOBYTE(req->wIndex) <= USBD_ITF_MAX_NUM)
203  {
204  pdev->dev.class_cb->Setup (pdev, req);
205 
206  if((req->wLength == 0)&& (ret == USBD_OK))
207  {
208  USBD_CtlSendStatus(pdev);
209  }
210  }
211  else
212  {
213  USBD_CtlError(pdev , req);
214  }
215  break;
216 
217  default:
218  USBD_CtlError(pdev , req);
219  break;
220  }
221  return ret;
222 }
223 
232 {
233 
234  uint8_t ep_addr;
235  USBD_Status ret = USBD_OK;
236 
237  ep_addr = LOBYTE(req->wIndex);
238 
239  /* Check the class specific requests before going to standard request */
241  {
242  pdev->dev.class_cb->Setup (pdev, req);
243  return ret;
244  }
245 
246  switch (req->bRequest)
247  {
248  case USB_REQ_SET_FEATURE :
249 
250  switch (pdev->dev.device_status)
251  {
252  case USB_OTG_ADDRESSED:
253  if ((ep_addr != 0x00) && (ep_addr != 0x80))
254  {
255  DCD_EP_Stall(pdev , ep_addr);
256  }
257  break;
258 
259  case USB_OTG_CONFIGURED:
260  if (req->wValue == USB_FEATURE_EP_HALT)
261  {
262  if ((ep_addr != 0x00) && (ep_addr != 0x80))
263  {
264  DCD_EP_Stall(pdev , ep_addr);
265 
266  }
267  }
268  pdev->dev.class_cb->Setup (pdev, req);
269  USBD_CtlSendStatus(pdev);
270 
271  break;
272 
273  default:
274  USBD_CtlError(pdev , req);
275  break;
276  }
277  break;
278 
279  case USB_REQ_CLEAR_FEATURE :
280 
281  switch (pdev->dev.device_status)
282  {
283  case USB_OTG_ADDRESSED:
284  if ((ep_addr != 0x00) && (ep_addr != 0x80))
285  {
286  DCD_EP_Stall(pdev , ep_addr);
287  }
288  break;
289 
290  case USB_OTG_CONFIGURED:
291  if (req->wValue == USB_FEATURE_EP_HALT)
292  {
293  if ((ep_addr != 0x00) && (ep_addr != 0x80))
294  {
295  DCD_EP_ClrStall(pdev , ep_addr);
296  pdev->dev.class_cb->Setup (pdev, req);
297  }
298  USBD_CtlSendStatus(pdev);
299  }
300  break;
301 
302  default:
303  USBD_CtlError(pdev , req);
304  break;
305  }
306  break;
307 
308  case USB_REQ_GET_STATUS:
309  switch (pdev->dev.device_status)
310  {
311  case USB_OTG_ADDRESSED:
312  if ((ep_addr != 0x00) && (ep_addr != 0x80))
313  {
314  DCD_EP_Stall(pdev , ep_addr);
315  }
316  break;
317 
318  case USB_OTG_CONFIGURED:
319 
320 
321  if ((ep_addr & 0x80)== 0x80)
322  {
323  if(pdev->dev.in_ep[ep_addr & 0x7F].is_stall)
324  {
325  USBD_ep_status = 0x0001;
326  }
327  else
328  {
329  USBD_ep_status = 0x0000;
330  }
331  }
332  else if ((ep_addr & 0x80)== 0x00)
333  {
334  if(pdev->dev.out_ep[ep_addr].is_stall)
335  {
336  USBD_ep_status = 0x0001;
337  }
338 
339  else
340  {
341  USBD_ep_status = 0x0000;
342  }
343  }
344 
345  else
346  {
347  /* Do Nothing */
348  }
349 
350  USBD_CtlSendData (pdev,
351  (uint8_t *)&USBD_ep_status,
352  2);
353  break;
354 
355  default:
356  USBD_CtlError(pdev , req);
357  break;
358  }
359  break;
360 
361  default:
362  break;
363  }
364  return ret;
365 }
374  USB_SETUP_REQ *req)
375 {
376  uint16_t len;
377  uint8_t *pbuf;
378  len = req->wLength ;
379 
380  switch (req->wValue >> 8)
381  {
382 #if (USBD_LPM_ENABLED == 1)
383  case USB_DESC_TYPE_BOS:
384  pbuf = pdev->pDesc->GetBOSDescriptor(pdev->dev_speed, &len);
385  break;
386 #endif
388  pbuf = pdev->dev.usr_device->GetDeviceDescriptor(pdev->cfg.speed, &len);
389  break;
390 
392  pbuf = (uint8_t *)pdev->dev.class_cb->GetConfigDescriptor(pdev->cfg.speed, &len);
393 #ifdef USB_OTG_HS_CORE
394  if((pdev->cfg.speed == USB_OTG_SPEED_FULL )&&
395  (pdev->cfg.phy_itface == USB_OTG_ULPI_PHY))
396  {
397  pbuf = (uint8_t *)pdev->dev.class_cb->GetOtherConfigDescriptor(pdev->cfg.speed, &len);
398  }
399 #endif
400  pbuf[1] = USB_DESC_TYPE_CONFIGURATION;
401  pdev->dev.pConfig_descriptor = pbuf;
402  break;
403 
405  switch ((uint8_t)(req->wValue))
406  {
407  case USBD_IDX_LANGID_STR:
408  pbuf = pdev->dev.usr_device->GetLangIDStrDescriptor(pdev->cfg.speed, &len);
409  break;
410 
411  case USBD_IDX_MFC_STR:
412  pbuf = pdev->dev.usr_device->GetManufacturerStrDescriptor(pdev->cfg.speed, &len);
413  break;
414 
416  pbuf = pdev->dev.usr_device->GetProductStrDescriptor(pdev->cfg.speed, &len);
417  break;
418 
419  case USBD_IDX_SERIAL_STR:
420  pbuf = pdev->dev.usr_device->GetSerialStrDescriptor(pdev->cfg.speed, &len);
421  break;
422 
423  case USBD_IDX_CONFIG_STR:
424  pbuf = pdev->dev.usr_device->GetConfigurationStrDescriptor(pdev->cfg.speed, &len);
425  break;
426 
428  pbuf = pdev->dev.usr_device->GetInterfaceStrDescriptor(pdev->cfg.speed, &len);
429  break;
430 
431  default:
432 #ifdef USB_SUPPORT_USER_STRING_DESC
433  pbuf = pdev->dev.class_cb->GetUsrStrDescriptor(pdev->cfg.speed, (req->wValue) , &len);
434  break;
435 #else
436  USBD_CtlError(pdev , req);
437  return;
438 #endif /* USBD_CtlError(pdev , req)*/
439  }
440  break;
442 #ifdef USB_OTG_HS_CORE
443  if(pdev->cfg.speed == USB_OTG_SPEED_HIGH )
444  {
445 
446  pbuf = (uint8_t *)pdev->dev.class_cb->GetConfigDescriptor(pdev->cfg.speed, &len);
447 
448  USBD_DeviceQualifierDesc[4]= pbuf[14];
449  USBD_DeviceQualifierDesc[5]= pbuf[15];
450  USBD_DeviceQualifierDesc[6]= pbuf[16];
451 
454  break;
455  }
456  else
457  {
458  USBD_CtlError(pdev , req);
459  return;
460  }
461 #else
462  USBD_CtlError(pdev , req);
463  return;
464 #endif
465 
467 #ifdef USB_OTG_HS_CORE
468 
469  if(pdev->cfg.speed == USB_OTG_SPEED_HIGH )
470  {
471  pbuf = (uint8_t *)pdev->dev.class_cb->GetOtherConfigDescriptor(pdev->cfg.speed, &len);
473  break;
474  }
475  else
476  {
477  USBD_CtlError(pdev , req);
478  return;
479  }
480 #else
481  USBD_CtlError(pdev , req);
482  return;
483 #endif
484  default:
485  USBD_CtlError(pdev , req);
486  return;
487  }
488 
489  if((len != 0)&& (req->wLength != 0))
490  {
491 
492  len = MIN(len , req->wLength);
493 
494  USBD_CtlSendData (pdev,
495  pbuf,
496  len);
497  }
498 
499 }
500 
509  USB_SETUP_REQ *req)
510 {
511  uint8_t dev_addr;
512 
513  if ((req->wIndex == 0) && (req->wLength == 0))
514  {
515  dev_addr = (uint8_t)(req->wValue) & 0x7F;
516 
517  if (pdev->dev.device_status == USB_OTG_CONFIGURED)
518  {
519  USBD_CtlError(pdev , req);
520  }
521  else
522  {
523  pdev->dev.device_address = dev_addr;
524  DCD_EP_SetAddress(pdev, dev_addr);
525  USBD_CtlSendStatus(pdev);
526 
527  if (dev_addr != 0)
528  {
529  pdev->dev.device_status = USB_OTG_ADDRESSED;
530  }
531  else
532  {
533  pdev->dev.device_status = USB_OTG_DEFAULT;
534  }
535  }
536  }
537  else
538  {
539  USBD_CtlError(pdev , req);
540  }
541 }
542 
551  USB_SETUP_REQ *req)
552 {
553 
554  static uint8_t cfgidx;
555 
556  cfgidx = (uint8_t)(req->wValue);
557 
558  if (cfgidx > USBD_CFG_MAX_NUM )
559  {
560  USBD_CtlError(pdev , req);
561  }
562  else
563  {
564  switch (pdev->dev.device_status)
565  {
566  case USB_OTG_ADDRESSED:
567  if (cfgidx)
568  {
569  pdev->dev.device_config = cfgidx;
570  pdev->dev.device_status = USB_OTG_CONFIGURED;
571  USBD_SetCfg(pdev , cfgidx);
572  USBD_CtlSendStatus(pdev);
573  }
574  else
575  {
576  USBD_CtlSendStatus(pdev);
577  }
578  break;
579 
580  case USB_OTG_CONFIGURED:
581  if (cfgidx == 0)
582  {
583  pdev->dev.device_status = USB_OTG_ADDRESSED;
584  pdev->dev.device_config = cfgidx;
585  USBD_ClrCfg(pdev , cfgidx);
586  USBD_CtlSendStatus(pdev);
587 
588  }
589  else if (cfgidx != pdev->dev.device_config)
590  {
591  /* Clear old configuration */
592  USBD_ClrCfg(pdev , pdev->dev.device_config);
593 
594  /* set new configuration */
595  pdev->dev.device_config = cfgidx;
596  USBD_SetCfg(pdev , cfgidx);
597  USBD_CtlSendStatus(pdev);
598  }
599  else
600  {
601  USBD_CtlSendStatus(pdev);
602  }
603  break;
604 
605  default:
606  USBD_CtlError(pdev , req);
607  break;
608  }
609  }
610 }
611 
620  USB_SETUP_REQ *req)
621 {
622 
623  if (req->wLength != 1)
624  {
625  USBD_CtlError(pdev , req);
626  }
627  else
628  {
629  switch (pdev->dev.device_status )
630  {
631  case USB_OTG_ADDRESSED:
632 
633  USBD_CtlSendData (pdev,
634  (uint8_t *)&USBD_default_cfg,
635  1);
636  break;
637 
638  case USB_OTG_CONFIGURED:
639 
640  USBD_CtlSendData (pdev,
641  &pdev->dev.device_config,
642  1);
643  break;
644 
645  default:
646  USBD_CtlError(pdev , req);
647  break;
648  }
649  }
650 }
651 
660  USB_SETUP_REQ *req)
661 {
662 
663 
664  switch (pdev->dev.device_status)
665  {
666  case USB_OTG_ADDRESSED:
667  case USB_OTG_CONFIGURED:
668 
669 #ifdef USBD_SELF_POWERED
670  USBD_cfg_status = USB_CONFIG_SELF_POWERED;
671 #else
672  USBD_cfg_status = 0x00;
673 #endif
674 
675  if (pdev->dev.DevRemoteWakeup)
676  {
677  USBD_cfg_status |= USB_CONFIG_REMOTE_WAKEUP;
678  }
679 
680  USBD_CtlSendData (pdev,
681  (uint8_t *)&USBD_cfg_status,
682  2);
683  break;
684 
685  default :
686  USBD_CtlError(pdev , req);
687  break;
688  }
689 }
690 
691 
700  USB_SETUP_REQ *req)
701 {
702 
704  uint8_t test_mode = 0;
705 
706  if (req->wValue == USB_FEATURE_REMOTE_WAKEUP)
707  {
708  pdev->dev.DevRemoteWakeup = 1;
709  pdev->dev.class_cb->Setup (pdev, req);
710  USBD_CtlSendStatus(pdev);
711  }
712 
713  else if ((req->wValue == USB_FEATURE_TEST_MODE) &&
714  ((req->wIndex & 0xFF) == 0))
715  {
716  dctl.d32 = USB_OTG_READ_REG32(&pdev->regs.DREGS->DCTL);
717 
718  test_mode = req->wIndex >> 8;
719  switch (test_mode)
720  {
721  case 1: /* TEST_J */
722  dctl.b.tstctl = 1;
723  break;
724 
725  case 2: /* TEST_K */
726  dctl.b.tstctl = 2;
727  break;
728 
729  case 3: /* TEST_SE0_NAK */
730  dctl.b.tstctl = 3;
731  break;
732 
733  case 4: /* TEST_PACKET */
734  dctl.b.tstctl = 4;
735  break;
736 
737  case 5: /* TEST_FORCE_ENABLE */
738  dctl.b.tstctl = 5;
739  break;
740 
741  default :
742  dctl.b.tstctl = 1;
743  break;
744  }
745  SET_TEST_MODE = dctl;
746  pdev->dev.test_mode = 1;
747  USBD_CtlSendStatus(pdev);
748  }
749  else
750  {
751  /* Do Nothing */
752  }
753 }
754 
755 
764  USB_SETUP_REQ *req)
765 {
766  switch (pdev->dev.device_status)
767  {
768  case USB_OTG_ADDRESSED:
769  case USB_OTG_CONFIGURED:
770  if (req->wValue == USB_FEATURE_REMOTE_WAKEUP)
771  {
772  pdev->dev.DevRemoteWakeup = 0;
773  pdev->dev.class_cb->Setup (pdev, req);
774  USBD_CtlSendStatus(pdev);
775  }
776  break;
777 
778  default :
779  USBD_CtlError(pdev , req);
780  break;
781  }
782 }
783 
793  USB_SETUP_REQ *req)
794 {
795  req->bmRequest = *(uint8_t *) (pdev->dev.setup_packet);
796  req->bRequest = *(uint8_t *) (pdev->dev.setup_packet + 1);
797  req->wValue = SWAPBYTE (pdev->dev.setup_packet + 2);
798  req->wIndex = SWAPBYTE (pdev->dev.setup_packet + 4);
799  req->wLength = SWAPBYTE (pdev->dev.setup_packet + 6);
800 
801  pdev->dev.in_ep[0].ctl_data_len = req->wLength ;
802  pdev->dev.device_state = USB_OTG_EP0_SETUP;
803 }
804 
814  USB_SETUP_REQ *req)
815 {
816  (void)req;
817  DCD_EP_Stall(pdev , 0x80);
818  DCD_EP_Stall(pdev , 0);
819  USB_OTG_EP0_OutStart(pdev);
820 }
821 
822 
831 void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
832 {
833  uint8_t idx = 0;
834 
835  if (desc != NULL)
836  {
837  *len = USBD_GetLen(desc) * 2 + 2;
838  unicode[idx++] = *len;
839  unicode[idx++] = USB_DESC_TYPE_STRING;
840 
841  while (*desc != NULL)
842  {
843  unicode[idx++] = *desc++;
844  unicode[idx++] = 0x00;
845  }
846  }
847 }
848 
855 static uint8_t USBD_GetLen(uint8_t *buf)
856 {
857  uint8_t len = 0;
858 
859  while (*buf != NULL)
860  {
861  len++;
862  buf++;
863  }
864 
865  return len;
866 }
881 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define USB_OTG_DEFAULT
Definition: usb_dcd.h:56
USBD_Status USBD_StdItfReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdItfReq Handle standard usb interface requests.
Definition: usbd_req.c:194
header file for the usbd_req.c file
uint8_t phy_itface
Definition: usb_core.h:170
USBD_Status
Definition: usbd_core.h:51
#define USB_LEN_DEV_QUALIFIER_DESC
Definition: usbd_def.h:53
#define USBD_IDX_CONFIG_STR
Definition: usbd_def.h:64
static void USBD_GetStatus(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetStatus Handle Get Status request.
Definition: usbd_req.c:659
#define USB_DESC_TYPE_DEVICE_QUALIFIER
Definition: usbd_def.h:94
#define USB_OTG_EP0_SETUP
Definition: usb_core.h:53
#define USB_REQ_SET_ADDRESS
Definition: usbd_def.h:80
#define USB_REQ_TYPE_CLASS
Definition: usbd_def.h:68
USBD_Status USBD_CtlSendData(USB_OTG_CORE_HANDLE *pdev, uint8_t *buf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
Definition: usbd_ioreq.c:95
static uint8_t USBD_GetLen(uint8_t *buf)
USBD_GetLen return the string length.
Definition: usbd_req.c:855
#define USB_CONFIG_REMOTE_WAKEUP
Definition: usbd_def.h:98
#define USBD_CFG_MAX_NUM
#define USB_REQ_GET_STATUS
Definition: usbd_def.h:77
__ALIGN_BEGIN uint32_t USBD_ep_status __ALIGN_END
Definition: usbd_req.c:79
static void USBD_GetDescriptor(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetDescriptor Handle Get Descriptor requests.
Definition: usbd_req.c:373
uint8_t USBD_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC]
Definition: usbd_desc.c:166
uint32_t DCD_EP_Stall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Stall an endpoint.
Definition: usb_dcd.c:306
USBD_Status USBD_ClrCfg(USB_OTG_CORE_HANDLE *pdev, uint8_t cfgidx)
USBD_ClrCfg Clear current configuration.
Definition: usbd_core.c:459
#define USB_FEATURE_EP_HALT
Definition: usbd_def.h:101
#define USBD_ITF_MAX_NUM
Definition: usbd_conf.h:33
__IO USB_OTG_DCTL_TypeDef SET_TEST_MODE
Definition: usbd_core.c:97
#define USBD_IDX_PRODUCT_STR
Definition: usbd_def.h:62
#define USB_REQ_SET_FEATURE
Definition: usbd_def.h:79
#define USB_REQ_SET_CONFIGURATION
Definition: usbd_def.h:84
#define USBD_IDX_SERIAL_STR
Definition: usbd_def.h:63
#define USB_OTG_SPEED_FULL
Definition: usb_defines.h:62
USB_OTG_CORE_CFGS cfg
Definition: usb_core.h:289
#define MIN(a, b)
Definition: usb_defines.h:178
uint8_t speed
Definition: usb_core.h:166
#define USB_OTG_SPEED_HIGH
Definition: usb_defines.h:61
#define USBD_IDX_LANGID_STR
Definition: usbd_def.h:60
#define __IO
Definition: core_cm0.h:198
uint16_t wIndex
Definition: usb_core.h:185
uint8_t USBD_StrDesc[USB_MAX_STR_DESC_SIZ]
Definition: usbd_req.c:95
#define __ALIGN_BEGIN
USBD_Status USBD_SetCfg(USB_OTG_CORE_HANDLE *pdev, uint8_t cfgidx)
USBD_SetCfg Configure device and start the interface.
Definition: usbd_core.c:443
#define USB_DESC_TYPE_BOS
Definition: usbd_def.h:96
#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.
Definition: usbd_ioreq.c:183
void USBD_ParseSetupRequest(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_ParseSetupRequest Copy buffer into setup structure.
Definition: usbd_req.c:792
__IO uint32_t DCTL
Definition: usb_regs.h:116
#define USB_OTG_READ_REG32(reg)
Definition: usb_defines.h:225
uint32_t DCD_EP_ClrStall(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
Clear stall condition on endpoints.
Definition: usb_dcd.c:333
static void USBD_SetAddress(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_SetAddress Set device address.
Definition: usbd_req.c:508
#define USB_REQ_GET_DESCRIPTOR
Definition: usbd_def.h:81
uint8_t bmRequest
Definition: usb_core.h:182
#define USB_FEATURE_REMOTE_WAKEUP
Definition: usbd_def.h:102
#define USB_OTG_ADDRESSED
Definition: usb_dcd.h:57
void USBD_CtlError(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_CtlError Handle USB low level Error.
Definition: usbd_req.c:813
header file for the usbd_ioreq.c file
#define SWAPBYTE(addr)
Definition: usbd_def.h:122
#define USB_REQ_CLEAR_FEATURE
Definition: usbd_def.h:78
static void USBD_GetConfig(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_GetConfig Handle Get device configuration request.
Definition: usbd_req.c:619
void DCD_EP_SetAddress(USB_OTG_CORE_HANDLE *pdev, uint8_t address)
This Function set USB device address.
Definition: usb_dcd.c:382
#define USB_FEATURE_TEST_MODE
Definition: usbd_def.h:103
#define USB_REQ_GET_CONFIGURATION
Definition: usbd_def.h:83
uint16_t wLength
Definition: usb_core.h:186
#define USBD_IDX_INTERFACE_STR
Definition: usbd_def.h:65
uint8_t bRequest
Definition: usb_core.h:183
#define NULL
Definition: usbd_def.h:50
static void USBD_ClrFeature(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_ClrFeature Handle clear device feature request.
Definition: usbd_req.c:763
#define LOBYTE(x)
Definition: usbd_def.h:125
static void USBD_SetFeature(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_SetFeature Handle Set device feature request.
Definition: usbd_req.c:699
#define USB_OTG_CONFIGURED
Definition: usb_dcd.h:58
#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION
Definition: usbd_def.h:95
#define USBD_IDX_MFC_STR
Definition: usbd_def.h:61
void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
USBD_GetString Convert Ascii string into unicode one.
Definition: usbd_req.c:831
#define USB_DESC_TYPE_CONFIGURATION
Definition: usbd_def.h:90
#define USB_REQ_TYPE_MASK
Definition: usbd_def.h:70
#define USB_DESC_TYPE_DEVICE
Definition: usbd_def.h:89
USBD_Status USBD_StdEPReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdEPReq Handle standard usb endpoint requests.
Definition: usbd_req.c:231
#define USB_DESC_TYPE_STRING
Definition: usbd_def.h:91
#define USB_CONFIG_SELF_POWERED
Definition: usbd_def.h:99
USB_OTG_CORE_REGS regs
Definition: usb_core.h:290
#define USB_OTG_ULPI_PHY
Definition: usb_defines.h:64
uint16_t wValue
Definition: usb_core.h:184
USBD_Status USBD_StdDevReq(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_StdDevReq Handle standard usb device requests.
Definition: usbd_req.c:143
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.
Definition: usbd_req.c:550
USB_OTG_DREGS * DREGS
Definition: usb_regs.h:225


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:26