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

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

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

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

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

示例1: main

int main(){  // Make SSbar be an output so it does not interfere with SPI communication.  set_digital_output(IO_B4, LOW);  // Set the mode to SVP_MODE_ANALOG so we can get analog readings on line D/RX.  svp_set_mode(SVP_MODE_ANALOG);  while(1)  {    clear(); // Erase the LCD.    if (usb_configured())    {      // Connected to USB and the computer recognizes the device.      print("USB");    }    else if (usb_power_present())    {      // Connected to USB.      print("usb");    }    if (usb_suspend())    {      // Connected to USB, in the Suspend state.        lcd_goto_xy(4,0);      print("SUS");    }    if (dtr_enabled())    {      // The DTR virtual handshaking line is 1.      // This often means that a terminal program is conencted to the      // Pololu Orangutan SVP USB Communication Port.      lcd_goto_xy(8,0);      print("DTR");    }    if (rts_enabled())    {      // The RTS virtual handshaking line is 1.      lcd_goto_xy(12,0);      print("RTS");    }    // Display an analog reading from channel D, in millivolts.    lcd_goto_xy(0,1);    print("Channel D: ");    print_long(analog_read_millivolts(CHANNEL_D));    // Wait for 100 ms, otherwise the LCD would flicker.    delay_ms(100);  }}
开发者ID:AndySze,项目名称:libpololu-avr,代码行数:55,


示例2: idle_mode

void idle_mode(void){    u8 key;//deg_str("idle_mode /n");    //dac_out_select(DAC_MUSIC, 0);    //clear_all_event();    dac_mute_control(1,1);    #ifdef PLAY_STATUS_LED_FUNC    set_play_status_led_spark(PLED_OFF);#endif	    KT_AMFMStandby();    usb_suspend();	    flush_all_msg();    disp_port(MENU_POWER_OFF);    input_number_en=0;    vol_change_en=0;#ifdef DEFAULT_VOL    sys_main_vol=DEFAULT_VOL;#endif    delay_10ms(20);#ifdef SYS_SOFT_WARE_GOIN_STANDBY    if(sys_pwr_flag==0){		put_msg_fifo(MSG_SYS_CORE_SLEEP);		    }#endif	   while (1)    {        key = app_get_msg();        switch (key)        {#ifdef SYS_SOFT_WARE_GOIN_STANDBY                case MSG_SYS_CORE_SLEEP:    		core_power_off();					break;#endif		        case MSG_CHANGE_WORK_MODE:	     	clear_all_event();    	     	flush_all_msg();            	return;        case MSG_MUSIC_NEW_DEVICE_IN:							//有新设备接入	 	break;        default:            	ap_handle_hotkey(key);                    	break;        }    }}
开发者ID:go2net,项目名称:kt-rec-pro,代码行数:52,


示例3: usb_on_isr

void usb_on_isr(int vector, void* param){    int i;    EXO* exo = param;    unsigned int sta = OTG_FS_GENERAL->INTSTS;    //first two most often called    if ((OTG_FS_GENERAL->INTMSK & OTG_FS_GENERAL_INTMSK_RXFLVLM) && (sta & OTG_FS_GENERAL_INTSTS_RXFLVL))    {        //mask interrupts, will be umasked by process after FIFO read        OTG_FS_GENERAL->INTMSK &= ~OTG_FS_GENERAL_INTMSK_RXFLVLM;        stm32_otg_on_isr_rx(exo);        return;    }    for (i = 0; i < USB_EP_COUNT_MAX; ++i)        if (exo->usb.in[i] != NULL && exo->usb.in[i]->io_active && (OTG_FS_DEVICE->INEP[i].INT & OTG_FS_DEVICE_ENDPOINT_INT_XFRC))        {            OTG_FS_DEVICE->INEP[i].INT = OTG_FS_DEVICE_ENDPOINT_INT_XFRC;            if (exo->usb.in[i]->size >= exo->usb.in[i]->io->data_size)            {                exo->usb.in[i]->io_active = false;                iio_complete(exo->usb.device, HAL_IO_CMD(HAL_USB, IPC_WRITE), USB_EP_IN | i, exo->usb.in[i]->io);                exo->usb.in[i]->io = NULL;            }            else                stm32_otg_tx(exo,  USB_EP_IN | i);            return;        }    //rarely called    if (sta & OTG_FS_GENERAL_INTSTS_ENUMDNE)    {        usb_enumdne(exo);        OTG_FS_GENERAL->INTSTS |= OTG_FS_GENERAL_INTSTS_ENUMDNE;        return;    }    if ((sta & OTG_FS_GENERAL_INTSTS_USBSUSP) && (OTG_FS_GENERAL->INTMSK & OTG_FS_GENERAL_INTMSK_USBSUSPM))    {        usb_suspend(exo);        OTG_FS_GENERAL->INTSTS |= OTG_FS_GENERAL_INTSTS_USBSUSP;        return;    }    if (sta & OTG_FS_GENERAL_INTSTS_WKUPINT)    {        usb_wakeup(exo);        OTG_FS_GENERAL->INTSTS |= OTG_FS_GENERAL_INTSTS_WKUPINT | OTG_FS_GENERAL_INTSTS_USBSUSP;    }    OTG_FS_GENERAL->OTGINT  = 0xFFFFFF;// clear other request}
开发者ID:alexeyk13,项目名称:rexos,代码行数:48,


示例4: decode_play

/*----------------------------------------------------------------------------*/void decode_play(void){#ifdef MP3_UART_ENABLE	sys_printf(" SYS GO IN DECODE MODE");#endif	Mute_Ext_PA(MUTE);	disp_play_filenum_timer=10;	folder_select=0;	folder_mode_select=0;	rtc_setting=0;	disp_scenario = DISP_NORMAL;	Disp_Con(DISP_SCAN_DISK);	sysclock_div2(1);#ifndef NO_SD_DECODE_FUNC	    	sd_speed_init(0, 50);#endif			decodeclock_div2(DECODE_CLK_DIV2);				//decoder分频,可以减少功耗    	music_info_init();    	dsp_hi_pro();    	decodeint_hi_pro();    	device_active = 0;    	put_msg_lifo(SEL_GIVEN_DEVICE_GIVEN_FILE);	set_max_vol(MAX_ANALOG_VOL-DECODE_ANALOG_VOL_CUT, MAX_DIGITAL_VOL);			//设置Music模式的音量上限    //suspend_sdmmc();	music_play();	Mute_Ext_PA(MUTE);#ifdef ADKEY_SELECT_MODE    	mode_switch_protect_bit=1;#endif	disp_scenario = DISP_NORMAL;	folder_select=0;	folder_mode_select=0;		stop_decode();#ifdef USE_USB_PROG_PLAY_MODE		usb_prog_mode_cls();	#endif#if(MEMORY_STYLE != USE_DEVICE)	usb_suspend();			//Entered Suspend mode#endif	write_playtime(&playpoint_time);				//记录断点信息(EEPROM)	main_vol_set(0, CHANGE_VOL_NO_MEM);}
开发者ID:goshafreelock,项目名称:sc-cd-pro,代码行数:49,


示例5: idle_mode

void idle_mode(void){    u8 key;    //deg_str("idle_mode /n");    //dac_out_select(DAC_MUSIC, 0);    //clear_all_event();    KT_AMFMStandby();    usb_suspend();	    flush_all_msg();    disp_port(MENU_POWER_OFF);    input_number_en=0;    vol_change_en=0;    SYS_POWER_OFF();	    LCD_BACKLIGHT_OFF();		    //core_power_off();	   while (1)    {        key = app_get_msg();        switch (key)        {    	  	case MSG_POWER:        		work_mode = MUSIC_MODE;        	case MSG_CHANGE_WORK_MODE:	     		clear_all_event();    	     		flush_all_msg();			irkey_activated =0;			sys_pwr_flag =1;           	 	return;       	case MSG_MUSIC_NEW_DEVICE_IN:							//有新设备接入		  	//put_msg_lifo(MSG_CHANGE_WORK_MODE);			 		break;        	default:           	 	//ap_handle_hotkey(key);                    		break;        }    }}
开发者ID:go2net,项目名称:kt-rec-pro,代码行数:43,


示例6: music_decode

/*----------------------------------------------------------------------------*/void music_decode(void){   sys_printf(" ------------------------------------>music_decode ");#ifdef AC_SLAVE_ENABLE	DSA_init();#endif	    dev_remov_timer=0;    play_mode = REPEAT_OFF;    disk_toc_ok=0;    dev_invalid=0;    input_number_en = 1;									//允许数字输入功能    vol_change_en=1;    key_voice_en=1;    main_menu = MENU_MUSIC_MAIN;    dec_msg = get_dec_msg_ptr();    fat_ptr1.buf = win_buffer;    SYSTEM_CLK_DIV1();    //sd_speed_init(0, 100);    key_table_sel(0);    flush_all_msg();    music_info_init();    set_max_vol(MAX_ANOLOG_VOL,MAX_DIGITAL_VOL);///设置最大音量        if(DSA_SEL_DEV==DEVICE_SDMMC0){		        given_device = DEVICE_SDMMC0;    }    else if(DSA_SEL_DEV==DEVICE_UDISK){        given_device = DEVICE_UDISK;   }    //put_msg_lifo(MSG_MUSIC_SELECT_NEW_DEVICE);        music_play();    //delay_10ms(3);    stop_decode();    usb_suspend();				//Entered Suspend Mode    key_voice_en=0;    main_vol_set(0, CHANGE_VOL_NO_MEM);    given_device = NO_DEVICE;}
开发者ID:BGCX261,项目名称:zhengao-dsa-pro-svn-to-git,代码行数:44,


示例7: sys_sleep_mode

void sys_sleep_mode(){#if 1	usb_suspend();			//Entered Suspend mode	suspend_sdmmc();	dac_mute_control(1,1);#if 1    	DACCON1 |= BIT(6);                  //DAC高阻	CLKGAT |= BIT(5);  //SDCLK关闭		//CLKCON |= (BIT(3));	//CLKCON |= (BIT(6));	//Delay(600);#endif		rc_pll_delay();	//Delay(200);		sysclock_div2(1);#endif		}
开发者ID:goshafreelock,项目名称:sc-cd-pro,代码行数:21,


示例8: usb_dev_poweroff

static int usb_dev_poweroff(struct device *dev){	return usb_suspend(dev, PMSG_HIBERNATE);}
开发者ID:vovan888,项目名称:p750-kernel,代码行数:4,


示例9: usb_dev_freeze

static int usb_dev_freeze(struct device *dev){	return usb_suspend(dev, PMSG_FREEZE);}
开发者ID:vovan888,项目名称:p750-kernel,代码行数:4,


示例10: usb_dev_suspend

static int usb_dev_suspend(struct device *dev){	return usb_suspend(dev, PMSG_SUSPEND);}
开发者ID:vovan888,项目名称:p750-kernel,代码行数:4,


示例11: platform_isr_usb

void platform_isr_usb (void) {/// Check if the setup interrupt is pending.  We need to check it before other/// interrupts, to work around that the Setup Int has lower priority then Input/// Endpoint 0    //ot_u8 bWakeUp = FALSE;    if (USBIFG & SETUPIFG) {        //bWakeUp = usbisr_setuppkt();        usbisr_setuppkt();        USBIFG &= ~SETUPIFG;    // clear the interrupt bit    }    switch (__even_in_range(USBVECINT, USBVECINT_OUTPUT_ENDPOINT7)) {    case USBVECINT_NONE:        break;    case USBVECINT_PWR_DROP:    //__no_operation();        break;    case USBVECINT_PLL_LOCK:        break;    case USBVECINT_PLL_SIGNAL:        break;#       if (USBEVT_MASK & USBEVT_CLOCKFAULT)    case USBVECINT_PLL_RANGE:        usbevt_pllerror();        break;#       endif    case USBVECINT_PWR_VBUSOn:        usbisr_vbuson();#           if (USBEVT_MASK & USBEVT_VBUSON)        usbevt_vbuson();#           endif        break;    case USBVECINT_PWR_VBUSOff:        usbisr_vbusoff();#           if (USBEVT_MASK & USBEVT_VBUSOFF)        usbevt_vbusoff();#           endif        break;    case USBVECINT_USB_TIMESTAMP:        break;    case USBVECINT_INPUT_ENDPOINT0:        usbisr_ep0in();        break;    case USBVECINT_OUTPUT_ENDPOINT0:        //bWakeUp = usbisr_ep0out();        usbisr_ep0out();        break;    case USBVECINT_RSTR:        usb_reset();#           if (USBEVT_MASK & USBEVT_RESET)        usbevt_reset();#           endif        break;    case USBVECINT_SUSR:        usb_suspend();#           if (USBEVT_MASK & USBEVT_SUSPEND)        usbevt_suspend();#           endif        break;    case USBVECINT_RESR:        usb_resume();#           if (USBEVT_MASK & USBEVT_RESUME)        usbevt_resume();#           endif        //bWakeUp = TRUE;       //Always wake on resume        break;    case USBVECINT_SETUP_PACKET_RECEIVED:        // NAK both IEP and OEP enpoints        dblock_ep0.bIEPBCNT = EPBCNT_NAK;        dblock_ep0.bOEPBCNT = EPBCNT_NAK;        //bWakeUp             = usbisr_setuppkt();        usbisr_setuppkt();        break;    case USBVECINT_STPOW_PACKET_RECEIVED:        break;    case USBVECINT_INPUT_ENDPOINT1:        break;    case USBVECINT_INPUT_ENDPOINT2:        //bWakeUp = CdcToHostFromBuffer(CDC0_INTFNUM);        usbcdc_transfer_buf2host(CDC0_INTFNUM);        break;    case USBVECINT_INPUT_ENDPOINT3:        break;    case USBVECINT_INPUT_ENDPOINT4://.........这里部分代码省略.........
开发者ID:jpnorair,项目名称:OpenTag,代码行数:101,


示例12: __irq_usb_lp_can_rx0

void __irq_usb_lp_can_rx0(void) {  if (CAN1->enabled) {    can_rx_irq_handler();    return;  }  uint16 istr = USB_BASE->ISTR;  /* Use USB_ISR_MSK to only include code for bits we care about. */#if (USB_ISR_MSK & USB_ISTR_RESET)  if (istr & USB_ISTR_RESET & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_RESET;    pProperty->Reset();  }#endif#if (USB_ISR_MSK & USB_ISTR_PMAOVR)  if (istr & ISTR_PMAOVR & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_PMAOVR;  }#endif#if (USB_ISR_MSK & USB_ISTR_ERR)  if (istr & USB_ISTR_ERR & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_ERR;  }#endif#if (USB_ISR_MSK & USB_ISTR_WKUP)  if (istr & USB_ISTR_WKUP & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_WKUP;    usb_resume(RESUME_EXTERNAL);  }#endif#if (USB_ISR_MSK & USB_ISTR_SUSP)  if (istr & USB_ISTR_SUSP & USBLIB->irq_mask) {    /* check if SUSPEND is possible */    if (SUSPEND_ENABLED) {        usb_suspend();    } else {        /* if not possible then resume after xx ms */        usb_resume(RESUME_LATER);    }    /* clear of the ISTR bit must be done after setting of CNTR_FSUSP */    USB_BASE->ISTR = ~USB_ISTR_SUSP;}#endif#if (USB_ISR_MSK & USB_ISTR_SOF)  if (istr & USB_ISTR_SOF & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_SOF;  }#endif#if (USB_ISR_MSK & USB_ISTR_ESOF)  if (istr & USB_ISTR_ESOF & USBLIB->irq_mask) {    USB_BASE->ISTR = ~USB_ISTR_ESOF;    /* resume handling timing is made with ESOFs */    usb_resume(RESUME_ESOF); /* request without change of the machine state */  }#endif  /*   * Service the correct transfer interrupt.   */#if (USB_ISR_MSK & USB_ISTR_CTR)  if (istr & USB_ISTR_CTR & USBLIB->irq_mask) {    dispatch_ctr_lp();  }#endif}
开发者ID:devanlai,项目名称:libmaple,代码行数:73,



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


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