Prusa MINI Firmware overview
USBH_CORE_Exported_FunctionsPrototype
Collaboration diagram for USBH_CORE_Exported_FunctionsPrototype:

Functions

USBH_StatusTypeDef USBH_Init (USBH_HandleTypeDef *phost, void(*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t), uint8_t id)
 HCD_Init Initialize the HOST Core. More...
 
USBH_StatusTypeDef USBH_DeInit (USBH_HandleTypeDef *phost)
 HCD_Init De-Initialize the Host portion of the driver. More...
 
USBH_StatusTypeDef USBH_RegisterClass (USBH_HandleTypeDef *phost, USBH_ClassTypeDef *pclass)
 USBH_RegisterClass Link class driver to Host Core. More...
 
USBH_StatusTypeDef USBH_SelectInterface (USBH_HandleTypeDef *phost, uint8_t interface)
 USBH_SelectInterface Select current interface. More...
 
uint8_t USBH_FindInterface (USBH_HandleTypeDef *phost, uint8_t Class, uint8_t SubClass, uint8_t Protocol)
 USBH_FindInterface Find the interface index for a specific class. More...
 
uint8_t USBH_GetActiveClass (USBH_HandleTypeDef *phost)
 USBH_GetActiveClass Return Device Class. More...
 
uint8_t USBH_FindInterfaceIndex (USBH_HandleTypeDef *phost, uint8_t interface_number, uint8_t alt_settings)
 USBH_FindInterfaceIndex Find the interface index for a specific class interface and alternate setting number. More...
 
USBH_StatusTypeDef USBH_Start (USBH_HandleTypeDef *phost)
 USBH_Start Start the USB Host Core. More...
 
USBH_StatusTypeDef USBH_Stop (USBH_HandleTypeDef *phost)
 USBH_Stop Stop the USB Host Core. More...
 
USBH_StatusTypeDef USBH_Process (USBH_HandleTypeDef *phost)
 USBH_Process Background process of the USB Core. More...
 
USBH_StatusTypeDef USBH_ReEnumerate (USBH_HandleTypeDef *phost)
 HCD_ReEnumerate Perform a new Enumeration phase. More...
 
USBH_StatusTypeDef USBH_LL_Init (USBH_HandleTypeDef *phost)
 Initialize the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_DeInit (USBH_HandleTypeDef *phost)
 De-Initialize the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_Start (USBH_HandleTypeDef *phost)
 Start the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_Stop (USBH_HandleTypeDef *phost)
 Stop the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_Connect (USBH_HandleTypeDef *phost)
 USBH_LL_Connect Handle USB Host connexion event. More...
 
USBH_StatusTypeDef USBH_LL_Disconnect (USBH_HandleTypeDef *phost)
 USBH_LL_Disconnect Handle USB Host disconnection event. More...
 
USBH_SpeedTypeDef USBH_LL_GetSpeed (USBH_HandleTypeDef *phost)
 Return the USB host speed from the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_ResetPort (USBH_HandleTypeDef *phost)
 Reset the Host port of the low level driver. More...
 
uint32_t USBH_LL_GetLastXferSize (USBH_HandleTypeDef *phost, uint8_t)
 Return the last transfered packet size. More...
 
USBH_StatusTypeDef USBH_LL_DriverVBUS (USBH_HandleTypeDef *phost, uint8_t)
 Drive VBUS. More...
 
USBH_StatusTypeDef USBH_LL_OpenPipe (USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t)
 Open a pipe of the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_ClosePipe (USBH_HandleTypeDef *phost, uint8_t)
 Close a pipe of the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_SubmitURB (USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t *, uint16_t, uint8_t)
 Submit a new URB to the low level driver. More...
 
USBH_URBStateTypeDef USBH_LL_GetURBState (USBH_HandleTypeDef *phost, uint8_t)
 Get a URB state from the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_SetToggle (USBH_HandleTypeDef *phost, uint8_t, uint8_t)
 Set toggle for a pipe. More...
 
uint8_t USBH_LL_GetToggle (USBH_HandleTypeDef *phost, uint8_t)
 Return the current toggle of a pipe. More...
 
void USBH_Delay (uint32_t Delay)
 Delay routine for the USB Host Library. More...
 
void USBH_LL_SetTimer (USBH_HandleTypeDef *phost, uint32_t)
 USBH_LL_SetTimer Set the initial Host Timer tick. More...
 
void USBH_LL_IncTimer (USBH_HandleTypeDef *phost)
 USBH_LL_IncTimer Increment Host Timer tick. More...
 

Detailed Description

Function Documentation

◆ USBH_Init()

USBH_StatusTypeDef USBH_Init ( USBH_HandleTypeDef phost,
void(*)(USBH_HandleTypeDef *phost, uint8_t pUsrFunc,
uint8_t  id 
)

HCD_Init Initialize the HOST Core.

Parameters
phostHost Handle
pUsrFuncUser Callback
Return values
USBHStatus
93 {
94  /* Check whether the USB Host handle is valid */
95  if(phost == NULL)
96  {
97  USBH_ErrLog("Invalid Host handle");
98  return USBH_FAIL;
99  }
100 
101  /* Set DRiver ID */
102  phost->id = id;
103 
104  /* Unlink class*/
105  phost->pActiveClass = NULL;
106  phost->ClassNumber = 0;
107 
108  /* Restore default states and prepare EP0 */
109  DeInitStateMachine(phost);
110 
111  /* Assign User process */
112  if(pUsrFunc != NULL)
113  {
114  phost->pUser = pUsrFunc;
115  }
116 
117 #if (USBH_USE_OS == 1)
118 
119  /* Create USB Host Queue */
120  osMessageQDef(USBH_Queue, 10, uint16_t);
121  phost->os_event = osMessageCreate (osMessageQ(USBH_Queue), NULL);
122 
123  /*Create USB Host Task */
124 #if defined (USBH_PROCESS_STACK_SIZE)
125  osThreadDef(USBH_Thread, USBH_Process_OS, USBH_PROCESS_PRIO, 0, USBH_PROCESS_STACK_SIZE);
126 #else
127  osThreadDef(USBH_Thread, USBH_Process_OS, USBH_PROCESS_PRIO, 0, 8 * configMINIMAL_STACK_SIZE);
128 #endif
129  phost->thread = osThreadCreate (osThread(USBH_Thread), phost);
130 #endif
131 
132  /* Initialize low level driver */
133  USBH_LL_Init(phost);
134  return USBH_OK;
135 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_DeInit()

USBH_StatusTypeDef USBH_DeInit ( USBH_HandleTypeDef phost)

HCD_Init De-Initialize the Host portion of the driver.

Parameters
phostHost Handle
Return values
USBHStatus
144 {
145  DeInitStateMachine(phost);
146 
147  if(phost->pData != NULL)
148  {
149  phost->pActiveClass->pData = NULL;
150  USBH_LL_Stop(phost);
151  }
152 
153  return USBH_OK;
154 }
Here is the call graph for this function:

◆ USBH_RegisterClass()

USBH_StatusTypeDef USBH_RegisterClass ( USBH_HandleTypeDef phost,
USBH_ClassTypeDef pclass 
)

USBH_RegisterClass Link class driver to Host Core.

Parameters
phost: Host Handle
pclassClass handle
Return values
USBHStatus
200 {
202 
203  if(pclass != 0)
204  {
206  {
207  /* link the class to the USB Host handle */
208  phost->pClass[phost->ClassNumber++] = pclass;
209  status = USBH_OK;
210  }
211  else
212  {
213  USBH_ErrLog("Max Class Number reached");
214  status = USBH_FAIL;
215  }
216  }
217  else
218  {
219  USBH_ErrLog("Invalid Class handle");
220  status = USBH_FAIL;
221  }
222 
223  return status;
224 }
Here is the caller graph for this function:

◆ USBH_SelectInterface()

USBH_StatusTypeDef USBH_SelectInterface ( USBH_HandleTypeDef phost,
uint8_t  interface 
)

USBH_SelectInterface Select current interface.

Parameters
phostHost Handle
interfaceInterface number
Return values
USBHStatus
234 {
236 
237  if(interface < phost->device.CfgDesc.bNumInterfaces)
238  {
239  phost->device.current_interface = interface;
240  USBH_UsrLog ("Switching to Interface (#%d)", interface);
241  USBH_UsrLog ("Class : %xh", phost->device.CfgDesc.Itf_Desc[interface].bInterfaceClass );
242  USBH_UsrLog ("SubClass : %xh", phost->device.CfgDesc.Itf_Desc[interface].bInterfaceSubClass );
243  USBH_UsrLog ("Protocol : %xh", phost->device.CfgDesc.Itf_Desc[interface].bInterfaceProtocol );
244  }
245  else
246  {
247  USBH_ErrLog ("Cannot Select This Interface.");
248  status = USBH_FAIL;
249  }
250  return status;
251 }
Here is the caller graph for this function:

◆ USBH_FindInterface()

uint8_t USBH_FindInterface ( USBH_HandleTypeDef phost,
uint8_t  Class,
uint8_t  SubClass,
uint8_t  Protocol 
)

USBH_FindInterface Find the interface index for a specific class.

Parameters
phostHost Handle
ClassClass code
SubClassSubClass code
ProtocolProtocol code
Return values
interfaceindex in the configuration structure
Note
: (1)interface index 0xFF means interface index not found
275 {
277  USBH_CfgDescTypeDef *pcfg ;
278  int8_t if_ix = 0;
279 
280  pif = (USBH_InterfaceDescTypeDef *)0;
281  pcfg = &phost->device.CfgDesc;
282 
283  while (if_ix < USBH_MAX_NUM_INTERFACES)
284  {
285  pif = &pcfg->Itf_Desc[if_ix];
286  if(((pif->bInterfaceClass == Class) || (Class == 0xFF))&&
287  ((pif->bInterfaceSubClass == SubClass) || (SubClass == 0xFF))&&
288  ((pif->bInterfaceProtocol == Protocol) || (Protocol == 0xFF)))
289  {
290  return if_ix;
291  }
292  if_ix++;
293  }
294  return 0xFF;
295 }
Here is the caller graph for this function:

◆ USBH_GetActiveClass()

uint8_t USBH_GetActiveClass ( USBH_HandleTypeDef phost)

USBH_GetActiveClass Return Device Class.

Parameters
phostHost Handle
interfaceInterface index
Return values
ClassCode
261 {
262  return (phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass);
263 }

◆ USBH_FindInterfaceIndex()

uint8_t USBH_FindInterfaceIndex ( USBH_HandleTypeDef phost,
uint8_t  interface_number,
uint8_t  alt_settings 
)

USBH_FindInterfaceIndex Find the interface index for a specific class interface and alternate setting number.

Parameters
phostHost Handle
interface_numberinterface number
alt_settings: alternate setting number
Return values
interfaceindex in the configuration structure
Note
: (1)interface index 0xFF means interface index not found
307 {
309  USBH_CfgDescTypeDef *pcfg ;
310  int8_t if_ix = 0;
311 
312  pif = (USBH_InterfaceDescTypeDef *)0;
313  pcfg = &phost->device.CfgDesc;
314 
315  while (if_ix < USBH_MAX_NUM_INTERFACES)
316  {
317  pif = &pcfg->Itf_Desc[if_ix];
318  if((pif->bInterfaceNumber == interface_number) && (pif->bAlternateSetting == alt_settings))
319  {
320  return if_ix;
321  }
322  if_ix++;
323  }
324  return 0xFF;
325 }

◆ USBH_Start()

USBH_StatusTypeDef USBH_Start ( USBH_HandleTypeDef phost)

USBH_Start Start the USB Host Core.

Parameters
phostHost Handle
Return values
USBHStatus
334 {
335  /* Start the low level driver */
336  USBH_LL_Start(phost);
337 
338  /* Activate VBUS on the port */
339  USBH_LL_DriverVBUS (phost, TRUE);
340 
341  return USBH_OK;
342 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_Stop()

USBH_StatusTypeDef USBH_Stop ( USBH_HandleTypeDef phost)

USBH_Stop Stop the USB Host Core.

Parameters
phostHost Handle
Return values
USBHStatus
351 {
352  /* Stop and cleanup the low level driver */
353  USBH_LL_Stop(phost);
354 
355  /* DeActivate VBUS on the port */
356  USBH_LL_DriverVBUS (phost, FALSE);
357 
358  /* FRee Control Pipes */
359  USBH_FreePipe (phost, phost->Control.pipe_in);
360  USBH_FreePipe (phost, phost->Control.pipe_out);
361 
362  return USBH_OK;
363 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_Process()

USBH_StatusTypeDef USBH_Process ( USBH_HandleTypeDef phost)

USBH_Process Background process of the USB Core.

Parameters
phostHost Handle
Return values
USBHStatus
398 {
400  uint8_t idx = 0;
401 
402  switch (phost->gState)
403  {
404  case HOST_IDLE :
405 
406  if (phost->device.is_connected)
407  {
408  /* Wait for 200 ms after connection */
410  USBH_Delay(200);
411  USBH_LL_ResetPort(phost);
412 #if (USBH_USE_OS == 1)
413  osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
414 #endif
415  }
416  break;
417 
419  break;
420 
421  case HOST_DEV_ATTACHED :
422 
423  USBH_UsrLog("USB Device Attached");
424 
425  /* Wait for 100 ms after Reset */
426  USBH_Delay(100);
427 
428  phost->device.speed = USBH_LL_GetSpeed(phost);
429 
430  phost->gState = HOST_ENUMERATION;
431 
432  phost->Control.pipe_out = USBH_AllocPipe (phost, 0x00);
433  phost->Control.pipe_in = USBH_AllocPipe (phost, 0x80);
434 
435 
436  /* Open Control pipes */
437  USBH_OpenPipe (phost,
438  phost->Control.pipe_in,
439  0x80,
440  phost->device.address,
441  phost->device.speed,
443  phost->Control.pipe_size);
444 
445  /* Open Control pipes */
446  USBH_OpenPipe (phost,
447  phost->Control.pipe_out,
448  0x00,
449  phost->device.address,
450  phost->device.speed,
452  phost->Control.pipe_size);
453 
454 #if (USBH_USE_OS == 1)
455  osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
456 #endif
457 
458  break;
459 
460  case HOST_ENUMERATION:
461  /* Check for enumeration status */
462  if ( USBH_HandleEnum(phost) == USBH_OK)
463  {
464  /* The function shall return USBH_OK when full enumeration is complete */
465  USBH_UsrLog ("Enumeration done.");
466  phost->device.current_interface = 0;
467  if(phost->device.DevDesc.bNumConfigurations == 1)
468  {
469  USBH_UsrLog ("This device has only 1 configuration.");
471 
472  }
473  else
474  {
475  phost->gState = HOST_INPUT;
476  }
477 
478  }
479  break;
480 
481  case HOST_INPUT:
482  {
483  /* user callback for end of device basic enumeration */
484  if(phost->pUser != NULL)
485  {
486  phost->pUser(phost, HOST_USER_SELECT_CONFIGURATION);
488 
489 #if (USBH_USE_OS == 1)
490  osMessagePut ( phost->os_event, USBH_STATE_CHANGED_EVENT, 0);
491 #endif
492  }
493  }
494  break;
495 
497  /* set configuration */
498  if (USBH_SetCfg(phost, phost->device.CfgDesc.bConfigurationValue) == USBH_OK)
499  {
500  phost->gState = HOST_CHECK_CLASS;
501  USBH_UsrLog ("Default configuration set.");
502 
503  }
504 
505  break;
506 
507  case HOST_CHECK_CLASS:
508 
509  if(phost->ClassNumber == 0)
510  {
511  USBH_UsrLog ("No Class has been registered.");
512  }
513  else
514  {
515  phost->pActiveClass = NULL;
516 
517  for (idx = 0; idx < USBH_MAX_NUM_SUPPORTED_CLASS ; idx ++)
518  {
519  if(phost->pClass[idx]->ClassCode == phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass)
520  {
521  phost->pActiveClass = phost->pClass[idx];
522  }
523  }
524 
525  if(phost->pActiveClass != NULL)
526  {
527  if(phost->pActiveClass->Init(phost)== USBH_OK)
528  {
529  phost->gState = HOST_CLASS_REQUEST;
530  USBH_UsrLog ("%s class started.", phost->pActiveClass->Name);
531 
532  /* Inform user that a class has been activated */
533  phost->pUser(phost, HOST_USER_CLASS_SELECTED);
534  }
535  else
536  {
537  phost->gState = HOST_ABORT_STATE;
538  USBH_UsrLog ("Device not supporting %s class.", phost->pActiveClass->Name);
539  }
540  }
541  else
542  {
543  phost->gState = HOST_ABORT_STATE;
544  USBH_UsrLog ("No registered class for this device.");
545  }
546  }
547 
548 #if (USBH_USE_OS == 1)
549  osMessagePut ( phost->os_event, USBH_STATE_CHANGED_EVENT, 0);
550 #endif
551  break;
552 
553  case HOST_CLASS_REQUEST:
554  /* process class standard control requests state machine */
555  if(phost->pActiveClass != NULL)
556  {
557  status = phost->pActiveClass->Requests(phost);
558 
559  if(status == USBH_OK)
560  {
561  phost->gState = HOST_CLASS;
562  }
563  }
564  else
565  {
566  phost->gState = HOST_ABORT_STATE;
567  USBH_ErrLog ("Invalid Class Driver.");
568 
569 #if (USBH_USE_OS == 1)
570  osMessagePut ( phost->os_event, USBH_STATE_CHANGED_EVENT, 0);
571 #endif
572  }
573 
574  break;
575  case HOST_CLASS:
576  /* process class state machine */
577  if(phost->pActiveClass != NULL)
578  {
579  phost->pActiveClass->BgndProcess(phost);
580  }
581  break;
582 
583  case HOST_DEV_DISCONNECTED :
584 
585  DeInitStateMachine(phost);
586 
587  /* Re-Initilaize Host for new Enumeration */
588  if(phost->pActiveClass != NULL)
589  {
590  phost->pActiveClass->DeInit(phost);
591  phost->pActiveClass = NULL;
592  }
593  break;
594 
595  case HOST_ABORT_STATE:
596  default :
597  break;
598  }
599  return USBH_OK;
600 }
Here is the call graph for this function:

◆ USBH_ReEnumerate()

USBH_StatusTypeDef USBH_ReEnumerate ( USBH_HandleTypeDef phost)

HCD_ReEnumerate Perform a new Enumeration phase.

Parameters
phostHost Handle
Return values
USBHStatus
372 {
373  /*Stop Host */
374  USBH_Stop(phost);
375 
376  /*Device has disconnected, so wait for 200 ms */
377  USBH_Delay(200);
378 
379  /* Set State machines in default state */
380  DeInitStateMachine(phost);
381 
382  /* Start again the host */
383  USBH_Start(phost);
384 
385 #if (USBH_USE_OS == 1)
386  osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
387 #endif
388  return USBH_OK;
389 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_Init()

USBH_StatusTypeDef USBH_LL_Init ( USBH_HandleTypeDef phost)

Initialize the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus
193  {
194  /* Init USB_IP */
195  if (phost->id == HOST_HS) {
196  /* Link the driver to the stack. */
197  hhcd_USB_OTG_HS.pData = phost;
198  phost->pData = &hhcd_USB_OTG_HS;
199 
200  hhcd_USB_OTG_HS.Instance = USB_OTG_HS;
201  hhcd_USB_OTG_HS.Init.Host_channels = 12;
202  hhcd_USB_OTG_HS.Init.speed = HCD_SPEED_FULL;
203  hhcd_USB_OTG_HS.Init.dma_enable = DISABLE;
204  hhcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;
205  hhcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
206  hhcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
207  hhcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE;
208  hhcd_USB_OTG_HS.Init.use_external_vbus = DISABLE;
209  if (HAL_HCD_Init(&hhcd_USB_OTG_HS) != HAL_OK) {
210  Error_Handler();
211  }
212 
213  USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hhcd_USB_OTG_HS));
214  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_DeInit()

USBH_StatusTypeDef USBH_LL_DeInit ( USBH_HandleTypeDef phost)

De-Initialize the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus
223  {
224  HAL_StatusTypeDef hal_status = HAL_OK;
225  USBH_StatusTypeDef usb_status = USBH_OK;
226 
227  hal_status = HAL_HCD_DeInit(phost->pData);
228 
229  switch (hal_status) {
230  case HAL_OK:
231  usb_status = USBH_OK;
232  break;
233  case HAL_ERROR:
234  usb_status = USBH_FAIL;
235  break;
236  case HAL_BUSY:
237  usb_status = USBH_BUSY;
238  break;
239  case HAL_TIMEOUT:
240  usb_status = USBH_FAIL;
241  break;
242  default:
243  usb_status = USBH_FAIL;
244  break;
245  }

◆ USBH_LL_Start()

USBH_StatusTypeDef USBH_LL_Start ( USBH_HandleTypeDef phost)

Start the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus
254  {
255  HAL_StatusTypeDef hal_status = HAL_OK;
256  USBH_StatusTypeDef usb_status = USBH_OK;
257 
258  hal_status = HAL_HCD_Start(phost->pData);
259 
260  switch (hal_status) {
261  case HAL_OK:
262  usb_status = USBH_OK;
263  break;
264  case HAL_ERROR:
265  usb_status = USBH_FAIL;
266  break;
267  case HAL_BUSY:
268  usb_status = USBH_BUSY;
269  break;
270  case HAL_TIMEOUT:
271  usb_status = USBH_FAIL;
272  break;
273  default:
274  usb_status = USBH_FAIL;
275  break;
276  }
Here is the caller graph for this function:

◆ USBH_LL_Stop()

USBH_StatusTypeDef USBH_LL_Stop ( USBH_HandleTypeDef phost)

Stop the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus
285  {
286  HAL_StatusTypeDef hal_status = HAL_OK;
287  USBH_StatusTypeDef usb_status = USBH_OK;
288 
289  hal_status = HAL_HCD_Stop(phost->pData);
290 
291  switch (hal_status) {
292  case HAL_OK:
293  usb_status = USBH_OK;
294  break;
295  case HAL_ERROR:
296  usb_status = USBH_FAIL;
297  break;
298  case HAL_BUSY:
299  usb_status = USBH_BUSY;
300  break;
301  case HAL_TIMEOUT:
302  usb_status = USBH_FAIL;
303  break;
304  default:
305  usb_status = USBH_FAIL;
306  break;
307  }
Here is the caller graph for this function:

◆ USBH_LL_Connect()

USBH_StatusTypeDef USBH_LL_Connect ( USBH_HandleTypeDef phost)

USBH_LL_Connect Handle USB Host connexion event.

Parameters
phostHost Handle
Return values
USBH_Status
827 {
828  if(phost->gState == HOST_IDLE )
829  {
830  phost->device.is_connected = 1;
831 
832  if(phost->pUser != NULL)
833  {
834  phost->pUser(phost, HOST_USER_CONNECTION);
835  }
836  }
837  else if(phost->gState == HOST_DEV_WAIT_FOR_ATTACHMENT )
838  {
839  phost->gState = HOST_DEV_ATTACHED ;
840  }
841 #if (USBH_USE_OS == 1)
842  osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
843 #endif
844 
845  return USBH_OK;
846 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_Disconnect()

USBH_StatusTypeDef USBH_LL_Disconnect ( USBH_HandleTypeDef phost)

USBH_LL_Disconnect Handle USB Host disconnection event.

Parameters
phostHost Handle
Return values
USBH_Status
855 {
856  /*Stop Host */
857  USBH_LL_Stop(phost);
858 
859  /* FRee Control Pipes */
860  USBH_FreePipe (phost, phost->Control.pipe_in);
861  USBH_FreePipe (phost, phost->Control.pipe_out);
862 
863  phost->device.is_connected = 0;
864 
865  if(phost->pUser != NULL)
866  {
867  phost->pUser(phost, HOST_USER_DISCONNECTION);
868  }
869  USBH_UsrLog("USB Device disconnected");
870 
871  /* Start the low level driver */
872  USBH_LL_Start(phost);
873 
874  phost->gState = HOST_DEV_DISCONNECTED;
875 
876 #if (USBH_USE_OS == 1)
877  osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
878 #endif
879 
880  return USBH_OK;
881 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_GetSpeed()

USBH_SpeedTypeDef USBH_LL_GetSpeed ( USBH_HandleTypeDef phost)

Return the USB host speed from the low level driver.

Parameters
phostHost handle
Return values
USBHspeeds
316  {
318 
319  switch (HAL_HCD_GetCurrentSpeed(phost->pData)) {
320  case 0:
321  speed = USBH_SPEED_HIGH;
322  break;
323 
324  case 1:
325  speed = USBH_SPEED_FULL;
326  break;
327 
328  case 2:
329  speed = USBH_SPEED_LOW;
330  break;
331 
332  default:
333  speed = USBH_SPEED_FULL;
334  break;
335  }
Here is the caller graph for this function:

◆ USBH_LL_ResetPort()

USBH_StatusTypeDef USBH_LL_ResetPort ( USBH_HandleTypeDef phost)

Reset the Host port of the low level driver.

Parameters
phostHost handle
Return values
USBHstatus
344  {
345  HAL_StatusTypeDef hal_status = HAL_OK;
346  USBH_StatusTypeDef usb_status = USBH_OK;
347 
348  hal_status = HAL_HCD_ResetPort(phost->pData);
349  switch (hal_status) {
350  case HAL_OK:
351  usb_status = USBH_OK;
352  break;
353  case HAL_ERROR:
354  usb_status = USBH_FAIL;
355  break;
356  case HAL_BUSY:
357  usb_status = USBH_BUSY;
358  break;
359  case HAL_TIMEOUT:
360  usb_status = USBH_FAIL;
361  break;
362  default:
363  usb_status = USBH_FAIL;
364  break;
365  }
Here is the caller graph for this function:

◆ USBH_LL_GetLastXferSize()

uint32_t USBH_LL_GetLastXferSize ( USBH_HandleTypeDef phost,
uint8_t  pipe 
)

Return the last transfered packet size.

Parameters
phostHost handle
pipePipe index
Return values
Packetsize
375  {
Here is the caller graph for this function:

◆ USBH_LL_DriverVBUS()

USBH_StatusTypeDef USBH_LL_DriverVBUS ( USBH_HandleTypeDef phost,
uint8_t  state 
)

Drive VBUS.

Parameters
phostHost handle
state: VBUS state This parameter can be one of the these values: 0 : VBUS Active 1 : VBUS Inactive
Return values
Status
534  {
535 
536  /* USER CODE BEGIN 0 */
537 
538  /* USER CODE END 0*/
539 
540  if (phost->id == HOST_HS) {
541  if (state == 0) {
542  /* Drive high Charge pump */
543  /* ToDo: Add IOE driver control */
544  /* USER CODE BEGIN DRIVE_HIGH_CHARGE_FOR_HS */
545 
546  /* USER CODE END DRIVE_HIGH_CHARGE_FOR_HS */
547  } else {
548  /* Drive low Charge pump */
549  /* ToDo: Add IOE driver control */
550  /* USER CODE BEGIN DRIVE_LOW_CHARGE_FOR_HS */
551 
552  /* USER CODE END DRIVE_LOW_CHARGE_FOR_HS */
553  }
554  }
555  HAL_Delay(200);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_OpenPipe()

USBH_StatusTypeDef USBH_LL_OpenPipe ( USBH_HandleTypeDef phost,
uint8_t  pipe_num,
uint8_t  epnum,
uint8_t  dev_address,
uint8_t  speed,
uint8_t  ep_type,
uint16_t  mps 
)

Open a pipe of the low level driver.

Parameters
phostHost handle
pipe_numPipe index
epnumEndpoint number
dev_addressDevice USB address
speedDevice Speed
ep_typeEndpoint type
mpsEndpoint max packet size
Return values
USBHstatus
391  {
392  HAL_StatusTypeDef hal_status = HAL_OK;
393  USBH_StatusTypeDef usb_status = USBH_OK;
394 
395  hal_status = HAL_HCD_HC_Init(phost->pData, pipe_num, epnum,
396  dev_address, speed, ep_type, mps);
397 
398  switch (hal_status) {
399  case HAL_OK:
400  usb_status = USBH_OK;
401  break;
402  case HAL_ERROR:
403  usb_status = USBH_FAIL;
404  break;
405  case HAL_BUSY:
406  usb_status = USBH_BUSY;
407  break;
408  case HAL_TIMEOUT:
409  usb_status = USBH_FAIL;
410  break;
411  default:
412  usb_status = USBH_FAIL;
413  break;
414  }
Here is the caller graph for this function:

◆ USBH_LL_ClosePipe()

USBH_StatusTypeDef USBH_LL_ClosePipe ( USBH_HandleTypeDef phost,
uint8_t  pipe 
)

Close a pipe of the low level driver.

Parameters
phostHost handle
pipePipe index
Return values
USBHstatus
424  {
425  HAL_StatusTypeDef hal_status = HAL_OK;
426  USBH_StatusTypeDef usb_status = USBH_OK;
427 
428  hal_status = HAL_HCD_HC_Halt(phost->pData, pipe);
429 
430  switch (hal_status) {
431  case HAL_OK:
432  usb_status = USBH_OK;
433  break;
434  case HAL_ERROR:
435  usb_status = USBH_FAIL;
436  break;
437  case HAL_BUSY:
438  usb_status = USBH_BUSY;
439  break;
440  case HAL_TIMEOUT:
441  usb_status = USBH_FAIL;
442  break;
443  default:
444  usb_status = USBH_FAIL;
445  break;
446  }
Here is the caller graph for this function:

◆ USBH_LL_SubmitURB()

USBH_StatusTypeDef USBH_LL_SubmitURB ( USBH_HandleTypeDef phost,
uint8_t  pipe,
uint8_t  direction,
uint8_t  ep_type,
uint8_t  token,
uint8_t pbuff,
uint16_t  length,
uint8_t  do_ping 
)

Submit a new URB to the low level driver.

Parameters
phostHost handle
pipePipe index This parameter can be a value from 1 to 15
direction: Channel number This parameter can be one of the these values: 0 : Output 1 : Input
ep_type: Endpoint Type This parameter can be one of the these values:
  • EP_TYPE_CTRL: Control type
  • EP_TYPE_ISOC: Isochrounous type
  • EP_TYPE_BULK: Bulk type
  • EP_TYPE_INTR: Interrupt type
token: Endpoint Type This parameter can be one of the these values:
  • 0: PID_SETUP
  • 1: PID_DATA
pbuff: pointer to URB data
length: Length of URB data
do_ping: activate do ping protocol (for high speed only) This parameter can be one of the these values: 0 : do ping inactive 1 : do ping active
Return values
Status
479  {
480  HAL_StatusTypeDef hal_status = HAL_OK;
481  USBH_StatusTypeDef usb_status = USBH_OK;
482 
483  hal_status = HAL_HCD_HC_SubmitRequest(phost->pData, pipe, direction,
484  ep_type, token, pbuff, length,
485  do_ping);
486 
487  switch (hal_status) {
488  case HAL_OK:
489  usb_status = USBH_OK;
490  break;
491  case HAL_ERROR:
492  usb_status = USBH_FAIL;
493  break;
494  case HAL_BUSY:
495  usb_status = USBH_BUSY;
496  break;
497  case HAL_TIMEOUT:
498  usb_status = USBH_FAIL;
499  break;
500  default:
501  usb_status = USBH_FAIL;
502  break;
503  }
Here is the caller graph for this function:

◆ USBH_LL_GetURBState()

USBH_URBStateTypeDef USBH_LL_GetURBState ( USBH_HandleTypeDef phost,
uint8_t  pipe 
)

Get a URB state from the low level driver.

Parameters
phostHost handle
pipePipe index This parameter can be a value from 1 to 15
Return values
URBstate This parameter can be one of the these values:
  • URB_IDLE
  • URB_DONE
  • URB_NOTREADY
  • URB_NYET
  • URB_ERROR
  • URB_STALL
521  {
Here is the caller graph for this function:

◆ USBH_LL_SetToggle()

USBH_StatusTypeDef USBH_LL_SetToggle ( USBH_HandleTypeDef phost,
uint8_t  pipe,
uint8_t  toggle 
)

Set toggle for a pipe.

Parameters
phostHost handle
pipePipe index
toggletoggle (0/1)
Return values
Status
566  {
567  HCD_HandleTypeDef *pHandle;
568  pHandle = phost->pData;
569 
570  if (pHandle->hc[pipe].ep_is_in) {
571  pHandle->hc[pipe].toggle_in = toggle;
572  } else {
573  pHandle->hc[pipe].toggle_out = toggle;
574  }
575 
Here is the caller graph for this function:

◆ USBH_LL_GetToggle()

uint8_t USBH_LL_GetToggle ( USBH_HandleTypeDef phost,
uint8_t  pipe 
)

Return the current toggle of a pipe.

Parameters
phostHost handle
pipePipe index
Return values
toggle(0/1)
585  {
586  uint8_t toggle = 0;
587  HCD_HandleTypeDef *pHandle;
588  pHandle = phost->pData;
589 
590  if (pHandle->hc[pipe].ep_is_in) {
591  toggle = pHandle->hc[pipe].toggle_in;
592  } else {
593  toggle = pHandle->hc[pipe].toggle_out;
594  }
Here is the caller graph for this function:

◆ USBH_Delay()

void USBH_Delay ( uint32_t  Delay)

Delay routine for the USB Host Library.

Parameters
DelayDelay in ms
Return values
None
603  {
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_LL_SetTimer()

void USBH_LL_SetTimer ( USBH_HandleTypeDef phost,
uint32_t  time 
)

USBH_LL_SetTimer Set the initial Host Timer tick.

Parameters
phostHost Handle
Return values
None
792 {
793  phost->Timer = time;
794 }
Here is the caller graph for this function:

◆ USBH_LL_IncTimer()

void USBH_LL_IncTimer ( USBH_HandleTypeDef phost)

USBH_LL_IncTimer Increment Host Timer tick.

Parameters
phostHost Handle
Return values
None
802 {
803  phost->Timer ++;
804  USBH_HandleSof(phost);
805 }
Here is the call graph for this function:
Here is the caller graph for this function:
direction
uint8_t direction
Definition: UsbCore.h:185
HOST_CHECK_CLASS
Definition: usbh_def.h:337
USBH_LL_GetSpeed
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
Return the USB host speed from the low level driver.
Definition: usbh_conf.c:314
HOST_USER_SELECT_CONFIGURATION
#define HOST_USER_SELECT_CONFIGURATION
Definition: usbh_core.h:64
USBH_SetCfg
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t configuration_value)
USBH_SetCfg The command sets the configuration value to the connected device.
Definition: usbh_ctlreq.c:260
HAL_BUSY
Definition: stm32f4xx_hal_def.h:59
osThreadDef
#define osThreadDef(name, thread, priority, instances, stacksz)
Definition: cmsis_os.h:468
HAL_OK
Definition: stm32f4xx_hal_def.h:57
USBH_DeviceTypeDef::current_interface
uint8_t current_interface
Definition: usbh_def.h:428
_ConfigurationDescriptor::Itf_Desc
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
Definition: usbh_def.h:296
USBH_HandleEnum
static USBH_StatusTypeDef USBH_HandleEnum(USBH_HandleTypeDef *phost)
USBH_HandleEnum This function includes the complete enumeration process.
Definition: usbh_core.c:609
HOST_HS
#define HOST_HS
Definition: usbh_conf.h:127
USBH_Start
USBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost)
USBH_Start Start the USB Host Core.
Definition: usbh_core.c:333
HOST_USER_DISCONNECTION
#define HOST_USER_DISCONNECTION
Definition: usbh_core.h:68
USBH_Delay
void USBH_Delay(uint32_t Delay)
Delay routine for the USB Host Library.
Definition: usbh_conf.c:601
HOST_INPUT
Definition: usbh_def.h:335
USBH_DeviceTypeDef::DevDesc
USBH_DevDescTypeDef DevDesc
Definition: usbh_def.h:429
_InterfaceDescriptor::bInterfaceNumber
uint8_t bInterfaceNumber
Definition: usbh_def.h:274
USBH_ErrLog
#define USBH_ErrLog(...)
Definition: usbh_conf.h:176
USBH_ClassTypeDef::Requests
USBH_StatusTypeDef(* Requests)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:443
USBH_LL_DriverVBUS
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t)
Drive VBUS.
Definition: usbh_conf.c:532
USBH_ClassTypeDef::BgndProcess
USBH_StatusTypeDef(* BgndProcess)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:444
HAL_TIMEOUT
Definition: stm32f4xx_hal_def.h:60
hhcd_USB_OTG_HS
HCD_HandleTypeDef hhcd_USB_OTG_HS
Definition: usbh_conf.c:67
state
static volatile fsensor_t state
Definition: filament_sensor.c:23
_ConfigurationDescriptor::bConfigurationValue
uint8_t bConfigurationValue
Definition: usbh_def.h:292
HOST_DEV_DISCONNECTED
Definition: usbh_def.h:331
HOST_CLASS_REQUEST
Definition: usbh_def.h:334
_USBH_HandleTypeDef::Timer
__IO uint32_t Timer
Definition: usbh_def.h:461
HOST_USER_CONNECTION
#define HOST_USER_CONNECTION
Definition: usbh_core.h:67
HOST_ENUMERATION
Definition: usbh_def.h:333
NULL
#define NULL
Definition: usbd_def.h:53
USBH_ClassTypeDef::pData
void * pData
Definition: usbh_def.h:446
_USBH_HandleTypeDef::Control
USBH_CtrlTypeDef Control
Definition: usbh_def.h:455
USBH_LL_ResetPort
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
Reset the Host port of the low level driver.
Definition: usbh_conf.c:342
_InterfaceDescriptor
Definition: usbh_def.h:270
USBH_DeviceTypeDef::address
uint8_t address
Definition: usbh_def.h:425
USBH_LL_Stop
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:283
createSpeedLookupTable.default
default
Definition: createSpeedLookupTable.py:15
USBH_SPEED_FULL
Definition: usbh_def.h:320
_USBH_HandleTypeDef::id
uint8_t id
Definition: usbh_def.h:462
HAL_ERROR
Definition: stm32f4xx_hal_def.h:58
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:55
HOST_DEV_ATTACHED
Definition: usbh_def.h:330
HOST_IDLE
Definition: usbh_def.h:328
HOST_DEV_WAIT_FOR_ATTACHMENT
Definition: usbh_def.h:329
USBH_FreePipe
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
Definition: usbh_pipes.c:158
HOST_ABORT_STATE
Definition: usbh_def.h:340
USBH_DeviceTypeDef::CfgDesc
USBH_CfgDescTypeDef CfgDesc
Definition: usbh_def.h:430
USBH_SPEED_LOW
Definition: usbh_def.h:321
_DeviceDescriptor::bNumConfigurations
uint8_t bNumConfigurations
Definition: usbh_def.h:255
USBH_OpenPipe
USBH_StatusTypeDef USBH_OpenPipe(USBH_HandleTypeDef *phost, uint8_t ch_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
USBH_Open_Pipe Open a pipe.
Definition: usbh_pipes.c:93
USBH_LL_SetTimer
void USBH_LL_SetTimer(USBH_HandleTypeDef *phost, uint32_t)
USBH_LL_SetTimer Set the initial Host Timer tick.
Definition: usbh_core.c:791
USBH_LL_Start
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
Start the low level portion of the host driver.
Definition: usbh_conf.c:252
USBH_PROCESS_STACK_SIZE
#define USBH_PROCESS_STACK_SIZE
Definition: usbh_conf.h:133
TRUE
#define TRUE
Definition: usbh_def.h:61
USBH_ClassTypeDef::ClassCode
uint8_t ClassCode
Definition: usbh_def.h:440
USBH_MAX_NUM_SUPPORTED_CLASS
#define USBH_MAX_NUM_SUPPORTED_CLASS
Definition: usbh_conf.h:111
USBH_OK
Definition: usbh_def.h:304
configMINIMAL_STACK_SIZE
#define configMINIMAL_STACK_SIZE
Definition: FreeRTOSConfig.h:111
osMessagePut
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
USBH_STATE_CHANGED_EVENT
Definition: usbh_def.h:399
_ConfigurationDescriptor
Definition: usbh_def.h:286
USBH_Stop
USBH_StatusTypeDef USBH_Stop(USBH_HandleTypeDef *phost)
USBH_Stop Stop the USB Host Core.
Definition: usbh_core.c:350
_USBH_HandleTypeDef::device
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
USBH_DeviceTypeDef::speed
uint8_t speed
Definition: usbh_def.h:426
USBH_DeviceTypeDef::is_connected
__IO uint8_t is_connected
Definition: usbh_def.h:427
USBH_CtrlTypeDef::pipe_size
uint8_t pipe_size
Definition: usbh_def.h:408
USBH_ClassTypeDef::DeInit
USBH_StatusTypeDef(* DeInit)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:442
USBH_PROCESS_PRIO
#define USBH_PROCESS_PRIO
Definition: usbh_conf.h:132
USBH_SPEED_HIGH
Definition: usbh_def.h:319
USBH_ClassTypeDef::Init
USBH_StatusTypeDef(* Init)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:441
USBH_CtrlTypeDef::pipe_in
uint8_t pipe_in
Definition: usbh_def.h:406
Error_Handler
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
HOST_USER_CLASS_SELECTED
#define HOST_USER_CLASS_SELECTED
Definition: usbh_core.h:66
FALSE
#define FALSE
Definition: usbh_def.h:57
uint8_t
const uint8_t[]
Definition: 404_html.c:3
USBH_UsrLog
#define USBH_UsrLog(...)
Definition: usbh_conf.h:166
USBH_LL_Init
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
Initialize the low level portion of the host driver.
Definition: usbh_conf.c:191
USBH_StatusTypeDef
USBH_StatusTypeDef
Definition: usbh_def.h:302
_InterfaceDescriptor::bInterfaceProtocol
uint8_t bInterfaceProtocol
Definition: usbh_def.h:279
_InterfaceDescriptor::bInterfaceSubClass
uint8_t bInterfaceSubClass
Definition: usbh_def.h:278
DeInitStateMachine
static USBH_StatusTypeDef DeInitStateMachine(USBH_HandleTypeDef *phost)
DeInitStateMachine De-Initialize the Host state machine.
Definition: usbh_core.c:162
_USBH_HandleTypeDef::pClass
USBH_ClassTypeDef * pClass[USBH_MAX_NUM_SUPPORTED_CLASS]
Definition: usbh_def.h:457
status
static status_t status
Definition: filament_sensor.c:37
_USBH_HandleTypeDef::ClassNumber
uint32_t ClassNumber
Definition: usbh_def.h:459
USBH_CtrlTypeDef::pipe_out
uint8_t pipe_out
Definition: usbh_def.h:407
_USBH_HandleTypeDef::pData
void * pData
Definition: usbh_def.h:463
osMessageCreate
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
USBH_SpeedTypeDef
USBH_SpeedTypeDef
Definition: usbh_def.h:317
osMessageQ
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
USBH_FAIL
Definition: usbh_def.h:306
USBH_BUSY
Definition: usbh_def.h:305
HAL_Delay
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
Definition: stm32f4xx_hal.c:393
_USBH_HandleTypeDef::pUser
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
Definition: usbh_def.h:464
USBH_ClassTypeDef::Name
const char * Name
Definition: usbh_def.h:439
USBH_MAX_NUM_INTERFACES
#define USBH_MAX_NUM_INTERFACES
Definition: usbh_conf.h:102
length
png_uint_32 length
Definition: png.c:2247
_USBH_HandleTypeDef::pActiveClass
USBH_ClassTypeDef * pActiveClass
Definition: usbh_def.h:458
USBH_HandleSof
static void USBH_HandleSof(USBH_HandleTypeDef *phost)
USBH_HandleSof Call SOF process.
Definition: usbh_core.c:813
_USBH_HandleTypeDef::gState
__IO HOST_StateTypeDef gState
Definition: usbh_def.h:452
USBH_EP_CONTROL
#define USBH_EP_CONTROL
Definition: usbh_ioreq.h:61
USBH_PORT_EVENT
Definition: usbh_def.h:395
USBH_AllocPipe
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
Definition: usbh_pipes.c:138
_InterfaceDescriptor::bAlternateSetting
uint8_t bAlternateSetting
Definition: usbh_def.h:275
HOST_CLASS
Definition: usbh_def.h:338
osThreadCreate
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
Definition: cmsis_os.c:245
HOST_SET_CONFIGURATION
Definition: usbh_def.h:336
osThread
#define osThread(name)
Definition: cmsis_os.h:478
_InterfaceDescriptor::bInterfaceClass
uint8_t bInterfaceClass
Definition: usbh_def.h:277
osMessageQDef
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818