sources/common/libs/STM32Cube_F4/Middlewares/ST/STM32_USB_Device_Library/Class/Printer/Src/usbd_printer.c
/**
  * @brief  USBD_PRNT_ReceivePacket
  *         prepare OUT Endpoint for reception
  * @param  pdev: device instance
  * @retval status
  */
@brief  USBD_PRNT_ReceivePacket
prepare OUT Endpoint for reception
@param  pdev: device instance
@retval status
@brief USBD_PRNT_ReceivePacket prepare OUT Endpoint for reception @param pdev : device instance @retval status
uint8_t USBD_PRNT_ReceivePacket(USBD_HandleTypeDef *pdev)
{
  USBD_PRNT_HandleTypeDef *hPRNT = (USBD_PRNT_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
#ifdef USE_USBD_COMPOSITE
  PRNTInEpAdd  = USBD_CoreGetEPAdd(pdev, USBD_EP_IN, USBD_EP_TYPE_BULK);
  PRNTOutEpAdd = USBD_CoreGetEPAdd(pdev, USBD_EP_OUT, USBD_EP_TYPE_BULK);
#endif 
  if (hPRNT == NULL)
  {
    return (uint8_t)USBD_FAIL;
  }
  if (pdev->dev_speed == USBD_SPEED_HIGH)
  {
    (void)USBD_LL_PrepareReceive(pdev, PRNTOutEpAdd, hPRNT->RxBuffer,
                                 PRNT_DATA_HS_OUT_PACKET_SIZE);
  }
  else
  {
    (void)USBD_LL_PrepareReceive(pdev, PRNTOutEpAdd, hPRNT->RxBuffer,
                                 PRNT_DATA_FS_OUT_PACKET_SIZE);
  }
  return (uint8_t)USBD_OK;
}
uint8_t USBD_PRNT_ReceivePacket ( USBD_HandleTypeDef * pdev ) { USBD_PRNT_HandleTypeDef * hPRNT = ( USBD_PRNT_HandleTypeDef * ) pdev -> pClassDataCmsit [ pdev -> classId ] ; #ifdef USE_USBD_COMPOSITE PRNTInEpAdd = USBD_CoreGetEPAdd ( pdev , USBD_EP_IN , USBD_EP_TYPE_BULK ) ; PRNTOutEpAdd = USBD_CoreGetEPAdd ( pdev , USBD_EP_OUT , USBD_EP_TYPE_BULK ) ; #endif if ( hPRNT == NULL ) { return ( uint8_t ) USBD_FAIL ; } if ( pdev -> dev_speed == USBD_SPEED_HIGH ) { ( void ) USBD_LL_PrepareReceive ( pdev , PRNTOutEpAdd , hPRNT -> RxBuffer , PRNT_DATA_HS_OUT_PACKET_SIZE ) ; } else { ( void ) USBD_LL_PrepareReceive ( pdev , PRNTOutEpAdd , hPRNT -> RxBuffer , PRNT_DATA_FS_OUT_PACKET_SIZE ) ; } return ( uint8_t ) USBD_OK ; }
@brief  USBD_PRNT_ReceivePacket
         prepare OUT Endpoint for reception
 @param  pdev: device instance
 @retval status
@brief USBD_PRNT_ReceivePacket prepare OUT Endpoint for reception @param pdev : device instance @retval status
/* Get the Endpoints addresses allocated for this class instance */ /* USE_USBD_COMPOSITE */ /* Prepare Out endpoint to receive next packet */ /* Prepare Out endpoint to receive next packet */