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

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

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

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

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

示例1: main

int main(void){  SetupHardware();  /* Create a regular character stream for the interface so that it can be used with the stdio.h functions */  CDC_Device_CreateStream(&VirtualSerial_CDC_Interface, &USBSerialStream);  GlobalInterruptEnable();  while(1)  {    DebounceUpdate();    EncoderUpdate();    LedUpdate();    SendSerial();    /* Must throw away unused bytes from the host, or it will lock up while waiting for the device */    CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);    CDC_Device_USBTask(&VirtualSerial_CDC_Interface);    HID_Device_USBTask(&Mouse_HID_Interface);    HID_Device_USBTask(&Keyboard_HID_Interface);    USB_USBTask();  }}
开发者ID:Hylian,项目名称:sdvx,代码行数:27,


示例2: main

intmain(void){	initHardware();	sei();	kbdInit();	scanInit();	layersInit();	macrosInit();	expLoad();	_delay_ms(5);	scanEnable();	/* try loading vref from eeprom; if set to 0xffff, run calibration */	vrefLoad();	if (vrefGet() == 0xffff)		kbdCalibrate();	for (;;) {		/* try to keep updates synchronous; we don't want to update		 * bitmap if we haven't sent the last report yet.		 */		if (( usingNKROReport() && !updateNKROReport) ||		    (!usingNKROReport() && !updateKeyboardReport)) {			bool needsUpdate = false;			needsUpdate |= kbdUpdateSCBmp();			needsUpdate |= macrosProcessScan();			needsUpdate |= expProcessScan(needsUpdate);			if (needsUpdate) {				updateKeyboardReport = true;				updateNKROReport     = true;				updateSystemReport   = true;				updateConsumerReport = true;			}			layersProcessScan();		}		if (USB_DeviceState == DEVICE_STATE_Unattached ||		    USB_DeviceState == DEVICE_STATE_Suspended)			if (USB_Device_RemoteWakeupEnabled && kbdWantsWakeup())				USB_Device_SendRemoteWakeup();		HID_Device_USBTask(&keyboardHIDIface);		HID_Device_USBTask(&genericHIDIface);		HID_Device_USBTask(&nkroHIDIface);		HID_Device_USBTask(&extrakeyHIDIface);		USB_USBTask();	}}
开发者ID:BASLQC,项目名称:xwhatits-capsense-controller,代码行数:54,


示例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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	for (;;)	{		HID_Device_USBTask(&Keyboard_HID_Interface);		HID_Device_USBTask(&Mouse_HID_Interface);		USB_USBTask();	}}
开发者ID:TomMD,项目名称:teensy,代码行数:16,


示例4: main

/** * @brief Main program entry point * @return Will not return * @note  This routine contains the overall program flow, including initial * setup of all components and the main program loop */int main(void){	SetupHardware();	for (;; ) {		#if defined(USB_DEVICE_ROM_DRIVER)		USB_MouseReport_Data_t report;		uint16_t reportsize;		uint8_t reportID = 0;		memset(&report, 0, sizeof(USB_MouseReport_Data_t));		CALLBACK_HID_Device_CreateHIDReport(&Mouse_HID_Interface, &reportID, HID_REPORT_ITEM_In, &report, &reportsize);		if (memcmp(&report, Mouse_HID_Interface.Config.PrevReportINBuffer,				   Mouse_HID_Interface.Config.PrevReportINBufferSize)) {			memcpy(Mouse_HID_Interface.Config.PrevReportINBuffer,				   &report,				   Mouse_HID_Interface.Config.PrevReportINBufferSize);			CALLBACK_UsbdHid_SetReportChange(true);		}		#else		HID_Device_USBTask(&Mouse_HID_Interface);		USB_USBTask(Mouse_HID_Interface.Config.PortNumber, USB_MODE_Device);		#endif	}}
开发者ID:edarring,项目名称:lpcopen,代码行数:31,


示例5: 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){	stdout=&mystdout;	stdin=&mystdin;	SetupHardware();	//LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	//Eval Prototype Sharp Reset Pin	//DDRB &= ~RESET_PIN; //Set Input	//PORTB |= RESET_PIN; //Set High	//DDRB |= RESET_PIN; //Set Output	//Drude Sharp LCD Reset PIN	PORTF |= RESETN_PIN; //Set High	DDRF |= RESETN_PIN; //Set Output		//Digitizer Interrupt	//DDRB &= ~(_BV(7)); //PB7 input	//PORTB &= ~(1<<PB7); //PB7 low	PORTB |= (_BV(7)); //Set high (input pullup)		//IP4787CZ32Y HDMI ESD interface chip (HDMI_ACT PIN) Active-High (Test-Point 12)	PORTF |= (_BV(PF1)); //Set high (input pullup)		//Toshiba Interrupt Pin	PORTE |= (_BV(PE6)); //Set high (input pullup)	//Toshiba Standby Pin	PORTF |= (_BV(PF4)); //Set high (input pullup)	//Toshiba Reset Pin - Active Low	PORTC |= (_BV(PC7)); //Set high (input pullup)	//LCD-CABC	//PORTF |= (_BV(PF7)); //Set high (defaults to input pullup)	//DDRF &= ~(_BV(PF7)); //Set output	//PORTF |= (_BV(PF7)); //Set low	//LED-PWM	PORTD |= (_BV(PD6)); //Set high (defaults to input pullup)	//PORTD &= ~(_BV(PD6)); //Set low	//DDRD &= ~(_BV(PD6)); //Set output	RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data));	init_screen(0x1F); //magic number!		mxt_list_types();	for (;;)	{		HandleSerial();		CDC_Device_USBTask(&VirtualSerial_CDC_Interface);		HID_Device_USBTask(&Digitizer_HID_Interface);		USB_USBTask();		HandleDigitizer();	}}
开发者ID:ultimachine,项目名称:Drude-Firmware,代码行数:63,


示例6: 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();	puts_P(PSTR(ESC_FG_CYAN "Mouse Host/Device Demo running./r/n" ESC_FG_WHITE));	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	sei();	for (;;)	{		/* Determine which USB mode we are currently in */		if (USB_CurrentMode == USB_MODE_Host)		{			MouseHostTask();			HID_Host_USBTask(&Mouse_HID_Host_Interface);		}		else		{			HID_Device_USBTask(&Mouse_HID_Device_Interface);		}		USB_USBTask();	}}
开发者ID:davidk,项目名称:lufa-lib,代码行数:28,


示例7: 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();    RingBuffer_InitBuffer(&USARTtoUSB_Buffer);    sei();    for (;;)     {		HID_Device_USBTask(&Surface_HID_Interface);		USB_USBTask();			/* Turn off the Tx LED when the tick count reaches zero */		if (led1_ticks) 		{			led1_ticks--;			if (led1_ticks == 0) 			{				LEDs_TurnOffLEDs(LEDS_LED1);			}		}				/* Turn off the Rx LED when the tick count reaches zero */		if (led2_ticks) 		{			led2_ticks--;			if (led2_ticks == 0) 			{				LEDs_TurnOffLEDs(LEDS_LED2);			}		}    }}
开发者ID:Zenitram-Oriaj,项目名称:project-surface,代码行数:37,


示例8: 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){  uint32_t last = 0;  /* init fifo */  fifo_init(&fifo, fifo_buffer, sizeof(fifo_buffer));  /* setup hardware (button, LED, rtc...) */  SetupHardware();  /* enable interrupts */  sei();  /* main loop */  while(1)  {    /* if button pressed */    if (!(BUTTON_PIN & (1 << BUTTON)))    {      /* ignore if last button was pressed less than DELTA_T */      if(get_time() > (last+DELTA_T))      {        /* generate token and send it to host */        token();        last = get_time();      }    }    /* USB tasks */    HID_Device_USBTask(&Keyboard_HID_Interface);    USB_USBTask();  }}
开发者ID:Otti0815,项目名称:picosafe_login,代码行数:37,


示例9: main

int main(void){	USB_Init();		colors[0] = rgb8(0x30, 0x30, 0x30);	colors[1] = rgb8(0x30, 0x30, 0x30);	colors[2] = rgb8(0x30, 0x30, 0x30);		DDRC = _BV(DDC6);	PORTC = 0;	DDRD = _BV(DDD6);		//set SS, SCK, and MOSI to outputs	DDRB |= _BV(DDB0) | _BV(DDB1) | _BV(DDB2);		//SS low	PORTB &= ~_BV(PORTB0);		//clock normally low, clocked on rising edges, at osc/2	SPSR = 0; //_BV(SPI2X);	SPCR = _BV(SPIE) | _BV(MSTR) | _BV(SPE) | _BV(SPR0);	//16M / (2083 * 64) = 120.02hz	OCR3A = 2082;		//interrupt on overflow	TIMSK3 = _BV(OCIE3A);	//do nothing on counter match	//CTC, TOP is OCR3A	//timer prescale is 64	TCCR3A = 0;	TCCR3C = 0;	TCCR3B = _BV(WGM32) | _BV(CS31) | _BV(CS30);	sei();	while(true) {		if (refreshFrame) {			PORTC |= _BV(PORTC6);						//copy out of volatile			unsigned long now = millis;						float scale = 0.1f + 0.9f * (sin(2.0 * M_PI * now / 3000.0f) + 1.0) / 2.0;			for (unsigned char i = 0, idx = 0; i < 32; ++i) {				buffer[idx++] = colors[i].b * scale;				buffer[idx++] = colors[i].g * scale;				buffer[idx++] = colors[i].r * scale;			}						PORTC &= ~_BV(PORTC6);			refreshFrame = false;		}		HID_Device_USBTask(&Generic_HID_Interface);		USB_USBTask();		//sleep_mode();	}}
开发者ID:balefrost,项目名称:buildmonitor-arduino,代码行数:59,


示例10: main

int main(void) {  SetupHardware();    GlobalInterruptEnable();    for (;;) {    HID_Device_USBTask(&Joystick_HID_Interface);    USB_USBTask();  }}
开发者ID:letoine,项目名称:NeoGeoControllerToUSB,代码行数:10,


示例11: usb_tasks

void usb_tasks(void){  MS_Device_USBTask(&Disk_MS_Interface);  CDC_Device_USBTask(&VirtualSerial_CDC_Interface);  HID_Device_USBTask(&Keyboard_HID_Interface);  USB_USBTask();  if(usb_keyboard_sending_string_GLOBAL)    usb_keyboard_service_write();}
开发者ID:flabbergast,项目名称:enstix,代码行数:10,


示例12: 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();	init_CIM_frame();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	sei();	for (;;)	{	    parse_CIM_protocol();		HID_Device_USBTask(&Keyboard_HID_Interface);	    parse_CIM_protocol();		HID_Device_USBTask(&Mouse_HID_Interface);	    parse_CIM_protocol();		HID_Device_USBTask(&Joystick_HID_Interface);	    parse_CIM_protocol();		USB_USBTask();	}}
开发者ID:Walid-Shouman,项目名称:AsTeRICS,代码行数:24,


示例13: 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){  GlobalInterruptEnable();  initialize_hardware();  while (true) {    matrix_scan();    HID_Device_USBTask(&Keyboard_HID_Interface);    USB_USBTask();  }}
开发者ID:mxkl,项目名称:gh60,代码行数:15,


示例14: 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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	sei();	for (;;)	{		HID_Device_USBTask(&MediaControl_HID_Interface);		USB_USBTask();	}}
开发者ID:BrazzoduroArduino,项目名称:Dougs-Arduino-Stuff,代码行数:16,


示例15: 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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	for (;;)	{		HID_Device_USBTask(&Device_HID_Interface);		USB_USBTask();	}}
开发者ID:BirdBrainTechnologies,项目名称:HummingbirdDuoFirmware,代码行数:16,


示例16: 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();    RingBuffer_InitBuffer(&USARTtoUSB_Buffer);        sei();        for (;;)    {        HID_Device_USBTask(&Joystick_HID_Interface);        USB_USBTask();    }}
开发者ID:eskerda,项目名称:arduines,代码行数:16,


示例17: 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){	HidApp_Init();	GlobalInterruptEnable();	for (;;)	{		HID_Device_USBTask(&Generic_HID_Interface);		USB_USBTask();		Encoder_Task();		Leds_Task();	}}
开发者ID:TransistorLabs,项目名称:glowproxy,代码行数:17,


示例18: main

intmain(void) {    MCUSR &= ~(1 << WDRF);    wdt_disable();    clock_prescale_set(clock_div_1);    USB_Init();    PORTD |= _BV(PORTD5) | _BV(PORTD6) | _BV(PORTD7);	// pull up    sei();    for (;;) {        HID_Device_USBTask(&stateMachine);        USB_USBTask();    }}
开发者ID:sgk,项目名称:AudioController,代码行数:14,


示例19: main

int main(void) {    hardwareInit();    initLEDs();    setOutputBit(&kOrangeLED, 1);    sei();    USB_Init();    while (1) {        HID_Device_USBTask(&mouseHIDInterface);        USB_USBTask();    }}
开发者ID:mayoff,项目名称:mouse-latency,代码行数:14,


示例20: main

/********************************************************** * Main function **********************************************************/int main(void){    //initialize    initialize();    //main loop    while (1)    {        /**LUFA usb related tasks*/		HID_Device_USBTask(&Keyboard_HID_Interface);        USB_USBTask();    }    return 0;}
开发者ID:corum,项目名称:usb-numpad,代码行数:18,


示例21: usb_task

void usb_task(void){     //CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);//     uint16_t got = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);//     if (got > 0) {//          CDC_Device_SendByte(&VirtualSerial_CDC_Interface, got &0xFF);//          CDC_Device_Flush(&VirtualSerial_CDC_Interface);//     }//     CDC_Device_USBTask(&serial_device);     MS_Device_USBTask(&ms_device);     HID_Device_USBTask(&keyboard_device);     USB_USBTask();}
开发者ID:JohnOH,项目名称:phatio,代码行数:15,


示例22: 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();		for (uint8_t Buffer = 0; Buffer < TOTAL_TRACKS; Buffer++)	  BitBuffer_Init(&TrackDataBuffers[Buffer]);	for (;;)	{		if (Magstripe_GetStatus() & MAG_CARDPRESENT)		  ReadMagstripeData();		HID_Device_USBTask(&Keyboard_HID_Interface);		USB_USBTask();	}}
开发者ID:boris-arzur,项目名称:SafecastBGeigie,代码行数:19,


示例23: 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();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	GlobalInterruptEnable();	for (;;)	{		CheckJoystickMovement();		/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */		CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);		CDC_Device_USBTask(&VirtualSerial_CDC_Interface);		HID_Device_USBTask(&Mouse_HID_Interface);		USB_USBTask();	}}
开发者ID:UltimateHackingKeyboard,项目名称:bootloader-right,代码行数:22,


示例24: main

int main(void){  SetupHardware();  GlobalInterruptEnable();  _delay_ms(10);  for (;;)  {    if ((PIND & 1) == 0) {      if (state == 1) {        pressed = true;        state = 0;      }    } else {      state = 1;    }    HID_Device_USBTask(&Keyboard_HID_Interface);    USB_USBTask();  }}
开发者ID:tmpvar,项目名称:tfire,代码行数:20,


示例25: 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();	/* Fetch logging interval from EEPROM */	LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM);	/* Check if the logging interval is invalid (0xFF) indicating that the EEPROM is blank */	if (LoggingInterval500MS_SRAM == 0xFF)	  LoggingInterval500MS_SRAM = DEFAULT_LOG_INTERVAL;	/* Mount and open the log file on the Dataflash FAT partition */	OpenLogFile();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	sei();	for (;;)	{		MS_Device_USBTask(&Disk_MS_Interface);		HID_Device_USBTask(&Generic_HID_Interface);		USB_USBTask();	}}
开发者ID:hopfgarten,项目名称:jnode-atmega-dual-firmware,代码行数:27,


示例26: 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();	/* Fetch logging interval from EEPROM */	LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM);	/* Mount and open the log file on the dataflash FAT partition */	OpenLogFile();	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);	sei();	/* Discard the first sample from the temperature sensor, as it is generally incorrect */	volatile uint8_t Dummy = Temperature_GetTemperature();	(void)Dummy;		for (;;)	{		MS_Device_USBTask(&Disk_MS_Interface);		HID_Device_USBTask(&Generic_HID_Interface);		USB_USBTask();	}}
开发者ID:Andrew0Hill,项目名称:keyboard,代码行数:27,



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


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