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

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

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

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

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

示例1: RNDIS_Task

void RNDIS_Task(void){	Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPADDR);	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	HandleUSB();}
开发者ID:QrackEE,项目名称:avrcraft,代码行数:9,


示例2: 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:hwchiu0810,项目名称:micro,代码行数:9,


示例3: main

/** Main program entry point. This routine contains the overall program flow, including initial *  setup of all components and the main program loop. */int main(void){	SetupHardware();	GlobalInterruptEnable();	uint8_t sending = 0;	for (;;) {		while (1) {                	int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);			if (ReceivedByte < 0) 				break;			if (!configured) continue;			if (!sending) {				PORTC.OUTSET = PIN1_bm;				sending = 1;			}			PORTD.OUTTGL = PIN5_bm;                	while(!USART_IsTXDataRegisterEmpty(&USART));                	USART_PutChar(&USART, ReceivedByte & 0xff);		}		if (sending) {			USART_ClearTXComplete(&USART);               		while(!USART_IsTXComplete(&USART));			PORTC.OUTCLR = PIN1_bm;			sending = 0;			}                Endpoint_SelectEndpoint(VirtualSerial_CDC_Interface.Config.DataINEndpoint.Address);                /* Check if a packet is already enqueued to the host - if so, we shouldn't try to send more data                 * until it completes as there is a chance nothing is listening and a lengthy timeout could occur */		if (configured && Endpoint_IsINReady()) {			uint8_t maxbytes = CDC_TXRX_EPSIZE;                	while (USART_RXBufferData_Available(&USART_data) && maxbytes-->0) {                        	uint8_t b = USART_RXBuffer_GetByte(&USART_data);				CDC_Device_SendByte(&VirtualSerial_CDC_Interface, b);				PORTD.OUTTGL = PIN5_bm;                	}                }		CDC_Device_USBTask(&VirtualSerial_CDC_Interface);		USB_USBTask();		if (loop++) continue;		if (!configured) continue;		PORTD.OUTTGL = PIN5_bm;	}}
开发者ID:drthth,项目名称:busware,代码行数:60,


示例4: uart_isdata

uint8_t uart_isdata(void) {	if (usb_rxpacket_leftb) {		Endpoint_SelectEndpoint(CDC_RX_EPNUM);		return usb_rxpacket_leftb;	}	usb_process();	usb_rxpacket_leftb = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);	return usb_rxpacket_leftb;}
开发者ID:urjaman,项目名称:frser-spi-u2,代码行数:9,


示例5: Endpoint_StallTransaction

void Endpoint_StallTransaction(void){	USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm;	if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc)	{		Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN);		USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm;	}}
开发者ID:40000ft,项目名称:lufa,代码行数:10,


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


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


示例8: ISR

ISR(USB_COM_vect, ISR_BLOCK){	uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();	USB_USBTask();	USB_INT_Clear(USB_INT_ENDPOINT_SETUP);		Endpoint_SelectEndpoint(PrevSelectedEndpoint);}
开发者ID:Diggen85,项目名称:a-culfw,代码行数:10,


示例9: MS_Device_USBTask

void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);	if (Endpoint_IsOUTReceived())	{		if (MS_Device_ReadInCommandBlock(MSInterfaceInfo))		{			if (MSInterfaceInfo->State.CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN)			  Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);			bool SCSICommandResult = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo);			MSInterfaceInfo->State.CommandStatus.Status              = (SCSICommandResult) ? MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;			MSInterfaceInfo->State.CommandStatus.Signature           = CPU_TO_LE32(MS_CSW_SIGNATURE);			MSInterfaceInfo->State.CommandStatus.Tag                 = MSInterfaceInfo->State.CommandBlock.Tag;			MSInterfaceInfo->State.CommandStatus.DataTransferResidue = MSInterfaceInfo->State.CommandBlock.DataTransferLength;			if (!(SCSICommandResult) && (le32_to_cpu(MSInterfaceInfo->State.CommandStatus.DataTransferResidue)))			  Endpoint_StallTransaction();			MS_Device_ReturnCommandStatus(MSInterfaceInfo);		}	}	if (MSInterfaceInfo->State.IsMassStoreReset)	{		Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);		Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);		Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);		Endpoint_ClearStall();		Endpoint_ResetDataToggle();		Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);		Endpoint_ClearStall();		Endpoint_ResetDataToggle();		MSInterfaceInfo->State.IsMassStoreReset = false;	}}
开发者ID:40000ft,项目名称:lufa,代码行数:43,


示例10: 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();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	Endpoint_Write_Byte(CMD_RESET_PROTECTION);	Endpoint_Write_Byte(STATUS_CMD_OK);	Endpoint_ClearIN();}
开发者ID:softants,项目名称:lufa-lib,代码行数:13,


示例11: CDC_Device_SendData_P

uint8_t CDC_Device_SendData_P(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_PStream_LE(Buffer, Length, NULL);}
开发者ID:tewarid,项目名称:ArduinoUnoUsbDfu,代码行数:10,


示例12: MS_Device_ReadInCommandBlock

static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo){	uint16_t BytesProcessed;	Endpoint_SelectEndpoint(MSInterfaceInfo->Config.PortNumber, MSInterfaceInfo->Config.DataOUTEndpointNumber);		BytesProcessed = 0;	while (Endpoint_Read_Stream_LE(MSInterfaceInfo->Config.PortNumber,																 &MSInterfaceInfo->State.CommandBlock,	                               (sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) ==	                               ENDPOINT_RWSTREAM_IncompleteTransfer)	{		if (MSInterfaceInfo->State.IsMassStoreReset)		  return false;	}	if ((MSInterfaceInfo->State.CommandBlock.Signature         != CPU_TO_LE32(MS_CBW_SIGNATURE))     ||	    (MSInterfaceInfo->State.CommandBlock.LUN               >= MSInterfaceInfo->Config.TotalLUNs) ||		(MSInterfaceInfo->State.CommandBlock.Flags              & 0x1F)                              ||		(MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0)                                 ||		(MSInterfaceInfo->State.CommandBlock.SCSICommandLength >  16))	{		Endpoint_StallTransaction(MSInterfaceInfo->Config.PortNumber);		Endpoint_SelectEndpoint(MSInterfaceInfo->Config.PortNumber, MSInterfaceInfo->Config.DataINEndpointNumber);		Endpoint_StallTransaction(MSInterfaceInfo->Config.PortNumber);		return false;	}	BytesProcessed = 0;	while (Endpoint_Read_Stream_LE(MSInterfaceInfo->Config.PortNumber,															    &MSInterfaceInfo->State.CommandBlock.SCSICommandData,	                                MSInterfaceInfo->State.CommandBlock.SCSICommandLength, &BytesProcessed) ==	                                ENDPOINT_RWSTREAM_IncompleteTransfer)	{		if (MSInterfaceInfo->State.IsMassStoreReset)		  return false;	}//	Endpoint_ClearOUT();	return true;}
开发者ID:JeremyHsiao,项目名称:TinyBlueRat_LPCv1_03,代码行数:43,


示例13: CDC_Device_SendString

uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,                              const 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:123jefferson,项目名称:MiniBloq-Sparki,代码行数:10,


示例14: ReceiveNextReport

/** Reads the next OUT report from the host from the OUT endpoint, if one has been sent. */void ReceiveNextReport(void){  static struct  {    struct    {      unsigned char type;      unsigned char length;    } header;    unsigned char buffer[EPSIZE];  } packet = { .header.type = BYTE_OUT_REPORT };  uint16_t length = 0;	/* Select the OUT Report Endpoint */	Endpoint_SelectEndpoint(OUT_EPNUM);	/* Check if OUT Endpoint contains a packet */	if (Endpoint_IsOUTReceived())	{		/* Check to see if the packet contains data */		if (Endpoint_IsReadWriteAllowed())		{      /* Read OUT Report Data */      uint8_t ErrorCode = Endpoint_Read_Stream_LE(packet.buffer, sizeof(packet.buffer), &length);      if(ErrorCode == ENDPOINT_RWSTREAM_NoError)      {        length = sizeof(packet.buffer);      }		}		/* Handshake the OUT Endpoint - clear endpoint and ready for next report */		Endpoint_ClearOUT();		if(length)		{		  packet.header.length = length & 0xFF;      Serial_SendData(&packet, sizeof(packet.header) + packet.header.length);		}	}}/** Function to manage HID report generation and transmission to the host, when in report mode. */void HID_Task(void){	/* Device must be connected and configured for the task to run */	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;  /* Send the next keypress report to the host */	SendNextReport();	/* Process the LED report sent from the host */	ReceiveNextReport();}
开发者ID:RalphFox,项目名称:GIMX-firmwares,代码行数:56,


示例15: TEMPLATE_FUNC_NAME

uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,                            uint16_t Length){	uint8_t* DataStream     = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));	bool     LastPacketFull = false;	Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);	if (Length > USB_ControlRequest.wLength)	  Length = USB_ControlRequest.wLength;	else if (!(Length))	  Endpoint_ClearIN();	while (Length || LastPacketFull)	{		uint8_t USB_DeviceState_LCL = USB_DeviceState;		if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)		  return ENDPOINT_RWCSTREAM_DeviceDisconnected;		else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)		  return ENDPOINT_RWCSTREAM_BusSuspended;		else if (Endpoint_IsSETUPReceived())		  return ENDPOINT_RWCSTREAM_HostAborted;		else if (Endpoint_IsOUTReceived())		  break;		if (Endpoint_IsINReady())		{			uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();			while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize))			{				TEMPLATE_TRANSFER_BYTE(DataStream);				TEMPLATE_BUFFER_MOVE(DataStream, 1);				Length--;				BytesInEndpoint++;			}			LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize);			Endpoint_ClearIN();		}	}	while (!(Endpoint_IsOUTReceived()))	{		uint8_t USB_DeviceState_LCL = USB_DeviceState;		if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)		  return ENDPOINT_RWCSTREAM_DeviceDisconnected;		else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)		  return ENDPOINT_RWCSTREAM_BusSuspended;	}	return ENDPOINT_RWCSTREAM_NoError;}
开发者ID:Atarity,项目名称:Lightpack,代码行数:55,


示例16: ReadInCommandBlock

/** Function to read in a command block from the host, via the bulk data OUT endpoint. This function reads in the next command block *  if one has been issued, and performs validation to ensure that the block command is valid. * *  /return Boolean true if a valid command block has been read in from the endpoint, false otherwise */static bool ReadInCommandBlock(void){	/* Select the Data Out endpoint */	Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);	/* Read in command block header */	Endpoint_Read_Stream_LE(&CommandBlock, (sizeof(CommandBlock) - sizeof(CommandBlock.SCSICommandData)),	                        StreamCallback_AbortOnMassStoreReset);	/* Check if the current command is being aborted by the host */	if (IsMassStoreReset)	  return false;	/* Verify the command block - abort if invalid */	if ((CommandBlock.Signature         != CBW_SIGNATURE) ||	    (CommandBlock.LUN               >= TOTAL_LUNS)    ||		(CommandBlock.Flags              & 0x1F)          ||		(CommandBlock.SCSICommandLength == 0)             ||		(CommandBlock.SCSICommandLength >  MAX_SCSI_COMMAND_LENGTH))	{		/* Stall both data pipes until reset by host */		Endpoint_StallTransaction();		Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);		Endpoint_StallTransaction();				return false;	}	/* Read in command block command data */	Endpoint_Read_Stream_LE(&CommandBlock.SCSICommandData,	                        CommandBlock.SCSICommandLength,	                        StreamCallback_AbortOnMassStoreReset);	  	/* Check if the current command is being aborted by the host */	if (IsMassStoreReset)	  return false;	/* Finalize the stream transfer to send the last packet */	Endpoint_ClearOUT();		return true;}
开发者ID:Andrew0Hill,项目名称:keyboard,代码行数:47,


示例17: RNDIS_Device_IsPacketReceived

bool RNDIS_Device_IsPacketReceived(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo){	if ((USB_DeviceState != DEVICE_STATE_Configured) ||	    (RNDISInterfaceInfo->State.CurrRNDISState != RNDIS_Data_Initialized))	{		return false;	}	Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpoint.Address);	return Endpoint_IsOUTReceived();}
开发者ID:abcminiuser,项目名称:lufa,代码行数:11,


示例18: SideShow_GetCurrentUser

static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* PacketHeader){	Endpoint_ClearOUT();	PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes;	Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);	Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));	SideShow_Write_Unicode_String(&UserSID);	Endpoint_ClearIN();}
开发者ID:TomMD,项目名称:teensy,代码行数:11,


示例19: SideShow_SetCurrentUser

static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* PacketHeader){	SideShow_Read_Unicode_String(&UserSID, sizeof(UserSID.UnicodeString));	Endpoint_ClearOUT();		PacketHeader->Length = sizeof(SideShow_PacketHeader_t);	Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);	Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));	Endpoint_ClearIN();}
开发者ID:TomMD,项目名称:teensy,代码行数:11,


示例20: USB_ResetConfig

/* * The Linux and OSX call the configuration changed entry each time * a transaction is started (e.g., multiple runs of cbmctrl status). * We need to reset the endpoints before reconfiguring them, otherwise * we get a hang the second time through. * * We keep the original endpoint selected after returning. */voidUSB_ResetConfig(){    static uint8_t endpoints[] = {        XUM_BULK_IN_ENDPOINT, XUM_BULK_OUT_ENDPOINT, 0,    };    uint8_t lastEndpoint, *endp;    lastEndpoint = Endpoint_GetCurrentEndpoint();    for (endp = endpoints; *endp != 0; endp++) {        Endpoint_SelectEndpoint(*endp);        Endpoint_ResetFIFO(*endp);        Endpoint_ResetDataToggle();        if (Endpoint_IsStalled())            Endpoint_ClearStall();    }    Endpoint_SelectEndpoint(lastEndpoint);}
开发者ID:Flaviowebit,项目名称:openCBM,代码行数:28,


示例21: XPROGProtocol_ReadCRC

/** Handler for the XPROG CRC command to read a specific memory space's CRC value for comparison between the *  attached device's memory and a data set on the host. */static void XPROGProtocol_ReadCRC(void){	uint8_t ReturnStatus = XPROG_ERR_OK;	struct	{		uint8_t CRCType;	} ReadCRC_XPROG_Params;	Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NULL);	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	uint32_t MemoryCRC;	if (XPROG_SelectedProtocol == XPROG_PROTOCOL_PDI)	{		uint8_t CRCCommand;		/* Determine which NVM command to send to the device depending on the memory to CRC */		switch (ReadCRC_XPROG_Params.CRCType)		{			case XPROG_CRC_APP:				CRCCommand = XMEGA_NVM_CMD_APPCRC;				break;			case XPROG_CRC_BOOT:				CRCCommand = XMEGA_NVM_CMD_BOOTCRC;				break;			default:				CRCCommand = XMEGA_NVM_CMD_FLASHCRC;				break;		}		/* Perform and retrieve the memory CRC, indicate timeout if occurred */		if (!(XMEGANVM_GetMemoryCRC(CRCCommand, &MemoryCRC)))		  ReturnStatus = XPROG_ERR_TIMEOUT;	}	else	{		/* TPI does not support memory CRC */		ReturnStatus = XPROG_ERR_FAILED;	}	Endpoint_Write_8(CMD_XPROG);	Endpoint_Write_8(XPROG_CMD_CRC);	Endpoint_Write_8(ReturnStatus);	if (ReturnStatus == XPROG_ERR_OK)	{		Endpoint_Write_8(MemoryCRC >> 16);		Endpoint_Write_16_LE(MemoryCRC & 0xFFFF);	}
开发者ID:Steffen-Engel,项目名称:lufa,代码行数:57,


示例22: Endpoint_ClearEndpoints

void Endpoint_ClearEndpoints(void){	for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)	{		Endpoint_SelectEndpoint(EPNum);		(&AVR32_USBB.uecfg0)[EPNum]    = 0;		(&AVR32_USBB.uecon0clr)[EPNum] = -1;		USB_Endpoint_FIFOPos[EPNum]    = &AVR32_USBB_SLAVE[EPNum * 0x10000];		Endpoint_DisableEndpoint();	}}
开发者ID:40000ft,项目名称:lufa,代码行数:11,


示例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: Device_SendByte

uint8_t Device_SendByte(USB_EPInfo_Device_t* EPInfo, const uint8_t Data){	if (USB_DeviceState != DEVICE_STATE_Configured) return ENDPOINT_RWSTREAM_DeviceDisconnected;	// USB_DeviceState 	// USBTask.h	// Indicates the current device state machine state. When in device mode, 	// this indicates the state via one of the values of the 	// USB_Device_States_t enum values.	//	// DEVICE_STATE_Configured(4)	// Device.h	// This state indicates that the device has been enumerated by the host 	// and is ready for USB communications to begin.	//	// ENDPOINT_RWSTREAM_DeviceDisconnected(2)	// EndpointStream.h	// Device was disconnected from the host during the transfer.		Endpoint_SelectEndpoint(EPInfo->DataINEPAddress);	// Endpoint_AVR8.h	// Select the given endpoint address.	if (!(Endpoint_IsReadWriteAllowed()))	// Endpoint_AVR8.h	// Determines if the currently selected endpoint may be read from 	// (if data is waiting in the endpoint bank and the endpoint is an OUT 	// direction, or if the bank is not yet full if the endpoint is an IN 	// direction). This function will return false if an error has occurred in 	// the endpoint, if the endpoint is an OUT direction and no packet (or an 	// empty packet) has been received, or if the endpoint is an IN direction 	// and the endpoint bank is full.	{		Endpoint_ClearIN();		// Endpoint_AVR8.h		// Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet and switching to the alternative endpoint bank if double banked				uint8_t ErrorCode;		if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)		// Endpoint_WaitUntilReady		// Endpoint_AVR8.h		// Spin-loops until the currently selected non-control endpoint is 		// ready for the next packet of data to be read or written to it.		//		// ENDPOINT_READYWAIT_NoError(0)		// Endpoint_AVR8.h		// Endpoint is ready for next packet, no error.			return ErrorCode;	}	Endpoint_Write_8(Data);	// Endpoint_AVR8.h	// Writes one byte to the currently selected endpoint's bank, for IN direction endpoints.	return ENDPOINT_READYWAIT_NoError;}
开发者ID:hokim72,项目名称:ATmega32U4,代码行数:54,


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


示例26: V2Protocol_SignOn

/** Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host. */static void V2Protocol_SignOn(void){	Endpoint_ClearOUT();	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);	Endpoint_Write_Byte(CMD_SIGN_ON);	Endpoint_Write_Byte(STATUS_CMD_OK);	Endpoint_Write_Byte(sizeof(PROGRAMMER_ID) - 1);	Endpoint_Write_Stream_LE(PROGRAMMER_ID, (sizeof(PROGRAMMER_ID) - 1), NO_STREAM_CALLBACK);	Endpoint_ClearIN();}
开发者ID:softants,项目名称:lufa-lib,代码行数:13,


示例27: MIDI_Device_USBTask

void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo){	if (USB_DeviceState != DEVICE_STATE_Configured)	  return;	#if !defined(NO_CLASS_DRIVER_AUTOFLUSH)	Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);	if (Endpoint_IsINReady())	  MIDI_Device_Flush(MIDIInterfaceInfo);	#endif}
开发者ID:abcminiuser,项目名称:lufa,代码行数:12,


示例28: Endpoint_ConfigureEndpoint_Prv

bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData){	Endpoint_SelectEndpoint(Number);	Endpoint_EnableEndpoint();	UECFG1X = 0;	UECFG0X = UECFG0XData;	UECFG1X = UECFG1XData;	return Endpoint_IsConfigured();}
开发者ID:dfletcher,项目名称:avr-pca9555,代码行数:12,


示例29: SideShow_GetString

static void SideShow_GetString(SideShow_PacketHeader_t* PacketHeader, void* UnicodeStruct){	Endpoint_ClearOUT();	PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +	                       sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;		Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);	Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));	SideShow_Write_Unicode_String(UnicodeStruct);	Endpoint_ClearIN();}
开发者ID:TomMD,项目名称:teensy,代码行数:12,


示例30: CDC_Device_USBTask

void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo){	if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))	  return;	Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);	if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint()))	  Endpoint_ClearOUT();	  	CDC_Device_Flush(CDCInterfaceInfo);}
开发者ID:emcute0319,项目名称:ir-usb-kbd,代码行数:12,



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


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