當前位置: 首頁>>代碼示例>>C++>>正文


C++ DCD_EP_PrepareRx函數代碼示例

本文整理匯總了C++中DCD_EP_PrepareRx函數的典型用法代碼示例。如果您正苦於以下問題:C++ DCD_EP_PrepareRx函數的具體用法?C++ DCD_EP_PrepareRx怎麽用?C++ DCD_EP_PrepareRx使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DCD_EP_PrepareRx函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: usbd_composite_Init

/**
  * @brief  usbd_cdc_Init
  *         Initilaize the CDC interface
  * @param  pdev: device instance
  * @param  cfgidx: Configuration index
  * @retval status
  */
static uint8_t  usbd_composite_Init (void  *pdev, 
                               uint8_t cfgidx)
{
  // CDC
  /* Open EP IN */
  DCD_EP_Open(pdev,
              CDC_IN_EP,
              CDC_DATA_IN_PACKET_SIZE,
              USB_OTG_EP_BULK);
  
  /* Open EP OUT */
  DCD_EP_Open(pdev,
              CDC_OUT_EP,
              CDC_DATA_OUT_PACKET_SIZE,
              USB_OTG_EP_BULK);
  
  /* Open Command IN EP */
  DCD_EP_Open(pdev,
              CDC_CMD_EP,
              CDC_CMD_PACKET_SZE,
              USB_OTG_EP_INT);
  
  /* Initialize the Interface physical components */
  APP_FOPS.pIf_Init();

  /* Prepare Out endpoint to receive next packet */
  DCD_EP_PrepareRx(pdev,
                   CDC_OUT_EP,
                   (uint8_t*)(USB_Rx_Buffer),
                   CDC_DATA_OUT_PACKET_SIZE);
  
  
  // HID
  /* Open EP IN */
  DCD_EP_Open(pdev,
              HID_IN_EP,
              HID_IN_PACKET,
              USB_OTG_EP_INT);
  
  /* Open EP OUT */
  DCD_EP_Open(pdev,
              HID_OUT_EP,
              HID_OUT_PACKET,
              USB_OTG_EP_INT);

  DCD_EP_PrepareRx(pdev,
                   HID_OUT_EP,
                   (uint8_t*)(USB_hid_Rx_Buffer),
                   HID_OUT_PACKET);
  
  return USBD_OK;
}
開發者ID:nbreit,項目名稱:snapsWinter,代碼行數:59,代碼來源:usbd_composite_core.c

示例2: usbd_cdc_Init

/**
  * @brief  usbd_cdc_Init
  *         Initilaize the CDC interface
  * @param  pdev: device instance
  * @param  cfgidx: Configuration index
  * @retval status
  */
static uint8_t  usbd_cdc_Init (void  *pdev, 		//初始化USB設備的端點及描述符
                               uint8_t cfgidx)
{
  uint8_t *pbuf;

  /* Open EP IN */
  DCD_EP_Open(pdev,				//設置輸入端點1的端點地址、最大包為64、端點類型為批量端點,並激活端點
              CDC_IN_EP,										//0x81
              VIRTUAL_COM_PORT_DATA_SIZE,		//64
              USB_OTG_EP_BULK);							//批量端點
  
  /* Open EP OUT */
  DCD_EP_Open(pdev,				//設置輸出端點3的端點地址、最大包為64、端點類型為批量端點,並激活端點
              CDC_OUT_EP,									//0x03
              VIRTUAL_COM_PORT_DATA_SIZE,	//64
              USB_OTG_EP_BULK);						//批量端點
  
  /* Open Command IN EP */
  DCD_EP_Open(pdev,				//設置輸入端點2的端點地址、最大包為8、端點類型為中斷端點,並激活端點
              CDC_CMD_EP,									//0x82
              VIRTUAL_COM_PORT_INT_SIZE,	//8
              USB_OTG_EP_INT);						//中斷端點
  
  pbuf = (uint8_t *)USBD_DeviceDesc;			//設備描述符
  pbuf[4] = DEVICE_CLASS_CDC;							/*bDeviceClass:CDC設備類代碼0x02*/
  pbuf[5] = DEVICE_SUBCLASS_CDC;					/*bDeviceSubClass子類代碼0x00*/

  /* Prepare Out endpoint to receive next packet */
  DCD_EP_PrepareRx(pdev,					//設備端點CDC_OUT_EP接收VIRTUAL_COM_PORT_DATA_SIZE個數據到USB_Rx_Buffer
                   CDC_OUT_EP,
                   (uint8_t*)(USB_Rx_Buffer),
                   VIRTUAL_COM_PORT_DATA_SIZE);
  
  return USBD_OK;
}
開發者ID:dxxdxpdxy,項目名稱:BlueSkyFlightControl,代碼行數:42,代碼來源:usbd_cdc_core.c

示例3: usbd_audio_DataOut

/**
  * @brief  usbd_audio_DataOut
  *         Handles the Audio Out data stage.
  * @param  pdev: instance
  * @param  epnum: endpoint number
  * @retval status
  */
static uint8_t  usbd_audio_DataOut (void *pdev, uint8_t epnum)
{     
  if (epnum == AUDIO_OUT_EP)
  {    
    /* Increment the Buffer pointer or roll it back when all buffers are full */
    if (IsocOutWrPtr >= (IsocOutBuff + (AUDIO_OUT_PACKET * OUT_PACKET_NUM)))
    {/* All buffers are full: roll back */
      IsocOutWrPtr = IsocOutBuff;
    }
    else
    {/* Increment the buffer pointer */
      IsocOutWrPtr += AUDIO_OUT_PACKET;
    }
    
    /* Toggle the frame index */  
    ((USB_OTG_CORE_HANDLE*)pdev)->dev.out_ep[epnum].even_odd_frame = 
      (((USB_OTG_CORE_HANDLE*)pdev)->dev.out_ep[epnum].even_odd_frame)? 0:1;
      
    /* Prepare Out endpoint to receive next audio packet */
    DCD_EP_PrepareRx(pdev,
                     AUDIO_OUT_EP,
                     (uint8_t*)(IsocOutWrPtr),
                     AUDIO_OUT_PACKET);
      
    /* Trigger the start of streaming only when half buffer is full */
    if ((PlayFlag == 0) && (IsocOutWrPtr >= (IsocOutBuff + ((AUDIO_OUT_PACKET * OUT_PACKET_NUM) / 2))))
    {
      /* Enable start of Streaming */
      PlayFlag = 1;
    }
  }
  
  return USBD_OK;
}
開發者ID:12019,項目名稱:STM32F4_UVC_Camera,代碼行數:41,代碼來源:usbd_audio_core.c

示例4: CCID_BulkMessage_In

/**
  * @brief  CCID_Message_In
  *         Handle Bulk IN & Intr IN data stage 
  * @param  pdev: device instance
  * @param  uint8_t epnum: endpoint index
  * @retval None
  */
void CCID_BulkMessage_In (USB_CORE_HANDLE  *pdev, 
                     uint8_t epnum)
{  
  if (epnum == (CCID_BULK_IN_EP & 0x7F))
  {/* Filter the epnum by masking with 0x7f (mask of IN Direction)  */
    
    /*************** Handle Bulk Transfer IN data completion  *****************/
    
    /* Toggle LED1 */
    STM_EVAL_LEDToggle(LED1);
    
    switch (Ccid_BulkState)
    {
    case CCID_STATE_SEND_RESP:
      
      Ccid_BulkState = CCID_STATE_IDLE;
      
      /* Prepare EP to Receive First Cmd */
      DCD_EP_PrepareRx (pdev,
                        CCID_BULK_OUT_EP,
                        (uint8_t *)&BulkOut_Data_Buff[0],
                        CCID_BULK_EPOUT_SIZE);   
      
      break;
      
    default:
      break;
    }
  }
  else if (epnum == (CCID_INTR_IN_EP & 0x7F))
  {
    /* Filter the epnum by masking with 0x7f (mask of IN Direction)  */
    CCID_SetIntrTransferStatus(1);  /* Transfer Complete Status */
  }
}
開發者ID:caozoux,項目名稱:arm,代碼行數:42,代碼來源:usbd_ccid_if.c

示例5: usbd_midi_Init

/**
* @brief  usbd_midi_Init
*         Initilaizes the MIDI interface.
* @param  pdev: device instance
* @param  cfgidx: Configuration index
* @retval status
*/
static uint8_t  usbd_midi_Init (void  *pdev,
                                 uint8_t cfgidx)
{
  /* Open EP OUT */
	/**
	* @brief  Configure an EP
	* @param pdev : Device instance
	* @param epdesc : Endpoint Descriptor
	* @retval : status
	*/
	(void)cfgidx;

  DCD_EP_Open(pdev,
		  	  MIDI_OUT_EP,
		  	  MIDI_PACKET_SIZE,
		  	  USB_OTG_EP_BULK);

  DCD_EP_Open(pdev,
  		  	  MIDI_IN_EP,
  		  	  MIDI_PACKET_SIZE,
  		  	  USB_OTG_EP_BULK);

  /* Prepare Out endpoint to receive midi data */
  DCD_EP_PrepareRx(pdev,
		  	  	   MIDI_OUT_EP,
                   (uint8_t*)usb_MidiOutBuff,
                   MIDI_PACKET_SIZE);

  //No Hardware to init
  return USBD_OK;
}
開發者ID:MartinBspheroid,項目名稱:LXR,代碼行數:38,代碼來源:usb_midi_core.c

示例6: usbd_rndis_data_out

// Data received on non-control Out endpoint
static uint8_t usbd_rndis_data_out(void *pdev, uint8_t epnum)
{
	static int rndis_received = 0;
	if (epnum == RNDIS_DATA_OUT_EP)
	{
		PUSB_OTG_EP ep = &((USB_OTG_CORE_HANDLE*)pdev)->dev.out_ep[epnum];
		if (rndis_received + ep->xfer_count > RNDIS_RX_BUFFER_SIZE)
		{
			usb_eth_stat.rxbad++;
			rndis_received = 0;
		}
		else
		{
			if (rndis_received + ep->xfer_count <= RNDIS_RX_BUFFER_SIZE)
			{
				memcpy(&rndis_rx_buffer[rndis_received], usb_rx_buffer, ep->xfer_count);
				rndis_received += ep->xfer_count;
				if (ep->xfer_count != RNDIS_DATA_OUT_SZ)
				{
					handle_packet(rndis_rx_buffer, rndis_received);
					rndis_received = 0;
				}
			}
			else
			{
					rndis_received = 0;
					usb_eth_stat.rxbad++;
			}
		}
		DCD_EP_PrepareRx(pdev, RNDIS_DATA_OUT_EP, (uint8_t*)usb_rx_buffer, RNDIS_DATA_OUT_SZ);
	}
  return USBD_OK;
}
開發者ID:nandojve,項目名稱:lrndis,代碼行數:34,代碼來源:usbd_rndis_core.c

示例7: USBD_CDC_ClassInit

/**
 * @brief  USBD_CDC_ClassInit
 *         Initilaize the CDC interface
 * @param  pdev: device instance
 * @param  cfgidx: Configuration index
 * @retval status
 */
static uint8_t  USBD_CDC_ClassInit (void* pdev, uint8_t cfgidx)
{
	DCD_EP_Open(pdev,
				USBD_Dev_CDC_D2H_EP,
				USBD_Dev_CDC_D2H_EP_SZ,
				USB_OTG_EP_BULK);

	DCD_EP_Open(pdev,
				USBD_Dev_CDC_H2D_EP,
				USBD_Dev_CDC_H2D_EP_SZ,
				USB_OTG_EP_BULK);

	DCD_EP_Open(pdev,
				USBD_Dev_CDC_CMD_EP,
				USBD_Dev_CDC_CMD_EP_SZ,
				USB_OTG_EP_INT);

	USBD_CDC_InFlight = 0;

	ringbuffer_init(&USBD_CDC_H2D_FIFO, malloc(CDC_DATA_IN_PACKET_SIZE), CDC_DATA_IN_PACKET_SIZE);
	ringbuffer_init(&USBD_CDC_D2H_FIFO, malloc(CDC_DATA_MAX_PACKET_SIZE), CDC_DATA_MAX_PACKET_SIZE);
	USBD_CDC_D2H_Buff = malloc(CDC_DATA_IN_PACKET_SIZE);
	USBD_CDC_H2D_Buff = malloc(CDC_DATA_MAX_PACKET_SIZE);
	USBD_CDC_CMD_Buff = malloc(CDC_CMD_PACKET_SZE);

	/* Prepare Out endpoint to receive next packet */
	DCD_EP_PrepareRx(pdev,
					USBD_Dev_CDC_H2D_EP,
					(uint8_t*)(USBD_CDC_H2D_Buff),
					USBD_Dev_CDC_H2D_EP_SZ);

	return USBD_OK;
}
開發者ID:Poopi,項目名稱:UsbXlater,代碼行數:40,代碼來源:usbd_dev_cdc.c

示例8: USBD_CtlContinueRx

//--------------------------------------------------------------
USBD_Status USBD_CtlContinueRx(USB_OTG_CORE_HANDLE * pdev, uint8_t * pbuf, uint16_t len)
{
    USBD_Status ret = USBD_OK;

    DCD_EP_PrepareRx(pdev, 0, pbuf, len);
    return ret;
}
開發者ID:nano-bio,項目名稱:TempControl,代碼行數:8,代碼來源:usbd_ioreq.c

示例9: usbd_rndis_init

static uint8_t usbd_rndis_init(void  *pdev, uint8_t cfgidx)
{
  DCD_EP_Open(pdev, RNDIS_NOTIFICATION_IN_EP, RNDIS_NOTIFICATION_IN_SZ, USB_OTG_EP_INT);
  DCD_EP_Open(pdev, RNDIS_DATA_IN_EP, RNDIS_DATA_IN_SZ, USB_OTG_EP_BULK);
  DCD_EP_Open(pdev, RNDIS_DATA_OUT_EP, RNDIS_DATA_OUT_SZ, USB_OTG_EP_BULK);
  DCD_EP_PrepareRx(pdev, RNDIS_DATA_OUT_EP, (uint8_t*)usb_rx_buffer, RNDIS_DATA_OUT_SZ);
  return USBD_OK;
}
開發者ID:nandojve,項目名稱:lrndis,代碼行數:8,代碼來源:usbd_rndis_core.c

示例10: usbd_cdc_msc_Init

/**
  * @brief  usbd_cdc_Init
  *         Initilaize the CDC interface
  * @param  pdev: device instance
  * @param  cfgidx: Configuration index
  * @retval status
  */
static uint8_t  usbd_cdc_msc_Init (void  *pdev,
                               uint8_t cfgidx)
{
//  uint8_t *pbuf;

//    MSC_BOT_Data = (filerBuf + 60*1024);
    MSC_BOT_Data = filerBuf;

  /* Open EP IN */
  DCD_EP_Open(pdev,
              CDC_IN_EP,
              CDC_DATA_IN_PACKET_SIZE,
              USB_OTG_EP_BULK);

  /* Open EP OUT */
  DCD_EP_Open(pdev,
              CDC_OUT_EP,
              CDC_DATA_OUT_PACKET_SIZE,
              USB_OTG_EP_BULK);

  /* Open Command IN EP */
  DCD_EP_Open(pdev,
              CDC_CMD_EP,
              CDC_CMD_PACKET_SZE,
              USB_OTG_EP_INT);

  /* Open EP IN */
  DCD_EP_Open(pdev,
              MSC_IN_EP,
              MSC_EPIN_SIZE,
              USB_OTG_EP_BULK);

  /* Open EP OUT */
  DCD_EP_Open(pdev,
              MSC_OUT_EP,
              MSC_EPOUT_SIZE,
              USB_OTG_EP_BULK);

//  pbuf = (uint8_t *)USBD_DeviceDesc;
//  pbuf[4] = DEVICE_CLASS_CDC;
//  pbuf[5] = DEVICE_SUBCLASS_CDC;

  /* Initialize the Interface physical components */
  APP_FOPS.pIf_Init();

//  usbd_cdc_msc_DeInit(pdev , cfgidx );

  /* Init the BOT  layer */
  MSC_BOT_Init(pdev);

  /* Prepare Out endpoint to receive next packet */
  DCD_EP_PrepareRx(pdev,
                   CDC_OUT_EP,
                   (uint8_t*)(USB_Rx_Buffer),
                   CDC_DATA_OUT_PACKET_SIZE);

  return USBD_OK;
}
開發者ID:ChrelleP,項目名稱:autoquad,代碼行數:65,代碼來源:usbd_cdc_msc_core.c

示例11: MSC_BOT_Reset

/**
* @brief  MSC_BOT_Reset
*         Reset the BOT Machine
* @param  pdev: device instance
* @retval  None
*/
void MSC_BOT_Reset (USB_OTG_CORE_HANDLE  *pdev) {
	MSC_BOT_State = BOT_IDLE;
	MSC_BOT_Status = BOT_STATE_RECOVERY;
	/* Prapare EP to Receive First BOT Cmd */
	DCD_EP_PrepareRx (pdev,
					  MSC_OUT_EP,
					  (uint8_t *)&MSC_BOT_cbw,
					  BOT_CBW_LENGTH);
}
開發者ID:jiezhi320,項目名稱:quadfork,代碼行數:15,代碼來源:usbd_msc_bot.c

示例12: USBD_CtlReceiveStatus

//--------------------------------------------------------------
USBD_Status USBD_CtlReceiveStatus(USB_OTG_CORE_HANDLE * pdev)
{
    USBD_Status ret = USBD_OK;
    pdev->dev.device_state = USB_OTG_EP0_STATUS_OUT;
    DCD_EP_PrepareRx(pdev, 0, NULL, 0);

    USB_OTG_EP0_OutStart(pdev);

    return ret;
}
開發者ID:nano-bio,項目名稱:TempControl,代碼行數:11,代碼來源:usbd_ioreq.c

示例13: MSC_BOT_Init

/**
  * @brief  MSC_BOT_Init
  *         Initialize the BOT Process
  * @param  pdev: device instance
  * @retval None
  */
void MSC_BOT_Init (USB_CORE_HANDLE  *pdev)
{
  MSC_BOT_State = BOT_IDLE;
  MSC_BOT_Status = BOT_STATE_NORMAL;
  USBD_STORAGE_fops->Init(0);
  
  /* Prepare EP to Receive First BOT Cmd */
  DCD_EP_PrepareRx (pdev,
                    MSC_OUT_EP,
                    (uint8_t *)&MSC_BOT_cbw,
                    BOT_CBW_LENGTH);    
}
開發者ID:royazriel,項目名稱:RoboMow,代碼行數:18,代碼來源:usbd_msc_bot.c

示例14: USBD_CtlPrepareRx

//--------------------------------------------------------------
USBD_Status USBD_CtlPrepareRx(USB_OTG_CORE_HANDLE * pdev, uint8_t * pbuf, uint16_t len)
{
    USBD_Status ret = USBD_OK;

    pdev->dev.out_ep[0].total_data_len = len;
    pdev->dev.out_ep[0].rem_data_len = len;
    pdev->dev.device_state = USB_OTG_EP0_DATA_OUT;

    DCD_EP_PrepareRx(pdev, 0, pbuf, len);


    return ret;
}
開發者ID:nano-bio,項目名稱:TempControl,代碼行數:14,代碼來源:usbd_ioreq.c

示例15: CCID_Init

/**
  * @brief  CCID_Init
  *         Initialize the CCID USB Layer
  * @param  pdev: device instance
  * @retval None
  */
void CCID_Init (USB_CORE_HANDLE  *pdev)
{
  /* CCID Related Initialization */
  CCID_SetIntrTransferStatus(1);  /* Transfer Complete Status */
  CCID_UpdSlotChange(1);
  SC_InitParams();  
  
  /* Prepare EP to Receive First Cmd */
  DCD_EP_PrepareRx (pdev,
                    CCID_BULK_OUT_EP,
                    (uint8_t *)&BulkOut_Data_Buff[0],
                    CCID_BULK_EPOUT_SIZE);   
}
開發者ID:caozoux,項目名稱:arm,代碼行數:19,代碼來源:usbd_ccid_if.c


注:本文中的DCD_EP_PrepareRx函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。