51 #define USBH_ADDRESS_DEFAULT 0 52 #define USBH_ADDRESS_ASSIGNED 1 53 #define USBH_MPS_DEFAULT 0x40 81 #if (USBH_USE_OS == 1) 82 static void USBH_Process_OS(
void const * argument);
109 DeInitStateMachine(phost);
114 phost->
pUser = pUsrFunc;
117 #if (USBH_USE_OS == 1) 124 #if defined (USBH_PROCESS_STACK_SIZE) 125 osThreadDef(USBH_Thread, USBH_Process_OS, USBH_PROCESS_PRIO, 0, USBH_PROCESS_STACK_SIZE);
145 DeInitStateMachine(phost);
240 USBH_UsrLog (
"Switching to Interface (#%d)", interface);
380 DeInitStateMachine(phost);
385 #if (USBH_USE_OS == 1) 412 #if (USBH_USE_OS == 1) 454 #if (USBH_USE_OS == 1) 462 if ( USBH_HandleEnum(phost) ==
USBH_OK)
469 USBH_UsrLog (
"This device has only 1 configuration.");
489 #if (USBH_USE_OS == 1) 544 USBH_UsrLog (
"No registered class for this device.");
548 #if (USBH_USE_OS == 1) 569 #if (USBH_USE_OS == 1) 585 DeInitStateMachine(phost);
718 #if (USBH_USE_OS == 1) 727 #if (USBH_USE_OS == 1) 750 #if (USBH_USE_OS == 1) 773 #if (USBH_USE_OS == 1) 804 USBH_HandleSof(phost);
841 #if (USBH_USE_OS == 1) 876 #if (USBH_USE_OS == 1) 884 #if (USBH_USE_OS == 1) 890 static void USBH_Process_OS(
void const * argument)
CMD_StateTypeDef RequestState
USBH_StatusTypeDef(* DeInit)(struct _USBH_HandleTypeDef *phost)
Header file for usbh_core.c.
#define USBH_MAX_NUM_SUPPORTED_CLASS
void USBH_LL_SetTimer(USBH_HandleTypeDef *phost, uint32_t time)
USBH_LL_SetTimer Set the initial Host Timer tick.
#define USBH_MAX_PIPES_NBR
USBH_DeviceTypeDef device
USBH_StatusTypeDef USBH_ReEnumerate(USBH_HandleTypeDef *phost)
HCD_ReEnumerate Perform a new Enumeration phase.
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.
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t configuration_value)
USBH_SetCfg The command sets the configuration value to the connected device.
USBH_StatusTypeDef USBH_Get_DevDesc(USBH_HandleTypeDef *phost, uint8_t length)
USBH_Get_DevDesc Issue Get Device Descriptor command to the device. Once the response received...
USBH_StatusTypeDef USBH_Get_StringDesc(USBH_HandleTypeDef *phost, uint8_t string_index, uint8_t *buff, uint16_t length)
USBH_Get_StringDesc Issues string Descriptor command to the device. Once the response received...
uint8_t bNumConfigurations
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
uint8_t USBH_GetActiveClass(USBH_HandleTypeDef *phost)
USBH_GetActiveClass Return Device Class.
function completed; message event occurred.
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_DriverVBUS Drive VBUS.
#define USB_CONFIGURATION_DESC_SIZE
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...
USBH_StatusTypeDef USBH_RegisterClass(USBH_HandleTypeDef *phost, USBH_ClassTypeDef *pclass)
USBH_RegisterClass Link class driver to Host Core.
void USBH_Delay(uint32_t Delay)
USBH_Delay Delay routine for the USB Host Library.
USBH_StatusTypeDef(* SOFProcess)(struct _USBH_HandleTypeDef *phost)
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
#define USBH_DEVICE_ADDRESS
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
#define osMessageQ(name)
Access a Message Queue Definition.
USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress)
USBH_SetAddress This command sets the address to the connected device.
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
USBH_LL_Init Initialize the Low Level portion of the Host driver.
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
#define HOST_USER_CONNECTION
USBH_StatusTypeDef(* Init)(struct _USBH_HandleTypeDef *phost)
USBH_StatusTypeDef USBH_LL_Connect(USBH_HandleTypeDef *phost)
USBH_LL_Connect Handle USB Host connexion event.
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
USBH_LL_GetSpeed Return the USB Host Speed from the Low Level Driver.
USBH_StatusTypeDef(* Requests)(struct _USBH_HandleTypeDef *phost)
ENUM_StateTypeDef EnumState
#define osThreadDef(name, thread, priority, instances, stacksz)
USBH_CfgDescTypeDef CfgDesc
uint8_t bConfigurationValue
USBH_StatusTypeDef USBH_Stop(USBH_HandleTypeDef *phost)
USBH_Stop Stop the USB Host Core.
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
USBH_LL_Stop Stop the Low Level portion of the Host driver.
#define USBH_MAX_NUM_INTERFACES
osStatus status
status code: event or error information
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
#define USBH_ADDRESS_DEFAULT
#define osWaitForever
wait forever timeout value
#define HOST_USER_DISCONNECTION
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.
uint8_t bInterfaceSubClass
uint8_t bAlternateSetting
USBH_StatusTypeDef USBH_LL_Disconnect(USBH_HandleTypeDef *phost)
USBH_LL_Disconnect Handle USB Host disconnection event.
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
USBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost)
USBH_Start Start the USB Host Core.
#define HOST_USER_CLASS_SELECTED
#define USBH_MAX_DATA_BUFFER
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
USBH_LL_ResetPort Reset the Host Port of the Low Level Driver.
__IO HOST_StateTypeDef gState
uint8_t current_interface
USBH_StatusTypeDef(* BgndProcess)(struct _USBH_HandleTypeDef *phost)
uint8_t bInterfaceProtocol
USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length)
USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received...
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
uint8_t Data[USBH_MAX_DATA_BUFFER]
#define HOST_USER_SELECT_CONFIGURATION
#define USB_DEVICE_DESC_SIZE
USBH_StatusTypeDef USBH_DeInit(USBH_HandleTypeDef *phost)
HCD_Init De-Initialize the Host portion of the driver.
USBH_ClassTypeDef * pClass[USBH_MAX_NUM_SUPPORTED_CLASS]
USBH_DevDescTypeDef DevDesc
#define configMINIMAL_STACK_SIZE
USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
USBH_Process Background process of the USB Core.
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
USBH_ClassTypeDef * pActiveClass
USBH_StatusTypeDef USBH_Init(USBH_HandleTypeDef *phost, void(*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t), uint8_t id)
HCD_Init Initialize the HOST Core.
void USBH_LL_IncTimer(USBH_HandleTypeDef *phost)
USBH_LL_IncTimer Increment Host Timer tick.
USBH_StatusTypeDef USBH_SelectInterface(USBH_HandleTypeDef *phost, uint8_t interface)
USBH_SelectInterface Select current interface.
__IO uint8_t is_connected
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
USBH_LL_Start Start the Low Level portion of the Host driver.