本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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 */
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}