本文整理汇总了C++中HAL_PCD_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_PCD_Init函数的具体用法?C++ HAL_PCD_Init怎么用?C++ HAL_PCD_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_PCD_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
{
#ifdef USE_USB_FS
/* Set LL Driver parameters */
hpcd.Instance = USB_OTG_FS;
hpcd.Init.dev_endpoints = 4;
hpcd.Init.use_dedicated_ep1 = 0;
hpcd.Init.ep0_mps = 0x40;
hpcd.Init.dma_enable = 0;
hpcd.Init.low_power_enable = 0;
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.Sof_enable = 0;
hpcd.Init.speed = PCD_SPEED_FULL;
hpcd.Init.vbus_sensing_enable = 1;
hpcd.Init.lpm_enable = 0;
/* Link The driver to the stack */
hpcd.pData = pdev;
pdev->pData = &hpcd;
/* Initialize LL Driver */
HAL_PCD_Init(&hpcd);
HAL_PCDEx_SetRxFiFo(&hpcd, 0xA0);
HAL_PCDEx_SetTxFiFo(&hpcd, 0, 0xA0);
#endif
#ifdef USE_USB_HS
/* Set LL Driver parameters */
hpcd.Instance = USB_OTG_HS;
hpcd.Init.dev_endpoints = 6;
hpcd.Init.use_dedicated_ep1 = 0;
hpcd.Init.ep0_mps = 0x40;
/* Be aware that enabling DMA mode will result in data being sent only by
multiple of 4 packet sizes. This is due to the fact that USB DMA does
not allow sending data from non word-aligned addresses.
For this specific application, it is advised to not enable this option
unless required. */
hpcd.Init.dma_enable = 0;
hpcd.Init.low_power_enable = 0;
hpcd.Init.phy_itface = PCD_PHY_ULPI;
hpcd.Init.Sof_enable = 0;
hpcd.Init.speed = PCD_SPEED_HIGH;
hpcd.Init.vbus_sensing_enable = 1;
hpcd.Init.lpm_enable = 0;
/* Link The driver to the stack */
hpcd.pData = pdev;
pdev->pData = &hpcd;
/* Initialize LL Driver */
HAL_PCD_Init(&hpcd);
HAL_PCDEx_SetRxFiFo(&hpcd, 0x200);
HAL_PCDEx_SetTxFiFo(&hpcd, 0, 0x200);
#endif
return USBD_OK;
}
示例2: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
/* Link The driver to the stack */
hpcd_USB_OTG_FS.pData = pdev;
pdev->pData = &hpcd_USB_OTG_FS;
#ifdef STM32F4
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 4;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL; // MUST KEEP THIS FULL - buffer sizes only big enough for this, not high
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE; // NO DMA - we are assuming USBD_CtlSendData/USBD_LL_Transmit don't keep the pointer they are passed
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_8;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = ENABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
HAL_PCD_Init(&hpcd_USB_OTG_FS);
// USB memory is 1.25kB - lots of room for big FIFO sizes
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x20); // EP0 IN
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x40); // HID IN
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 2, 0x20); // CDC CMD
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 3, 0x40); // CDC IN
#endif
#ifdef STM32F1
hpcd_USB_OTG_FS.Instance = USB;
hpcd_USB_OTG_FS.Init.dev_endpoints = 8;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_8;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.battery_charging_enable = DISABLE;
HAL_PCD_Init(&hpcd_USB_OTG_FS);
// USB memory is 512 bytes according to datasheet, so we should have loads
// of space available?
/*HAL_PCDEx_PMAConfig(pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig(pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig(pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); // HID IN
HAL_PCDEx_PMAConfig(pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); // unused?
HAL_PCDEx_PMAConfig(pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); // CDC CMD
HAL_PCDEx_PMAConfig(pdev->pData , 0x83 , PCD_SNG_BUF, 0x180); // CDC IN
HAL_PCDEx_PMAConfig(pdev->pData , 0x03 , PCD_SNG_BUF, 0x1C0); // CDC OUT*/
// above doesn't work
HAL_PCDEx_PMAConfig(pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig(pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig(pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); // CDC IN
HAL_PCDEx_PMAConfig(pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); // CDC OUT
HAL_PCDEx_PMAConfig(pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); // CDC CMD
#endif
return USBD_OK;
}
示例3: stm32_usbc_init
void stm32_usbc_init(void)
{
LTRACE_ENTRY;
usbc.pma_highwater = 0x40;
// Set LL Driver parameters
usbc.handle.Instance = USB;
usbc.handle.Init.dev_endpoints = 4;
usbc.handle.Init.ep0_mps = 0x40;
usbc.handle.Init.phy_itface = PCD_PHY_EMBEDDED;
usbc.handle.Init.speed = PCD_SPEED_FULL;
usbc.handle.Init.low_power_enable = 0;
usbc.handle.Init.lpm_enable = 0;
usbc.handle.Init.battery_charging_enable = 0;
// Initialize LL Driver
HAL_PCD_Init(&usbc.handle);
HAL_PCDEx_PMAConfig(&usbc.handle, 0x00, PCD_SNG_BUF,
stm32_usbc_pma_alloc(0x40));
HAL_PCDEx_PMAConfig(&usbc.handle, 0x80, PCD_SNG_BUF,
stm32_usbc_pma_alloc(0x40));
}
示例4: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
if (pdev->id == DEVICE_FS) {
/* Link The driver to the stack */
hpcd_USB_OTG_FS.pData = pdev;
pdev->pData = &hpcd_USB_OTG_FS;
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 4;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
// hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_FS.Init.ep0_mps = 0x40;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK)
{
Error_Handler();
}
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x80);
}
return USBD_OK;
}
示例5: USBD_LL_Init
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
/* Link The driver to the stack */
hpcd_USB_FS.pData = pdev;
pdev->pData = &hpcd_USB_FS;
hpcd_USB_FS.Instance = USB;
hpcd_USB_FS.Init.dev_endpoints = 5;
hpcd_USB_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_FS.Init.low_power_enable = DISABLE;
hpcd_USB_FS.Init.lpm_enable = DISABLE;
HAL_PCD_Init(&hpcd_USB_FS);
/*
* PMA layout
* 0x00 - 0x17 (24 bytes) metadata?
* 0x18 - 0x57 (64 bytes) EP0 OUT
* 0x58 - 0x97 (64 bytes) EP0 IN
* 0x98 - 0xD7 (64 bytes) EP1 IN
* 0xD8 - 0x157 (128 bytes) EP1 OUT (buffer 1)
* 0x158 - 0x1D7 (128 bytes) EP1 OUT (buffer 2)
*/
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 24);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0x98);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x02 , PCD_DBL_BUF, 0x00D80158);
return USBD_OK;
}
示例6: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
{
/* Change Systick prioity */
NVIC_SetPriority (SysTick_IRQn, 0);
/*Set LL Driver parameters */
hpcd.Instance = USB_OTG_FS; /*Register base address*/
hpcd.Init.dev_endpoints = 4; /*device endpoints number*/
hpcd.Init.use_dedicated_ep1 = 0; /*Enable or disable the use of the dedicated EP1 interrupt.*/
hpcd.Init.ep0_mps = 0x40; /*Set the Endpoint 0 Max Packet size.(0x40=64)*/
hpcd.Init.dma_enable = 0; /*Enable or disable of the USB embedded DMA*/
hpcd.Init.low_power_enable = 0; /*Enable or disable the low power mode*/
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED; /*Select the used PHY interface*/
hpcd.Init.Sof_enable = 0; /*Enable or disable the output of the SOF signal*/
hpcd.Init.speed = PCD_SPEED_FULL; /*USB Core speed*/
hpcd.Init.vbus_sensing_enable = 1; /*Enable or disable the VBUS Sensing feature*/
/* Link The driver to the stack */
hpcd.pData = pdev;
pdev->pData = &hpcd;
/*Initialize LL Driver */
HAL_PCD_Init(&hpcd);
HAL_PCDEx_SetRxFiFo(&hpcd, 0x80); /*0x80=128*/
HAL_PCDEx_SetTxFiFo(&hpcd, 0, 0x40); /*0x40=64*/
HAL_PCDEx_SetTxFiFo(&hpcd, 1, 0x80); /*0x80=128*/
return USBD_OK;
}
示例7: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
if (pdev->id == DEVICE_HS) {
/* Link The driver to the stack */
hpcd_USB_OTG_HS.pData = pdev;
pdev->pData = &hpcd_USB_OTG_HS;
hpcd_USB_OTG_HS.Instance = USB_OTG_HS;
hpcd_USB_OTG_HS.Init.dev_endpoints = 11;
hpcd_USB_OTG_HS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_HS.Init.dma_enable = DISABLE;
hpcd_USB_OTG_HS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;
hpcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_HS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE;
hpcd_USB_OTG_HS.Init.use_dedicated_ep1 = DISABLE;
hpcd_USB_OTG_HS.Init.use_external_vbus = DISABLE;
HAL_PCD_Init(&hpcd_USB_OTG_HS);
HAL_PCD_SetRxFiFo(&hpcd_USB_OTG_HS, 0x200);
HAL_PCD_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x80);
HAL_PCD_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x174);
}
return USBD_OK;
}
示例8: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
{
/* Set LL Driver parameters */
hpcd.Instance = USB_OTG_FS;
hpcd.Init.dev_endpoints = 4;
hpcd.Init.use_dedicated_ep1 = 0;
hpcd.Init.ep0_mps = 0x40;
hpcd.Init.dma_enable = 0;
hpcd.Init.low_power_enable = 1;
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.Sof_enable = 0;
hpcd.Init.speed = PCD_SPEED_FULL;
hpcd.Init.vbus_sensing_enable = 1;
hpcd.Init.lpm_enable = 0;
/* Link The driver to the stack */
hpcd.pData = pdev;
pdev->pData = &hpcd;
/* Initialize LL Driver */
HAL_PCD_Init(&hpcd);
HAL_PCDEx_SetRxFiFo(&hpcd, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd, 0, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd, 1, 0x80);
return USBD_OK;
}
示例9: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init( USBD_HandleTypeDef *pdev )
{
hpcd.pData = pdev;
pdev->pData = &hpcd;
hpcd.Instance = USB_OTG_FS;
hpcd.Init.dev_endpoints = 4;
hpcd.Init.speed = PCD_SPEED_FULL;
hpcd.Init.dma_enable = DISABLE;
hpcd.Init.ep0_mps = DEP0CTL_MPS_64; // 0x40; ?
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.Sof_enable = DISABLE;
hpcd.Init.low_power_enable = DISABLE;
hpcd.Init.lpm_enable = DISABLE;
hpcd.Init.use_dedicated_ep1 = DISABLE;
#ifdef BOARD_USB_DEFAULT_VBUS_PIN
hpcd.Init.vbus_sensing_enable = ENABLE;
#else
hpcd.Init.vbus_sensing_enable = DISABLE;
#endif
if( HAL_PCD_Init( &hpcd ) != HAL_OK ) {
errno = 50000;
return USBD_FAIL;
};
HAL_PCDEx_SetRxFiFo( &hpcd, 0x80 );
HAL_PCDEx_SetTxFiFo( &hpcd, 0, 0x40 );
HAL_PCDEx_SetTxFiFo( &hpcd, 1, 0x80 );
return USBD_OK;
}
示例10: USBD_LL_Init
/**
* Initializes the Low Level portion of the Device driver.
*
* @param pdev: Device handle
* @return USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) {
if(pdev->id == DEVICE_FS) {
// Set LL Driver parameters
hpcd_FS.Instance = USB_OTG_FS;
hpcd_FS.Init.speed = PCD_SPEED_FULL;
hpcd_FS.Init.dev_endpoints = 4;
hpcd_FS.Init.use_dedicated_ep1 = 0;
hpcd_FS.Init.ep0_mps = 0x40;
hpcd_FS.Init.dma_enable = DISABLE;
hpcd_FS.Init.low_power_enable = ENABLE;
hpcd_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_FS.Init.Sof_enable = DISABLE;
hpcd_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_FS.Init.use_external_vbus = ENABLE;
// Link the driver to the stack
hpcd_FS.pData = pdev;
pdev->pData = &hpcd_FS;
// Initialize LL Driver
HAL_PCD_Init(&hpcd_FS);
HAL_PCD_SetRxFiFo(&hpcd_FS, 0x80);
HAL_PCD_SetTxFiFo(&hpcd_FS, 0, 0x40);
HAL_PCD_SetTxFiFo(&hpcd_FS, 1, 0x80);
}
return USBD_OK;
}
示例11: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
/* Link The driver to the stack */
hpcd_USB_FS.pData = pdev;
pdev->pData = &hpcd_USB_FS;
hpcd_USB_FS.Instance = USB;
hpcd_USB_FS.Init.dev_endpoints = 8;
hpcd_USB_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_FS.Init.ep0_mps = DEP0CTL_MPS_8;
hpcd_USB_FS.Init.low_power_enable = DISABLE;
hpcd_USB_FS.Init.lpm_enable = DISABLE;
hpcd_USB_FS.Init.battery_charging_enable = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK)
{
Error_Handler();
}
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100);
return USBD_OK;
}
示例12: MX_USB_PCD_Init
/* USB init function */
static void MX_USB_PCD_Init(void)
{
hpcd_USB_FS.Instance = USB;
hpcd_USB_FS.Init.dev_endpoints = 8;
hpcd_USB_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_FS.Init.ep0_mps = DEP0CTL_MPS_8;
hpcd_USB_FS.Init.low_power_enable = DISABLE;
hpcd_USB_FS.Init.lpm_enable = DISABLE;
hpcd_USB_FS.Init.battery_charging_enable = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK)
{
Error_Handler();
}
}
示例13: MX_USB_PCD_Init
void MX_USB_PCD_Init(void)
{
hpcd_USB_FS.Instance = USB;
hpcd_USB_FS.Init.dev_endpoints = 8;
hpcd_USB_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_FS.Init.ep0_mps = DEP0CTL_MPS_8;
hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_FS.Init.low_power_enable = DISABLE;
hpcd_USB_FS.Init.lpm_enable = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK)
{
Error_Handler();
}
}
示例14: MX_USB_OTG_FS_PCD_Init
void MX_USB_OTG_FS_PCD_Init(void)
{
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 7;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
HAL_PCD_Init(&hpcd_USB_OTG_FS);
}
示例15: USBD_LL_Init
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
{
/* Set LL Driver parameters */
hpcd.Instance = USB;
hpcd.Init.dev_endpoints = 8;
hpcd.Init.ep0_mps = 0x40;
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.speed = PCD_SPEED_FULL;
/* Link The driver to the stack */
hpcd.pData = pdev;
pdev->pData = &hpcd;
/* Initialize LL Driver */
HAL_PCD_Init(&hpcd);
HAL_PCDEx_PMAConfig(&hpcd , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig(&hpcd , 0x80 , PCD_SNG_BUF, 0x58);
return USBD_OK;
}