这篇教程C++ tc_start函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tc_start函数的典型用法代码示例。如果您正苦于以下问题:C++ tc_start函数的具体用法?C++ tc_start怎么用?C++ tc_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tc_start函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TICKER_COUNTER_Handlr2void TICKER_COUNTER_Handlr2(void){ uint32_t status=tc_get_status(TICKER_COUNTER_lp, TICKER_COUNTER_CHANNEL2); uint32_t interrupmask=tc_get_interrupt_mask(TICKER_COUNTER_lp, TICKER_COUNTER_CHANNEL2); if (((status & interrupmask) & TC_IER_CPCS)) { if(lp_ticker_interrupt_counter) { lp_ticker_interrupt_counter--; } else { if(lp_ticker_interrupt_offset) { tc_stop(TICKER_COUNTER_lp, TICKER_COUNTER_CHANNEL2); tc_write_rc(TICKER_COUNTER_lp, TICKER_COUNTER_CHANNEL2, (uint32_t)lp_ticker_interrupt_offset); tc_start(TICKER_COUNTER_lp, TICKER_COUNTER_CHANNEL2); lp_ticker_interrupt_offset=0; } else { lp_ticker_irq_handler(); } } }}
开发者ID:Archcady,项目名称:mbed-os,代码行数:20,
示例2: reset_timeoutstatic void reset_timeout(void){ if (s_period_counter > 0) { // see how long to wait uint16_t rc = min(0xffff,s_period_counter); tc_write_rc(CONFIG_BSP_BUZZER_REP_TIMER, CONFIG_BSP_BUZZER_REP_CHANNEL, rc); // remember how much we've waited s_period_counter -= rc; // Reset the counter tc_start(CONFIG_BSP_BUZZER_REP_TIMER, CONFIG_BSP_BUZZER_REP_CHANNEL); } else { // make sure the timer is stopped tc_stop(CONFIG_BSP_BUZZER_REP_TIMER, CONFIG_BSP_BUZZER_REP_CHANNEL); }}
开发者ID:ShankarWright,项目名称:TklabsVanet,代码行数:20,
示例3: tmr_init/*! /brief to initialiaze hw timer */uint8_t tmr_init(void){ uint8_t tmr_mul; /* Configure clock service. */#if SAM4L sysclk_enable_peripheral_clock(TIMER);#else sysclk_enable_peripheral_clock(ID_TC);#endif /* Get system clock. */ tmr_mul = sysclk_get_peripheral_bus_hz(TIMER) / DEF_1MHZ; tmr_mul = tmr_mul >> 1;#if SAM4L tc_init(TIMER, TIMER_CHANNEL_ID, TC_CMR_TCCLKS_TIMER_CLOCK2 | TC_CMR_WAVE | TC_CMR_WAVSEL_UP_NO_AUTO);#elif SAM4E tc_init(TIMER, TIMER_CHANNEL_ID, TC_CMR_TCCLKS_TIMER_CLOCK1 | TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC);#else tc_init(TIMER, TIMER_CHANNEL_ID, TC_CMR_TCCLKS_TIMER_CLOCK1 | TC_CMR_WAVE | TC_CMR_WAVSEL_UP);#endif /* Configure and enable interrupt on RC compare. */ configure_NVIC(TIMER, TIMER_CHANNEL_ID);#if SAM4E tc_get_status(TIMER, TIMER_CHANNEL_ID); tc_enable_interrupt(TIMER, TIMER_CHANNEL_ID, TC_IER_CPCS); tc_write_rc(TIMER, TIMER_CHANNEL_ID, UINT16_MAX);#else tc_get_status(TIMER, TIMER_CHANNEL_ID); tc_enable_interrupt(TIMER, TIMER_CHANNEL_ID, TC_IER_COVFS);#endif tmr_disable_cc_interrupt(); tc_start(TIMER, TIMER_CHANNEL_ID); return tmr_mul;}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:43,
示例4: TC0_Handlervoid TC0_Handler(void){ volatile uint32_t ul_dummy, TC_value; /* Get the current timer counter value from a 32-bit register*/ TC_value = tc_read_tc(TC0,0); /* Clear status bit to acknowledge interrupt */ ul_dummy = tc_get_status(TC0, 0); if ((ul_dummy & TC_SR_CPCS) == TC_SR_CPCS) { #if DEBUG printf("%08x OV /n",TC_value); #endif time_msb++; rtimer_clock_t now = ((rtimer_clock_t)time_msb << 32)|tc_read_tc(TC0,0); rtimer_clock_t clock_to_wait = next_rtimer_time - now; if(clock_to_wait <= 0x100000000 && clock_to_wait > 0) { // We must set now the Timer Compare Register. // Set the auxiliary timer (TC0,1) at the write time interrupt tc_write_rc(TC0,1,(uint32_t)clock_to_wait); // Set and enable interrupt on RC compare tc_enable_interrupt(TC0,1,TC_IER_CPCS); // Start the auxiliary timer tc_start(TC0,1); } } else { printf("ERROR: TC: Unknown interrupt./n"); }}
开发者ID:EmuxEvans,项目名称:calipso,代码行数:39,
示例5: configure_tc_trigger/** * /brief Configure to trigger AFEC by TIOA output of timer. */static void configure_tc_trigger(void){ uint32_t ul_div = 0; uint32_t ul_tc_clks = 0; uint32_t ul_sysclk = sysclk_get_cpu_hz(); /* Enable peripheral clock. */ pmc_enable_periph_clk(ID_TC0); /* Configure TC for a 1Hz frequency and trigger on RC compare. */ tc_find_mck_divisor(1, ul_sysclk, &ul_div, &ul_tc_clks, ul_sysclk); tc_init(TC0, 0, ul_tc_clks | TC_CMR_CPCTRG | TC_CMR_WAVE | TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_SET); TC0->TC_CHANNEL[0].TC_RA = (ul_sysclk / ul_div) / 2; TC0->TC_CHANNEL[0].TC_RC = (ul_sysclk / ul_div) / 1; /* Start the Timer. */ tc_start(TC0, 0); afec_set_trigger(AFEC1, AFEC_TRIG_TIO_CH_0);}
开发者ID:InSoonPark,项目名称:asf,代码行数:25,
示例6: configure_tcstatic void configure_tc(void){ /* * Aqui atualizamos o clock da cpu que foi configurado em sysclk init * * O valor atual est'a em : 120_000_000 Hz (120Mhz) */ uint32_t ul_sysclk = TC_CMR_TCCLKS_TIMER_CLOCK5; /* * Ativa o clock do periférico TC 0 * */ pmc_enable_periph_clk(ID_TC0); /* * Configura TC para operar no modo de compara C++ tc_write_rc函数代码示例 C++ tc_log_error函数代码示例
|