您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Endpoint_Write_Stream_LE函数代码示例

51自学网 2021-06-01 20:38:10
  C++
这篇教程C++ Endpoint_Write_Stream_LE函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Endpoint_Write_Stream_LE函数的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint_Write_Stream_LE函数的具体用法?C++ Endpoint_Write_Stream_LE怎么用?C++ Endpoint_Write_Stream_LE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Endpoint_Write_Stream_LE函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SideShow_GetApplicationOrder

static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* PacketHeader){	uint8_t  TotalApplications = 0;		   	Endpoint_ClearOUT();	for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)	{		if (InstalledApplications[App].InUse)		  TotalApplications++;	}	PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +	                       sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));		Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);	Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));	Endpoint_Write_DWord_LE(TotalApplications);		for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)	{		if (InstalledApplications[App].InUse)		  Endpoint_Write_Stream_LE(&InstalledApplications[App].ApplicationID, sizeof(GUID_t));	}	Endpoint_ClearIN();}
开发者ID:TomMD,项目名称:teensy,代码行数:27,


示例2: SCSI_Command_Inquiry

/** Command processing for an issued SCSI INQUIRY command. This command returns information about the device's features *  and capabilities to the host. * *  /param[in] MSInterfaceInfo  Pointer to the Mass Storage class interface structure that the command is associated with * *  /return Boolean true if the command completed successfully, false otherwise. */static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo){	uint16_t AllocationLength  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);	uint16_t BytesTransferred  = (AllocationLength < sizeof(InquiryData))? AllocationLength :	                                                                       sizeof(InquiryData);	/* Only the standard INQUIRY data is supported, check if any optional INQUIRY bits set */	if ((MSInterfaceInfo->State.CommandBlock.SCSICommandData[1] & ((1 << 0) | (1 << 1))) ||	     MSInterfaceInfo->State.CommandBlock.SCSICommandData[2])	{		/* Optional but unsupported bits set - update the SENSE key and fail the request */		SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,		               SCSI_ASENSE_INVALID_FIELD_IN_CDB,		               SCSI_ASENSEQ_NO_QUALIFIER);		return false;	}		Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NO_STREAM_CALLBACK);	uint8_t PadBytes[AllocationLength - BytesTransferred];		/* Pad out remaining bytes with 0x00 */	Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK);	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	MSInterfaceInfo->State.CommandBlock.DataTransferLength -= BytesTransferred;		return true;}
开发者ID:davr,项目名称:lufa-lib,代码行数:40,


示例3: Endpoint_Streaming

void Endpoint_Streaming(uint8_t corenum, uint8_t *buffer, uint16_t packetsize,						uint16_t totalpackets, uint16_t dummypackets){	uint8_t PhyEP = endpointhandle(corenum)[endpointselected[corenum]];	uint16_t i;	if (PhyEP & 1) {		for (i = 0; i < totalpackets; i++) {			while (!Endpoint_IsReadWriteAllowed(corenum)) ;			Endpoint_Write_Stream_LE(corenum,(void *) (buffer + i * packetsize), packetsize, NULL);			Endpoint_ClearIN(corenum);		}		for (i = 0; i < dummypackets; i++) {			while (!Endpoint_IsReadWriteAllowed(corenum)) ;			Endpoint_Write_Stream_LE(corenum,(void *) buffer, packetsize, NULL);			Endpoint_ClearIN(corenum);		}	}	else {		stream_total_packets = totalpackets + dummypackets;		for (i = 0; i < totalpackets; i++) {			DcdDataTransfer(PhyEP, (uint8_t *) (buffer + i * packetsize), packetsize);			Endpoint_ClearOUT(corenum);			while (!Endpoint_IsReadWriteAllowed(corenum)) ;		}		for (i = 0; i < dummypackets; i++) {			DcdDataTransfer(PhyEP, buffer, packetsize);			Endpoint_ClearOUT(corenum);			while (!Endpoint_IsReadWriteAllowed(corenum)) ;		}		stream_total_packets = 0;	}}
开发者ID:JeremyHsiao,项目名称:TinyBlueRat_LPCv1_03,代码行数:33,


示例4: CDC_Device_SendControlLineStateChange

void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return;	Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpointNumber);	USB_Request_Header_t Notification = (USB_Request_Header_t)		{			.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),			.bRequest      = CDC_NOTIF_SerialState,			.wValue        = CPU_TO_LE16(0),			.wIndex        = CPU_TO_LE16(0),			.wLength       = CPU_TO_LE16(sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost)),		};	Endpoint_Write_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NULL);	Endpoint_Write_Stream_LE(&CDCInterfaceInfo->State.ControlLineStates.DeviceToHost,	                         sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost),	                         NULL);	Endpoint_ClearIN();}#if defined(FDEV_SETUP_STREAM)void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,                             FILE* const Stream){	*Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar, _FDEV_SETUP_RW);	fdev_set_udata(Stream, CDCInterfaceInfo);}
开发者ID:cloud-hot,项目名称:Jennisense,代码行数:30,


示例5: RNDIS_Device_SendPacket

uint8_t RNDIS_Device_SendPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,                                void* Buffer,                                const uint16_t PacketLength){	uint8_t ErrorCode;	if ((USB_DeviceState != DEVICE_STATE_Configured) ||	    (RNDISInterfaceInfo->State.CurrRNDISState != RNDIS_Data_Initialized))	{		return ENDPOINT_RWSTREAM_DeviceDisconnected;	}	Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpoint.Address);	if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)	  return ErrorCode;	RNDIS_Packet_Message_t RNDISPacketHeader;	memset(&RNDISPacketHeader, 0, sizeof(RNDIS_Packet_Message_t));	RNDISPacketHeader.MessageType   = CPU_TO_LE32(REMOTE_NDIS_PACKET_MSG);	RNDISPacketHeader.MessageLength = cpu_to_le32(sizeof(RNDIS_Packet_Message_t) + PacketLength);	RNDISPacketHeader.DataOffset    = CPU_TO_LE32(sizeof(RNDIS_Packet_Message_t) - sizeof(RNDIS_Message_Header_t));	RNDISPacketHeader.DataLength    = cpu_to_le32(PacketLength);	Endpoint_Write_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_Packet_Message_t), NULL);	Endpoint_Write_Stream_LE(Buffer, PacketLength, NULL);	Endpoint_ClearIN();	return ENDPOINT_RWSTREAM_NoError;}
开发者ID:abcminiuser,项目名称:lufa,代码行数:32,


示例6: SCSI_Command_Inquiry

/** Command processing for an issued SCSI INQUIRY command. This command returns information about the device's features *  and capabilities to the host. */static void SCSI_Command_Inquiry(void){	uint16_t AllocationLength  = SwapEndian_16(*(uint16_t*)&CommandBlock.SCSICommandData[3]);	uint16_t BytesTransferred  = (AllocationLength < sizeof(InquiryData))? AllocationLength :	                                                                       sizeof(InquiryData);	/* Only the standard INQUIRY data is supported, check if any optional INQUIRY bits set */	if ((CommandBlock.SCSICommandData[1] & ((1 << 0) | (1 << 1))) ||	     CommandBlock.SCSICommandData[2])	{		/* Optional but unsupported bits set - update the SENSE key and fail the request */		SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,		               SCSI_ASENSE_INVALID_FIELD_IN_CDB,		               SCSI_ASENSEQ_NO_QUALIFIER);		return;	}	/* Write the INQUIRY data to the endpoint */	Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, StreamCallback_AbortOnMassStoreReset);	uint8_t PadBytes[AllocationLength - BytesTransferred];		/* Pad out remaining bytes with 0x00 */	Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), StreamCallback_AbortOnMassStoreReset);	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	CommandBlock.DataTransferLength -= BytesTransferred;}
开发者ID:G33KatWork,项目名称:XBox-360-AVR-flasher,代码行数:35,


示例7: SCSI_Command_Request_Sense

/** Command processing for an issued SCSI REQUEST SENSE command. This command returns information about the last issued command, *  including the error code and additional error information so that the host can determine why a command failed to complete. * *  /param[in] MSInterfaceInfo  Pointer to the Mass Storage class interface structure that the command is associated with */static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInfo){	uint8_t  AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];	uint8_t  BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);		uint8_t PadBytes[AllocationLength - BytesTransferred];	Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NO_STREAM_CALLBACK);	Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), NO_STREAM_CALLBACK);	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	MSInterfaceInfo->State.CommandBlock.DataTransferLength -= BytesTransferred;}
开发者ID:TomMD,项目名称:teensy,代码行数:19,


示例8: HID_Task

/** Function to manage HID report generation and transmission to the host. */void HID_Task(void){	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	/* Select the Joystick Report Endpoint */	Endpoint_SelectEndpoint(JOYSTICK_EPADDR);	/* Check to see if the host is ready for another packet */	if (Endpoint_IsINReady())	{		USB_JoystickReport_Data_t JoystickReportData;		/* Create the next HID report to send to the host */		GetNextReport(&JoystickReportData);		/* Write Joystick Report Data */		Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData), NULL);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();		/* Clear the report data afterwards */		memset(&JoystickReportData, 0, sizeof(JoystickReportData));	}}
开发者ID:BrazzoduroArduino,项目名称:Dougs-Arduino-Stuff,代码行数:28,


示例9: MS_Device_ReturnCommandStatus

static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo){	Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);	while (Endpoint_IsStalled())	{		#if !defined(INTERRUPT_CONTROL_ENDPOINT)		USB_USBTask();		#endif		if (MSInterfaceInfo->State.IsMassStoreReset)		  return;	}	Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);	while (Endpoint_IsStalled())	{		#if !defined(INTERRUPT_CONTROL_ENDPOINT)		USB_USBTask();		#endif				if (MSInterfaceInfo->State.IsMassStoreReset)		  return;	}		CallbackIsResetSource = &MSInterfaceInfo->State.IsMassStoreReset;	if (Endpoint_Write_Stream_LE(&MSInterfaceInfo->State.CommandStatus, sizeof(MS_CommandStatusWrapper_t),	                             StreamCallback_MS_Device_AbortOnMassStoreReset))	{		return;	}	Endpoint_ClearIN();}
开发者ID:Andrew0Hill,项目名称:keyboard,代码行数:35,


示例10: SendNextReport

/** Sends the next HID report to the host, via the IN endpoint. */void SendNextReport(void){	/* Select the IN Report Endpoint */	Endpoint_SelectEndpoint(IN_EPNUM);  if (ready && sendReport)  {    /* Wait until the host is ready to accept another packet */    while (!Endpoint_IsINReady()) {}		/* Write IN Report Data */		Endpoint_Write_Stream_LE(report, sizeof(report), NULL);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();    sendReport = 0;#ifdef REPORT_NB_INFO		nbReports++;		if(!nbReports) {      Serial_SendData(info, sizeof(info));		}#endif	}}
开发者ID:RalphFox,项目名称:GIMX-firmwares,代码行数:27,


示例11: RNDIS_Notification

/** Task to manage the sending and receiving of encapsulated RNDIS data and notifications. This removes the RNDIS *  wrapper from recieved Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper *  to a frame in the FrameOUT global before sending the buffer contents to the host. */void RNDIS_Notification(void){	/* Select the notification endpoint */	Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);	/* Check if a message response is ready for the host */	if (Endpoint_ReadWriteAllowed() && ResponseReady)	{		USB_Notification_t Notification = (USB_Notification_t)			{				bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),				bNotification: NOTIF_RESPONSE_AVAILABLE,				wValue:        0,				wIndex:        0,				wLength:       0,			};		/* Indicate that a message response is ready for the host */		Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearCurrentBank();		/* Indicate a response is no longer ready */		ResponseReady = false;	}
开发者ID:BackupTheBerlios,项目名称:culeth,代码行数:30,


示例12: HID_Task

void HID_Task(void){    if (USB_DeviceState != DEVICE_STATE_Configured)      return;    Endpoint_SelectEndpoint(GENERIC_OUT_EPNUM);    if (Endpoint_IsOUTReceived())    {        if (Endpoint_IsReadWriteAllowed())        {            Endpoint_Read_Stream_LE(&HIDReportInData, sizeof(HIDReportInData), NULL);        }        Endpoint_ClearOUT();    }    Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);    if (Endpoint_IsINReady())    {        Endpoint_Write_Stream_LE(&HIDReportOutData, sizeof(HIDReportOutData), NULL);        memset(&HIDReportOutData, 0, GENERIC_REPORT_SIZE + 1);        Endpoint_ClearIN();    }}
开发者ID:HexTank,项目名称:KADE,代码行数:25,


示例13: Endpoint_Streaming

void Endpoint_Streaming(uint8_t * buffer,uint16_t packetsize,						uint16_t totalpackets,uint16_t dummypackets){	uint8_t PhyEP = endpointhandle[endpointselected];	uint16_t i;	dummypackets = dummypackets;	if(PhyEP&1)	{		for(i=0;i<totalpackets;i++){			while(!Endpoint_IsReadWriteAllowed());			Endpoint_Write_Stream_LE((void*)(buffer + i*packetsize), packetsize,NULL);			Endpoint_ClearIN();		}	}	else	{		for(i=0;i<totalpackets;i++){			DcdDataTransfer(PhyEP, usb_data_buffer_OUT, packetsize);			Endpoint_ClearOUT();			while(!Endpoint_IsReadWriteAllowed());			Endpoint_Read_Stream_LE((void*)(buffer + i*packetsize),packetsize,NULL);		}	}}
开发者ID:AlexandreN7,项目名称:Liqui_lense,代码行数:25,


示例14: MIDI_To_Host

// From Arduino/Serial to USB/Host void MIDI_To_Host(void){	// Device must be connected and configured for the task to run	if (USB_DeviceState != DEVICE_STATE_Configured) return;	// Select the MIDI IN stream	Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPADDR);	if (Endpoint_IsINReady())	{		if (mPendingMessageValid == true)		{			mPendingMessageValid = false;			// Write the MIDI event packet to the endpoint			Endpoint_Write_Stream_LE(&mCompleteMessage, sizeof(mCompleteMessage), NULL);			// Clear out complete message			memset(&mCompleteMessage, 0, sizeof(mCompleteMessage)); 			// Send the data in the endpoint to the host			Endpoint_ClearIN();			LEDs_TurnOffLEDs(LEDS_LED2);			tx_ticks = TICK_COUNT; 		}	}}
开发者ID:guidokritz,项目名称:KiloMux-Shield,代码行数:30,


示例15: usb_debug

void usb_debug( char *msg ){	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;		Endpoint_SelectEndpoint(GENERIC_IN_EPADDR);	/* Check to see if the host is ready to accept another packet */	if (Endpoint_IsINReady())	{		/* Create a temporary buffer to hold the report to send to the host */		uint8_t GenericData[BUFFER_EPSIZE];				int len = strlen( msg );		GenericData[0] = len;		GenericData[1] = 0x01;	// debug msg				for ( int c = 0; c < len; c++ )			GenericData[c + 2] = *msg++;		/* Write Generic Report Data */		Endpoint_Write_Stream_LE(&GenericData, sizeof(GenericData), NULL);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();	}		_delay_ms(200);}
开发者ID:12019,项目名称:mooltipass,代码行数:31,


示例16: main

/** Main program entry point. This routine configures the hardware required by the application, then *  enters a loop to run the application tasks in sequence. */int main(void){	SetupHardware();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	for (;;)	{		USB_USBTask();		uint8_t ReceivedData[VENDOR_IO_EPSIZE];		memset(ReceivedData, 0x00, sizeof(ReceivedData));		Endpoint_SelectEndpoint(VENDOR_OUT_EPADDR);		if (Endpoint_IsOUTReceived())		{			Endpoint_Read_Stream_LE(ReceivedData, VENDOR_IO_EPSIZE, NULL);			Endpoint_ClearOUT();			Endpoint_SelectEndpoint(VENDOR_IN_EPADDR);			Endpoint_Write_Stream_LE(ReceivedData, VENDOR_IO_EPSIZE, NULL);			Endpoint_ClearIN();		}	}}
开发者ID:40000ft,项目名称:lufa,代码行数:29,


示例17: RNDIS_Device_USBTask

void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.NotificationEndpoint.Address);	if (Endpoint_IsINReady() && RNDISInterfaceInfo->State.ResponseReady)	{		USB_Request_Header_t Notification = (USB_Request_Header_t)			{				.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),				.bRequest      = RNDIS_NOTIF_ResponseAvailable,				.wValue        = CPU_TO_LE16(0),				.wIndex        = CPU_TO_LE16(0),				.wLength       = CPU_TO_LE16(0),			};		Endpoint_Write_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NULL);		Endpoint_ClearIN();		RNDISInterfaceInfo->State.ResponseReady = false;	}}
开发者ID:abcminiuser,项目名称:lufa,代码行数:25,


示例18: ReturnCommandStatus

/** Returns the filled Command Status Wrapper back to the host via the bulk data IN endpoint, waiting for the host to clear any *  stalled data endpoints as needed. */static void ReturnCommandStatus(void){	/* Select the Data Out endpoint */	Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);	/* While data pipe is stalled, wait until the host issues a control request to clear the stall */	while (Endpoint_IsStalled())	{		/* Check if the current command is being aborted by the host */		if (IsMassStoreReset)		  return;	}	/* Select the Data In endpoint */	Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);	/* While data pipe is stalled, wait until the host issues a control request to clear the stall */	while (Endpoint_IsStalled())	{		/* Check if the current command is being aborted by the host */		if (IsMassStoreReset)		  return;	}	/* Write the CSW to the endpoint */	Endpoint_Write_Stream_LE(&CommandStatus, sizeof(CommandStatus),	                          StreamCallback_AbortOnMassStoreReset);	/* Check if the current command is being aborted by the host */	if (IsMassStoreReset)	  return;	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearIN();}
开发者ID:Dzenik,项目名称:RF-Pirate,代码行数:38,


示例19: CDC_Task

/** Function to manage CDC data transmission and reception to and from the host. */void CDC_Task(void){	char*       ReportString    = NULL;	uint8_t     JoyStatus_LCL   = Joystick_GetStatus();	static bool ActionSent      = false;	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	/* Determine if a joystick action has occurred */	if (JoyStatus_LCL & JOY_UP)	  ReportString = "Joystick Up/r/n";	else if (JoyStatus_LCL & JOY_DOWN)	  ReportString = "Joystick Down/r/n";	else if (JoyStatus_LCL & JOY_LEFT)	  ReportString = "Joystick Left/r/n";	else if (JoyStatus_LCL & JOY_RIGHT)	  ReportString = "Joystick Right/r/n";	else if (JoyStatus_LCL & JOY_PRESS)	  ReportString = "Joystick Pressed/r/n";	else	  ActionSent = false;	/* Flag management - Only allow one string to be sent per action */	if ((ReportString != NULL) && (ActionSent == false) && LineEncoding.BaudRateBPS)	{		ActionSent = true;		/* Select the Serial Tx Endpoint */		Endpoint_SelectEndpoint(CDC_TX_EPADDR);		/* Write the String to the Endpoint */		Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), NULL);		/* Remember if the packet to send completely fills the endpoint */		bool IsFull = (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();		/* If the last packet filled the endpoint, send an empty packet to release the buffer on		 * the receiver (otherwise all data will be cached until a non-full packet is received) */		if (IsFull)		{			/* Wait until the endpoint is ready for another packet */			Endpoint_WaitUntilReady();			/* Send an empty packet to ensure that the host does not buffer data sent to it */			Endpoint_ClearIN();		}	}	/* Select the Serial Rx Endpoint */	Endpoint_SelectEndpoint(CDC_RX_EPADDR);	/* Throw away any received data from the host */	if (Endpoint_IsOUTReceived())	  Endpoint_ClearOUT();}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:61,


示例20: TMC_Task

/** Function to manage TMC data transmission and reception to and from the host. */void TMC_Task(void){	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	TMC_MessageHeader_t MessageHeader;	uint8_t             MessagePayload[128];	/* Try to read in a TMC message from the interface, process if one is available */	if (ReadTMCHeader(&MessageHeader))	{		/* Indicate busy */		LEDs_SetAllLEDs(LEDMASK_USB_BUSY);		switch (MessageHeader.MessageID)		{			case TMC_MESSAGEID_DEV_DEP_MSG_OUT:				LastTransferLength = 0;				while (Endpoint_Read_Stream_LE(MessagePayload, MIN(MessageHeader.TransferSize, sizeof(MessagePayload)), &LastTransferLength) ==				       ENDPOINT_RWSTREAM_IncompleteTransfer)				{					if (IsTMCBulkOUTReset)					  break;				}				Endpoint_ClearOUT();				ProcessSentMessage(MessagePayload, LastTransferLength);				break;			case TMC_MESSAGEID_DEV_DEP_MSG_IN:				Endpoint_ClearOUT();				MessageHeader.TransferSize = GetNextMessage(MessagePayload);				MessageHeader.MessageIDSpecific.DeviceOUT.LastMessageTransaction = true;				WriteTMCHeader(&MessageHeader);				LastTransferLength = 0;				while (Endpoint_Write_Stream_LE(MessagePayload, MessageHeader.TransferSize, &LastTransferLength) ==				       ENDPOINT_RWSTREAM_IncompleteTransfer)				{					if (IsTMCBulkINReset)					  break;				}				Endpoint_ClearIN();				break;			default:				Endpoint_StallTransaction();				break;		}		LEDs_SetAllLEDs(LEDMASK_USB_READY);	}	/* All pending data has been processed - reset the data abort flags */	IsTMCBulkINReset  = false;	IsTMCBulkOUTReset = false;}
开发者ID:ASHOK1991,项目名称:lb-Arduino-Code,代码行数:60,


示例21: process_GET_POSE

void process_GET_POSE(){	uint16_t myPose[6];	myPose[0] = 0;//Do This Right	Endpoint_ClearSETUP();	Endpoint_Write_Stream_LE(myPose, 16, 0);	Endpoint_ClearIN();	Endpoint_ClearStatusStage();}
开发者ID:DJGCrusader,项目名称:TinyArmTroller,代码行数:8,


示例22: CDC_Device_SendString

uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, char* const Data, const uint16_t Length){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return ENDPOINT_RWSTREAM_DeviceDisconnected;		Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);	return Endpoint_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:8,


示例23: CDC_Device_SendString

uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,                              const char* const String){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);	return Endpoint_Write_Stream_LE(String, strlen(String), NULL);}
开发者ID:cloud-hot,项目名称:Jennisense,代码行数:9,


示例24: Keyboard_HID_Task

/** Keyboard task. This generates the next keyboard HID report for the host, and transmits it via the *  keyboard IN endpoint when the host is ready for more data. Additionally, it processes host LED status *  reports sent to the device via the keyboard OUT reporting endpoint. */void Keyboard_HID_Task(void){	uint8_t JoyStatus_LCL = Joystick_GetStatus();	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	/* Check if board button is not pressed, if so mouse mode enabled */	if (!(Buttons_GetStatus() & BUTTONS_BUTTON1))	{		/* Make sent key uppercase by indicating that the left shift key is pressed */		KeyboardReportData.Modifier = KEYBOARD_MODIFER_LEFTSHIFT;		if (JoyStatus_LCL & JOY_UP)		  KeyboardReportData.KeyCode[0] = 0x04; // A		else if (JoyStatus_LCL & JOY_DOWN)		  KeyboardReportData.KeyCode[0] = 0x05; // B		if (JoyStatus_LCL & JOY_LEFT)		  KeyboardReportData.KeyCode[0] = 0x06; // C		else if (JoyStatus_LCL & JOY_RIGHT)		  KeyboardReportData.KeyCode[0] = 0x07; // D		if (JoyStatus_LCL & JOY_PRESS)		  KeyboardReportData.KeyCode[0] = 0x08; // E	}	/* Select the Keyboard Report Endpoint */	Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);	/* Check if Keyboard Endpoint Ready for Read/Write */	if (Endpoint_IsReadWriteAllowed())	{		/* Write Keyboard Report Data */		Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();		/* Clear the report data afterwards */		memset(&KeyboardReportData, 0, sizeof(KeyboardReportData));	}	/* Select the Keyboard LED Report Endpoint */	Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);	/* Check if Keyboard LED Endpoint Ready for Read/Write */	if (Endpoint_IsReadWriteAllowed())	{				/* Read in and process the LED report from the host */		Keyboard_ProcessLEDReport(Endpoint_Read_Byte());		/* Handshake the OUT Endpoint - clear endpoint and ready for next report */		Endpoint_ClearOUT();	}}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:61,


示例25: PRNT_Device_SendString

uint8_t PRNT_Device_SendString(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo,                               const char* const String){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(PRNTInterfaceInfo->Config.DataINEndpoint.Address);	return Endpoint_Write_Stream_LE(String, strlen(String), NULL);}
开发者ID:40000ft,项目名称:lufa,代码行数:9,


示例26: HID_Task

void HID_Task(void){	ring_buffer * _tx_buffer =  &tx_buffer_cdc;	/* Device must be connected and configured for the task to run */	//if (USB_DeviceState != DEVICE_STATE_Configured)	//  return;	Endpoint_SelectEndpoint(GENERIC_OUT_EPNUM);	/* Check to see if a packet has been sent from the host */	if (Endpoint_IsOUTReceived())	{		/* Check to see if the packet contains data */		if (Endpoint_IsReadWriteAllowed())		{			/* Create a temporary buffer to hold the read in report from the host */			uint8_t GenericData[GENERIC_REPORT_SIZE];			/* Read Generic Report Data */			Endpoint_Read_Stream_LE(&GenericData, sizeof(GenericData), NULL);			/* Process Generic Report Data */			ProcessGenericHIDReport(GenericData);						dataReceived = 1;		}		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearOUT();	}	Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);	/* Check to see if the host is ready to accept another packet */	//if (Endpoint_IsINReady() && dataReceived!=0)		// && (_tx_buffer->head != _tx_buffer->tail)	if (Endpoint_IsINReady())	{		/* Create a temporary buffer to hold the report to send to the host */		uint8_t GenericData[GENERIC_REPORT_SIZE];		/* Create Generic Report Data */		CreateGenericHIDReport(GenericData);		/* Write Generic Report Data */		Endpoint_Write_Stream_LE(&GenericData, sizeof(GenericData), NULL);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();		dataReceived = 0;	}	}
开发者ID:123jefferson,项目名称:MiniBloq-Sparki,代码行数:56,


示例27: Endpoint_Write_Control_Stream_LE

uint8_t Endpoint_Write_Control_Stream_LE(const void* const Buffer,			                                         uint16_t Length){	Endpoint_Write_Stream_LE((uint8_t*)Buffer, MIN(Length, USB_ControlRequest.wLength), NULL);	Endpoint_ClearIN();// 	while (!(Endpoint_IsOUTReceived()))// 	{// 	}	return ENDPOINT_RWCSTREAM_NoError;}
开发者ID:AlexandreN7,项目名称:Liqui_lense,代码行数:10,


示例28: SCSI_Command_Request_Sense

/** Command processing for an issued SCSI REQUEST SENSE command. This command returns information about the last issued command, *  including the error code and additional error information so that the host can determine why a command failed to complete. */static void SCSI_Command_Request_Sense(void){	uint8_t  AllocationLength = CommandBlock.SCSICommandData[4];	uint8_t  BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);		/* Send the SENSE data - this indicates to the host the status of the last command */	Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, StreamCallback_AbortOnMassStoreReset);		uint8_t PadBytes[AllocationLength - BytesTransferred];		/* Pad out remaining bytes with 0x00 */	Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), StreamCallback_AbortOnMassStoreReset);	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	CommandBlock.DataTransferLength -= BytesTransferred;}
开发者ID:G33KatWork,项目名称:XBox-360-AVR-flasher,代码行数:22,


示例29: CDC_Device_SendData

uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,                            const void* const Buffer,                            const uint16_t Length){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);	return Endpoint_Write_Stream_LE(Buffer, Length, NULL);}
开发者ID:tewarid,项目名称:ArduinoUnoUsbDfu,代码行数:10,


示例30: PRNT_Device_SendData

uint8_t PRNT_Device_SendData(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo,                             const void* const Buffer,                             const uint16_t Length){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(PRNTInterfaceInfo->Config.DataINEndpoint.Address);	return Endpoint_Write_Stream_LE(Buffer, Length, NULL);}
开发者ID:40000ft,项目名称:lufa,代码行数:10,



注:本文中的Endpoint_Write_Stream_LE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ EndsWith函数代码示例
C++ Endpoint_Write_Control_Stream_LE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。