AnsweredAssumed Answered

USB Host Library for STM32F4

Question asked by wake.bert on Mar 29, 2014
Latest reply on Mar 29, 2014 by Chinzei.Tsuneo
Hi,

I'm using the new version of the USB Host library that comes with STM Cube, but I'm having some difficulty as the only documentation I can find is for the old library. Does anyone know if there is any new documentation? I can't find any and there seems to be some substantial differences.

For example, previously I could initialize the host with:
void USBH_Init (USB_OTG_CORE_HANDLE *pdev, USB_OTG_CORE_ID_TypeDef coreID,USBH_HOST *phost, USBH_Class_cb_TypeDef *class_cb, USBH_Usr_cb_TypeDef *usr_cb);

While the new init function looks very different:
USBH_StatusTypeDef  USBH_Init(USBH_HandleTypeDef *phost, void (*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t ), uint8_t id)

So it's not clear to me how the user call back works. Am I supposed to use just one function, and switch on the ID (the uint8_t argument in the pointer to the user function above)? The list of 5 possible IDs doesn't directly correspond to the previous four user callback functions that had to be implemented either.

Any help appreciated
Bert

Outcomes