这篇教程C++ timer_enable函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中timer_enable函数的典型用法代码示例。如果您正苦于以下问题:C++ timer_enable函数的具体用法?C++ timer_enable怎么用?C++ timer_enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了timer_enable函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: bsp_timer_scheduleIn/**/brief Schedule the callback to be called in some specified time.The delay is expressed relative to the last compare event. It doesn't matterhow long it took to call this function after the last compare, the timer willexpire precisely delayTicks after the last one.The only possible problem is that it took so long to call this function thatthe delay specified is shorter than the time already elapsed since the lastcompare. In that case, this function triggers the interrupt to fire right away.This means that the interrupt may fire a bit off, but this inaccuracy does notpropagate to subsequent timers./param delayTicks Number of ticks before the timer expired, relative to the last compare event.*/void bsp_timer_scheduleIn(PORT_TIMER_WIDTH delayTicks) { PORT_TIMER_WIDTH newCompareValue; PORT_TIMER_WIDTH temp_last_compare_value; PORT_TIMER_WIDTH current_value; temp_last_compare_value = bsp_timer_vars.last_compare_value; newCompareValue = bsp_timer_vars.last_compare_value+delayTicks; bsp_timer_vars.last_compare_value = newCompareValue; current_value=timer_get_current_value(TIMER_NUM2); if (delayTicks<current_value-temp_last_compare_value) { // we're already too late, schedule the ISR right now manually // setting the interrupt flag triggers an interrupt // TODO .. check that this works correctly. timer_set_compare(TIMER_NUM2,TIMER_COMPARE_REG0,delayTicks+current_value); timer_enable(TIMER_NUM2); //in case not enabled // } else { // this is the normal case, have timer expire at newCompareValue timer_set_compare(TIMER_NUM2,TIMER_COMPARE_REG0,newCompareValue); timer_enable(TIMER_NUM2); //in case not enabled }}
开发者ID:Adilla,项目名称:openwsn-fw,代码行数:43,
示例2: busy_waitvoid busy_wait(unsigned int ds){ timer_enable(0); timer_set_reload(0); timer_set_counter(get_system_frequency()/10*ds); timer_enable(1); while(timer_get());}
开发者ID:skristiansson,项目名称:milkymist-ng-mor1kx,代码行数:8,
示例3: us_ticker_initvoid us_ticker_init(void) { if (us_ticker_inited) { return; } us_ticker_inited = 1; timer_enable(US_TICKER_TIMER); timer_start(US_TICKER_TIMER, 10000, FALSE); timer_enable(US_COUNTER_TIMER); timer_start(US_COUNTER_TIMER, 1000, TRUE); NVIC_EnableIRQ(TIMER1_IRQn); NVIC_EnableIRQ(TIMER2_IRQn);}
开发者ID:ARMmbed,项目名称:mbed-hal-nxp-jn517x,代码行数:12,
示例4: TimerHandler/* TimerHandler from fm.c */static void TimerHandler(int n,int c,int count,double stepTime){ if( count == 0 ) { /* Reset FM Timer */ timer_enable (Timer[n][c], 0); } else { /* Start FM Timer */ double timeSec = (double)count * stepTime; if (!timer_enable(Timer[n][c], 1)) timer_adjust (Timer[n][c], timeSec, (c<<7)|n, 0); }}
开发者ID:Bremma,项目名称:pinmame,代码行数:14,
示例5: timer_handlerstatic void timer_handler(void *param,int c,int count,int clock){ struct ym2203_info *info = param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); } else { /* Start FM Timer */ attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count); if (!timer_enable(info->timer[c], 1)) timer_adjust_oneshot(info->timer[c], period, 0); }}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:14,
示例6: TimerHandler/* TimerHandler from fm.c */static void TimerHandler(void *param,int c,int count,double stepTime){ struct ym2610_info *info = param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); } else { /* Start FM Timer */ double timeSec = (double)count * stepTime; if (!timer_enable(info->timer[c], 1)) timer_adjust_ptr(info->timer[c], timeSec, 0); }}
开发者ID:broftkd,项目名称:mess-cvs,代码行数:15,
示例7: init_rgb_pwmvoid init_rgb_pwm(uint8_t _gpio_r, uint8_t _gpio_g, uint8_t _gpio_b, uint8_t _gpio_i){ timer_init(); MSS_GPIO_config((gpio_r_i = _gpio_r), MSS_GPIO_INPUT_MODE | MSS_GPIO_IRQ_EDGE_POSITIVE); MSS_GPIO_config((gpio_g_i = _gpio_g), MSS_GPIO_INPUT_MODE | MSS_GPIO_IRQ_EDGE_POSITIVE); MSS_GPIO_config((gpio_b_i = _gpio_b), MSS_GPIO_INPUT_MODE | MSS_GPIO_IRQ_EDGE_POSITIVE); MSS_GPIO_config((gpio_i_i = _gpio_i), MSS_GPIO_INPUT_MODE | MSS_GPIO_IRQ_EDGE_POSITIVE); MSS_GPIO_enable_irq(_gpio_r); MSS_GPIO_enable_irq(_gpio_g); MSS_GPIO_enable_irq(_gpio_b); MSS_GPIO_enable_irq(_gpio_i); // add the timer peripherals to the timer module red_timer_id = add_timer(TIMER_RED); green_timer_id = add_timer(TIMER_GREEN); blue_timer_id = add_timer(TIMER_BLUE); pulse_timer_id = add_timer(TIMER_PULSE); // all colors overflow at their max pwm value timer_setOverflowVal(red_timer_id, 1000000); timer_setOverflowVal(blue_timer_id, 1000000); timer_setOverflowVal(green_timer_id, 1000000); // pulse uses overflow only //timer_enable_allInterrupts(pulse_timer_id); timer_enable_overflowInt(pulse_timer_id); timer_disable_compareInt(pulse_timer_id); // colors require overflow and compare registers timer_enable_allInterrupts(red_timer_id); timer_enable_allInterrupts(blue_timer_id); timer_enable_allInterrupts(green_timer_id); timer_enable_compareInt(red_timer_id); timer_enable_compareInt(blue_timer_id); timer_enable_compareInt(green_timer_id); timer_enable_overflowInt(red_timer_id); timer_enable_overflowInt(blue_timer_id); timer_enable_overflowInt(green_timer_id); timer_enable(red_timer_id); timer_enable(green_timer_id); timer_enable(blue_timer_id); //timer_enable(pulse_timer_id); // don't start the colors until set_brightness is called}
开发者ID:camsoupa,项目名称:cc3000,代码行数:50,
示例8: radiotimer_setPeriodvoid radiotimer_setPeriod(PORT_RADIOTIMER_WIDTH period) { radiotimer_vars.period=(PORT_RADIOTIMER_WIDTH)period; timer_reset(TIMER_NUM3); timer_enable(TIMER_NUM3); radiotimer_vars.counter_slot_val=radiotimer_getValue(); //it is 0 always. remove that.. timer_set_compare(TIMER_NUM3, TIMER_COMPARE_REG0, radiotimer_vars.counter_slot_val+period); //the period timer is controlled by the compare 0 register}
开发者ID:Babody,项目名称:openwsn-fw,代码行数:7,
示例9: mainint main(void){ static console_command_t commands[2]; commands[0].callback = command_callback; commands[1].callback = branch_hub_command_callback; commands[1].help_callback = branch_hub_help_callback; ADCON1 = 0x0F; CMCON = 0x07; TRISA = 0x00; PORTA = 0x00; interrupt_initialize(); timer_initialize(); timer_register(timer_callback, 1000, &timer_id); timer_enable(timer_id); console_initialize(); console_register_command(commands[0], "main"); console_register_command(commands[1], "hub"); hub_init(HUB_ADDRESS); while(1) { console_process_tasks(); }}
开发者ID:joh06937,项目名称:raspberry_pi,代码行数:29,
示例10: get_hzstatic u32get_hz(){ // divided counter by 16 lapic_write_reg(_LAPIC_DC_OFFSET, 0x3); // enable timer interrupt(vector 255) lapic_write_reg(_LAPIC_TIMER_OFFSET, 0xff); timer_enable(); // initialize PIT channel 2 in one-shot mode // waiting 1/100 sec outb(0x61, (inb(0x61)&0xfd)|1); outb(0x43, 0xb2); // 1193182/100 = 11932 = 0x2e9c outb(0x42, 0x9c); // lsb inb(0x60); // short delay outb(0x42, 0x2e); // msb // reload counter u8 v = inb(0x61) & 0xfe; outb(0x61, v); outb(0x61, v|1); // reset apic timer init counter to -1 lapic_write_reg(_LAPIC_IC_OFFSET, 0xffffffff); // wait until the PIT counter reaches zero while (!(inb(0x61) & 0x20)); // disable timer interrupt timer_disable(); return (0xffffffff - lapic_read_reg(_LAPIC_CC_OFFSET) + 1) * 100 * 16;}
开发者ID:tw4452852,项目名称:tos,代码行数:34,
示例11: timer_writestatic voidtimer_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size){ struct timerblock *t = opaque; struct xlx_timer *xt; unsigned int timer; uint32_t value = val64; addr >>= 2; timer = timer_from_addr(addr); xt = &t->timers[timer]; D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)/n", __func__, addr * 4, value, timer, addr & 3)); /* Further decoding to address a specific timers reg. */ addr &= 3; switch (addr) { case R_TCSR: if (value & TCSR_TINT) value &= ~TCSR_TINT; xt->regs[addr] = value & 0x7ff; if (value & TCSR_ENT) timer_enable(xt); break; default: if (addr < ARRAY_SIZE(xt->regs)) xt->regs[addr] = value; break; } timer_update_irq(t);}
开发者ID:32bitmicro,项目名称:riscv-qemu,代码行数:34,
示例12: dm_event_timer_initvoid dm_event_timer_init(dm_event_timer_t* const event_timer, dm_event_timer_mode mode, timer_regs_t* const timer_regs, compare_regs_t* const compare_regs) { datastream_object_init(&event_timer->super); //call parents init function /* * set method pointer(s) of super-"class" to sub-class function(s) */ event_timer->super.update = dm_event_timer_update; event_timer->control_out = &control_port_dummy; event_timer->timer = timer_regs; event_timer->compare = compare_regs; event_timer->mode = mode; event_timer->peridic_next = 0; event_timer->start_delay = 0; event_timer->repetitions = -1; dm_event_timer_clear_event_list(event_timer); timer_enable(timer_regs); //TODO enable timer only when needed? //timer_set_interval_ms(timer_regs, 1000); compare_init_mode_set(compare_regs, 0);}
开发者ID:carstenbru,项目名称:fpga-log,代码行数:27,
示例13: dxl_pingDXL_COMM_ERR dxl_ping(DXL_ACTUATOR_t *settings, unsigned char id, unsigned char* err) { char tx_buff[6]; tx_buff[0] = 0xFF; tx_buff[1] = 0xFF; tx_buff[2] = id; tx_buff[3] = 2; tx_buff[4] = DXL_PING; tx_buff[5] = 0x0; dxl_insert_checksum(tx_buff); gpio.out(settings->TxEnGpio, 1); uart.puts(settings->Uart, tx_buff, tx_buff[3] + 4); gpio.out(settings->TxEnGpio, 0); unsigned char rx_cnt = 0; signed short rx_char; char rx_buff[150]; memset(rx_buff, 0, 150); bool preamble_ok = false; DXL_COMM_ERR errors = DXL_COMM_RXTIMEOUT; timer(timeout_timer); timer_interval(&timeout_timer, settings->timeout); while(1) { timer_enable(&timeout_timer); while(1) { rx_char = uart.getc_no_blocking(settings->Uart); if(rx_char != (signed short)-1) { if(rx_char == 0xFF && preamble_ok == false && rx_cnt < 2) { rx_buff[rx_cnt] = rx_char; rx_cnt++; break; } if(rx_char != 0xFF && rx_cnt == 1 && preamble_ok == false) rx_cnt = 0; if(rx_char != 0xFF && rx_cnt == 2 && preamble_ok == false) preamble_ok = true; if(preamble_ok == true) break; } if(timer_tick(&timeout_timer)) { return errors; } } if(preamble_ok) { if(rx_cnt < 56) rx_buff[rx_cnt++] = rx_char; else errors = DXL_COMM_OVERFLOW; if(rx_buff[LENGTH] > 54) { errors = DXL_COMM_RXCORRUPT; } if(rx_cnt > 3) { if(rx_cnt - 3 >= rx_buff[3]) { if(dxl_verify_checksum(rx_buff)) { *err = rx_buff[4]; return DXL_COMM_SUCCESS; } else { errors = DXL_COMM_CHECKSUM; } } } } }}
开发者ID:MorgothCreator,项目名称:mSdk,代码行数:60,
示例14: GD_TIMER_GpregTimerClose/*!*********************************************************************************** /brief Close a soft timer.**** This function closes an instance of the soft timer.**** /param pHandle The pHandle of the soft timer to be closed.**** /return One of the following status codes:** - #GD_OK if successful** - #GD_ERR_BAD_PARAMETER if the given parameter is not correctly** specified.**** /sa GD_TIMER_SoftTimerOpen******************************************************************************/GERR GD_TIMER_GpregTimerClose(GD_HANDLE * pHandle){ GD_TIMER_DEVICE_S* device; if(pHandle == NULL) return GD_ERR_INVALID_HANDLE; device = (GD_TIMER_DEVICE_S*)(*pHandle); if(device == NULL) { return GD_ERR_INVALID_HANDLE; } device->eState = TIME_FREE; device->nTimeCount = 0; device->bpTimeEnd = NULL; device->fpCallBackAddress = NULL; /* Disable the slow hard timer interrupt */ timer_enable(device->timerReg, GD_INT_DISABLED); GD_INT_Enable(&device->handle, GD_INT_DISABLED); *pHandle = 0; return GD_OK;}
开发者ID:ArdaFu,项目名称:rt-thread,代码行数:41,
示例15: time_initvoid __init time_init(void){ if (setup_baget_irq(BAGET_VIC_TIMER_IRQ, &timer_irq) < 0) printk("time_init: unable request irq for system timer/n"); timer_enable(); /* We don't call sti() here, because it is too early for baget */}
开发者ID:dmgerman,项目名称:linux-pre-history,代码行数:7,
示例16: mls_Timing_Initvoid mls_Timing_Init(void){ timer_init(QN_TIMER1, TMR1_Tick); timer_config(QN_TIMER1, TIMER_PSCAL_DIV, TIMER_COUNT_US(1000, TIMER_PSCAL_DIV)); timer_enable(QN_TIMER1, MASK_ENABLE); Time_Tick = 0;}
开发者ID:NguyenTrongThinh,项目名称:NTAG_I2C,代码行数:7,
示例17: TIMER_CALLBACKstatic TIMER_CALLBACK( music_playback ){ int pattern = 0; const device_config *device = devtag_get_device(machine, "oki"); if ((okim6295_r(device,0) & 0x08) == 0) { if (sslam_bar != 0) { sslam_bar += 1; if (sslam_bar >= (sslam_snd_loop[sslam_melody][0] + 1)) sslam_bar = 1; } pattern = sslam_snd_loop[sslam_melody][sslam_bar]; if (pattern == 0xff) { /* Restart track from first bar */ sslam_bar = 1; pattern = sslam_snd_loop[sslam_melody][sslam_bar]; } if (pattern == 0x00) { /* Non-looped track. Stop playing it */ sslam_track = 0; sslam_melody = 0; sslam_bar = 0; timer_enable(music_timer,0); } if (pattern) { logerror("Changing bar in music track to pattern %02x/n",pattern); okim6295_w(device,0,(0x80 | pattern)); okim6295_w(device,0,0x81); } }// {// pattern = sslam_snd_loop[sslam_melody][sslam_bar];// popmessage("Music track: %02x, Melody: %02x, Pattern: %02x, Bar:%02d",sslam_track,sslam_melody,pattern,sslam_bar);// }}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:35,
示例18: mcr68_common_initstatic void mcr68_common_init(void){ int i; /* reset the 6840's */ m6840_counter_periods[0] = ATTOTIME_IN_HZ(30); /* clocked by /VBLANK */ m6840_counter_periods[1] = attotime_never; /* grounded */ m6840_counter_periods[2] = ATTOTIME_IN_HZ(512 * 30); /* clocked by /HSYNC */ m6840_status = 0x00; m6840_status_read_since_int = 0x00; m6840_msb_buffer = m6840_lsb_buffer = 0; for (i = 0; i < 3; i++) { struct counter_state *m6840 = &m6840_state[i]; m6840->control = 0x00; m6840->latch = 0xffff; m6840->count = 0xffff; timer_enable(m6840->timer, FALSE); m6840->timer_active = 0; m6840->period = m6840_counter_periods[i]; } /* initialize the clock */ m6840_internal_counter_period = ATTOTIME_IN_HZ(cpunum_get_clock(0) / 10); /* reset cocktail flip */ mcr_cocktail_flip = 0; /* initialize the sound */ mcr_sound_reset();}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:33,
示例19: diag_sd_initstatic int diag_sd_init(char *argv[], const char *test_name, int verbose){ int rval = 0; int slot, type; putstr("running SD "); putstr(test_name); putstr(" test .../r/n"); putstr("press any key to terminate!/r/n"); if (strcmp(argv[0], "sd") == 0) { slot = SCARDMGR_SLOT_SD; } else if (strcmp(argv[0], "sdio") == 0) { slot = SCARDMGR_SLOT_SDIO; } else if (strcmp(argv[0], "sd2") == 0) { slot = SCARDMGR_SLOT_SD2; } else { slot = SCARDMGR_SLOT_SD; } if (strcmp(argv[1], "sd") == 0) { type = SDMMC_TYPE_SD; } else if (strcmp(argv[1], "sdhc") == 0) { type = SDMMC_TYPE_SDHC; } else if (strcmp(argv[1], "mmc") == 0) { type = SDMMC_TYPE_MMC; } else if (strcmp(argv[1], "MoviNAND") == 0) { type = SDMMC_TYPE_MOVINAND; } else { type = SDMMC_TYPE_AUTO; } timer_reset_count(TIMER2_ID); timer_enable(TIMER2_ID); rval = sdmmc_init(slot, type); timer_disable(TIMER2_ID); if (verbose) { putstr("/r/nInit takes: "); putdec(timer_get_count(TIMER2_ID)); putstr("mS/r/n"); putstr("SD clock: "); putdec(get_sd_freq_hz()); putstr("Hz/r/n");#if (SD_HAS_SDXC_CLOCK == 1) putstr("SDXC clock: ");#if (CHIP_REV == A7S) putdec((u32)amb_get_sdio_clock_frequency(HAL_BASE_VP));#else putdec((u32)amb_get_sdxc_clock_frequency(HAL_BASE_VP));#endif putstr("Hz/r/n");#endif putstr("total_secs: "); putdec(sdmmc_get_total_sectors()); putstr("/r/n"); } return rval;}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:59,
示例20: timeHndvoid timeHnd(void){ u8 tr,doTimer; timer_int(0); timer_enable(0); timer_clearstat(); for(tr=0; tr<NUM_TRACKS; tr++){ if(trackTable[tr].play == 0) continue; if(trackTable[tr].data[trackTable[tr].currNote].tickPosition == musicTick && trackTable[tr].data[trackTable[tr].currNote].onoff == 0x09){//Start note while(trackTable[tr].data[trackTable[tr].currNote+1].tickPosition == musicTick && //Look for the last note in a cord and play that one. trackTable[tr].data[trackTable[tr].currNote+1].onoff == 0x09) trackTable[tr].currNote++; SND_REGS[tr].SxFQH=(FREQUENCY[trackTable[tr].data[trackTable[tr].currNote].note]>>8) & 0xFF; SND_REGS[tr].SxFQL=FREQUENCY[trackTable[tr].data[trackTable[tr].currNote].note] & 0xFF; SND_REGS[tr].SxLRV=trackTable[tr].volume; SND_REGS[tr].SxRAM = tr; trackTable[tr].offNote = 0; SND_REGS[tr].SxINT = 0x9F; } /*some midi's don't have off notes so this sets a max length for a given note*/ trackTable[tr].offNote++; if(trackTable[tr].offNote > MAX_NOTE_LENGTH){ SND_REGS[tr].SxINT = 0x00; } while(trackTable[tr].data[trackTable[tr].currNote].tickPosition <= musicTick && trackTable[tr].data[trackTable[tr].currNote].tickPosition != 0xFFFFFFFF){ trackTable[tr].currNote++; } if(trackTable[tr].data[trackTable[tr].currNote].tickPosition == 0xFFFFFFFF){ trackTable[tr].play = 0; trackTable[tr].currNote = 0; SND_REGS[tr].SxINT=0; } } musicTick++; doTimer = 0x00; for(tr=0; tr<NUM_TRACKS; tr++){ if(trackTable[tr].play == 1) doTimer = 0x01; } if(doTimer){ timer_int(1); timer_enable(1); }}
开发者ID:imaspiderman,项目名称:VBGame,代码行数:46,
示例21: timer_config/** /brief configure the TIMER peripheral /param[in] none /param[out] none /retval none */void timer_config(void){/* ----------------------------------------------------------------------- TIMER0 configuration to: generate 3 complementary PWM signals with 3 different duty cycles: TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 3600 so the TIMER0 counter clock used is 20KHz. the three duty cycles are computed as the following description: the channel 0 duty cycle is set to 25% so channel 1N is set to 75%. the channel 1 duty cycle is set to 50% so channel 2N is set to 50%. the channel 2 duty cycle is set to 75% so channel 3N is set to 25%. ----------------------------------------------------------------------- */ timer_oc_parameter_struct timer_ocintpara; timer_parameter_struct timer_initpara; rcu_periph_clock_enable(RCU_TIMER0); timer_deinit(TIMER0); /* TIMER0 configuration */ timer_initpara.timer_prescaler = 3599; timer_initpara.timer_alignedmode = TIMER_COUNTER_EDGE; timer_initpara.timer_counterdirection = TIMER_COUNTER_UP; timer_initpara.timer_period = 15999; timer_initpara.timer_clockrivision = TIMER_CKDIV_DIV1; timer_initpara.timer_repetitioncounter = 0; timer_init(TIMER0,&timer_initpara); /* CH1,CH2 and CH3 configuration in PWM mode */ timer_ocintpara.timer_outputState = TIMER_CCX_ENABLE; timer_ocintpara.timer_outputnState = TIMER_CCXN_ENABLE; timer_ocintpara.timer_ocpolarity = TIMER_OC_POLARITY_HIGH; timer_ocintpara.timer_ocnpolarity = TIMER_OCN_POLARITY_HIGH; timer_ocintpara.timer_ocidleState = TIMER_OC_IDLE_STATE_LOW; timer_ocintpara.timer_ocnidleState = TIMER_OCN_IDLE_STATE_LOW; timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); timer_channel_output_config(TIMER0,TIMER_CH_1,&timer_ocintpara); timer_channel_output_config(TIMER0,TIMER_CH_2,&timer_ocintpara); timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,3999); timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM1); timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_1,7999); timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM1); timer_channel_output_shadow_config(TIMER0,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_2,11999); timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM1); timer_channel_output_shadow_config(TIMER0,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); timer_primary_output_config(TIMER0,ENABLE); /* auto-reload preload enable */ timer_auto_reload_shadow_enable(TIMER0); timer_enable(TIMER0);}
开发者ID:Arcko,项目名称:trochili,代码行数:64,
示例22: GD_TIMER_GpregTimerSet/*!*********************************************************************************** /brief Set the soft timer.**** This function sets the value to an instance of the soft timer.**** /param pHandle The pHandle of the soft timer to be set.** /param timeValue The timer value in 100 milliseconds.** /param flag A pointer the timmer flag.** /param fp Pointer to the callback function.**** /return One of the following status codes:** - #GD_OK if successful** - #GD_ERR_BAD_PARAMETER if the given parameter are not correctly** specified.********************************************************************************/GERR GD_TIMER_GpregTimerSet(GD_HANDLE* pHandle, U32 timeValue, GBOOL* flag, void(*fp)() ){ GD_TIMER_DEVICE_S* device; if(pHandle == NULL) return GD_ERR_INVALID_HANDLE; if(timeValue > (0xFFFFFFFF / (GD_GET_APB_ClkHz() / 100))) { return GD_ERR_TIMER_OUTOF_RANG; } device = (GD_TIMER_DEVICE_S*)(*pHandle); if(device == NULL) { return GD_ERR_INVALID_HANDLE; } /* Disable the sbusl interrupt until we set the state machine */ GD_INT_Enable(&device->handle, GD_INT_DISABLED); timer_enable(device->timerReg, GD_INT_DISABLED); if (fp != NULL) device->fpCallBackAddress = fp; if (flag != NULL) device->bpTimeEnd = flag; device->nTimeCount = timeValue * 10;// timeValue (ms) GH_TIMER_set_CntnSts(device->timerReg, device->nTimeCount * (GD_GET_APB_ClkHz() / 1000) - 1); GH_TIMER_set_Reloadn(device->timerReg, device->nTimeCount * (GD_GET_APB_ClkHz() / 1000) - 1); device->eState = TIME_RUNNING; /* Enable the slow hard timer interrupt */ timer_enable(device->timerReg, GD_INT_ENABLED); GD_INT_Enable(&device->handle, GD_INT_ENABLED); return GD_OK;}
开发者ID:ArdaFu,项目名称:rt-thread,代码行数:63,
示例23: timer_interval//#####################################################void timer_interval(STimer_t *S_Timer_Struct,unsigned long long _Value){#ifdef USE_RTC_100_MS S_Timer_Struct->S_Timmer_Interval = (_Value & (unsigned long long)INT64_MAX) / 10;#else S_Timer_Struct->S_Timmer_Interval = _Value & (unsigned long long)INT64_MAX;#endif timer_enable(S_Timer_Struct);}
开发者ID:MorgothCreator,项目名称:mSdk,代码行数:10,
示例24: device_enable_implstatic intdevice_enable_impl (struct device_interface *di, struct sh7780_tmu *device){ device->state = STATE_ENABLED; device->remaining_ticks = 0; timer_enable(device); return DEVICE_ENABLED;}
开发者ID:hro424,项目名称:okl4-sh,代码行数:10,
示例25: set_pulse_rate// pulse rate oscillates the led brightness between max_brightness and min_brightness// param: rate - the number of cycles to wait before interrupting (which changes master_brightness)// (0 = no pulse, 1=fast pulse 1-2^32=slower pulse)void set_pulse_rate(uint32_t ms){ timer_setOverflowVal(pulse_timer_id, ms*HZ_PER_MILLI_SEC); if(ms > 0) { timer_enable_allInterrupts(pulse_timer_id); timer_enable(pulse_timer_id); } else { timer_disable_allInterrupts(pulse_timer_id); timer_disable(pulse_timer_id); }}
开发者ID:camsoupa,项目名称:cc3000,代码行数:13,
示例26: timer_hitstatic void timer_hit(void *opaque){ struct xlx_timer *xt = opaque; struct timerblock *t = xt->parent; D(fprintf(stderr, "%s %d/n", __func__, xt->nr)); xt->regs[R_TCSR] |= TCSR_TINT; if (xt->regs[R_TCSR] & TCSR_ARHT) timer_enable(xt); timer_update_irq(t);}
开发者ID:32bitmicro,项目名称:riscv-qemu,代码行数:11,
示例27: TimerHandler_3812static void TimerHandler_3812(int c,double period){ if( period == 0 ) { /* Reset FM Timer */ timer_enable(Timer_3812[c], 0); } else { /* Start FM Timer */ timer_adjust(Timer_3812[c], period, c, 0); }}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:11,
示例28: device_enable_implstatic intdevice_enable_impl (struct device_interface *di, struct imx31_timer *device){ device->state = STATE_ENABLED; device->remaining_ticks = 0; timer_enable(device); DBG("timer is enabled/n"); return DEVICE_ENABLED;}
开发者ID:BreezeWu,项目名称:okl4_3.0,代码行数:11,
注:本文中的timer_enable函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ timer_exists函数代码示例 C++ timer_elapsed函数代码示例 |