90 static void USBH_ParseStringDesc (uint8_t* psrc, uint8_t* pdest, uint16_t length);
143 #if (USBH_KEEP_CFG_DESCRIPTOR == 1) 144 pData = phost->
device.CfgDesc_Raw;
176 uint8_t string_index,
188 USBH_ParseStringDesc(phost->
device.
Data,buff, length);
237 uint8_t DeviceAddress)
242 USB_REQ_TYPE_STANDARD;
266 USB_REQ_TYPE_STANDARD;
284 uint8_t ep_num, uint8_t altSetting)
290 USB_REQ_TYPE_STANDARD;
337 dev_desc->
bLength = *(uint8_t *) (buf + 0);
352 dev_desc->
iProduct = *(uint8_t *) (buf + 15);
380 cfg_desc->
bLength = *(uint8_t *) (buf + 0);
387 cfg_desc->
bMaxPower = *(uint8_t *) (buf + 8);
402 USBH_ParseInterfaceDesc (pif, (uint8_t *)pdesc);
406 while ((ep_ix < pif->bNumEndpoints) && (ptr < cfg_desc->
wTotalLength))
412 USBH_ParseEPDesc (pep, (uint8_t *)pdesc);
434 if_descriptor->
bLength = *(uint8_t *) (buf + 0);
442 if_descriptor->
iInterface = *(uint8_t *) (buf + 8);
456 ep_descriptor->
bLength = *(uint8_t *) (buf + 0);
461 ep_descriptor->
bInterval = *(uint8_t *) (buf + 6);
472 static void USBH_ParseStringDesc (uint8_t* psrc,
490 strlength = ( ( (psrc[0]-2) <= length) ? (psrc[0]-2) :length);
493 for (idx = 0; idx < strlength; idx+=2 )
547 #if (USBH_USE_OS == 1) 553 status = USBH_HandleControl(phost);
635 #if (USBH_USE_OS == 1) 642 #if (USBH_USE_OS == 1) 667 #if (USBH_USE_OS == 1) 677 #if (USBH_USE_OS == 1) 685 #if (USBH_USE_OS == 1) 709 #if (USBH_USE_OS == 1) 720 #if (USBH_USE_OS == 1) 729 #if (USBH_USE_OS == 1) 739 #if (USBH_USE_OS == 1) 765 #if (USBH_USE_OS == 1) 773 #if (USBH_USE_OS == 1) 782 #if (USBH_USE_OS == 1) 806 #if (USBH_USE_OS == 1) 814 #if (USBH_USE_OS == 1) 822 #if (USBH_USE_OS == 1) USBH_StatusTypeDef USBH_SetInterface(USBH_HandleTypeDef *phost, uint8_t ep_num, uint8_t altSetting)
USBH_SetInterface The command sets the Interface value to the connected device.
CMD_StateTypeDef RequestState
USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length)
USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the reques...
USBH_DeviceTypeDef device
USBH_DescHeader_t * USBH_GetNextDesc(uint8_t *pbuf, uint16_t *ptr)
USBH_GetNextDesc This function return the next descriptor header.
#define HOST_USER_UNRECOVERED_ERROR
uint8_t bNumConfigurations
#define USB_CONFIGURATION_DESC_SIZE
#define USB_REQ_RECIPIENT_DEVICE
#define USB_DESC_CONFIGURATION
#define USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_GET_DESCRIPTOR
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
USBH_StatusTypeDef USBH_CtlSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num, uint8_t do_ping)
USBH_CtlSendData Sends a data Packet to the Device.
#define USB_REQ_SET_CONFIGURATION
#define USBH_MAX_ERROR_COUNT
USBH_CfgDescTypeDef CfgDesc
uint8_t bConfigurationValue
#define USB_REQ_RECIPIENT_INTERFACE
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
USBH_StatusTypeDef USBH_CtlSendSetup(USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t hc_num)
USBH_CtlSendSetup Sends the Setup Packet to the Device.
Header file for usbh_ctlreq.c.
#define USB_REQ_SET_INTERFACE
#define USB_DESC_TYPE_ENDPOINT
#define USB_DESC_TYPE_INTERFACE
USBH_EpDescTypeDef Ep_Desc[USBH_MAX_NUM_ENDPOINTS]
uint8_t bInterfaceSubClass
#define USB_REQ_TYPE_STANDARD
uint8_t bAlternateSetting
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_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_GetURBState Get a URB state from the low level driver.
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...
USBH_StatusTypeDef USBH_CtlReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num)
USBH_CtlReceiveData Receives the Device Response to the Setup Packet.
USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress)
USBH_SetAddress This command sets the address to the connected device.
#define USB_DESC_TYPE_STRING
USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length)
USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received...
uint8_t bInterfaceProtocol
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
uint8_t Data[USBH_MAX_DATA_BUFFER]
USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, uint8_t req_type, uint16_t value_idx, uint8_t *buff, uint16_t length)
USBH_GetDescriptor Issues Descriptor command to the device. Once the response received, it parses the descriptor and updates the status.
USBH_DevDescTypeDef DevDesc
#define USB_REQ_CLEAR_FEATURE
#define USB_REQ_SET_ADDRESS
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t cfg_idx)
USBH_SetCfg The command sets the configuration value to the connected device.
#define FEATURE_SELECTOR_ENDPOINT
USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num)
USBH_ClrFeature This request is used to clear or disable a specific feature.
struct _USB_Setup::_SetupPkt_Struc b