STM32F429+USB3300+MIC2025,STM32是怎么控制USB3300给U盘供电的??

2019-07-20 06:40发布

STM32F429+USB3300+MIC2025,STM32是怎么控制USB3300给U盘供电的??
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
4条回答
sammy902583
2019-07-20 16:16
wuhongying77 发表于 2018-8-15 17:11
USB3300的一个引脚可以控制MIC2025要不要放电,可是受STM32影响,现在我不知道在代码的那个地方可以控制 ...


/**
  * @brief  Initializes the Low Level portion of the Host driver.
  * @param  phost: Host handle
  * @retval USBH Status
  */
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
{  
#ifdef USE_USB_FS  
  /* Set the LL driver parameters */
  hhcd.Instance = USB_OTG_FS;
  hhcd.Init.Host_channels = 11;
  hhcd.Init.dma_enable = 0;
  hhcd.Init.low_power_enable = 0;
  hhcd.Init.phy_itface = HCD_PHY_EMBEDDED;
  hhcd.Init.Sof_enable = 0;
  hhcd.Init.speed = HCD_SPEED_FULL;
  /* Link the driver to the stack */
  hhcd.pData = phost;
  phost->pData = &hhcd;
  /* Initialize the LL Driver */
  HAL_HCD_Init(&hhcd);
#endif
#ifdef USE_USB_HS  
  /* Set the LL driver parameters */
  hhcd.Instance = USB_OTG_HS;
  hhcd.Init.Host_channels = 11;
  hhcd.Init.dma_enable = 0;
  hhcd.Init.low_power_enable = 0;
  hhcd.Init.phy_itface = HCD_PHY_ULPI;
  hhcd.Init.Sof_enable = 0;
  hhcd.Init.speed = HCD_SPEED_HIGH;
  hhcd.Init.use_external_vbus = 1;  
  /* Link the driver to the stack */
  hhcd.pData = phost;
  phost->pData = &hhcd;
  /* Initialize the LL driver */
  HAL_HCD_Init(&hhcd);
#endif

  USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hhcd));
  
  return USBH_OK;
}

不知道是不是这个, 可以试试看.

一周热门 更多>