这篇教程C++ twi_init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中twi_init函数的典型用法代码示例。如果您正苦于以下问题:C++ twi_init函数的具体用法?C++ twi_init怎么用?C++ twi_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了twi_init函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: setUpvoid setUp() { init_fake_port(); twi_tests_setUp(); twea_flag = 0; BOOL res = twi_init(testPin1, testPin2); TEST_ASSERT_TRUE_MESSAGE(res, "failed to initialize twi master.");}
开发者ID:antongulenko,项目名称:TankOS,代码行数:7,
示例2: mainint main( void ) { twi_init(); // Init TWI interface // Init HT16K22. Page 32 datasheet twi_start(); twi_tx(0xE0); // Display I2C addres + R/W bit twi_tx(0x21); // Internal osc on (page 10 HT16K33) twi_stop(); twi_start(); twi_tx(0xE0); // Display I2C address + R/W bit twi_tx(0xA0); // HT16K33 pins all output twi_stop(); twi_start(); twi_tx(0xE0); // Display I2C address + R/W bit twi_tx(0xE3); // Display Dimming 4/16 duty cycle twi_stop(); twi_start(); twi_tx(0xE0); // Display I2C address + R/W bit twi_tx(0x81); // Display OFF - Blink On twi_stop(); twi_clear(); play_fill_animation(); clear_rows(); return 1; }
开发者ID:gjoosen,项目名称:Microcontrollers,代码行数:34,
示例3: mainint main(void){ DDRA=0xFF; PORTA=0x00; uint8_t time[3]; uint8_t Flag,Flag1; usartInit(); printf("*--------------------------------------------------- */r/n"); printf("*-------------------AT24CXX experiment-------------- */r/n"); printf("*--------------------------------------------------- */r/n"); twi_init(); PCF8563_init(); PCF8563_setTime(0,0,0); while(1) { while(1) { PCF8563_getTime(time); if(Flag1 != Flag) { PORTA = time[0]; printf("Real time clock %d:%d:%d /r /n",time[2],time[1],time[0]); Flag1=Flag; } Flag = time[0]; } }}
开发者ID:joemustafa,项目名称:AVR_CODE,代码行数:34,
示例4: mainintmain (void)// This is just a place holder application that will be replaced by// bootloader programming. When built with BOOTSTRAPPER defined the// application will allow the bootloader itself to be programmed.{#ifdef BOOTSTRAPPER // Initialize the bootloader exit and active flags. bootloader_exit = 0; bootloader_active = 0; // Initialize programming module. prog_init(); // Initialize TWI module. twi_init();#endif // Loop forever. for (;;) {#ifdef BOOTSTRAPPER // Check for TWI conditions that require handling. twi_check_conditions();#endif }#ifdef BOOTSTRAPPER // Restore TWI interface to powerup defaults. twi_deinit();#endif return 0;}
开发者ID:AndySze,项目名称:OpenServo,代码行数:35,
示例5: mainint main(void){ init_sys_clocks(); init_dbg_rs232(FPBA_HZ); print_dbg("AVR UC3 DSP DEMO/r/n"); irq_initialize_vectors(); // GUI, Controller and DSP process init gui_init(FCPU_HZ, FHSB_HZ, FPBA_HZ, FPBB_HZ); gui_text_print(GUI_COMMENT_ID, TEXT_IDLE); gui_text_print(GUI_FILTER_ID, filter_active_get_description()); controller_init(FCPU_HZ, FHSB_HZ, FPBA_HZ, FPBB_HZ); twi_init(); dsp_process_init(FCPU_HZ, FHSB_HZ, FPBA_HZ, FPBB_HZ); cpu_irq_enable(); // Main loop while (1) { gui_task(); controller_task(); dsp_process_task(); state_machine_task(); }}
开发者ID:kerichsen,项目名称:asf,代码行数:29,
示例6: teensy_init/* returns * - success: 0 */uint8_t teensy_init(void) { CPU_PRESCALE(CPU_16MHz); // speed should match F_CPU in makefile // onboard LED DDRD &= ~(1<<6); // set D(6) as input PORTD &= ~(1<<6); // set D(6) internal pull-up disabled // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") _led_all_off(); // (just to put the pins in a known state) TCCR1A = 0b10101001; // set and configure fast PWM TCCR1B = 0b00001001; // set and configure fast PWM // I2C (TWI) twi_init(); // on pins D(1,0) // unused pins teensypin_write_all_unused(DDR, CLEAR); // set as input teensypin_write_all_unused(PORT, SET); // set internal pull-up enabled // rows teensypin_write_all_row(DDR, CLEAR); // set as input teensypin_write_all_row(PORT, SET); // set internal pull-up enabled // columns teensypin_write_all_column(DDR, CLEAR); // set as input (hi-Z) teensypin_write_all_column(PORT, CLEAR); // set internal pull-up // disabled return 0; // success}
开发者ID:OrangeJewce,项目名称:ergodox-firmware,代码行数:33,
示例7: pinModevoid GadgetShield::Setup(void){ // Configure infrared emitter and detector pinMode(IRIN_PIN, INPUT); // There is already an external pullup in the detector itself but it digitalWrite(IRIN_PIN, HIGH); // doesn't hurt to add our own pullup as the detector's is weak. pinMode(IROUT_PIN, OUTPUT); digitalWrite(IROUT_PIN, LOW); // Configure general-purpose LED's pinMode(LED1_PIN, OUTPUT); pinMode(LED2_PIN, OUTPUT); pinMode(LED3_PIN, OUTPUT); pinMode(LED4_PIN, OUTPUT); digitalWrite(LED1_PIN, LOW); digitalWrite(LED2_PIN, LOW); digitalWrite(LED3_PIN, LOW); digitalWrite(LED4_PIN, LOW); // Configure RGB LED pinMode(RED_PIN, OUTPUT); pinMode(GREEN_PIN, OUTPUT); pinMode(BLUE_PIN, OUTPUT); RGB(0,0,0); // Configure pushbuttons pinMode(PB1_PIN, INPUT); // There are already external pullups so no internal pullup is needed pinMode(PB2_PIN, INPUT); // Configure speaker pinMode(SPEAKER_PIN, OUTPUT); digitalWrite(SPEAKER_PIN, LOW); Speaker(1000); // Just to initialize timer infrastructure for speaker and Blue RGB LED pin Speaker(0); // Configure TWI interface to accelerometer and restore to default settings twi_init(); // Initialize accelerometer accel_init(); // Assume microphone baseline is 2.5V. Establish experimentally by calling MicrophoneSetBaseline(). m_mic_baseline = 127;}
开发者ID:RuggedCircuits,项目名称:Rugged-Circuits-Code,代码行数:35,
示例8: hh10d_initvoid hh10d_init(void *cfg) { // Read calibrate paremeter with TWI int rc; char buf[6]; twi_init(); rc = ee24xx_read_bytes(10,4,buf); if (rc != 4) { sens = 0; offset = 0; return; }#ifdef DEBUG uart_hexdump(buf,4); uart_putc ('/r'); uart_putc ('/n');#endif sens = buf[0] * 256 + buf[1]; offset = buf[2] * 256 + buf[3];#ifdef DEBUG itoa(sens,buf,10); uart_putstr(buf); uart_putstr_P(PSTR("/r/n")); itoa(offset,buf,10); uart_putstr(buf); uart_putstr_P(PSTR("/r/n"));#endif // rising edge EICRA |= (1 << ISC10) | (1 << ISC11); // enable INT1 EIMSK |= (1 << INT1);}
开发者ID:Conorta,项目名称:DIY-Wireless-Bug,代码行数:32,
示例9: mainint main(void){ // Enable peripherals system_init(); pins_init(); us1_init(); us0_init(); twi_init(); // Initialize state machines qcfp_init(); eq_init(); // Once everything is initialized, enable interrupts globally interrupts_enable(); // Enable Expansion module 3 and 4 (sensors plugged into these temporarily) AT91C_BASE_PIOA->PIO_CODR = AT91C_PIO_PA20; AT91C_BASE_PIOA->PIO_CODR = AT91C_PIO_PA23; sensors_init(); eq_post_timer(gpio_led_dance, 250, eq_timer_periodic); while(1) { eq_dispatch(); eq_dispatch_timers(); } return 0;}
开发者ID:smartphonequadrotor,项目名称:Quadrotor-Control-Firmware,代码行数:31,
示例10: mainint main(void){ char str[30]; status_init(); adc_init(); status_set(false); uart_init(1); twi_init(0xC); twi_enable_interrupt(); twi_register_get(get); measurement = 0; sei(); while (1) { // VRef is 2.56V // at T = 0, VOut = 0V. VOut scales at 10mV / C++ twi_master_init函数代码示例 C++ tw_osl_cur_func函数代码示例
|