We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In usbh_conf.c sample code the funtion USBH_LL_GetSpeed()
usbh_conf.c
funtion USBH_LL_GetSpeed()
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost) { USBH_SpeedTypeDef speed = USBH_SPEED_FULL; switch (HAL_HCD_GetCurrentSpeed(phost->pData)) { case 0: //// HCD_SPEED_HIGH (ok) speed = USBH_SPEED_HIGH; break; case 1: //// HCD_SPEED_FULL (duplicated) speed = USBH_SPEED_FULL; break; case 2: //// HCD_SPEED_LOW (duplicated) speed = USBH_SPEED_LOW; break; default: speed = USBH_SPEED_FULL; break; } return speed; }
calls HAL_HCD_GetCurrentSpeed() from stm32h7xx_ll_usb.c
HAL_HCD_GetCurrentSpeed()
stm32h7xx_ll_usb.c
/** * @brief Return Host Core speed * @param USBx Selected device * @retval speed : Host speed * This parameter can be one of these values: * @arg HCD_SPEED_HIGH: High speed mode * @arg HCD_SPEED_FULL: Full speed mode * @arg HCD_SPEED_LOW: Low speed mode */ uint32_t USB_GetHostSpeed(USB_OTG_GlobalTypeDef const *USBx) { uint32_t USBx_BASE = (uint32_t)USBx; __IO uint32_t hprt0 = 0U; hprt0 = USBx_HPRT0; return ((hprt0 & USB_OTG_HPRT_PSPD) >> 17); }
From the documentation this function is expected to return one of the following values defined in file stm32h7xx_hal_hcd.h:
stm32h7xx_hal_hcd.h
/** @defgroup HCD_Speed HCD Speed * @{ */ #define HCD_SPEED_HIGH USBH_HS_SPEED #define HCD_SPEED_FULL USBH_FSLS_SPEED // duplicated ??? #define HCD_SPEED_LOW USBH_FSLS_SPEED // duplicated ???
but I think this is an error.
USB_GetHostSpeed() should return a constant taken from stm32h7xx_ll_usb.h
USB_GetHostSpeed()
stm32h7xx_ll_usb.h
/** @defgroup USB_LL Device Speed * @{ */ #define USBD_HS_SPEED 0U #define USBD_HSINFS_SPEED 1U #define USBH_HS_SPEED 0U #define USBD_FS_SPEED 2U #define USBH_FSLS_SPEED 1U
and HAL_HCD_GetCurrentSpeed() should be documented for returning a constant taken from stm32h7xx_hal_hcd.h (se above).
--
From RM0043 par.57.14.28
Bits 18:17 PSPD[1:0]: Port speed Indicates the speed of the device attached to this port. 01: Full speed 10: Low speed 11: Reserved 00: High speed
The text was updated successfully, but these errors were encountered:
ALABSTM
No branches or pull requests
In
usbh_conf.c
sample code thefuntion USBH_LL_GetSpeed()
calls
HAL_HCD_GetCurrentSpeed()
fromstm32h7xx_ll_usb.c
From the documentation this function is expected to return one of the following values defined in file
stm32h7xx_hal_hcd.h
:but I think this is an error.
USB_GetHostSpeed()
should return a constant taken fromstm32h7xx_ll_usb.h
and
HAL_HCD_GetCurrentSpeed()
should be documented for returning a constant taken fromstm32h7xx_hal_hcd.h
(se above).--
From RM0043 par.57.14.28
The text was updated successfully, but these errors were encountered: