这篇教程C++ usbInit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中usbInit函数的典型用法代码示例。如果您正苦于以下问题:C++ usbInit函数的具体用法?C++ usbInit怎么用?C++ usbInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了usbInit函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(void){ led_init(); sht1x_init(); //sser_init(); wdt_enable(WDTO_1S); /* Even if you don't use the watchdog, turn it off here. On newer devices, * the status of the watchdog (on/off, period) is PRESERVED OVER RESET! */ /* RESET status: all port bits are inputs without pull-up. * That's the way we need D+ and D-. Therefore we don't need any * additional hardware initialization. */ odDebugInit(); DBG1(0x00, 0, 0); /* debug output: main starts */ usbInit(); usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */ unsigned char i = 0; while(--i){ /* fake USB disconnect for > 250 ms */ wdt_reset(); _delay_ms(1); } usbDeviceConnect(); sei(); DBG1(0x01, 0, 0); /* debug output: main loop starts */ for(;;){ wdt_reset(); usbPoll(); } return 0; /* never reached */}
开发者ID:baracudaz,项目名称:usb-sht,代码行数:32,
示例2: mainint main(){ fabscan_setup(); uchar i;// wdt_enable(WDTO_1S); // enable 1s watchdog timer usbInit(); usbDeviceDisconnect(); // enforce re-enumeration for(i = 0; i<250; i++) { // wait 500 ms// wdt_reset(); // keep the watchdog happy _delay_ms(2); } usbDeviceConnect(); sei(); // Enable interrupts after re-enumeration while(1) {// wdt_reset(); // keep the watchdog happy usbPoll(); if(fab_work_flag) // if there is new data for fabscan → let it work { fab_work_flag=0; fabscan_work(1,incomingByte); } } return 0;}
开发者ID:pholat,项目名称:FabScan_USB_brd,代码行数:27,
示例3: mainint main() { initLCD(); LCD_goto(1,0); lcd_puts("AVRLCD 4bit mode"); uchar i; DDRB = 1; // PB0 as output wdt_enable(WDTO_1S); // enable 1s watchdog timer usbInit(); usbDeviceDisconnect(); // enforce re-enumeration for(i = 0; i<250; i++) { // wait 500 ms wdt_reset(); // keep the watchdog happy _delay_ms(2); } usbDeviceConnect(); sei(); // Enable interrupts after re-enumeration while(1) { wdt_reset(); // keep the watchdog happy usbPoll(); } return 0;}
开发者ID:manoja328,项目名称:myavr,代码行数:26,
示例4: mainint main(void){ wdt_enable(WDTO_1S); odDebugInit(); hardwareInit(); usbInit(); intr3Status = 0; sendEmptyFrame = 0; sei(); for(;;){ /* main event loop */ wdt_reset(); usbPoll(); uartPoll();#if USB_CFG_HAVE_INTRIN_ENDPOINT3 /* We need to report rx and tx carrier after open attempt */ if(intr3Status != 0 && usbInterruptIsReady3()){ static uchar serialStateNotification[10] = {0xa1, 0x20, 0, 0, 0, 0, 2, 0, 3, 0}; if(intr3Status == 2){ usbSetInterrupt3(serialStateNotification, 8); }else{ usbSetInterrupt3(serialStateNotification+8, 2); } intr3Status--; }#endif } return 0;}
开发者ID:IvanOrfanidi,项目名称:AVR-Tests-Project,代码行数:34,
示例5: main// mainint main(void) { wdt_enable(WDTO_1S); hardwareInit(); usbInit(); sei(); unsigned int adcValue,replymask,replyshift,replybyte; while(1) { uchar i = 0; wdt_reset(); usbPoll(); PORTD ^= (1 << 6); //jump to bootloader if jumper is HIGH if(bit_is_clear(PIND, 5)) { startBootloader(); } for(i = 0; i < ADC_CHANNELS; i++) { //adcValue = adc_read(ADC_PRESCALER_32, ADC_VREF_AVCC, i); adcValue = i; usb_reply[i] = adcValue >> 2; replybyte = 16 + (i / 4); replyshift = ((i % 4) * 2); replymask = (3 << replyshift); usb_reply[replybyte] = (usb_reply[replybyte] & ~replymask) | (replymask & (adcValue << replyshift)); _delay_us(ADCDELAY); } usb_reply[20] = PINC; } return 0;}
开发者ID:patricksebastien,项目名称:hicu,代码行数:35,
示例6: mainvoid main(void) { uint16 speed = param_speed; uint8 port = param_port, pin=param_pin; uint8 ServoPos = 120; uint8 dir=1; systemInit(); usbInit(); InitServos(); EA=1; // Global interrupt enabled SetPin(0, port, pin); SetPin(1, 0, 1); SetPin(2, 0, 3); while (1) { delayMs(speed); usbComService(); if (dir==1) { ++ServoPos; } else { --ServoPos; } if (ServoPos > 253 || ServoPos < 2) { dir ^=1; } SetPos(0,ServoPos); SetPos(1,128); SetPos(2,64); }}
开发者ID:jpvlsmv,项目名称:Wixel-Servo-Lib,代码行数:35,
示例7: __attribute__void __attribute__((noreturn)) main( void ){ cli(); initLeds(); wdt_enable( WDTO_1S ); // USB initialization. usbInit(); usbDeviceDisconnect(); // enforce re-enumeration, do this while interrupts are disabled! unsigned char b = 150; while ( b-- ) { _delay_ms( 1 ); wdt_reset(); } cpuIoInit(); usbDeviceConnect(); sei(); for ( ;; ) { // main event loop usbPoll(); wdt_reset(); cpuIoPoll(); //_delay_ms( 10 ); }}
开发者ID:z80,项目名称:avrusb,代码行数:30,
示例8: InitEarlyUserFeatures/*************************************************************************NAME InitEarlyUserFeatures DESCRIPTION This function initialises the configureation that is required early on in the start-up sequence. RETURNS*/void InitEarlyUserFeatures ( void ) { ChargerConfigure(CHARGER_SUPPRESS_LED0, TRUE); /* Initialise the Button Manager */ buttonManagerInit() ; /* Once system Managers are initialised, load up the configuration */ configManagerInit(TRUE); /* Init wired before USB or wired audio gets routed before init */ wiredAudioInit(); /* USB init can be done once power lib initialised */ usbInit(); /* initialise the display */ displayInit(); /* initialise DUT */ dutInit(); /*configure the audio Pre amp if enabled */ initPreAmp( AUDIO_CHANNEL_A) ; initPreAmp( AUDIO_CHANNEL_B) ; /* Enter the limbo state as we may be ON due to a charger being plugged in */ stateManagerEnterLimboState(); }
开发者ID:jrryu,项目名称:HW--FW,代码行数:42,
示例9: mainint main( void ){ //=========================================== uchar calibrationValue; calibrationValue = eeprom_read_byte(0); /* calibration value from last time */ if(calibrationValue != 0xff){ OSCCAL = calibrationValue; } //=========================================== usbInit(); wdt_enable(WDTO_1S); /* Даже если Вы не используете сторожевой таймер (watchdog), выключите его здесь. На более новых * микроконтроллерах состояние watchdog (вкл/выкл, период) СОХРАНЯЕТСЯ ЧЕРЕЗ СБРОС! */ //=========================================== usbDeviceDisconnect(); _delay_ms(300); /* 300 ms disconnect */ usbDeviceConnect(); //=========================================== //LED_PORT_DDR |= _BV(LED_BIT); /* делаем ножку, куда подключен LED, выходом */ sbi(LED_PORT_DDR,LED_BIT); /* делаем ножку, куда подключен LED, выходом */ //=========================================== sei(); /* Разрешаем прерывания*/ for(;;){ /* main event loop */ wdt_reset(); usbPoll(); } //===========================================}
开发者ID:aBaTaPbl4,项目名称:BuildOrb2,代码行数:29,
示例10: vusb_initvoid vusb_init(void){ // inits the timer used for idle rate // a rate of 12M/(1024 * 256) = 45.78 Hz (period = 21845us) TCCR0B = _BV(CS02) | _BV(CS00);#define TMR1US 21845L // a rate of 12M/(64 * 256) = 732,42 Hz (1365us)// TCCR0B = _BV(CS01) | _BV(CS00);//#define TMR1US 1365L#define OVF2MS(tmr) ((uint16_t)(( (tmr) * TMR1US) / 1000))#define OVF2US(tmr) ((uint16_t)( (tmr) * TMR1US)) usbInit(); usbDeviceDisconnect(); // enforce re-enumeration, do this while interrupts are disabled! _delay_ms(260); // fake USB disconnect for > 250 ms usbDeviceConnect(); vusb_idle_rate = 0; vusb_curr_protocol = 1; // report protocol // clear the reports usb_consumer_report = 0; reset_keyboard_report();}
开发者ID:jthen,项目名称:7g-wireless,代码行数:27,
示例11: mainvoid main(){ uint32 last_ms; systemInit(); //configure the P1_2 and P1_3 IO pins makeAllOutputs(LOW); //initialise Anlogue Input 0 P0INP = 0x1; //initialise the USB port usbInit(); usbComRequestLineStateChangeNotification(LineStateChangeCallback); last_ms = getMs(); while (1) { boardService(); usbComService(); if((getMs()-last_ms) >=5000){ LED_YELLOW_TOGGLE(); printf("batteryPercent: %i/r/n", batteryPercent(adcRead(0 | ADC_REFERENCE_INTERNAL))); last_ms=getMs(); } }}
开发者ID:AdrianLxM,项目名称:wixel-sdk,代码行数:25,
示例12: mainint main(){ uchar i=0; wdt_enable(WDTO_1S); usbInit(); usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */ for (i=0; i<250; i++) { /* fake USB disconnect for > 500 ms */ wdt_reset(); _delay_ms(2); } usbDeviceConnect(); //LED_PORT_DDR |= _BV(LED_BIT); /* make the LED bit an output */ sei(); //DBG1(0x01, 0, 0); /* debug output: main loop starts */ while (1) { wdt_reset(); usbPoll(); }}
开发者ID:Ceitec,项目名称:F-00004,代码行数:26,
示例13: mainint main(void){#if STARTUP_DELAY /* Power ON delay (300ms) */ for (wait=0; wait<150; wait++) { delay_10us(200); // 2ms }#endif#if F_CPU == 12800000 /* RC OSC mode, (D-) */ TCCR0B = 3; /* 1/64 prescaler */ OSCCAL=118;#endif#if 1 /* PD5は USB D-, PD2はmodeジャンパ用 pullup */ /* なお、PD2はクロック出力を C++ usbPoll函数代码示例 C++ usbDeviceDisconnect函数代码示例
|