/** * @brief USBH_CDC_InterfaceDeInit * The function DeInit the Pipes used for the CDC class. * @param phost: Host handle * @retval USBH Status */ USBH_StatusTypeDef USBH_CDC_InterfaceDeInit (USBH_HandleTypeDef *phost) { CDC_HandleTypeDef *CDC_Handle = (CDC_HandleTypeDef*) phost->pActiveClass->pData; if ( CDC_Handle->CommItf.NotifPipe) { USBH_ClosePipe(phost, CDC_Handle->CommItf.NotifPipe); USBH_FreePipe (phost, CDC_Handle->CommItf.NotifPipe); CDC_Handle->CommItf.NotifPipe = 0; /* Reset the Channel as Free */ } if ( CDC_Handle->DataItf.InPipe) { USBH_ClosePipe(phost, CDC_Handle->DataItf.InPipe); USBH_FreePipe (phost, CDC_Handle->DataItf.InPipe); CDC_Handle->DataItf.InPipe = 0; /* Reset the Channel as Free */ } if ( CDC_Handle->DataItf.OutPipe) { USBH_ClosePipe(phost, CDC_Handle->DataItf.OutPipe); USBH_FreePipe (phost, CDC_Handle->DataItf.OutPipe); CDC_Handle->DataItf.OutPipe = 0; /* Reset the Channel as Free */ } if(phost->pActiveClass->pData) { USBH_free (phost->pActiveClass->pData); phost->pActiveClass->pData = 0; } return USBH_OK; }
/** * @brief USBH_MTP_InterfaceDeInit * The function DeInit the Pipes used for the MTP class. * @param phost: Host handle * @retval USBH Status */ USBH_StatusTypeDef USBH_MTP_InterfaceDeInit (USBH_HandleTypeDef *phost) { MTP_HandleTypeDef *MTP_Handle = phost->pActiveClass->pData; if (MTP_Handle->DataOutPipe) { USBH_ClosePipe(phost, MTP_Handle->DataOutPipe); USBH_FreePipe (phost, MTP_Handle->DataOutPipe); MTP_Handle->DataOutPipe = 0; /* Reset the Channel as Free */ } if (MTP_Handle->DataInPipe) { USBH_ClosePipe(phost, MTP_Handle->DataInPipe); USBH_FreePipe (phost, MTP_Handle->DataInPipe); MTP_Handle->DataInPipe = 0; /* Reset the Channel as Free */ } if (MTP_Handle->NotificationPipe) { USBH_ClosePipe(phost, MTP_Handle->NotificationPipe); USBH_FreePipe (phost, MTP_Handle->NotificationPipe); MTP_Handle->NotificationPipe = 0; /* Reset the Channel as Free */ } if(phost->pActiveClass->pData) { USBH_free (phost->pActiveClass->pData); phost->pActiveClass->pData = 0; } return USBH_OK; }
/** * @brief USBH_HID_InterfaceDeInit * The function DeInit the Pipes used for the HID class. * @param phost: Host handle * @retval USBH Status */ USBH_StatusTypeDef USBH_HID_InterfaceDeInit (USBH_HandleTypeDef *phost ) { HID_HandleTypeDef *HID_Handle = (HID_HandleTypeDef *) phost->pActiveClass->pData; if(HID_Handle->InPipe != 0x00) { USBH_ClosePipe (phost, HID_Handle->InPipe); USBH_FreePipe (phost, HID_Handle->InPipe); HID_Handle->InPipe = 0; /* Reset the pipe as Free */ } if(HID_Handle->OutPipe != 0x00) { USBH_ClosePipe(phost, HID_Handle->OutPipe); USBH_FreePipe (phost, HID_Handle->OutPipe); HID_Handle->OutPipe = 0; /* Reset the pipe as Free */ } if(phost->pActiveClass->pData) { USBH_free (phost->pActiveClass->pData); } return USBH_OK; }
/** * @brief USBH_MSC_InterfaceDeInit * The function DeInit the Pipes used for the MSC class. * @param phost: Host handle * @retval USBH Status */ USBH_StatusTypeDef USBH_MSC_InterfaceDeInit (USBH_HandleTypeDef *phost) { MSC_HandleTypeDef *MSC_Handle = (MSC_HandleTypeDef *) phost->pActiveClass->pData; if ( MSC_Handle->OutPipe) { USBH_ClosePipe(phost, MSC_Handle->OutPipe); USBH_FreePipe (phost, MSC_Handle->OutPipe); MSC_Handle->OutPipe = 0; /* Reset the Channel as Free */ } if ( MSC_Handle->InPipe) { USBH_ClosePipe(phost, MSC_Handle->InPipe); USBH_FreePipe (phost, MSC_Handle->InPipe); MSC_Handle->InPipe = 0; /* Reset the Channel as Free */ } if(phost->pActiveClass->pData) { USBH_free (phost->pActiveClass->pData); phost->pActiveClass->pData = 0; } return USBH_OK; }