当前位置: 首页>>代码示例>>C++>>正文


C++ HAL_HCD_Init函数代码示例

本文整理汇总了C++中HAL_HCD_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_HCD_Init函数的具体用法?C++ HAL_HCD_Init怎么用?C++ HAL_HCD_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了HAL_HCD_Init函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: USBH_LL_Init

/**
  * @brief  USBH_LL_Init 
  *         Initialize the Low Level portion of the Host driver.
  * @param  phost: Host handle
  * @retval USBH Status
  */
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
{
  if(phost->id == 0) 
  {
    /* Set the LL Driver parameters */
    hhcd_FS.Instance = USB_OTG_FS;
    hhcd_FS.Init.Host_channels = 11; 
    hhcd_FS.Init.dma_enable = 0;
    hhcd_FS.Init.low_power_enable = 0;
    hhcd_FS.Init.phy_itface = HCD_PHY_EMBEDDED; 
    hhcd_FS.Init.Sof_enable = 0;
    hhcd_FS.Init.speed = HCD_SPEED_FULL;
    hhcd_FS.Init.vbus_sensing_enable = 0;
    hhcd_FS.Init.lpm_enable = 0;
    
    /* Link the driver to the stack */
    hhcd_FS.pData = phost;
    phost->pData = &hhcd_FS;
    
    /* Initialize the LL Driver */
    HAL_HCD_Init(&hhcd_FS);
  }
  else /*phost->id == 1*/
  {
    /* Set the LL driver parameters */
    hhcd_HS.Instance = USB_OTG_HS;
    hhcd_HS.Init.Host_channels = 11; 
    hhcd_HS.Init.dma_enable = 1;
    hhcd_HS.Init.low_power_enable = 0;
    
#ifdef USE_USB_HS_IN_FS
    hhcd_HS.Init.phy_itface = HCD_PHY_EMBEDDED; 
#else
    hhcd_HS.Init.phy_itface = HCD_PHY_ULPI; 
#endif
    hhcd_HS.Init.Sof_enable = 0;
    hhcd_HS.Init.speed = HCD_SPEED_HIGH;
    hhcd_HS.Init.vbus_sensing_enable = 0;
    hhcd_HS.Init.use_external_vbus = 1;
    hhcd_HS.Init.lpm_enable = 0;
    
    /* Link the driver to the stack */
    hhcd_HS.pData = phost;
    phost->pData = &hhcd_HS;
    
    /* Initialize the LL driver */
    HAL_HCD_Init(&hhcd_HS);
  }
  USBH_LL_SetTimer (phost, HAL_HCD_GetCurrentFrame(&hhcd_HS));
  USBH_LL_SetTimer (phost, HAL_HCD_GetCurrentFrame(&hhcd_FS));
  
  return USBH_OK;
}
开发者ID:vlsi1217,项目名称:STM32F7Cube,代码行数:59,代码来源:usbh_conf.c

示例2: USBH_LL_Init

/**
  * @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;
  hhcd.Init.vbus_sensing_enable = 0;
  hhcd.Init.lpm_enable = 0;
  
  /* 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;
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:30,代码来源:usbh_conf.c

示例3: USBH_LL_Init

/**
  * @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)
{  
  /*Set LL Driver parameters */
  hhcd.Instance = USB_OTG_HS;
  hhcd.Init.Host_channels = 11; 
  hhcd.Init.dma_enable = 1;
  hhcd.Init.low_power_enable = 0;
  hhcd.Init.phy_itface = HCD_PHY_EMBEDDED; 
  hhcd.Init.Sof_enable = 0;
  hhcd.Init.speed = HCD_SPEED_HIGH;
  hhcd.Init.vbus_sensing_enable = 0;
  hhcd.Init.use_external_vbus = 1;  
  /* Link The driver to the stack */
  hhcd.pData = phost;
  phost->pData = &hhcd;
  /*Initialize LL Driver */
  if (HAL_HCD_Init(&hhcd) != HAL_OK)
  {
    return USBH_FAIL;
  }
  
  USBH_LL_SetTimer (phost, HAL_HCD_GetCurrentFrame(&hhcd));
  
  return USBH_OK;
}
开发者ID:chsigi,项目名称:blindschleiche,代码行数:30,代码来源:usbh_conf.c

示例4: USBH_LL_Init

/**
 * @brief  USBH_LL_Init
 *         Initialize the Low Level portion of the Host driver.
 * @param  phost: Host handle
 * @retval USBH Status
 */
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost) {
  /* Change Systick prioity */
  //HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
  RCC->AHB1ENR |= RCC_AHB1ENR_OTGHSEN;
  RCC->AHB1LPENR |= RCC_AHB1LPENR_OTGHSLPEN;

  /*Set 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_EMBEDDED;
  hHCD.Init.Sof_enable = 0;
  hHCD.Init.speed = HCD_SPEED_FULL;
  hHCD.Init.vbus_sensing_enable = 0;
  /* Link The driver to the stack */
  hHCD.pData = phost;
  phost->pData = &hHCD;
  /*Initialize LL Driver */
  HAL_HCD_Init(&hHCD);

//  USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FHMOD;
  USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hHCD));

  return USBH_OK;
}
开发者ID:AndrewCapon,项目名称:axoloti,代码行数:32,代码来源:usbh_conf.c

示例5: USBH_LL_Init

/**
  * @brief  USBH_LL_Init 
  *         Initialize the Low Level portion of the Host driver.
  * @param  phost: Host handle
  * @retval USBH Status
  */
USBH_StatusTypeDef  USBH_LL_Init (USBH_HandleTypeDef *phost)
{
  /* Init USB_IP */
  if (phost->id == HOST_HS) {
  /* Link The driver to the stack */
  hhcd_USB_OTG_HS.pData = phost;
  phost->pData = &hhcd_USB_OTG_HS;

  hhcd_USB_OTG_HS.Instance = USB_OTG_HS;
  hhcd_USB_OTG_HS.Init.dev_endpoints = 6;
  hhcd_USB_OTG_HS.Init.Host_channels = 12;
  hhcd_USB_OTG_HS.Init.speed = HCD_SPEED_FULL;
  hhcd_USB_OTG_HS.Init.dma_enable = DISABLE;
  hhcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;
  hhcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
  hhcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
  hhcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE;
  hhcd_USB_OTG_HS.Init.use_external_vbus = DISABLE;
  if (HAL_HCD_Init(&hhcd_USB_OTG_HS) != HAL_OK)
  {
    Error_Handler();
  }

  USBH_LL_SetTimer (phost, HAL_HCD_GetCurrentFrame(&hhcd_USB_OTG_HS));
  }
  return USBH_OK;
}
开发者ID:jhgorse,项目名称:STM32F429ZITx_cube_usbh_hid,代码行数:33,代码来源:usbh_conf.c

示例6: USBH_LL_Init

/**
  * @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;
  /* 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;
#ifdef USE_USB_HS_IN_FS
  hhcd.Init.phy_itface = HCD_PHY_EMBEDDED; 
#else  
  hhcd.Init.phy_itface = HCD_PHY_ULPI; 
#endif  
  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 /*USE_USB_HS*/ 
  USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hhcd));
  
  return USBH_OK;
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:46,代码来源:usbh_conf.c

示例7: USBH_LL_Init

/**
  * @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)
{
    /* Set the LL driver parameters */
    handleHCD.Instance = USB_OTG_FS;
    handleHCD.Init.speed = HCD_SPEED_FULL;
    handleHCD.Init.Host_channels = 11;
    handleHCD.Init.dma_enable = 0;
    handleHCD.Init.low_power_enable = 0;
    handleHCD.Init.phy_itface = HCD_PHY_EMBEDDED;
    handleHCD.Init.Sof_enable = 0;
    handleHCD.Init.vbus_sensing_enable = 0;
    handleHCD.Init.use_external_vbus = 0;

    /* Link the driver to the stack */
    handleHCD.pData = phost;
    phost->pData = &handleHCD;
    /* Initialize the LL driver */
    HAL_HCD_Init(&handleHCD);

    USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&handleHCD));

    return USBH_OK;
}
开发者ID:Sasha7b9,项目名称:Osci,代码行数:28,代码来源:usbh_conf.c


注:本文中的HAL_HCD_Init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。