本文整理汇总了C++中USBD_LL_SetupStage函数的典型用法代码示例。如果您正苦于以下问题:C++ USBD_LL_SetupStage函数的具体用法?C++ USBD_LL_SetupStage怎么用?C++ USBD_LL_SetupStage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USBD_LL_SetupStage函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HAL_PCD_SetupStageCallback
void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd)
{
USBD_HandleTypeDef *pdev = (USBD_HandleTypeDef*)hpcd->pData;
USBD_ParseSetupRequest((USBD_SetupReqTypedef*)&pdev->request, (uint8_t*)hpcd->Setup);
bool request_was_handled = false;
if ((pdev->request.bmRequest & 0x1F) == USB_REQ_RECIPIENT_DEVICE ) { // device request
request_was_handled = USBD_GS_CAN_CustomDeviceRequest(pdev, &pdev->request);
}
if ((pdev->request.bmRequest & 0x1F) == USB_REQ_RECIPIENT_INTERFACE ) { // interface request
request_was_handled = USBD_GS_CAN_CustomInterfaceRequest(pdev, &pdev->request);
}
if (!request_was_handled) {
USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup);
}
}
示例2: HAL_PCD_SetupStageCallback
/**
* @brief SetupStage callback.
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_SetupStage(hpcd->pData, (uint8_t *)hpcd->Setup);
}