• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ HID_Device_USBTask函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了HID_Device_USBTask函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:note.c


示例2: main

int
main(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,代码来源:ibm_capsense_usb.c


示例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,代码来源:KeyboardMouse.c


示例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,代码来源:Mouse.c


示例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,代码来源:VirtualSerialDigitizer.c


示例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,代码来源:MouseHostDevice.c


示例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,代码来源:ArduinoSurface.c


示例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,代码来源:picosafelogin.c


示例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,代码来源:main.cpp


示例10: main

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


示例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,代码来源:LufaLayer.c


示例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,代码来源:HID_actuator.c


示例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,代码来源:keyboard.c


示例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,代码来源:MediaController.c


示例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,代码来源:KeyboardMouseMultiReport.c


示例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,代码来源:Gamepad.c


示例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,代码来源:HidApp.c


示例18: main

int
main(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,代码来源:AudioController.c


示例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,代码来源:mouseimposter.c


示例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,代码来源:main.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HID_MOUSE_UpdatePosition函数代码示例发布时间:2022-05-30
下一篇:
C++ HID_Device_MillisecondElapsed函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap