void USB_DataOutStage (void) { uint32_t cnt; cnt = USB_ReadEP(0x00, EP0Data.pData); EP0Data.pData += cnt; EP0Data.Count -= cnt; }
/* * USB Endpoint 2 Event Callback * Called automatically on USB Endpoint 2 Event * Parameter: event */ void USB_EndPoint2(uint32_t event) { switch (event) { case USB_EVT_OUT: USB_ReadEP(USB_ENDPOINT_OUT(2), OUT2Packet); lasershark_process_uart_bridge_command(); USB_WriteEP(USB_ENDPOINT_IN(2), IN2Packet, 64); break; case USB_EVT_IN: break; } }
/* * USB Endpoint 1 Event Callback * Called automatically on USB Endpoint 1 Event * Parameter: event */ void USB_EndPoint1(uint32_t event) { switch (event) { case USB_EVT_OUT: USB_ReadEP(USB_ENDPOINT_OUT(1), OUT1Packet); lasershark_process_command(); USB_WriteEP(USB_ENDPOINT_IN(1), IN1Packet, 64); break; case USB_EVT_IN: break; } }
/*---------------------------------------------------------------------------- CDC_BulkOut call on DataOut Request Parameters: none Return Value: none *---------------------------------------------------------------------------*/ void CDC_BulkOut(void) { int numBytesRead; // get data from USB into intermediate buffer numBytesRead = USB_ReadEP(CDC_DEP_OUT, &BulkBufOut[0]); // ... add code to check for overwrite // store data in a buffer to transmit it over serial interface CDC_WrOutBuf ((char *)&BulkBufOut[0], numBytesRead); vCDCNewDataNotify(); }
void USB_SOF_Event (void) { #if USB_DMA == 0 if (USB_ReadEP(0x03, (BYTE *)&DataBuf[DataIn])) { /* Data Available */ DataIn += P_S; /* Update Data In Index */ DataIn &= B_S - 1; /* Adjust Data In Index */ if (((DataIn - DataOut) & (B_S - 1)) == (B_S/2)) { DataRun = 1; /* Data Stream running */ } } else { /* No Data */ DataRun = 0; /* Data Stream not running */ DataOut = DataIn; /* Initialize Data Indexes */ } #endif }
void USB_StatusOutStage (void) { USB_ReadEP(0x00, EP0Buf); }
void USB_SetupStage (void) { USB_ReadEP(0x00, (uint8_t *)&SetupPacket); }
void USB_SetupStage (void) { USB_ReadEP(0x00, (U8 *)&SetupPacket); }