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

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

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

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

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

示例1: V2Protocol_ResetProtection

/** Handler for the CMD_RESET_PROTECTION command, implemented as a dummy ACK function as *  no target short-circuit protection is currently implemented. */static void V2Protocol_ResetProtection(void){	Endpoint_ClearOUT();	if ( use_libusb == true ) {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__LIBUSB);	} else {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__DEFAULT);	}	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	Endpoint_Write_8(CMD_RESET_PROTECTION);	Endpoint_Write_8(STATUS_CMD_OK);	Endpoint_ClearIN();}
开发者ID:madworm,项目名称:avrispmkII_LUFA,代码行数:20,


示例2: HUB_Task

void HUB_Task(void){	Endpoint_SelectEndpoint(1);	if (Endpoint_IsReadWriteAllowed())	{		if (hub_int_response) {			if (hub_int_force_data0) {				Endpoint_ResetDataToggle();				hub_int_force_data0 = 0;			}			Endpoint_Write_Byte(hub_int_response);			Endpoint_ClearIN();			hub_int_response = 0x00;		}	}}
开发者ID:RancidoPS3ita,项目名称:Psgroove_Hermes_V.4_Modded,代码行数:17,


示例3: HID_Task

void HID_Task(void){	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	Endpoint_SelectEndpoint(GENERIC_OUT_EPADDR);	/* 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);		}		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearOUT();	}	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[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();	}}
开发者ID:40000ft,项目名称:lufa,代码行数:46,


示例4: V2Protocol_UnknownCommand

/** Handler for unknown V2 protocol commands. This discards all sent data and returns a *  STATUS_CMD_UNKNOWN status back to the host. * *  /param[in] V2Command  Issued V2 Protocol command byte from the host */static void V2Protocol_UnknownCommand(const uint8_t V2Command){	/* Discard all incoming data */	while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE)	{		Endpoint_ClearOUT();		Endpoint_WaitUntilReady();	}	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	Endpoint_Write_8(V2Command);	Endpoint_Write_8(STATUS_CMD_UNKNOWN);	Endpoint_ClearIN();}
开发者ID:Codingboy,项目名称:ucuni,代码行数:22,


示例5: uart_send

void uart_send(uint8_t d) {	do {		if (usb_txpacket_leftb) {			Endpoint_SelectEndpoint(CDC_TX_EPNUM);		        Endpoint_Write_Byte(d);		        usb_txpacket_leftb--;		        if (usb_txpacket_leftb == 1) {		                Endpoint_ClearIN(); /* Go data, GO. */		        	usb_txpacket_leftb = 0;		        }		        return;		}		usb_process();		if (CDC_Device_SendByte_Prep(&VirtualSerial_CDC_Interface) == 0)			usb_txpacket_leftb = CDC_IN_EPSIZE;	} while (1);}
开发者ID:urjaman,项目名称:frser-spi-u2,代码行数:17,


示例6: CDC_Device_ProcessControlRequest

void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo){	if (!(Endpoint_IsSETUPReceived()))	  return;	  	if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber)	  return;	switch (USB_ControlRequest.bRequest)	{		case REQ_GetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				Endpoint_Write_Control_Stream_LE(&CDCInterfaceInfo->State.LineEncoding, sizeof(CDCInterfaceInfo->State.LineEncoding));				Endpoint_ClearOUT();			}						break;		case REQ_SetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				Endpoint_Read_Control_Stream_LE(&CDCInterfaceInfo->State.LineEncoding, sizeof(CDCInterfaceInfo->State.LineEncoding));				Endpoint_ClearIN();				EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);			}				break;		case REQ_SetControlLineState:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{								Endpoint_ClearSETUP();								CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue;								EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);				Endpoint_ClearStatusStage();			}				break;	}}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:45,


示例7: SCSI_Command_Read_Capacity_10

/** Command processing for an issued SCSI READ CAPACITY (10) command. This command returns information about the device's capacity *  on the selected Logical Unit (drive), as a number of OS-sized blocks. */static void SCSI_Command_Read_Capacity_10(void){	/* Send the total number of logical blocks in the current LUN */	Endpoint_Write_DWord_BE(LUN_MEDIA_BLOCKS - 1);	/* Send the logical block size of the device (must be 512 bytes) */	Endpoint_Write_DWord_BE(VIRTUAL_MEMORY_BLOCK_SIZE);	/* Check if the current command is being aborted by the host */	if (IsMassStoreReset)	  return;	/* Send the endpoint data packet to the host */	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	CommandBlock.DataTransferLength -= 8;}
开发者ID:G33KatWork,项目名称:XBox-360-AVR-flasher,代码行数:21,


示例8: MIDI_Device_SendEventPacket

uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo,                                    const MIDI_EventPacket_t* const Event){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	uint8_t ErrorCode;	Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);	if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != ENDPOINT_RWSTREAM_NoError)	  return ErrorCode;	if (!(Endpoint_IsReadWriteAllowed()))	  Endpoint_ClearIN();	return ENDPOINT_RWSTREAM_NoError;}
开发者ID:abcminiuser,项目名称:lufa,代码行数:18,


示例9: XPROGProtocol_EnterXPROGMode

/** Handler for the XPROG ENTER_PROGMODE command to establish a connection with the attached device. */static void XPROGProtocol_EnterXPROGMode(void){	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	bool NVMBusEnabled = false;	if (XPROG_SelectedProtocol == XPROG_PROTOCOL_PDI)	  NVMBusEnabled = XMEGANVM_EnablePDI();	else if (XPROG_SelectedProtocol == XPROG_PROTOCOL_TPI)	  NVMBusEnabled = TINYNVM_EnableTPI();	Endpoint_Write_8(CMD_XPROG);	Endpoint_Write_8(XPROG_CMD_ENTER_PROGMODE);	Endpoint_Write_8(NVMBusEnabled ? XPROG_ERR_OK : XPROG_ERR_FAILED);	Endpoint_ClearIN();}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:19,


示例10: RNDIS_Device_ProcessControlRequest

void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo){	if (!(Endpoint_IsSETUPReceived()))	  return;	  	if (USB_ControlRequest.wIndex != RNDISInterfaceInfo->Config.ControlInterfaceNumber)	  return;	switch (USB_ControlRequest.bRequest)	{		case REQ_SendEncapsulatedCommand:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, USB_ControlRequest.wLength);				Endpoint_ClearIN();				RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo);			}						break;		case REQ_GetEncapsulatedResponse:			if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;				if (!(MessageHeader->MessageLength))				{					RNDISInterfaceInfo->State.RNDISMessageBuffer[0] = 0;					MessageHeader->MessageLength = 1;				}				Endpoint_Write_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, MessageHeader->MessageLength);								Endpoint_ClearOUT();				MessageHeader->MessageLength = 0;			}				break;	}}
开发者ID:geemoo,项目名称:oopslogger,代码行数:44,


示例11: XPROGProtocol_ReadMemory

/** Handler for the XPROG READ_MEMORY command to read data from a specific address space within the *  attached device. */static void XPROGProtocol_ReadMemory(void){	uint8_t ReturnStatus = XPROG_ERR_OK;	struct	{		uint8_t  MemoryType;		uint32_t Address;		uint16_t Length;	} ReadMemory_XPROG_Params;	Endpoint_Read_Stream_LE(&ReadMemory_XPROG_Params, sizeof(ReadMemory_XPROG_Params), NULL);	ReadMemory_XPROG_Params.Address = SwapEndian_32(ReadMemory_XPROG_Params.Address);	ReadMemory_XPROG_Params.Length  = SwapEndian_16(ReadMemory_XPROG_Params.Length);	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	uint8_t ReadBuffer[256];	if (XPROG_SelectedProtocol == XPROG_PROTOCOL_PDI)	{		/* Read the PDI target's memory, indicate timeout if occurred */		if (!(XMEGANVM_ReadMemory(ReadMemory_XPROG_Params.Address, ReadBuffer, ReadMemory_XPROG_Params.Length)))		  ReturnStatus = XPROG_ERR_TIMEOUT;	}	else	{		/* Read the TPI target's memory, indicate timeout if occurred */		if (!(TINYNVM_ReadMemory(ReadMemory_XPROG_Params.Address, ReadBuffer, ReadMemory_XPROG_Params.Length)))		  ReturnStatus = XPROG_ERR_TIMEOUT;	}	Endpoint_Write_8(CMD_XPROG);	Endpoint_Write_8(XPROG_CMD_READ_MEM);	Endpoint_Write_8(ReturnStatus);	if (ReturnStatus == XPROG_ERR_OK)	  Endpoint_Write_Stream_LE(ReadBuffer, ReadMemory_XPROG_Params.Length, NULL);	Endpoint_ClearIN();}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:46,


示例12: 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,


示例13: EVENT_USB_Device_ControlRequest

/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to *  the device from the USB host before passing along unhandled control requests to the library for processing *  internally. */void EVENT_USB_Device_ControlRequest(void){	/* Process RNDIS class commands */	switch (USB_ControlRequest.bRequest)	{		case RNDIS_REQ_SendEncapsulatedCommand:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				/* Read in the RNDIS message into the message buffer */				Endpoint_Read_Control_Stream_LE(RNDISMessageBuffer, USB_ControlRequest.wLength);				Endpoint_ClearIN();				/* Process the RNDIS message */				ProcessRNDISControlMessage();			}			break;		case RNDIS_REQ_GetEncapsulatedResponse:			if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))			{				/* Check if a response to the last message is ready */				if (!(MessageHeader->MessageLength))				{					/* Set the response to a single 0x00 byte to indicate that no response is ready */					RNDISMessageBuffer[0] = 0;					MessageHeader->MessageLength = 1;				}				Endpoint_ClearSETUP();				/* Write the message response data to the endpoint */				Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, MessageHeader->MessageLength);				Endpoint_ClearOUT();				/* Reset the message header once again after transmission */				MessageHeader->MessageLength = 0;			}			break;	}}
开发者ID:DuinoPilot,项目名称:lufa,代码行数:47,


示例14: V2Protocol_SignOn

/** Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host. */static void V2Protocol_SignOn(void){	Endpoint_ClearOUT();	if ( use_libusb == true ) {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__LIBUSB);	} else {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__DEFAULT);	}	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	Endpoint_Write_8(CMD_SIGN_ON);	Endpoint_Write_8(STATUS_CMD_OK);	Endpoint_Write_8(sizeof(PROGRAMMER_ID) - 1);	Endpoint_Write_Stream_LE(PROGRAMMER_ID, (sizeof(PROGRAMMER_ID) - 1), NULL);	Endpoint_ClearIN();}
开发者ID:madworm,项目名称:avrispmkII_LUFA,代码行数:20,


示例15: MIDI_Device_Flush

uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	uint8_t ErrorCode;	Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);	if (Endpoint_BytesInEndpoint())	{		Endpoint_ClearIN();		if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)		  return ErrorCode;	}	return ENDPOINT_READYWAIT_NoError;}
开发者ID:abcminiuser,项目名称:lufa,代码行数:19,


示例16: XPROGProtocol_SetMode

/** Handler for the CMD_XPROG_SETMODE command, which sets the programmer-to-target protocol used for PDI/TPI *  programming. */void XPROGProtocol_SetMode(void){	struct	{		uint8_t Protocol;	} SetMode_XPROG_Params;	Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL);	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	XPROG_SelectedProtocol = SetMode_XPROG_Params.Protocol;	Endpoint_Write_8(CMD_XPROG_SETMODE);	Endpoint_Write_8((SetMode_XPROG_Params.Protocol != XPROG_PROTOCOL_JTAG) ? STATUS_CMD_OK : STATUS_CMD_FAILED);	Endpoint_ClearIN();}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:22,


示例17: usbSetLed

void usbSetLed(){	Endpoint_ClearSETUP();//ack setup packet	u8 recvData = 0;	while (recvData < 0)//never	{		while (!Endpoint_IsOUTReceived())		{			//wait for data		}		Endpoint_ClearOUT();//ack data packet	}	onLed(led2);	while (!Endpoint_IsINReady())	{		//wait until host ready to recv	}	Endpoint_ClearIN();//ack}
开发者ID:Codingboy,项目名称:ucuni,代码行数:19,


示例18: 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. * *  /return Boolean true if the command completed successfully, false otherwise. */static bool SCSI_Command_Request_Sense(void){	uint8_t  AllocationLength = CommandBlock.SCSICommandData[4];	uint8_t  BytesTransferred = MIN(AllocationLength, sizeof(SenseData));	/* Send the SENSE data - this indicates to the host the status of the last command */	Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NULL);	/* Pad out remaining bytes with 0x00 */	Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearIN();	/* Succeed the command and update the bytes transferred counter */	CommandBlock.DataTransferLength -= BytesTransferred;	return true;}
开发者ID:Armadill0,项目名称:CANBus-Triple_Genesis-Connect,代码行数:24,


示例19: 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())	{		/* Write Joystick Report Data */		Endpoint_Write_Stream_LE(&gamepad_state, sizeof(gamepad_state), NULL);		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();	}}
开发者ID:HexTank,项目名称:KADE,代码行数:20,


示例20: EVENT_USB_Device_ControlRequest

/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to *  the device from the USB host before passing along unhandled control requests to the library for processing *  internally. */void EVENT_USB_Device_ControlRequest(void){	/* Process CDC specific control requests */	switch (USB_ControlRequest.bRequest)	{		case CDC_REQ_GetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				/* Write the line coding data to the control endpoint */				Endpoint_Write_Control_Stream_LE(&LineEncoding, sizeof(CDC_LineEncoding_t));				Endpoint_ClearOUT();			}			break;		case CDC_REQ_SetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				/* Read the line coding data in from the host into the global struct */				Endpoint_Read_Control_Stream_LE(&LineEncoding, sizeof(CDC_LineEncoding_t));				Endpoint_ClearIN();			}			break;		case CDC_REQ_SetControlLineState:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				Endpoint_ClearStatusStage();				/* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake				         lines. The mask is read in from the wValue parameter in USB_ControlRequest, and can be masked against the						 CONTROL_LINE_OUT_* masks to determine the RTS and DTR line states using the following code:				*/			}			break;	}}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:46,


示例21: speedtest_send

// pure usb transmit takes 15secs (1040KB/s) for 16MBvoid speedtest_send(void) {	uint8_t k;	uint32_t i = 0;	/* Select the IN stream endpoint */	Endpoint_SelectEndpoint(IN_EP);	while (i < NOR_BSS_128) {		/* Check if the current endpoint can be written to and that the next sample should be stored */		while (!Endpoint_IsINReady()) USB_USBTask();		for (k = 0; k < TX_BUFFER_SIZE; ++k) {			Endpoint_Write_8(0);		}		Endpoint_ClearIN();		i += TX_BUFFER_SIZE;	}}
开发者ID:GotoHack,项目名称:NANDORway,代码行数:21,


示例22: CDC_Device_SendByte

uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);	if (!(Endpoint_IsReadWriteAllowed()))	{			Endpoint_ClearIN();		uint8_t ErrorCode;		if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)		  return ErrorCode;	}	Endpoint_Write_Byte(Data);	return ENDPOINT_READYWAIT_NoError;}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:20,


示例23: uart_recv

uint8_t uart_recv(void) {	do {		if (usb_rxpacket_leftb) {			uint8_t d;			Endpoint_SelectEndpoint(CDC_RX_EPNUM);			d = Endpoint_Read_Byte();			usb_rxpacket_leftb--;			if (!usb_rxpacket_leftb)				Endpoint_ClearOUT();			return d;		}		usb_process();		usb_rxpacket_leftb = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);		if ((!usb_rxpacket_leftb)&&(usb_txpacket_leftb)) {			Endpoint_SelectEndpoint(CDC_TX_EPNUM);	                Endpoint_ClearIN(); /* Go data, GO. */	                usb_txpacket_leftb = 0;	        }	} while (1);}
开发者ID:urjaman,项目名称:frser-spi-u2,代码行数:20,


示例24: 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;	}	uint16_t BytesProcessed = 0;	while (Endpoint_Write_Stream_LE(&MSInterfaceInfo->State.CommandStatus,	                                sizeof(MS_CommandStatusWrapper_t), &BytesProcessed) ==	                                ENDPOINT_RWSTREAM_IncompleteTransfer)	{		#if !defined(INTERRUPT_CONTROL_ENDPOINT)		USB_USBTask();		#endif		if (MSInterfaceInfo->State.IsMassStoreReset)		  return;	}	Endpoint_ClearIN();}
开发者ID:davidk,项目名称:lufa-lib,代码行数:41,


示例25: Mouse_HID_Task

/** Mouse task. This generates the next mouse HID report for the host, and transmits it via the *  mouse IN endpoint when the host is ready for more data. */void Mouse_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 pressed, if so mouse mode enabled */	if (Buttons_GetStatus() & BUTTONS_BUTTON1)	{		if (JoyStatus_LCL & JOY_UP)		  MouseReportData.Y =  1;		else if (JoyStatus_LCL & JOY_DOWN)		  MouseReportData.Y = -1;		if (JoyStatus_LCL & JOY_RIGHT)		  MouseReportData.X =  1;		else if (JoyStatus_LCL & JOY_LEFT)		  MouseReportData.X = -1;		if (JoyStatus_LCL & JOY_PRESS)		  MouseReportData.Button  = (1 << 0);	}	/* Select the Mouse Report Endpoint */	Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);	/* Check if Mouse Endpoint Ready for Read/Write */	if (Endpoint_IsReadWriteAllowed())	{		/* Write Mouse Report Data */		Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));		/* Finalize the stream transfer to send the last packet */		Endpoint_ClearIN();		/* Clear the report data afterwards */		memset(&MouseReportData, 0, sizeof(MouseReportData));	}}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:44,


示例26: V2Protocol_LoadAddress

/** Handler for the CMD_LOAD_ADDRESS command, loading the given device address into a *  global storage variable for later use, and issuing LOAD EXTENDED ADDRESS commands *  to the attached device as required. */static void V2Protocol_LoadAddress(void){	Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NULL);	Endpoint_ClearOUT();	if ( use_libusb == true ) {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__LIBUSB);	} else {		Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM__DEFAULT);	}	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	if (CurrentAddress & (1UL << 31))	  MustLoadExtendedAddress = true;	Endpoint_Write_8(CMD_LOAD_ADDRESS);	Endpoint_Write_8(STATUS_CMD_OK);	Endpoint_ClearIN();}
开发者ID:madworm,项目名称:avrispmkII_LUFA,代码行数:25,


示例27: CDC_Device_Flush

uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo){	uint8_t status = 0;	if ((USB_DeviceState == DEVICE_STATE_Configured) &&	(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS != 0))	{		Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);		if (Endpoint_BytesInEndpoint())		{			Endpoint_ClearIN();		}		status = ENDPOINT_READYWAIT_NoError;	}	else	{		status = ENDPOINT_RWSTREAM_DeviceDisconnected;	}	return status;}
开发者ID:ManagementCenterInnsbruck,项目名称:InfineonMulticopter_LARIX,代码行数:21,


示例28: PRNT_Device_SendByte

uint8_t PRNT_Device_SendByte(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo,                             const uint8_t Data){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return ENDPOINT_RWSTREAM_DeviceDisconnected;	Endpoint_SelectEndpoint(PRNTInterfaceInfo->Config.DataINEndpoint.Address);	if (!(Endpoint_IsReadWriteAllowed()))	{		Endpoint_ClearIN();		uint8_t ErrorCode;		if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)		  return ErrorCode;	}	Endpoint_Write_8(Data);	return ENDPOINT_READYWAIT_NoError;}
开发者ID:40000ft,项目名称:lufa,代码行数:21,


示例29: EVENT_USB_Device_ControlRequest

/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to *  the device from the USB host before passing along unhandled control requests to the library for processing *  internally. */void EVENT_USB_Device_ControlRequest(void){	/* Determine which interface's Line Coding data is being set from the wIndex parameter */	void* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? &LineEncoding1 : &LineEncoding2;	/* Process CDC specific control requests */	switch (USB_ControlRequest.bRequest)	{		case CDC_REQ_GetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				/* Write the line coding data to the control endpoint */				Endpoint_Write_Control_Stream_LE(LineEncodingData, sizeof(CDC_LineEncoding_t));				Endpoint_ClearOUT();			}			break;		case CDC_REQ_SetLineEncoding:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				/* Read the line coding data in from the host into the global struct */				Endpoint_Read_Control_Stream_LE(LineEncodingData, sizeof(CDC_LineEncoding_t));				Endpoint_ClearIN();			}			break;		case CDC_REQ_SetControlLineState:			if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))			{				Endpoint_ClearSETUP();				Endpoint_ClearStatusStage();			}			break;	}}
开发者ID:AmesianX,项目名称:OpenPCR,代码行数:44,



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


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